From 61501726f2e04ba2ee3496d82a34749b3ae61fc0 Mon Sep 17 00:00:00 2001 From: caes Date: Fri, 4 Aug 2017 00:24:07 -0400 Subject: [PATCH] removed png --- src/png++-0.2.5/AUTHORS | 4 - src/png++-0.2.5/BUGS | 13 - src/png++-0.2.5/COPYING | 25 - src/png++-0.2.5/ChangeLog | 29 - src/png++-0.2.5/Doxyfile | 1304 ----------------------- src/png++-0.2.5/INSTALL | 81 -- src/png++-0.2.5/Makefile | 148 --- src/png++-0.2.5/NEWS | 54 - src/png++-0.2.5/TODO | 20 - src/png++-0.2.5/color.hpp | 65 -- src/png++-0.2.5/config.hpp | 61 -- src/png++-0.2.5/consumer.hpp | 257 ----- src/png++-0.2.5/convert_color_space.hpp | 338 ------ src/png++-0.2.5/dbf_api.html | 436 -------- src/png++-0.2.5/end_info.hpp | 74 -- src/png++-0.2.5/error.hpp | 84 -- src/png++-0.2.5/ga_pixel.hpp | 86 -- src/png++-0.2.5/generator.hpp | 207 ---- src/png++-0.2.5/gray_pixel.hpp | 111 -- src/png++-0.2.5/image.hpp | 536 ---------- src/png++-0.2.5/image_info.hpp | 203 ---- src/png++-0.2.5/index_pixel.hpp | 112 -- src/png++-0.2.5/info.hpp | 152 --- src/png++-0.2.5/info_base.hpp | 77 -- src/png++-0.2.5/io_base.hpp | 468 -------- src/png++-0.2.5/packed_pixel.hpp | 84 -- src/png++-0.2.5/palette.hpp | 48 - src/png++-0.2.5/pixel_buffer.hpp | 495 --------- src/png++-0.2.5/pixel_traits.hpp | 99 -- src/png++-0.2.5/png.hpp | 295 ----- src/png++-0.2.5/reader.hpp | 179 ---- src/png++-0.2.5/require_color_space.hpp | 171 --- src/png++-0.2.5/rgb_pixel.hpp | 90 -- src/png++-0.2.5/rgba_pixel.hpp | 96 -- src/png++-0.2.5/streaming_base.hpp | 128 --- src/png++-0.2.5/tRNS.hpp | 48 - src/png++-0.2.5/types.hpp | 120 --- src/png++-0.2.5/writer.hpp | 199 ---- 38 files changed, 6997 deletions(-) delete mode 100644 src/png++-0.2.5/AUTHORS delete mode 100644 src/png++-0.2.5/BUGS delete mode 100644 src/png++-0.2.5/COPYING delete mode 100644 src/png++-0.2.5/ChangeLog delete mode 100644 src/png++-0.2.5/Doxyfile delete mode 100644 src/png++-0.2.5/INSTALL delete mode 100644 src/png++-0.2.5/Makefile delete mode 100644 src/png++-0.2.5/NEWS delete mode 100644 src/png++-0.2.5/TODO delete mode 100644 src/png++-0.2.5/color.hpp delete mode 100644 src/png++-0.2.5/config.hpp delete mode 100644 src/png++-0.2.5/consumer.hpp delete mode 100644 src/png++-0.2.5/convert_color_space.hpp delete mode 100644 src/png++-0.2.5/dbf_api.html delete mode 100644 src/png++-0.2.5/end_info.hpp delete mode 100644 src/png++-0.2.5/error.hpp delete mode 100644 src/png++-0.2.5/ga_pixel.hpp delete mode 100644 src/png++-0.2.5/generator.hpp delete mode 100644 src/png++-0.2.5/gray_pixel.hpp delete mode 100644 src/png++-0.2.5/image.hpp delete mode 100644 src/png++-0.2.5/image_info.hpp delete mode 100644 src/png++-0.2.5/index_pixel.hpp delete mode 100644 src/png++-0.2.5/info.hpp delete mode 100644 src/png++-0.2.5/info_base.hpp delete mode 100644 src/png++-0.2.5/io_base.hpp delete mode 100644 src/png++-0.2.5/packed_pixel.hpp delete mode 100644 src/png++-0.2.5/palette.hpp delete mode 100644 src/png++-0.2.5/pixel_buffer.hpp delete mode 100644 src/png++-0.2.5/pixel_traits.hpp delete mode 100644 src/png++-0.2.5/png.hpp delete mode 100644 src/png++-0.2.5/reader.hpp delete mode 100644 src/png++-0.2.5/require_color_space.hpp delete mode 100644 src/png++-0.2.5/rgb_pixel.hpp delete mode 100644 src/png++-0.2.5/rgba_pixel.hpp delete mode 100644 src/png++-0.2.5/streaming_base.hpp delete mode 100644 src/png++-0.2.5/tRNS.hpp delete mode 100644 src/png++-0.2.5/types.hpp delete mode 100644 src/png++-0.2.5/writer.hpp diff --git a/src/png++-0.2.5/AUTHORS b/src/png++-0.2.5/AUTHORS deleted file mode 100644 index 25aad54..0000000 --- a/src/png++-0.2.5/AUTHORS +++ /dev/null @@ -1,4 +0,0 @@ -png++ is written by Alexander Shulgin (alex dot shulgin at gmail dot com) -Copyright (C) 2007,2008 - -When writing to me be sure to put png++: in the subject :-) diff --git a/src/png++-0.2.5/BUGS b/src/png++-0.2.5/BUGS deleted file mode 100644 index 66ba2e2..0000000 --- a/src/png++-0.2.5/BUGS +++ /dev/null @@ -1,13 +0,0 @@ -This file lists known bugs and limitations in png++: - -- Lacks support for output transformations - -- Lacks support for optional/unknown chunks in PNG data stream - -- Documentation sucks - - -To report bugs, please use Savannah bug tracker: -http://savannah.nongnu.org/bugs/?group=pngpp&func=additem - -Do not forget to check if the bug was already filed. :-) diff --git a/src/png++-0.2.5/COPYING b/src/png++-0.2.5/COPYING deleted file mode 100644 index 04889ba..0000000 --- a/src/png++-0.2.5/COPYING +++ /dev/null @@ -1,25 +0,0 @@ -Copying png++ is subject to the following license: - -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, - this list of conditions and the following disclaimer. - - 2. 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. - - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. diff --git a/src/png++-0.2.5/ChangeLog b/src/png++-0.2.5/ChangeLog deleted file mode 100644 index e4433a9..0000000 --- a/src/png++-0.2.5/ChangeLog +++ /dev/null @@ -1,29 +0,0 @@ -2009-06-21 Alex Shulgin - - * config.hpp: Added support for FreeBSD (detect endianness). - Patch by . - -png++-0.2.3 19 Oct 2008 - - Fixed numerous `already defined' errors due to require_color_space - implementation. Added `config.hpp'. Fixed `strerror' usage. - Minor docs fixes. - -png++-0.2.1 08 Dec 2007 - - Added support for tRNS chunk. Added non-std IO streams support. - Fixed 16-bit endianness problems. Improved test script. - -png++-0.2.0 08 Jul 2007 - - Major internal code refactoring. Added support for non-8-bit - data, row-by-row IO, added docs, test suite and more. Fixed some - bugs including interlace handling. - -png++-0.1.1 07 Apr 2007 - - Added appropriate copyright notices. - -png++-0.1.0 04 Feb 2007 - - Initial release. diff --git a/src/png++-0.2.5/Doxyfile b/src/png++-0.2.5/Doxyfile deleted file mode 100644 index 0db262f..0000000 --- a/src/png++-0.2.5/Doxyfile +++ /dev/null @@ -1,1304 +0,0 @@ -# Doxyfile 1.5.2 - -# This file describes the settings to be used by the documentation -# system doxygen (www.doxygen.org) for a project All text after a hash -# (#) is considered a comment and will be ignored The format is: TAG = -# value [value, ...] For lists items can also be appended using: TAG -# += value [value, ...] Values that contain spaces should be placed -# between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the -# config file that follow. The default is UTF-8 which is also the -# encoding used for all text before the first occurrence of this -# tag. Doxygen uses libiconv (or the iconv built into libc) for the -# transcoding. See http://www.gnu.org/software/libiconv for the list -# of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words -# surrounded by quotes) that should identify the project. - -PROJECT_NAME = png++ - -# The PROJECT_NUMBER tag can be used to enter a project or revision -# number. This could be handy for archiving the generated -# documentation or if some version control system is used. - -PROJECT_NUMBER = 0.2.1 - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or -# absolute) base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will -# be used. - -OUTPUT_DIRECTORY = doc - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of -# each output format and will distribute the generated files over -# these directories. Enabling this option can be useful when feeding -# doxygen a huge amount of source files, where putting all generated -# files in the same directory would otherwise cause performance -# problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, -# Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Polish, -# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, -# Swedish, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen -# will include brief member descriptions after the members that are -# listed in the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will -# prepend the brief description of a member or function before the -# detailed description. Note: if both HIDE_UNDOC_MEMBERS and -# BRIEF_MEMBER_DESC are set to NO, the brief descriptions will be -# completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description -# abbreviator that is used to form the text in various listings. Each -# string in this list, if found as the leading text of the brief -# description, will be stripped from the text and the result after -# processing the whole list, is used as the annotated text. Otherwise, -# the brief description is used as-is. If left blank, the following -# values are used ("$name" is automatically replaced with the name of -# the entity): "The $name class" "The $name widget" "The $name file" -# "is" "provides" "specifies" "contains" "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES -# then Doxygen will generate a detailed section even if there is only -# a brief description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show -# all inherited members of a class in the documentation of that class -# as if those members were ordinary class members. Constructors, -# destructors and assignment operators of the base classes will not be -# shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend -# the full path before files name in the file list and in the header -# files. If set to NO the shortest path that makes the file name -# unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH -# tag can be used to strip a user-defined part of the path. Stripping -# is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the -# file list. If left blank the directory from which doxygen is run is -# used as the path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part -# of the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. If -# left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths -# that are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much -# shorter (but less readable) file names. This can be useful is your -# file systems doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc comments -# will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. - -JAVADOC_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or -# /// comments) as a brief description. This used to be the default -# behaviour. The new default is to treat a multi-line C++ comment -# block as a detailed description. Set this tag to YES if you prefer -# the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the DETAILS_AT_TOP tag is set to YES then Doxygen will output the -# detailed description near the top, like JavaDoc. If set to NO, the -# detailed description appears after the member documentation. - -DETAILS_AT_TOP = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an -# undocumented member inherits the documentation from any documented -# member that it re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will -# produce a new page for each member. If set to NO, the documentation -# of a member will be part of the file/class/namespace that contains -# it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts as -# commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you -# to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with -# heading "Side Effects:". You can put \n's in the value part of an -# alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of -# C sources only. Doxygen will then generate output that is more -# tailored for C. For instance, some of the names that are used will -# be different. The list of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of -# Java sources only. Doxygen will then generate output that is more -# tailored for Java. For instance, namespaces will be presented as -# packages, qualified scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do -# not want to include (a tag file for) the STL sources as input, then -# you should set this tag to YES in order to let doxygen match -# functions declarations and definitions whose arguments contain STL -# classes (e.g. func(std::string); v.s. func(std::string) {}). This -# also make the inheritance and collaboration diagrams that involve -# STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option -# to YES to enable parsing support. - -CPP_CLI_SUPPORT = NO - -# If member grouping is used in the documentation and the -# DISTRIBUTE_GROUP_DOC tag is set to YES, then doxygen will reuse the -# documentation of the first member in the group (if any) for the -# other members of the group. By default all members of a group must -# be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member -# groups of the same type (for instance a group of public functions) -# to be put as a subgroup of that type (e.g. under the Public -# Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. - -SUBGROUPING = YES - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all -# entities in documentation are documented, even if no documentation -# was available. Private class members and static file members will -# be hidden unless the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set -# to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a -# class will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the -# documentation. If set to NO only classes defined in header files -# are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. If set to NO (the -# default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. If -# set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. This -# option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class -# hierarchy. If set to NO (the default) these classes will be -# included in the various overviews. This option has no effect if -# EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide -# all friend (class|struct|union) declarations. If set to NO (the -# default) these declarations will be included in the documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. If set to -# NO (the default) these blocks will be appended to the function's -# detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed -# after a \internal command is included. If the tag is set to NO (the -# default) then the documentation will be excluded. Set it to YES to -# include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only -# generate file names in lower-case letters. If set to YES upper-case -# letters are also allowed. This is useful if you have classes or -# files whose names only differ in case and if your file system -# supports case sensitive file names. Windows and Mac users are -# advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then -# Doxygen will put a list of the files that are included by a file in -# the documentation of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag -# [inline] is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear -# in declaration order. - -SORT_MEMBER_DOCS = NO - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members -# alphabetically by member name. If set to NO (the default) the -# members will appear in declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to NO -# (the default), the class list will be sorted only by class name, not -# including the namespace part. Note: This option is not very useful -# if HIDE_SCOPE_NAMES is set to YES. Note: This option applies only -# to the class list, not to the alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or disable -# (NO) the todo list. This list is created by putting \todo commands -# in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or disable -# (NO) the test list. This list is created by putting \test commands -# in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) -# the bug list. This list is created by putting \bug commands in the -# documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST = YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to -# appear in the documentation. If the initializer consists of more -# lines than specified here it will be hidden. Use a value of 0 to -# hide initializers completely. The appearance of the initializer of -# individual variables and defines in the documentation can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files -# generated at the bottom of the documentation of classes and -# structs. If set to YES the list will mention the files that were -# used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple -# directories then setting the SHOW_DIRECTORIES tag to YES will show -# the directory hierarchy in the documentation. The default is NO. - -SHOW_DIRECTORIES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or -# script that doxygen should invoke to get the current version for -# each file (typically from the version control system). Doxygen will -# invoke the program by executing (via popen()) the command -# , where is the value of the -# FILE_VERSION_FILTER tag, and is the name of an input -# file provided by doxygen. Whatever the program writes to standard -# output is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages -# that are generated by doxygen. Possible values are YES and NO. If -# left blank NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then -# this flag will automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings -# for potential errors in the documentation, such as not documenting -# some parameters in a documented function, or documenting parameters -# that don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their -# parameters or return value. If set to NO (the default) doxygen will -# only warn about wrong or incomplete parameter documentation, but not -# about the absence of documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages -# that doxygen can produce. The string should contain the $file, -# $line, and $text tags, which will be replaced by the file and line -# number from which the warning originated and the warning -# text. Optionally the format may contain $version, which will be -# replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is -# written to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories -# that contain documented source files. You may enter file names like -# "myfile.cpp" or directories like "/usr/src/myproject". Separate the -# files or directories with spaces. - -INPUT = - -# This tag can be used to specify the character encoding of the source -# files that doxygen parses. Internally doxygen uses the UTF-8 -# encoding, which is also the default input encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible -# encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like -# *.cpp and *.h) to filter out the source-files in the directories. If -# left blank the following patterns are tested: *.c *.cc *.cxx *.cpp -# *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp *.h++ -# *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not -# subdirectories should be searched for input files as well. Possible -# values are YES and NO. If left blank NO is used. - -RECURSIVE = NO - -# The EXCLUDE tag can be used to specify files and/or directories that -# should excluded from the INPUT source files. This way you can easily -# exclude a subdirectory from a directory tree whose root is specified -# with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are -# excluded from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to -# exclude certain files from those directories. Note that the -# wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol -# names (namespaces, classes, functions, etc.) that should be excluded -# from the output. The symbol name can be a fully qualified name, a -# word, or if the wildcard * is used, a substring. Examples: -# ANamespace, AClass, AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included -# (see the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can -# use the EXAMPLE_PATTERNS tag to specify one or more wildcard pattern -# (like *.cpp and *.h) to filter out the source-files in the -# directories. If left blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will -# be searched for input files to be used with the \include or -# \dontinclude commands irrespective of the value of the RECURSIVE -# tag. Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the -# documentation (see the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen -# should invoke to filter for each input file. Doxygen will invoke the -# filter program by executing (via popen()) the command -# , where is the value of the INPUT_FILTER tag, -# and is the name of an input file. Doxygen will then use -# the output that the filter program writes to standard output. If -# FILTER_PATTERNS is specified, this tag will be ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file -# pattern basis. Doxygen will compare the file name with each pattern -# and apply the filter if there is a match. The filters are a list of -# the form: pattern=filter (like *.cpp=my_cpp_filter). See -# INPUT_FILTER for further info on how filters are used. If -# FILTER_PATTERNS is empty, INPUT_FILTER is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if -# set using INPUT_FILTER) will be used to filter the input files when -# producing source files to browse (i.e. when SOURCE_BROWSER is set to -# YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files -# will be generated. Documented entities will be cross-referenced with -# these sources. Note: To get rid of all source code in the generated -# output, make sure also VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body of -# functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will -# instruct doxygen to hide any special comment blocks from generated -# source code fragments. Normal C and C++ comments will always remain -# visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES (the default) then -# for each documented function all documented functions referencing it -# will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES (the default) then for -# each documented function all documented entities called/used by that -# function will be listed. - -REFERENCES_RELATION = YES - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) and -# SOURCE_BROWSER tag is set to YES, then the hyperlinks from functions -# in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will link to -# the source code. Otherwise they will link to the documentstion. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source -# code will point to the HTML generated by the htags(1) tool instead -# of doxygen built-in source browser. The htags tool is part of GNU's -# global source tagging system (see -# http://www.gnu.org/software/global/global.html). You will need -# version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of -# columns in which this list will be split (can be a number in the -# range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes -# that should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be -# put. If a relative path is entered the value of OUTPUT_DIRECTORY -# will be put in front of it. If left blank `html' will be used as the -# default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file -# extension for each generated HTML page (for example: -# .htm,.php,.asp). If it is left blank doxygen will generate files -# with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header -# for each generated HTML page. If it is left blank doxygen will -# generate a standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer -# for each generated HTML page. If it is left blank doxygen will -# generate a standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined -# cascading style sheet that is used by each HTML page. It can be used -# to fine-tune the look of the HTML output. If the tag is left blank -# doxygen will generate a default style sheet. Note that doxygen will -# try to copy the style sheet file to the HTML output directory, so -# don't put your own stylesheet in the HTML output directory as well, -# or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file -# (.chm) of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can be -# used to specify the file name of the resulting .chm file. You can -# add a path in front of the file if the result should not be written -# to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) -# of the HTML help compiler (hhc.exe). If non-empty doxygen will try -# to run the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that it -# should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group -# members to the contents of the HTML help documentation and to the -# tree view. - -TOC_EXPAND = NO - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index -# at top of each HTML page. The value NO (the default) enables the -# index and the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range -# [1..20]) that doxygen will group on one line in the generated HTML -# documentation. - -ENUM_VALUES_PER_LINE = 4 - -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one -# that is generated for HTML Help). For this to work a browser that -# supports JavaScript, DHTML, CSS and frames is required (for instance -# Mozilla 1.0+, Netscape 6.0+, Internet explorer 5.0+, or -# Konqueror). Windows users are probably better off using the HTML -# help feature. - -GENERATE_TREEVIEW = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can -# be used to set the initial width (in pixels) of the frame in which -# the tree is shown. - -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be -# put. If a relative path is entered the value of OUTPUT_DIRECTORY -# will be put in front of it. If left blank `latex' will be used as -# the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name -# to be invoked. If left blank `latex' will be used as the default -# command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name -# to generate index for LaTeX. If left blank `makeindex' will be used -# as the default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more -# compact LaTeX documents. This may be useful for small projects and -# may help to save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used by -# the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header -# for the generated latex document. The header should contain -# everything until the first chapter. If it is left blank doxygen will -# generate a standard header. Notice: only use this tag if you know -# what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf -# viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead -# of plain latex in the generated Makefile. Set this option to YES to -# get a higher quality PDF documentation. - -USE_PDFLATEX = NO - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the -# \\batchmode. command to the generated LaTeX files. This will -# instruct LaTeX to keep running if errors occur, instead of asking -# the user for help. This option is also used when generating -# formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not include -# the index chapters (such as File Index, Compound Index, etc.) in -# the output. - -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF -# output The RTF output is optimized for Word 97 and may not look very -# pretty with other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be -# put. If a relative path is entered the value of OUTPUT_DIRECTORY -# will be put in front of it. If left blank `rtf' will be used as the -# default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will contain links (just -# like the HTML output) instead of page references. This makes the -# output suitable for online browsing using WORD or other programs -# which support those fields. Note: wordpad (write) and others do not -# support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to -# doxygen's config file, i.e. a series of assignments. You only have -# to provide replacements, missing definitions are set to their -# default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be -# put. If a relative path is entered the value of OUTPUT_DIRECTORY -# will be put in front of it. If left blank `man' will be used as the -# default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to the -# generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files only -# source the real man page, but without them the man command would be -# unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will generate an XML -# file that captures the structure of the code including all -# documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be -# put. If a relative path is entered the value of OUTPUT_DIRECTORY -# will be put in front of it. If left blank `xml' will be used as the -# default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, which can -# be used by a validating XML parser to check the syntax of the XML -# files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, which can be used -# by a validating XML parser to check the syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will dump the -# program listings (including syntax highlighting and -# cross-referencing information) to the XML output. Note that enabling -# this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will generate -# an AutoGen Definitions (see autogen.sf.net) file that captures the -# structure of the code including all documentation. Note that this -# feature is still experimental and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will generate a -# Perl module file that captures the structure of the code including -# all documentation. Note that this feature is still experimental and -# incomplete at the moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate the -# necessary Makefile rules, Perl scripts and LaTeX code to be able to -# generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will -# be nicely formatted so it can be parsed by a human reader. This is -# useful if you want to understand what is going on. On the other -# hand, if this tag is set to NO the size of the Perl module output -# will be much smaller and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the -# same Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen -# will evaluate all C-preprocessor directives found in the sources and -# include files. - -ENABLE_PREPROCESSING = NO - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all -# macro names in the source code. If set to NO (the default) only -# conditional compilation will be performed. Macro expansion can be -# done in a controlled way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to -# YES then the macro expansion is limited to the macros specified with -# the PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes -# files in the INCLUDE_PATH (see below) will be search if a #include -# is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories -# that contain include files that are not input files but should be -# processed by the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more -# wildcard patterns (like *.h and *.hpp) to filter out the -# header-files in the directories. If left blank, the patterns -# specified with FILE_PATTERNS will be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names -# that are defined before the preprocessor is started (similar to the -# -D option of gcc). The argument of the tag is a list of macros of -# the form: name or name=definition (no spaces). If the definition and -# the = are omitted =1 is assumed. To prevent a macro definition from -# being undefined via #undef or recursively expanded use the := -# operator instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES -# then this tag can be used to specify a list of macro names that -# should be expanded. The macro definition that is found in the -# sources will be used. Use the PREDEFINED tag if you want to use a -# different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are -# alone on a line, have an all uppercase name, and do not end with a -# semicolon. Such function macros are typically used for boiler-plate -# code, and will confuse the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation can be -# added for each tagfile. The format of a tag file without this -# location is as follows: TAGFILES = file1 file2 ... Adding location -# for the tag files is done as follows: TAGFILES = file1=loc1 "file2 = -# loc2" ... where "loc1" and "loc2" can be relative or absolute paths -# or URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. Note that each tag -# file must have a unique name (where the name does NOT include the -# path) If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will -# create a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be -# listed in the class index. If set to NO only the inherited external -# classes will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be -# listed in the modules index. If set to NO, only the current -# project's groups will be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl -# script interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes -# with base or super classes. Setting the tag to NO turns the diagrams -# off. Note that this option is superseded by the HAVE_DOT option -# below. This is only a fallback. It is recommended to install and use -# dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using -# the \msc command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert -# it in the documentation. The MSCGEN_PATH tag allows you to specify -# the directory where the mscgen tool resides. If left empty the tool -# is assumed to be found in the default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented or is -# not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot -# tool is available from the path. This tool is part of Graphviz, a -# graph visualization toolkit from AT&T and Lucent Bell Labs. The -# other options in this section have no effect if this option is set -# to NO (the default) - -HAVE_DOT = NO - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct -# and indirect inheritance relations. Setting this tag to YES will -# force the the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a graph for each documented class showing the -# direct and indirect implementation dependencies (inheritance, -# containment, and class references variables) of the class with other -# documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups -# dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance -# and collaboration diagrams in a style similar to the OMG's Unified -# Modeling Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show -# the relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for -# each documented file showing the direct and indirect include -# dependencies of the file with other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for -# each documented header file showing the documented files that -# directly or indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class -# method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable -# call graphs for selected functions only using the \callgraph -# command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a caller dependency graph for every global function or -# class method. Note that enabling this option will significantly -# increase the time of a run. So in most cases it will be better to -# enable caller graphs for selected functions only using the -# \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then -# doxygen will graphical hierarchy of all classes instead of a textual -# one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set -# to YES then doxygen will show the dependencies a directory has on -# other directories in a graphical way. The dependency relations are -# determined by the #include relations between the files in the -# directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the -# images generated by dot. Possible values are png, jpg, or gif If -# left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool -# can be found. If left blank, it is assumed the dot tool can be found -# in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories -# that contain dot files that are included in the documentation (see -# the \dotfile command). - -DOTFILE_DIRS = - -# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum -# number of nodes that will be shown in the graph. If the number of -# nodes in a graph becomes larger than this value, doxygen will -# truncate the graph, which is visualized by representing a node as a -# red box. Note that doxygen will always show the root nodes and its -# direct children regardless of this setting. - -DOT_GRAPH_MAX_NODES = 50 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a -# transparent background. This is disabled by default, which results -# in a white background. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the -# edges of a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple -# output files in one run (i.e. multiple -o and -T options on the -# command line). This makes dot run faster, but since only newer -# versions of dot (>1.8.10) support this, this feature is disabled by -# default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes -# and arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate the -# various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should -# be used. If set to NO the values of all tags below this one will be -# ignored. - -SEARCHENGINE = NO diff --git a/src/png++-0.2.5/INSTALL b/src/png++-0.2.5/INSTALL deleted file mode 100644 index 076ad47..0000000 --- a/src/png++-0.2.5/INSTALL +++ /dev/null @@ -1,81 +0,0 @@ -General -======= - -PNG++ comes as a set of header files and does not require compilation -to be installed. For the same reason there are no binary packages for -png++. - - -Prerequisites -============= - -- png++ is known to work with libpng-1.2.x (probably, the 1.4.x - flavour will work too) - -- png++ compiles with g++-4.1. Other version should work well too, - but I have not tested. - -- png++ relies on GNU make for compiling tests and examples; in - particular it uses "remaking makefiles" feature. - -- Documentation is produced using doxygen (http://www.doxygen.org/). - - -Installation -============ - -Follow these instructions in order to install png++: - -- Unpack source package: - - $ tar -zxf png++-0.2.x.tar.gz -C ~/src - -- Go to your brand new png++ sources directory: - - $ cd ~/src/png++-0.2.x - -- Issue make to test how it's doing: - - $ make - -This will compile examples in the example/ directory. - -As always, CFLAGS and LDFLAGS could be used to adjust compilation. In -addition, you might want to specify custom libpng-config. Use -LIBPNG_CONFIG variable for that purpose, like this: - - $ make LIBPNG_CONFIG=~/bin/libpng-config - -If everything goes well, try: - - $ make test - -(or "make check" which is the same as above). This will run the test -suite. If tests do not produce error messages then probably all is -OK. - -- Now you can create documentation (optional). Use - - $ make docs - -to run doxygen in the sources directory. - -- Now it is time to become root and install png++ into your system: - - # make install - -It's OK to issue "make install" under ordinary user permissions if you -want to install png++ into your home directory. Run the following -command: - - $ make install PREFIX=$HOME - -This will copy png++ header files to ~/include/png++ and documentation -files to ~/share/doc/png++-0.2.x (if the docs were built). - -Without a PREFIX png++ installs to /usr/local - - -Happy hacking! --- -Alex Shulgin diff --git a/src/png++-0.2.5/Makefile b/src/png++-0.2.5/Makefile deleted file mode 100644 index af25cb4..0000000 --- a/src/png++-0.2.5/Makefile +++ /dev/null @@ -1,148 +0,0 @@ -# -# Copyright (C) 2007,2008 Alex Shulgin -# -# This file is part of png++ the C++ wrapper for libpng. PNG++ is free -# software; the exact copying conditions are as follows: -# -# 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, -# this list of conditions and the following disclaimer. -# -# 2. 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. -# -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. -# - -# don't forget to update version before releasing! -version := 0.2.5 - -ifndef PREFIX -PREFIX := /usr/local -endif - -ifdef MINGW -bin_suffix := .exe -endif - -make_cflags := -Wall $(CFLAGS) -I$(PREFIX)/include -make_ldflags := $(LDFLAGS) -L$(PREFIX)/lib - -ifndef NDEBUG -make_cflags := $(make_cflags) -g -make_ldflags := $(make_ldflags) -g -endif - -ifndef LIBPNG_CONFIG -LIBPNG_CONFIG := libpng-config -endif - -build_files := Makefile Doxyfile -doc_files := AUTHORS BUGS ChangeLog COPYING INSTALL NEWS README TODO -headers := *.hpp -sources := - -dist_dir := png++-$(version) -dist_package := png++-$(version).tar.gz -dist_files := $(build_files) $(doc_files) \ - $(headers) $(sources) -dist_subdirs := example test - -all: examples - -install: install-headers install-docs - -uninstall: uninstall-headers uninstall-docs - -install-headers: - mkdir -p $(PREFIX)/include/png++ - cp *.hpp $(PREFIX)/include/png++ - -uninstall-headers: - rm -rf $(PREFIX)/include/png++ - -dist: dist-mkdir dist-copy-files dist-package - -dist-mkdir: - rm -rf $(dist_dir) - mkdir $(dist_dir) - -dist-copy-files: - cp $(dist_files) $(dist_dir) - for i in $(dist_subdirs); do \ - $(MAKE) dist-copy-files -C $$i $(MAKEFLAGS) \ - dist_dir=`pwd`/$(dist_dir); \ - done - -dist-package: - rm -f $(dist_package) - tar -zcf $(dist_package) $(dist_dir) --exclude=.svn --exclude='*~' - rm -rf $(dist_dir) - -clean: test-clean examples-clean -# rm -f $(targets) - -thorough-clean: clean docs-clean - -check: test - -test: - $(MAKE) test -C test $(MAKEFLAGS) PNGPP=`pwd` - -test-clean: - $(MAKE) clean -C test $(MAKEFLAGS) - -test-compile-headers: *.hpp - for i in *.hpp; do \ - echo '#include "'$$i'"' >$$i.cpp \ - && g++ -c $$i.cpp $(make_cflags) `$(LIBPNG_CONFIG) --cflags`; \ - done - rm -f *.hpp.o *.hpp.cpp - -docs: - doxygen - -docs-clean: - rm -rf doc - -install-docs: - if [ -d doc ]; then \ - dir=$(PREFIX)/share/doc/$(dist_dir); \ - rm -rf $$dir; \ - mkdir -p $$dir \ - && cp -r $(doc_files) doc/html $$dir; \ - cd $(PREFIX)/share/doc; \ - [ -L png++ ] && rm png++; \ - [ -d png++ ] || ln -s $(dist_dir) png++; \ - fi - -uninstall-docs: - rm -rf $(PREFIX)/share/doc/$(dist_dir) $(PREFIX)/share/doc/png++ - -examples: - $(MAKE) -C example $(MAKEFLAGS) - -examples-clean: - $(MAKE) clean -C example $(MAKEFLAGS) - -.PHONY: all install \ - dist dist-mkdir dist-copy-files dist-package \ - clean thorough-clean \ - check test test-clean test-compile-headers \ - docs docs-clean \ - examples examples-clean diff --git a/src/png++-0.2.5/NEWS b/src/png++-0.2.5/NEWS deleted file mode 100644 index 269d7ff..0000000 --- a/src/png++-0.2.5/NEWS +++ /dev/null @@ -1,54 +0,0 @@ -Version 0.2.5: - - - Fixed compatibility with newer libpng versions (>= 1.4) - - - Fixed compilation on FreeBSD. - - - Fixed tRNS handling with transformations. - - - Added IO transformation debugging facility. - - - Better organized test suite. - -Version 0.2.3: - - - Fixed numerous `already defined' errors due to require_color_space - implementation. - - - Added `config.hpp'. - - - Fixed `strerror' usage. - - - Minor docs fixes. - - -Version 0.2.1: - - - Added support for tRNS chunk. - - - Added non-std IO streams support. - - - Fixed 16-bit endianness problems. - - - Improved test script. - - -Version 0.2.0: - - - Added support for 16-bit data (RGB, RGBA, Grayscale and Gray+Alpha - color types) - - - Added support for packed 1-, 2- or 4-bit pixels (Grayscale and - Indexed colors) - - - Fixed interlace handling code which was severely broken - - - Added possibility to process images without reading the entire - image into memory - - - Internals are refactored while the client interface is mostly - unchanged - - - Added intensive test suite - - - Added documentation diff --git a/src/png++-0.2.5/TODO b/src/png++-0.2.5/TODO deleted file mode 100644 index 553afca..0000000 --- a/src/png++-0.2.5/TODO +++ /dev/null @@ -1,20 +0,0 @@ -? add output transformations -+ support for non-8bit data -+ stream exceptions: badbit only -+ adjust png::image for non-memory back end buffer + row-by-row io -+ use doxygen -- add optional and unknown chunks handling -+ change bit_depth to size_t -+ move tests sources to test/, examples to examples/ -+ extract common code from generator/consumer -+ update pixel traits to detect channels count -+ unify template parameters naming -+ make sure all headers compile on their own -+ add compilation dependency detection -+ add pixel_buffer/image::operator[] -+ improve docs and README -? endianness in expand_8_to_16() -- unify error messages (capitalization, etc.) -+ move stream template parameter from class to function level in - generator and consumer -+ make all tests run even if any of them fails diff --git a/src/png++-0.2.5/color.hpp b/src/png++-0.2.5/color.hpp deleted file mode 100644 index b5ffde2..0000000 --- a/src/png++-0.2.5/color.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_COLOR_HPP_INCLUDED -#define PNGPP_COLOR_HPP_INCLUDED - -#include "types.hpp" - -namespace png -{ - - /** - * \brief PNG color struct extension. Adds constructors. - */ - struct color - : png_color - { - explicit color(byte r = 0, byte g = 0, byte b = 0) - { - this->red = r; - this->green = g; - this->blue = b; - } - - /** - * \brief Initializes color with a copy of png_color object. - */ - color(png_color const& other) - { - this->red = other.red; - this->green = other.green; - this->blue = other.blue; - } - }; - -} // namespace png - -#endif // PNGPP_COLOR_HPP_INCLUDED diff --git a/src/png++-0.2.5/config.hpp b/src/png++-0.2.5/config.hpp deleted file mode 100644 index 36aef7f..0000000 --- a/src/png++-0.2.5/config.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_CONFIG_HPP_INCLUDED -#define PNGPP_CONFIG_HPP_INCLUDED - -// Endianness test -#if defined(__GLIBC__) - -#include - -#elif defined(__WIN32) - -#define __LITTLE_ENDIAN 1234 -#define __BIG_ENDIAN 4321 -#define __BYTE_ORDER __LITTLE_ENDIAN - -#elif defined(__APPLE__) - -#include -#include - -#elif defined(__FreeBSD__) - -#include -#include - -#else - -#error Byte-order could not be detected. - -#endif - -#endif // PNGPP_CONFIG_HPP_INCLUDED diff --git a/src/png++-0.2.5/consumer.hpp b/src/png++-0.2.5/consumer.hpp deleted file mode 100644 index dac6374..0000000 --- a/src/png++-0.2.5/consumer.hpp +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_CONSUMER_HPP_INCLUDED -#define PNGPP_CONSUMER_HPP_INCLUDED - -#include -#include -#include -#include - -#include "config.hpp" -#include "error.hpp" -#include "streaming_base.hpp" -#include "reader.hpp" -#include "pixel_buffer.hpp" - -namespace png -{ - - /** - * \brief Pixel consumer class template. - * - * Used as a base class for custom pixel consumer classes as well - * as inside image class implementation to read pixels into the - * pixel buffer. - * - * Encapsulates PNG %image reading procedure. In order to create - * a custom pixel %consumer use CRTP trick: - * - * \code - * class pixel_consumer - * : public png::consumer< pixel, pixel_consumer > - * { - * ... - * }; - * \endcode - * - * Your pixel %consumer class should implement \c get_next_row() - * method and \c reset() method (optional). Their signatures are - * as follows: - * - * \code - * png::byte* get_next_row(size_t pos); - * void reset(size_t pass); - * \endcode - * - * The \c get_next_row() method is called every time a new row of - * %image data is available to the reader. The position of the row - * being read is passed as \c pos parameter. The \c pos takes - * values from \c 0 to \c -1 inclusively. The - * method should return the starting address of a row buffer - * capable of storing appropriate amount of pixels (i.e. the width - * of the %image being read). The address should be casted to - * png::byte* pointer type using \c reinterpret_cast<> or a - * C-style cast. - * - * The optional \c reset() method is called every time the new - * pass of interlaced %image processing starts. The number of - * interlace pass is avaiable as the only parameter of the method. - * For non-interlaced images the method is called once prior to - * any calls to \c get_next_row(). The value of \c 0 is passed - * for the \c pass number. - * - * An optional template parameter \c info_holder encapsulates - * image_info storage policy. Using def_image_info_holder results - * in image_info object stored as a sub-object of the consumer - * class. You may specify image_info_ref_holder in order to use a - * reference to the externally stored image_info object. This way - * you will have to construct the consumer object passing the - * reference to image_info object. - * - * Also, you might want implement an %info holder object yourself - * to fine-tune your code. In any case, you can access the - * image_info object from your %consumer class methods using the - * following code: - * - * \code - * png::image_info& info = m_info_holder.get_info(); - * \endcode - * - * An optional \c bool template parameter \c interlacing_supported - * specifies whether reading interlacing images is supported by - * your %consumer class. It defaults to \c false. An attempt to - * read an interlaced %image will result in discarding pixels - * obtained at all the interlacing passes except the last one. - * - * In order to fully support interlacing specify \c true for \c - * interlacing_supported parameter and implement \c reset() - * method. - * - * \see image, generator - */ - template< typename pixel, - class pixcon, - class info_holder = def_image_info_holder, - bool interlacing_supported = false > - class consumer - : public streaming_base< pixel, info_holder > - { - public: - typedef pixel_traits< pixel > traits; - - /** - * \brief The default io transformation: does nothing. - */ - struct transform_identity - { - void operator()(io_base&) const {} - }; - - /** - * \brief Reads an image from the stream using default io - * transformation. - */ - template< typename istream > - void read(istream& stream) - { - read(stream, transform_identity()); - } - - /** - * \brief Reads an image from the stream using custom io - * transformation. - * - * Essentially, this method constructs a reader object and - * instructs it to read the image from the stream. It handles - * IO transformation, as well as interlaced image reading. - */ - template< typename istream, class transformation > - void read(istream& stream, transformation const& transform) - { - reader< istream > rd(stream); - rd.read_info(); - transform(rd); - -#if __BYTE_ORDER == __LITTLE_ENDIAN - if (pixel_traits< pixel >::get_bit_depth() == 16) - { -#ifdef PNG_READ_SWAP_SUPPORTED - rd.set_swap(); -#else - throw error("Cannot read 16-bit image:" - " recompile with PNG_READ_SWAP_SUPPORTED."); -#endif - } -#endif - - // interlace handling _must_ be set up prior to info update - size_t pass_count; - if (rd.get_interlace_type() != interlace_none) - { -#ifdef PNG_READ_INTERLACING_SUPPORTED - pass_count = rd.set_interlace_handling(); -#else - throw error("Cannot read interlaced image:" - " interlace handling disabled."); -#endif - } - else - { - pass_count = 1; - } - - rd.update_info(); - if (rd.get_color_type() != traits::get_color_type() - || rd.get_bit_depth() != traits::get_bit_depth()) - { - throw std::logic_error("color type and/or bit depth mismatch" - " in png::consumer::read()"); - } - - this->get_info() = rd.get_image_info(); - - pixcon* pixel_con = static_cast< pixcon* >(this); - if (pass_count > 1 && !interlacing_supported) - { - skip_interlaced_rows(rd, pass_count); - pass_count = 1; - } - read_rows(rd, pass_count, pixel_con); - - rd.read_end_info(); - } - - protected: - typedef streaming_base< pixel, info_holder > base; - - /** - * \brief Constructs a consumer object using passed image_info - * object to store image information. - */ - explicit consumer(image_info& info) - : base(info) - { - } - - private: - template< typename istream > - void skip_interlaced_rows(reader< istream >& rd, size_t pass_count) - { - typedef std::vector< pixel > row; - typedef row_traits< row > row_traits_type; - row dummy_row(this->get_info().get_width()); - for (size_t pass = 1; pass < pass_count; ++pass) - { - rd.read_row(reinterpret_cast< byte* > - (row_traits_type::get_data(dummy_row))); - } - } - - template< typename istream > - void read_rows(reader< istream >& rd, size_t pass_count, - pixcon* pixel_con) - { - for (size_t pass = 0; pass < pass_count; ++pass) - { - pixel_con->reset(pass); - - for (size_t pos = 0; pos < this->get_info().get_height(); ++pos) - { - rd.read_row(pixel_con->get_next_row(pos)); - } - } - } - }; - -} // namespace png - -#endif // PNGPP_CONSUMER_HPP_INCLUDED diff --git a/src/png++-0.2.5/convert_color_space.hpp b/src/png++-0.2.5/convert_color_space.hpp deleted file mode 100644 index 0d57151..0000000 --- a/src/png++-0.2.5/convert_color_space.hpp +++ /dev/null @@ -1,338 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_CONVERT_COLOR_SPACE_HPP_INCLUDED -#define PNGPP_CONVERT_COLOR_SPACE_HPP_INCLUDED - -#include "error.hpp" -#include "rgb_pixel.hpp" -#include "rgba_pixel.hpp" -#include "gray_pixel.hpp" -#include "ga_pixel.hpp" -#include "index_pixel.hpp" -#include "reader.hpp" -#include "writer.hpp" - -namespace png -{ - - namespace detail - { - - /** - * \brief IO transformation class template. Converts %image %color - * space. - */ - template< typename pixel > - struct convert_color_space_impl - { - typedef pixel_traits< pixel > traits; - typedef typename traits::component_type component_type; - typedef basic_alpha_pixel_traits< component_type > alpha_traits; - - template< class reader > - void operator()(reader& io) const - { - handle_16(io); - handle_alpha(io, alpha_traits::get_alpha_filler()); - handle_palette(io); - handle_rgb(io); - handle_gray(io); - - io.set_color_type(traits::get_color_type()); - io.set_bit_depth(traits::get_bit_depth()); - } - - protected: - static void expand_8_to_16(png_struct*, png_row_info* row_info, - byte* row) - { -#ifdef DEBUG_EXPAND_8_16 - printf("row: width=%d, bytes=%d, channels=%d\n", - row_info->width, row_info->rowbytes, row_info->channels); - printf("<= "); - dump_row(row, row_info->rowbytes); -#endif - for (size_t i = row_info->rowbytes; i-- > 0; ) - { - row[2*i + 1] = row[i]; - row[2*i + 0] = 0; - } -#ifdef DEBUG_EXPAND_8_16 - printf("=> "); - dump_row(row, 2*row_info->rowbytes); -#endif - } - -#ifdef DEBUG_EXPAND_8_16 - static void dump_row(byte const* row, size_t width) - { - printf("{"); - for (size_t i = 0; i < width; ++i) - { - printf(" %02x,", row[i]); - } - printf(" }\n"); - } -#endif - - template< class reader > - static void handle_16(reader& io) - { - if (io.get_bit_depth() == 16 && traits::get_bit_depth() == 8) - { -#ifdef PNG_READ_16_TO_8_SUPPORTED - io.set_strip_16(); -#else - throw error("expected 8-bit data but found 16-bit;" - " recompile with PNG_READ_16_TO_8_SUPPORTED"); -#endif - } - if (io.get_bit_depth() != 16 && traits::get_bit_depth() == 16) - { -#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED - io.set_read_user_transform(expand_8_to_16); - io.set_user_transform_info(NULL, 16, - traits::get_channels()); -#else - throw error("expected 16-bit data but found 8-bit;" - " recompile with" - " PNG_READ_USER_TRANSFORM_SUPPORTED"); -#endif - } - } - - template< class reader > - static void handle_alpha(reader& io, uint_32 filler) - { - bool src_alpha = (io.get_color_type() & color_mask_alpha); - bool src_tRNS = io.has_chunk(chunk_tRNS); - bool dst_alpha = traits::get_color_type() & color_mask_alpha; - if ((src_alpha || src_tRNS) && !dst_alpha) - { -#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED - io.set_strip_alpha(); -#else - throw error("alpha channel unexpected;" - " recompile with" - " PNG_READ_STRIP_ALPHA_SUPPORTED"); -#endif - } - if (!src_alpha && dst_alpha) - { -#if defined(PNG_tRNS_SUPPORTED) && defined(PNG_READ_EXPAND_SUPPORTED) - if (src_tRNS) - { - io.set_tRNS_to_alpha(); - return; - } -#endif -#if defined(PNG_READ_FILLER_SUPPORTED) && !defined(PNG_1_0_X) - io.set_add_alpha(filler, filler_after); -#else - throw error("expected alpha channel but none found;" - " recompile with PNG_READ_FILLER_SUPPORTED" - " and be sure to use libpng > 1.0.x"); -#endif - } - } - - template< class reader > - static void handle_palette(reader& io) - { - if (io.get_color_type() == color_type_palette) - { -#ifdef PNG_READ_EXPAND_SUPPORTED - io.set_palette_to_rgb(); - - if (traits::get_color_type() != color_type_palette) - { - io.get_info().drop_palette(); - } -#else - throw error("indexed colors unexpected;" - " recompile with PNG_READ_EXPAND_SUPPORTED"); -#endif - } - } - - template< class reader > - static void handle_rgb(reader& io) - { - bool src_rgb = - io.get_color_type() & (color_mask_rgb | color_mask_palette); - bool dst_rgb = traits::get_color_type() & color_mask_rgb; - if (src_rgb && !dst_rgb) - { -#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED - io.set_rgb_to_gray(/*rgb_to_gray_error*/); -#else - throw error("grayscale data expected;" - " recompile with" - " PNG_READ_RGB_TO_GRAY_SUPPORTED"); -#endif - } - if (!src_rgb && dst_rgb) - { -#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED - io.set_gray_to_rgb(); -#else - throw error("expected RGB data;" - " recompile with" - " PNG_READ_GRAY_TO_RGB_SUPPORTED"); -#endif - } - } - - template< class reader > - static void handle_gray(reader& io) - { - if ((io.get_color_type() & ~color_mask_alpha) - == color_type_gray) - { - if (io.get_bit_depth() < 8 && traits::get_bit_depth() >= 8) - { -#ifdef PNG_READ_EXPAND_SUPPORTED - io.set_gray_1_2_4_to_8(); -#else - throw error("convert_color_space: expected 8-bit data;" - " recompile with" - " PNG_READ_EXPAND_SUPPORTED"); -#endif - } - } - } - }; - - } // namespace detal - - /** - * \brief IO transformation class template. Converts %image %color - * space. - * - * This IO transformation class template is used to convert %color - * space of the source %image to the %color space of the target - * %image. An error with human-readable description is thrown - * when the %color space could not be converted. Often, this - * means that you have to recompile libpng with some more - * conversion options turned on. - * - * Not implemented--see specializations. - * - * \see image, image::read - */ - template< typename pixel > - struct convert_color_space - { - }; - - /** - * \brief Converts %image %color space. A specialization for - * rgb_pixel type. - */ - template<> - struct convert_color_space< rgb_pixel > - : detail::convert_color_space_impl< rgb_pixel > - { - }; - - /** - * \brief Converts %image %color space. A specialization for - * rgb_pixel_16 type. - */ - template<> - struct convert_color_space< rgb_pixel_16 > - : detail::convert_color_space_impl< rgb_pixel_16 > - { - }; - - /** - * \brief Converts %image %color space. A specialization for - * rgba_pixel type. - */ - template<> - struct convert_color_space< rgba_pixel > - : detail::convert_color_space_impl< rgba_pixel > - { - }; - - /** - * \brief Converts %image %color space. A specialization for - * rgba_pixel_16 type. - */ - template<> - struct convert_color_space< rgba_pixel_16 > - : detail::convert_color_space_impl< rgba_pixel_16 > - { - }; - - /** - * \brief Converts %image %color space. A specialization for - * gray_pixel type. - */ - template<> - struct convert_color_space< gray_pixel > - : detail::convert_color_space_impl< gray_pixel > - { - }; - - /** - * \brief Converts %image %color space. A specialization for - * gray_pixel_16 type. - */ - template<> - struct convert_color_space< gray_pixel_16 > - : detail::convert_color_space_impl< gray_pixel_16 > - { - }; - - /** - * \brief Converts %image %color space. A specialization for - * ga_pixel type. - */ - template<> - struct convert_color_space< ga_pixel > - : detail::convert_color_space_impl< ga_pixel > - { - }; - - /** - * \brief Converts %image %color space. A specialization for - * ga_pixel_16 type. - */ - template<> - struct convert_color_space< ga_pixel_16 > - : detail::convert_color_space_impl< ga_pixel_16 > - { - }; - -} // namespace png - -#endif // PNGPP_CONVERT_COLOR_SPACE_HPP_INCLUDED diff --git a/src/png++-0.2.5/dbf_api.html b/src/png++-0.2.5/dbf_api.html deleted file mode 100644 index f7a311b..0000000 --- a/src/png++-0.2.5/dbf_api.html +++ /dev/null @@ -1,436 +0,0 @@ - - -Attribute (.DBF) API - - -

Attribute (.DBF) API

- -The Attribute (DBF) API uses DBFHandle to represent a handle for access -to one .dbf file. The contents of the DBFHandle are visible (see shapefil.h) -but should be ignored by the application. It is intended that all information -be accessed by API functions. Note that there should be exactly one record -in the .dbf file for each shape in the .shp/.shx files. This constraint -must be maintained by the application.

- - - -

DBFOpen()

- -
-DBFHandle DBFOpen( const char * pszDBFFile, const char * pszAccess );
-
-  pszDBFFile:		The name of the xBase (.dbf) file to access.
-
-  pszAccess:		The fopen() style access string.  At this time only
-			"rb" (read-only binary) and "rb+" (read/write binary) 
-		        should be used.
-
- - The DBFOpen() function should be used to establish access to an existing - xBase format table file. The returned DBFHandle is passed to other - access functions, and DBFClose() should be invoked to recover resources, and - flush changes to disk when complete. The DBFCreate() function should - called to create new xBase files. As a convenience, DBFOpen() can be - called with the name of a .shp or .shx file, and it will figure out the - name of the related .dbf file.

- - - -

DBFCreate()

- -
-DBFHandle DBFCreate( const char * pszDBFFile );
-
-  pszDBFFile:		The name of the xBase (.dbf) file to create.
-
- - The DBFCreate() function creates a new xBase format file with the given - name, and returns an access handle that can be used with other DBF functions. - The newly created file will have no fields, and no records. Fields should - be added with DBFAddField() before any records add written. - - - -

DBFGetFieldCount()

- -
-int DBFGetFieldCount( DBFHandle hDBF );
-
-  hDBF:		The access handle for the file to be queried, as returned
-                by DBFOpen(), or DBFCreate().
-
- - The DBFGetFieldCount() function returns the number of fields currently - defined for the indicated xBase file. - - - -

DBFGetRecordCount()

- -
-int DBFGetRecordCount( DBFHandle hDBF );
-
-  hDBF:		The access handle for the file to be queried, as returned by
-		DBFOpen(), or DBFCreate().
-
- - The DBFGetRecordCount() function returns the number of records that - exist on the xBase file currently. Note that with shape files one xBase - record exists for each shape in the .shp/.shx files.

- - - -

DBFGetFieldIndex()

- -
-int DBFGetFieldIndex( DBFHandle hDBF, const char *pszFieldName );
-
-  hDBF:		The access handle for the file to be queried, as returned by
-		DBFOpen(), or DBFCreate().
-
-  pszFieldName: Name of the field to search for.
-
- - Returns the index of the field matching this name, or -1 on failure. The - comparison is case insensitive. However, lengths must match exactly.

- - - -

DBFGetFieldInfo()

- -
-DBFFieldType DBFGetFieldInfo( DBFHandle hDBF, int iField, char * pszFieldName,
-                              int * pnWidth, int * pnDecimals );
-
-  hDBF:		The access handle for the file to be queried, as returned by
-		DBFOpen(), or DBFCreate().
-
-  iField:	The field to be queried.  This should be a number between 
-                0 and n-1, where n is the number fields on the file, as
-                returned by DBFGetFieldCount().
-
-  pszFieldName:	If this pointer is not NULL the name of the requested field
-		will be written to this location.  The pszFieldName buffer 
-                should be at least 12 character is size in order to hold
-		the longest possible field name of 11 characters plus a 
-                terminating zero character.
-
-  pnWidth:	If this pointer is not NULL, the width of the requested field
-		will be returned in the int pointed to by pnWidth.  This is
-                the width in characters.  
-
-  pnDecimals:	If this pointer is not NULL, the number of decimal places
-                precision defined for the field will be returned.  This is
-                zero for integer fields, or non-numeric fields.
-
- - The DBFGetFieldInfo() returns the type of the requested field, which is - one of the DBFFieldType enumerated values. As well, the field name, and - field width information can optionally be returned. The field type returned - does not correspond one to one with the xBase field types. For instance - the xBase field type for Date will just be returned as being FTInteger.

- -

-    typedef enum {
-      FTString,			/* fixed length string field 		*/
-      FTInteger,		/* numeric field with no decimals 	*/
-      FTDouble,			/* numeric field with decimals 		*/
-      FTLogical,		/* logical field.                       */
-      FTInvalid                 /* not a recognised field type 		*/
-    } DBFFieldType;
-
- - - -

DBFAddField()

- -
-int DBFAddField( DBFHandle hDBF, const char * pszFieldName, 
-                 DBFFieldType eType, int nWidth, int nDecimals );
-
-  hDBF:		The access handle for the file to be updated, as returned by
-		DBFOpen(), or DBFCreate().
-
-  pszFieldName:	The name of the new field.  At most 11 character will be used.
-                In order to use the xBase file in some packages it may be
-                necessary to avoid some special characters in the field names
-                such as spaces, or arithmetic operators.
-
-  eType:	One of FTString, FTInteger or FTDouble in order to establish
-                the type of the new field.  Note that some valid xBase field
-                types cannot be created such as date fields.
-
-  nWidth:	The width of the field to be created.  For FTString fields this
-                establishes the maximum length of string that can be stored.
-                For FTInteger this establishes the number of digits of the
-                largest number that can
-                be represented.  For FTDouble fields this in combination
-                with the nDecimals value establish the size, and precision
-                of the created field.
-
-  nDecimals:    The number of decimal places to reserve for FTDouble fields.
-                For all other field types this should be zero.  For instance
-                with nWidth=7, and nDecimals=3 numbers would be formatted
-                similarly to `123.456'.
-
- - The DBFAddField() function is used to add new fields to an existing xBase - file opened with DBFOpen(), or created with DBFCreate(). Note that fields - can only be added to xBase files with no records, though this is limitation - of this API, not of the file format.

- - The DBFAddField() return value is the field number of the new field, or - -1 if the addition of the field failed.

- - - -

DBFReadIntegerAttribute()

- -
-int DBFReadIntegerAttribute( DBFHandle hDBF, int iShape, int iField );
-  
-  hDBF:		The access handle for the file to be queried, as returned by
-		DBFOpen(), or DBFCreate().
-
-  iShape:	The record number (shape number) from which the field value
-                should be read.
-
-  iField:	The field within the selected record that should be read.
-
- - The DBFReadIntegerAttribute() will read the value of one field and return - it as an integer. This can be used even with FTString fields, though the - returned value will be zero if not interpretable as a number.

- - - -

DBFReadDoubleAttribute()

- -
-double DBFReadDoubleAttribute( DBFHandle hDBF, int iShape, int iField );
-  
-  hDBF:		The access handle for the file to be queried, as returned by
-		DBFOpen(), or DBFCreate().
-
-  iShape:	The record number (shape number) from which the field value
-                should be read.
-
-  iField:	The field within the selected record that should be read.
-
- - The DBFReadDoubleAttribute() will read the value of one field and return - it as a double. This can be used even with FTString fields, though the - returned value will be zero if not interpretable as a number.

- - - -

DBFReadStringAttribute()

- -
-const char *DBFReadStringAttribute( DBFHandle hDBF, int iShape, int iField );
-  
-  hDBF:		The access handle for the file to be queried, as returned by
-		DBFOpen(), or DBFCreate().
-
-  iShape:	The record number (shape number) from which the field value
-                should be read.
-
-  iField:	The field within the selected record that should be read.
-
- - The DBFReadStringAttribute() will read the value of one field and return - it as a string. This function may be used on any field type (including - FTInteger and FTDouble) and will return the string representation stored - in the .dbf file. The returned pointer is to an internal buffer - which is only valid untill the next DBF function call. It's contents may - be copied with normal string functions such as strcpy(), or strdup(). If - the TRIM_DBF_WHITESPACE macro is defined in shapefil.h (it is by default) - then all leading and trailing space (ASCII 32) characters will be stripped - before the string is returned.

- - - -

DBFIsAttributeNULL()

- -
-int DBFIsAttributeNULL( DBFHandle hDBF, int iShape, int iField );
-  
-  hDBF:		The access handle for the file to be queried, as returned by
-		DBFOpen(), or DBFCreate().
-
-  iShape:	The record number (shape number) from which the field value
-                should be read.
-
-  iField:	The field within the selected record that should be read.
-
- - This function will return TRUE if the indicated field is NULL valued - otherwise FALSE. Note that NULL fields are represented in the .dbf file - as having all spaces in the field. Reading NULL fields will result in - a value of 0.0 or an empty string with the other DBFRead*Attribute() - functions.

- - - -

DBFWriteIntegerAttribute

- -
-int DBFWriteIntegerAttribute( DBFHandle hDBF, int iShape, int iField,
-                              int nFieldValue );
-
-  hDBF:		The access handle for the file to be written, as returned by
-		DBFOpen(), or DBFCreate().
-
-  iShape:	The record number (shape number) to which the field value
-                should be written.
-
-  iField:	The field within the selected record that should be written.
-
-  nFieldValue:	The integer value that should be written.
-
- -The DBFWriteIntegerAttribute() function is used to write a value to a numeric -field (FTInteger, or FTDouble). If the write succeeds the value TRUE will -be returned, otherwise FALSE will be returned. If the value is too large to -fit in the field, it will be truncated and FALSE returned.

- - - -

DBFWriteDoubleAttribute()

- -
-int DBFWriteDoubleAttribute( DBFHandle hDBF, int iShape, int iField,
-                             double dFieldValue );
-
-  hDBF:		The access handle for the file to be written, as returned by
-		DBFOpen(), or DBFCreate().
-
-  iShape:	The record number (shape number) to which the field value
-                should be written.
-
-  iField:	The field within the selected record that should be written.
-
-  dFieldValue:	The floating point value that should be written.
-
- -The DBFWriteDoubleAttribute() function is used to write a value to a numeric -field (FTInteger, or FTDouble). If the write succeeds the value TRUE will -be returned, otherwise FALSE will be returned. If the value is too large to -fit in the field, it will be truncated and FALSE returned.

- - - -

DBFWriteStringAttribute()

- -
-int DBFWriteStringAttribute( DBFHandle hDBF, int iShape, int iField,
-                             const char * pszFieldValue );
-
-  hDBF:		The access handle for the file to be written, as returned by
-		DBFOpen(), or DBFCreate().
-
-  iShape:	The record number (shape number) to which the field value
-                should be written.
-
-  iField:	The field within the selected record that should be written.
-
-  pszFieldValue: The string to be written to the field.
-
- -The DBFWriteStringAttribute() function is used to write a value to a string -field (FString). If the write succeeds the value TRUE willbe returned, -otherwise FALSE will be returned. If the value is too large to -fit in the field, it will be truncated and FALSE returned.

- - - -

DBFWriteNULLAttribute()

- -
-int DBFWriteNULLAttribute( DBFHandle hDBF, int iShape, int iField );
-
-  hDBF:		The access handle for the file to be written, as returned by
-		DBFOpen(), or DBFCreate().
-
-  iShape:	The record number (shape number) to which the field value
-                should be written.
-
-  iField:	The field within the selected record that should be written.
-
- -The DBFWriteNULLAttribute() function is used to clear the indicated field -to a NULL value. In the .dbf file this is represented by setting the entire -field to spaces. If the write succeeds the value TRUE willbe returned, -otherwise FALSE will be returned.

- - - -

DBFClose()

- -
-void DBFClose( DBFHandle hDBF );
-
-  hDBF:		The access handle for the file to be closed.
-
- - The DBFClose() function will close the indicated xBase file (opened with - DBFOpen(), or DBFCreate()), flushing out all information to the file on - disk, and recovering any resources associated with having the file open. - The file handle (hDBF) should not be used again with the DBF API after - calling DBFClose().

- - - -

DBFIsRecordDeleted()

- -
-int DBFIsRecordDeleted( DBFHandle hDBF, int iShape );
-
-  hDBF:		The access handle for the file to be checked.
-  iShape:       The record index to check.
-
- - Returns TRUE (non-zero) if the record is marked for deletion, otherwise - it returns FALSE.

- - - -

DBFMarkRecordDeleted()

- -
-int DBFMarkRecordDeleted( DBFHandle hDBF, int iShape, int bIsDeleted );
-
-  hDBF:		The access handle for the file.
-  iShape:       The record index to update.
-  bIsDeleted:   TRUE to mark record deleted, or FALSE to undelete it.
-
- - Returns TRUE on success, or FALSE on error.

- - - -

DBFGetNativeFieldType()

- -
-char DBFGetNativeFieldType( DBFHandle hDBF, int iField );
-
-  hDBF:		The access handle for the file.
-  iField:       The field index to query.
-  
-
- - This function returns the DBF type code of the indicated field. It will - be one of:

- -

    -
  • 'C' (String) -
  • 'D' (Date) -
  • 'F' (Float) -
  • 'N' (Numeric, with or without decimal) -
  • 'L' (Logical) -
  • 'M' (Memo: 10 digits .DBT block ptr) -
  • ' ' (field out of range) -
- - - diff --git a/src/png++-0.2.5/end_info.hpp b/src/png++-0.2.5/end_info.hpp deleted file mode 100644 index 0959059..0000000 --- a/src/png++-0.2.5/end_info.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_END_INFO_HPP_INCLUDED -#define PNGPP_END_INFO_HPP_INCLUDED - -#include "info_base.hpp" - -namespace png -{ - - /** - * \brief Internal class to hold PNG ending %info. - * - * \see info, info_base - */ - class end_info - : public info_base - { - public: - end_info(io_base& io, png_struct* png) - : info_base(io, png) - { - } - - void destroy() - { - assert(m_info); - png_destroy_info_struct(m_png, & m_info); - } - - void read() - { - png_read_end(m_png, m_info); - } - - void write() const - { - png_write_end(m_png, m_info); - } - - // TODO: add methods to read/write text comments etc. - }; - -} // namespace png - -#endif // PNGPP_END_INFO_HPP_INCLUDED diff --git a/src/png++-0.2.5/error.hpp b/src/png++-0.2.5/error.hpp deleted file mode 100644 index 971032f..0000000 --- a/src/png++-0.2.5/error.hpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_ERROR_HPP_INCLUDED -#define PNGPP_ERROR_HPP_INCLUDED - -#include -#include -#include - -namespace png -{ - - /** - * \brief Exception class to represent runtime errors related to - * png++ operation. - */ - class error - : public std::runtime_error - { - public: - /** - * \param message error description - */ - explicit error(std::string const& message) - : std::runtime_error(message) - { - } - }; - - /** - * \brief Exception class to represent standard library errors - * (generally IO). - * - * \see reader, writer - */ - class std_error - : public std::runtime_error - { - public: - /** - * Constructs an std_error object. The \a message string is - * appended with ": " and the error description as - * returned by \c strerror(\a error). - * - * \param message error description - * \param error error number - */ - explicit std_error(std::string const& message, int error = errno) - : std::runtime_error((message + ": ") + strerror(error)) - { - } - }; - -} // namespace png - -#endif // PNGPP_ERROR_HPP_INCLUDED diff --git a/src/png++-0.2.5/ga_pixel.hpp b/src/png++-0.2.5/ga_pixel.hpp deleted file mode 100644 index b229441..0000000 --- a/src/png++-0.2.5/ga_pixel.hpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_GA_PIXEL_HPP_INCLUDED -#define PNGPP_GA_PIXEL_HPP_INCLUDED - -#include - -#include "types.hpp" -#include "pixel_traits.hpp" - -namespace png -{ - - /** - * \brief Basic Gray+Alpha pixel type. - */ - template< typename T > - struct basic_ga_pixel - { - typedef pixel_traits< basic_ga_pixel< T > > traits; - - /** - * \brief Constructs basic_ga_pixel object from \a value and - * \a alpha components passed as parameters. Alpha defaults - * to full opacity. - */ - basic_ga_pixel(T value = 0, T alpha = traits::get_alpha_filler()) - : value(value), alpha(alpha) - { - } - - T value; - T alpha; - }; - - /** - * \brief The 8-bit Gray+Alpha pixel type. - */ - typedef basic_ga_pixel< byte > ga_pixel; - - /** - * \brief The 16-bit Gray+Alpha pixel type. - */ - typedef basic_ga_pixel< uint_16 > ga_pixel_16; - - /** - * \brief Pixel traits specialization for basic_ga_pixel. - */ - template< typename T > - struct pixel_traits< basic_ga_pixel< T > > - : basic_pixel_traits< basic_ga_pixel< T >, T, color_type_ga >, - basic_alpha_pixel_traits< T > - { - }; - -} // namespace png - -#endif // PNGPP_GA_PIXEL_HPP_INCLUDED diff --git a/src/png++-0.2.5/generator.hpp b/src/png++-0.2.5/generator.hpp deleted file mode 100644 index e9cc02b..0000000 --- a/src/png++-0.2.5/generator.hpp +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_GENERATOR_HPP_INCLUDED -#define PNGPP_GENERATOR_HPP_INCLUDED - -#include -#include -#include -#include - -#include "config.hpp" -#include "error.hpp" -#include "streaming_base.hpp" -#include "writer.hpp" - -namespace png -{ - - /** - * \brief Pixel generator class template. - * - * Used as a base class for custom pixel generator classes as well - * as inside image class implementation to write pixels from the - * pixel buffer. - * - * A usage example can be found in \c example/pixel_generator.cpp. - * - * Encapsulates PNG %image writing procedure. In order to create - * a custom pixel %generator use CRTP trick: - * - * \code - * class pixel_generator - * : public png::generator< pixel, pixel_generator > - * { - * ... - * }; - * \endcode - * - * Your pixel %generator class should implement \c get_next_row() - * method and \c reset() method (optional). Their signatures are - * as follows: - * - * \code - * png::byte* get_next_row(size_t pos); - * void reset(size_t pass); - * \endcode - * - * The \c get_next_row() method is called every time a new row of - * %image data is needed by the writer. The position of the row - * being written is passed as \c pos parameter. The \c pos takes - * values from \c 0 to \c -1 inclusively. The - * method should return the starting address of a row buffer - * storing an appropriate amount of pixels (i.e. the width of the - * %image being written). The address should be casted to - * png::byte* pointer type using \c reinterpret_cast<> or a - * C-style cast. - * - * The optional \c reset() method is called every time the new - * pass of interlaced %image processing starts. The number of - * interlace pass is avaiable as the only parameter of the method. - * For non-interlaced images the method is called once prior to - * any calls to \c get_next_row(). The value of \c 0 is passed - * for the \c pass number. You do not have to implement this - * method unless you are going to support interlaced %image - * generation. - * - * An optional template parameter \c info_holder encapsulated - * image_info storage policy. Please refer to consumer class - * documentation for the detailed description of this parameter. - * - * An optional \c bool template parameter \c interlacing_supported - * specifies whether writing interlacing images is supported by - * your %generator class. It defaults to \c false. An attempt to - * write an interlaced %image will result in throwing - * \c std::logic_error. - * - * In order to fully support interlacing specify \c true for \c - * interlacing_supported parameter and implement \c reset() - * method. You _must_ generate the same pixels for every pass to - * get the correct PNG %image output. - * - * \see image, consumer - */ - template< typename pixel, - class pixgen, - class info_holder = def_image_info_holder, - bool interlacing_supported = false > - class generator - : public streaming_base< pixel, info_holder > - { - public: - /** - * \brief Writes an image to the stream. - * - * Essentially, this method constructs a writer object and - * instructs it to write the image to the stream. It handles - * writing interlaced images as long as your generator class - * supports this. - */ - template< typename ostream > - void write(ostream& stream) - { - writer< ostream > wr(stream); - wr.set_image_info(this->get_info()); - wr.write_info(); - -#if __BYTE_ORDER == __LITTLE_ENDIAN - if (pixel_traits< pixel >::get_bit_depth() == 16) - { -#ifdef PNG_WRITE_SWAP_SUPPORTED - wr.set_swap(); -#else - throw error("Cannot write 16-bit image:" - " recompile with PNG_WRITE_SWAP_SUPPORTED."); -#endif - } -#endif - - size_t pass_count; - if (this->get_info().get_interlace_type() != interlace_none) - { -#ifdef PNG_WRITE_INTERLACING_SUPPORTED - if (interlacing_supported) - { - pass_count = wr.set_interlace_handling(); - } - else - { - throw std::logic_error("Cannot write interlaced image:" - " generator does not support it."); - } -#else - throw error("Cannot write interlaced image:" - " interlace handling disabled."); -#endif - } - else - { - pass_count = 1; - } - pixgen* pixel_gen = static_cast< pixgen* >(this); - for (size_t pass = 0; pass < pass_count; ++pass) - { - pixel_gen->reset(pass); - - for (size_t pos = 0; pos < this->get_info().get_height(); ++pos) - { - wr.write_row(pixel_gen->get_next_row(pos)); - } - } - - wr.write_end_info(); - } - - protected: - typedef streaming_base< pixel, info_holder > base; - - /** - * \brief Constructs a generator object using passed image_info - * object to store image information. - */ - explicit generator(image_info& info) - : base(info) - { - } - - /** - * \brief Constructs a generator object prepared to generate - * an image of specified width and height. - */ - generator(size_t width, size_t height) - : base(width, height) - { - } - }; - -} // namespace png - -#endif // PNGPP_GENERATOR_HPP_INCLUDED diff --git a/src/png++-0.2.5/gray_pixel.hpp b/src/png++-0.2.5/gray_pixel.hpp deleted file mode 100644 index c1bdb07..0000000 --- a/src/png++-0.2.5/gray_pixel.hpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_GRAY_PIXEL_HPP_INCLUDED -#define PNGPP_GRAY_PIXEL_HPP_INCLUDED - -#include "types.hpp" -#include "packed_pixel.hpp" -#include "pixel_traits.hpp" - -namespace png -{ - - /** - * \brief The 8-bit Grayscale pixel type. - */ - typedef byte gray_pixel; - - /** - * \brief The 16-bit Grayscale pixel type. - */ - typedef uint_16 gray_pixel_16; - - /** - * \brief The packed gray pixel class template. The available - * specializations are for 1-, 2- and 4-bit pixels. - */ - template< size_t bits > - class packed_gray_pixel - : public packed_pixel< bits > - { - public: - packed_gray_pixel(byte value = 0) - : packed_pixel< bits >(value) - { - } - }; - - /** - * \brief The 1-bit Grayscale pixel type. - */ - typedef packed_gray_pixel< 1 > gray_pixel_1; - - /** - * \brief The 2-bit Grayscale pixel type. - */ - typedef packed_gray_pixel< 2 > gray_pixel_2; - - /** - * \brief The 4-bit Grayscale pixel type. - */ - typedef packed_gray_pixel< 4 > gray_pixel_4; - - /** - * \brief Pixel traits specialization for gray_pixel. - */ - template<> - struct pixel_traits< gray_pixel > - : basic_pixel_traits< gray_pixel, byte, color_type_gray > - { - }; - - /** - * \brief Pixel traits specialization for gray_pixel_16. - */ - template<> - struct pixel_traits< gray_pixel_16 > - : basic_pixel_traits< gray_pixel_16, uint_16, color_type_gray > - { - }; - - /** - * \brief Pixel traits specialization for packed_gray_pixel. - */ - template< size_t bits > - struct pixel_traits< packed_gray_pixel< bits > > - : basic_pixel_traits< packed_gray_pixel< bits >, byte, - color_type_gray, /* channels = */ 1, bits > - { - }; - -} // namespace png - -#endif // PNGPP_GRAY_PIXEL_HPP_INCLUDED diff --git a/src/png++-0.2.5/image.hpp b/src/png++-0.2.5/image.hpp deleted file mode 100644 index 0cbf8e4..0000000 --- a/src/png++-0.2.5/image.hpp +++ /dev/null @@ -1,536 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_IMAGE_HPP_INCLUDED -#define PNGPP_IMAGE_HPP_INCLUDED - -#include -#include "pixel_buffer.hpp" -#include "generator.hpp" -#include "consumer.hpp" -#include "convert_color_space.hpp" - -namespace png -{ - - /** - * \brief Class template to represent PNG image. - * - * The image consists of pixel data as well as additional %image - * %info like interlace type, compression method, palette (for - * colormap-based images) etc. Provides methods to read and write - * images from/to a generic stream and to manipulate %image pixels. - */ - template< typename pixel > - class image - { - public: - /** - * \brief The pixel traits type for \c pixel. - */ - typedef pixel_traits< pixel > traits; - - /** - * \brief The pixel buffer type for \c pixel. - */ - typedef pixel_buffer< pixel > pixbuf; - - /** - * \brief Represents a row of image pixel data. - */ - typedef typename pixbuf::row_type row_type; - - /** - * \brief A transformation functor to convert any image to - * appropriate color space. - */ - typedef convert_color_space< pixel > transform_convert; - - /** - * \brief The default io transformation: does nothing. - */ - struct transform_identity - { - void operator()(io_base&) const {} - }; - - /** - * \brief Constructs an empty image. - */ - image() - : m_info(make_image_info< pixel >()) - { - } - - /** - * \brief Constructs an empty image of specified width and height. - */ - image(size_t width, size_t height) - : m_info(make_image_info< pixel >()) - { - resize(width, height); - } - - /** - * \brief Constructs an image reading data from specified file - * using default converting transform. - */ - explicit image(std::string const& filename) - { - read(filename, transform_convert()); - } - - /** - * \brief Constructs an image reading data from specified file - * using custom transformaton. - */ - template< class transformation > - image(std::string const& filename, - transformation const& transform) - { - read(filename.c_str(), transform); - } - - /** - * \brief Constructs an image reading data from specified file - * using default converting transform. - */ - explicit image(char const* filename) - { - read(filename, transform_convert()); - } - - /** - * \brief Constructs an image reading data from specified file - * using custom transformaton. - */ - template< class transformation > - image(char const* filename, transformation const& transform) - { - read(filename, transform); - } - - /** - * \brief Constructs an image reading data from a stream using - * default converting transform. - */ - explicit image(std::istream& stream) - { - read_stream(stream, transform_convert()); - } - - /** - * \brief Constructs an image reading data from a stream using - * custom transformation. - */ - template< class transformation > - image(std::istream& stream, transformation const& transform) - { - read_stream(stream, transform); - } - - /** - * \brief Reads an image from specified file using default - * converting transform. - */ - void read(std::string const& filename) - { - read(filename, transform_convert()); - } - - /** - * \brief Reads an image from specified file using custom - * transformaton. - */ - template< class transformation > - void read(std::string const& filename, transformation const& transform) - { - read(filename.c_str(), transform); - } - - /** - * \brief Reads an image from specified file using default - * converting transform. - */ - void read(char const* filename) - { - read(filename, transform_convert()); - } - - /** - * \brief Reads an image from specified file using custom - * transformaton. - */ - template< class transformation > - void read(char const* filename, transformation const& transform) - { - std::ifstream stream(filename, std::ios::binary); - if (!stream.is_open()) - { - throw std_error(filename); - } - stream.exceptions(std::ios::badbit); - read_stream(stream, transform); - } - - /** - * \brief Reads an image from a stream using default - * converting transform. - */ - void read(std::istream& stream) - { - read_stream(stream, transform_convert()); - } - - /** - * \brief Reads an image from a stream using custom - * transformation. - */ - template< class transformation > - void read(std::istream& stream, transformation const& transform) - { - read_stream(stream, transform); - } - - /** - * \brief Reads an image from a stream using default - * converting transform. - */ - template< class istream > - void read_stream(istream& stream) - { - read_stream(stream, transform_convert()); - } - - /** - * \brief Reads an image from a stream using custom - * transformation. - */ - template< class istream, class transformation > - void read_stream(istream& stream, transformation const& transform) - { - pixel_consumer pixcon(m_info, m_pixbuf); - pixcon.read(stream, transform); - } - - /** - * \brief Writes an image to specified file. - */ - void write(std::string const& filename) - { - write(filename.c_str()); - } - - /** - * \brief Writes an image to specified file. - */ - void write(char const* filename) - { - std::ofstream stream(filename, std::ios::binary); - if (!stream.is_open()) - { - throw std_error(filename); - } - stream.exceptions(std::ios::badbit); - write_stream(stream); - } - - /** - * \brief Writes an image to a stream. - */ - void write_stream(std::ostream& stream) - { - write_stream(stream); - } - - /** - * \brief Writes an image to a stream. - */ - template< class ostream > - void write_stream(ostream& stream) - { - pixel_generator pixgen(m_info, m_pixbuf); - pixgen.write(stream); - } - - /** - * \brief Returns a reference to image pixel buffer. - */ - pixbuf& get_pixbuf() - { - return m_pixbuf; - } - - /** - * \brief Returns a const reference to image pixel buffer. - */ - pixbuf const& get_pixbuf() const - { - return m_pixbuf; - } - - /** - * \brief Replaces the image pixel buffer. - * - * \param buffer a pixel buffer object to take a copy from - */ - void set_pixbuf(pixbuf const& buffer) - { - m_pixbuf = buffer; - } - - size_t get_width() const - { - return m_pixbuf.get_width(); - } - - size_t get_height() const - { - return m_pixbuf.get_height(); - } - - /** - * \brief Resizes the image pixel buffer. - */ - void resize(size_t width, size_t height) - { - m_pixbuf.resize(width, height); - m_info.set_width(width); - m_info.set_height(height); - } - - /** - * \brief Returns a reference to the row of image data at - * specified index. - * - * \see pixel_buffer::get_row() - */ - row_type& get_row(size_t index) - { - return m_pixbuf.get_row(index); - } - - /** - * \brief Returns a const reference to the row of image data at - * specified index. - * - * \see pixel_buffer::get_row() - */ - row_type const& get_row(size_t index) const - { - return m_pixbuf.get_row(index); - } - - /** - * \brief The non-checking version of get_row() method. - */ - row_type& operator[](size_t index) - { - return m_pixbuf[index]; - } - - /** - * \brief The non-checking version of get_row() method. - */ - row_type const& operator[](size_t index) const - { - return m_pixbuf[index]; - } - - /** - * \brief Returns a pixel at (x,y) position. - */ - pixel get_pixel(size_t x, size_t y) const - { - return m_pixbuf.get_pixel(x, y); - } - - /** - * \brief Replaces a pixel at (x,y) position. - */ - void set_pixel(size_t x, size_t y, pixel p) - { - m_pixbuf.set_pixel(x, y, p); - } - - interlace_type get_interlace_type() const - { - return m_info.get_interlace_type(); - } - - void set_interlace_type(interlace_type interlace) - { - m_info.set_interlace_type(interlace); - } - - compression_type get_compression_type() const - { - return m_info.get_compression_type(); - } - - void set_compression_type(compression_type compression) - { - m_info.set_compression_type(compression); - } - - filter_type get_filter_type() const - { - return m_info.get_filter_type(); - } - - void set_filter_type(filter_type filter) - { - m_info.set_filter_type(filter); - } - - /** - * \brief Returns a reference to the image palette. - */ - palette& get_palette() - { - return m_info.get_palette(); - } - - /** - * \brief Returns a const reference to the image palette. - */ - palette const& get_palette() const - { - return m_info.get_palette(); - } - - /** - * \brief Replaces the image palette. - */ - void set_palette(palette const& plte) - { - m_info.set_palette(plte); - } - - tRNS const& get_tRNS() const - { - return m_info.get_tRNS(); - } - - tRNS& get_tRNS() - { - return m_info.get_tRNS(); - } - - void set_tRNS(tRNS const& trns) - { - m_info.set_tRNS(trns); - } - - protected: - /** - * \brief A common base class template for pixel_consumer and - * pixel_generator classes. - */ - template< typename base_impl > - class streaming_impl - : public base_impl - { - public: - streaming_impl(image_info& info, pixbuf& pixels) - : base_impl(info), - m_pixbuf(pixels) - { - } - - /** - * \brief Returns the starting address of a \c pos-th row - * in the image's pixel buffer. - */ - byte* get_next_row(size_t pos) - { - typedef typename pixbuf::row_traits row_traits; - return reinterpret_cast< byte* > - (row_traits::get_data(m_pixbuf.get_row(pos))); - } - - protected: - pixbuf& m_pixbuf; - }; - - /** - * \brief The pixel buffer adapter for reading pixel data. - */ - class pixel_consumer - : public streaming_impl< consumer< pixel, - pixel_consumer, - image_info_ref_holder, - /* interlacing = */ true > > - { - public: - pixel_consumer(image_info& info, pixbuf& pixels) - : streaming_impl< consumer< pixel, - pixel_consumer, - image_info_ref_holder, - true > >(info, pixels) - { - } - - void reset(size_t pass) - { - if (pass == 0) - { - this->m_pixbuf.resize(this->get_info().get_width(), - this->get_info().get_height()); - } - } - }; - - /** - * \brief The pixel buffer adapter for writing pixel data. - */ - class pixel_generator - : public streaming_impl< generator< pixel, - pixel_generator, - image_info_ref_holder, - /* interlacing = */ true > > - { - public: - pixel_generator(image_info& info, pixbuf& pixels) - : streaming_impl< generator< pixel, - pixel_generator, - image_info_ref_holder, - true > >(info, pixels) - { - } - }; - - image_info m_info; - pixbuf m_pixbuf; - }; - -} // namespace png - -#endif // PNGPP_IMAGE_HPP_INCLUDED diff --git a/src/png++-0.2.5/image_info.hpp b/src/png++-0.2.5/image_info.hpp deleted file mode 100644 index 9b17890..0000000 --- a/src/png++-0.2.5/image_info.hpp +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_IMAGE_INFO_HPP_INCLUDED -#define PNGPP_IMAGE_INFO_HPP_INCLUDED - -#include "types.hpp" -#include "palette.hpp" -#include "tRNS.hpp" -#include "pixel_traits.hpp" - -namespace png -{ - - /** - * \brief Holds information about PNG image. - * - * \see image, generator, consumer - */ - class image_info - { - public: - /** - * \brief Constructs the image_info object with default values - * for color_type, interlace_type, compression_method and - * filter_type. - */ - image_info() - : m_width(0), - m_height(0), - m_bit_depth(0), - m_color_type(color_type_none), - m_interlace_type(interlace_none), - m_compression_type(compression_type_default), - m_filter_type(filter_type_default) - { - } - - size_t get_width() const - { - return m_width; - } - - void set_width(size_t width) - { - m_width = width; - } - - size_t get_height() const - { - return m_height; - } - - void set_height(size_t height) - { - m_height = height; - } - - color_type get_color_type() const - { - return m_color_type; - } - - void set_color_type(color_type color_space) - { - m_color_type = color_space; - } - - size_t get_bit_depth() const - { - return m_bit_depth; - } - - void set_bit_depth(size_t bit_depth) - { - m_bit_depth = bit_depth; - } - - interlace_type get_interlace_type() const - { - return m_interlace_type; - } - - void set_interlace_type(interlace_type interlace) - { - m_interlace_type = interlace; - } - - compression_type get_compression_type() const - { - return m_compression_type; - } - - void set_compression_type(compression_type compression) - { - m_compression_type = compression; - } - - filter_type get_filter_type() const - { - return m_filter_type; - } - - void set_filter_type(filter_type filter) - { - m_filter_type = filter; - } - - palette const& get_palette() const - { - return m_palette; - } - - palette& get_palette() - { - return m_palette; - } - - void set_palette(palette const& plte) - { - m_palette = plte; - } - - /** - * \brief Removes all entries from the palette. - */ - void drop_palette() - { - m_palette.clear(); - } - - tRNS const& get_tRNS() const - { - return m_tRNS; - } - - tRNS& get_tRNS() - { - return m_tRNS; - } - - void set_tRNS(tRNS const& trns) - { - m_tRNS = trns; - } - - protected: - uint_32 m_width; - uint_32 m_height; - size_t m_bit_depth; - color_type m_color_type; - interlace_type m_interlace_type; - compression_type m_compression_type; - filter_type m_filter_type; - palette m_palette; - tRNS m_tRNS; - }; - - /** - * \brief Returns an image_info object with color_type and - * bit_depth fields setup appropriate for the \c pixel type. - */ - template< typename pixel > - image_info - make_image_info() - { - typedef pixel_traits< pixel > traits; - image_info info; - info.set_color_type(traits::get_color_type()); - info.set_bit_depth(traits::get_bit_depth()); - return info; - } - -} // namespace png - -#endif // PNGPP_IMAGE_INFO_HPP_INCLUDED diff --git a/src/png++-0.2.5/index_pixel.hpp b/src/png++-0.2.5/index_pixel.hpp deleted file mode 100644 index a28b806..0000000 --- a/src/png++-0.2.5/index_pixel.hpp +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_INDEX_PIXEL_HPP_INCLUDED -#define PNGPP_INDEX_PIXEL_HPP_INCLUDED - -#include "types.hpp" -#include "packed_pixel.hpp" -#include "pixel_traits.hpp" - -namespace png -{ - - /** - * \brief The 8-bit Indexed (colormap) pixel type. - */ - class index_pixel - { - public: - index_pixel(byte index = 0) - : m_index(index) - { - } - - operator byte() const - { - return m_index; - } - - private: - byte m_index; - }; - - /** - * \brief The packed indexed pixel class template. The available - * specializations are for 1-, 2- and 4-bit pixels. - */ - template< size_t bits > - class packed_index_pixel - : public packed_pixel< bits > - { - public: - packed_index_pixel(byte value = 0) - : packed_pixel< bits >(value) - { - } - }; - - /** - * \brief The 1-bit Indexed pixel type. - */ - typedef packed_index_pixel< 1 > index_pixel_1; - - /** - * \brief The 1-bit Indexed pixel type. - */ - typedef packed_index_pixel< 2 > index_pixel_2; - - /** - * \brief The 1-bit Indexed pixel type. - */ - typedef packed_index_pixel< 4 > index_pixel_4; - - /** - * \brief Pixel traits specialization for index_pixel. - */ - template<> - struct pixel_traits< index_pixel > - : basic_pixel_traits< index_pixel, byte, color_type_palette > - { - }; - - /** - * \brief Pixel traits specialization for packed_index_pixel. - */ - template< size_t bits > - struct pixel_traits< packed_index_pixel< bits > > - : basic_pixel_traits< packed_index_pixel< bits >, byte, - color_type_palette, /* channels = */ 1, bits > - { - }; - -} // namespace png - -#endif // PNGPP_INDEX_PIXEL_HPP_INCLUDED diff --git a/src/png++-0.2.5/info.hpp b/src/png++-0.2.5/info.hpp deleted file mode 100644 index a12bf2a..0000000 --- a/src/png++-0.2.5/info.hpp +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_INFO_HPP_INCLUDED -#define PNGPP_INFO_HPP_INCLUDED - -#include -#include "info_base.hpp" -#include "image_info.hpp" - -namespace png -{ - - /** - * \brief Holds information about PNG image. Adapter class for IO - * image operations. - */ - class info - : public info_base, - public image_info - { - public: - info(io_base& io, png_struct* png) - : info_base(io, png) - { - } - - void read() - { - assert(m_png); - assert(m_info); - - png_read_info(m_png, m_info); - png_get_IHDR(m_png, - m_info, - & m_width, - & m_height, - reinterpret_cast< int* >(& m_bit_depth), - reinterpret_cast< int* >(& m_color_type), - reinterpret_cast< int* >(& m_interlace_type), - reinterpret_cast< int* >(& m_compression_type), - reinterpret_cast< int* >(& m_filter_type)); - - if (png_get_valid(m_png, m_info, chunk_PLTE) == chunk_PLTE) - { - png_color* colors = 0; - int count = 0; - png_get_PLTE(m_png, m_info, & colors, & count); - m_palette.assign(colors, colors + count); - } -#ifdef PNG_tRNS_SUPPORTED - if (png_get_valid(m_png, m_info, chunk_tRNS) == chunk_tRNS) - { - if (m_color_type == color_type_palette) - { - int count; - byte* values; - if (png_get_tRNS(m_png, m_info, & values, & count, NULL) - != PNG_INFO_tRNS) - { - throw error("png_get_tRNS() failed"); - } - m_tRNS.assign(values, values + count); - } - } -#endif - } - - void write() const - { - assert(m_png); - assert(m_info); - - sync_ihdr(); - if (m_color_type == color_type_palette) - { - if (! m_palette.empty()) - { - png_set_PLTE(m_png, m_info, - const_cast< color* >(& m_palette[0]), - m_palette.size()); - } - if (! m_tRNS.empty()) - { -#ifdef PNG_tRNS_SUPPORTED - png_set_tRNS(m_png, m_info, - const_cast< byte* >(& m_tRNS[0]), - m_tRNS.size(), - NULL); -#else - throw error("attempted to write tRNS chunk;" - " recompile with PNG_tRNS_SUPPORTED"); -#endif - } - } - png_write_info(m_png, m_info); - } - - void update() - { - assert(m_png); - assert(m_info); - - sync_ihdr(); - png_read_update_info(m_png, m_info); - } - - protected: - void sync_ihdr(void) const - { - png_set_IHDR(m_png, - m_info, - m_width, - m_height, - m_bit_depth, - m_color_type, - m_interlace_type, - m_compression_type, - m_filter_type); - } - }; - -} // namespace png - -#endif // PNGPP_INFO_HPP_INCLUDED diff --git a/src/png++-0.2.5/info_base.hpp b/src/png++-0.2.5/info_base.hpp deleted file mode 100644 index 45e1542..0000000 --- a/src/png++-0.2.5/info_base.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_INFO_BASE_HPP_INCLUDED -#define PNGPP_INFO_BASE_HPP_INCLUDED - -#include -#include "error.hpp" -#include "types.hpp" - -namespace png -{ - - class io_base; - - /** - * \brief Internal class to hold PNG info or end_info. - */ - class info_base - { - info_base(info_base const&); - info_base& operator=(info_base const&); - - public: - info_base(io_base& io, png_struct* png) - : m_io(io), - m_png(png), - m_info(png_create_info_struct(m_png)) - { - } - - png_info* get_png_info() const - { - return m_info; - } - - png_info** get_png_info_ptr() - { - return & m_info; - } - - protected: - io_base& m_io; - png_struct* m_png; - png_info* m_info; - }; - -} // namespace png - -#endif // PNGPP_INFO_BASE_HPP_INCLUDED diff --git a/src/png++-0.2.5/io_base.hpp b/src/png++-0.2.5/io_base.hpp deleted file mode 100644 index f4073da..0000000 --- a/src/png++-0.2.5/io_base.hpp +++ /dev/null @@ -1,468 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_IO_BASE_HPP_INCLUDED -#define PNGPP_IO_BASE_HPP_INCLUDED - -#include -#include -#include -#include "error.hpp" -#include "info.hpp" -#include "end_info.hpp" - -static void -trace_io_transform(char const* fmt, ...) -{ -#ifdef DEBUG_IO_TRANSFORM - va_list va; - va_start(va, fmt); - fprintf(stderr, "TRANSFORM_IO: "); - vfprintf(stderr, fmt, va); - va_end(va); -#endif -} -#define TRACE_IO_TRANSFORM trace_io_transform - -namespace png -{ - - /** - * \brief Base class for PNG reader/writer classes. - * - * \see reader, writer - */ - class io_base - { - io_base(io_base const&); - io_base& operator=(io_base const&); - - public: - explicit io_base(png_struct* png) - : m_png(png), - m_info(*this, m_png), - m_end_info(*this, m_png) - { - } - - ~io_base() - { - assert(! m_png); - assert(! m_info.get_png_info()); - assert(! m_end_info.get_png_info()); - } - - png_struct* get_png_struct() const - { - return m_png; - } - - info& get_info() - { - return m_info; - } - - info const& get_info() const - { - return m_info; - } - - image_info const& get_image_info() const - { - return m_info; - } - - void set_image_info(image_info const& info) - { - static_cast< image_info& >(m_info) = info; // slice it - } - - end_info& get_end_info() - { - return m_end_info; - } - - end_info const& get_end_info() const - { - return m_end_info; - } - - ////////////////////////////////////////////////////////////////////// - // info accessors - // - size_t get_width() const - { - return m_info.get_width(); - } - - void set_width(size_t width) - { - m_info.set_width(width); - } - - size_t get_height() const - { - return m_info.get_height(); - } - - void set_height(size_t height) - { - m_info.set_height(height); - } - - color_type get_color_type() const - { - return m_info.get_color_type(); - } - - void set_color_type(color_type color_space) - { - m_info.set_color_type(color_space); - } - - size_t get_bit_depth() const - { - return m_info.get_bit_depth(); - } - - void set_bit_depth(size_t bit_depth) - { - m_info.set_bit_depth(bit_depth); - } - - interlace_type get_interlace_type() const - { - return m_info.get_interlace_type(); - } - - void set_interlace_type(interlace_type interlace) - { - m_info.set_interlace_type(interlace); - } - - compression_type get_compression_type() const - { - return m_info.get_compression_type(); - } - - void set_compression_type(compression_type compression) - { - m_info.set_compression_type(compression); - } - - filter_type get_filter_type() const - { - return m_info.get_filter_type(); - } - - void set_filter_type(filter_type filter) - { - m_info.set_filter_type(filter); - } - - ////////////////////////////////////////////////////////////////////// - - bool has_chunk(chunk id) - { - return png_get_valid(m_png, - m_info.get_png_info(), - uint_32(id)) == uint_32(id); - } - -#if defined(PNG_READ_EXPAND_SUPPORTED) - void set_gray_1_2_4_to_8() const - { - TRACE_IO_TRANSFORM("png_set_expand_gray_1_2_4_to_8\n"); - png_set_expand_gray_1_2_4_to_8(m_png); - } - - void set_palette_to_rgb() const - { - TRACE_IO_TRANSFORM("png_set_palette_to_rgb\n"); - png_set_palette_to_rgb(m_png); - } - - void set_tRNS_to_alpha() const - { - TRACE_IO_TRANSFORM("png_set_tRNS_to_alpha\n"); - png_set_tRNS_to_alpha(m_png); - } -#endif // defined(PNG_READ_EXPAND_SUPPORTED) - -#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) - void set_bgr() const - { - TRACE_IO_TRANSFORM("png_set_bgr\n"); - png_set_bgr(m_png); - } -#endif - -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) - void set_gray_to_rgb() const - { - TRACE_IO_TRANSFORM("png_set_gray_to_rgb\n"); - png_set_gray_to_rgb(m_png); - } -#endif - -#ifdef PNG_FLOATING_POINT_SUPPORTED - void set_rgb_to_gray(rgb_to_gray_error_action error_action - = rgb_to_gray_silent, - double red_weight = -1.0, - double green_weight = -1.0) const - { - TRACE_IO_TRANSFORM("png_set_rgb_to_gray: error_action=%d," - " red_weight=%lf, green_weight=%lf\n", - error_action, red_weight, green_weight); - - png_set_rgb_to_gray(m_png, error_action, red_weight, green_weight); - } -#else - void set_rgb_to_gray(rgb_to_gray_error_action error_action - = rgb_to_gray_silent, - fixed_point red_weight = -1, - fixed_point green_weight = -1) const - { - TRACE_IO_TRANSFORM("png_set_rgb_to_gray_fixed: error_action=%d," - " red_weight=%d, green_weight=%d\n", - error_action, red_weight, green_weight); - - png_set_rgb_to_gray_fixed(m_png, error_action, - red_weight, green_weight); - } -#endif // PNG_FLOATING_POINT_SUPPORTED - - ////////////////////////////////////////////////////////////////////// - // alpha channel transformations - // -#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) - void set_strip_alpha() const - { - TRACE_IO_TRANSFORM("png_set_strip_alpha\n"); - png_set_strip_alpha(m_png); - } -#endif - -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) \ - || defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) - void set_swap_alpha() const - { - TRACE_IO_TRANSFORM("png_set_swap_alpha\n"); - png_set_swap_alpha(m_png); - } -#endif - -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) \ - || defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) - void set_invert_alpha() const - { - TRACE_IO_TRANSFORM("png_set_invert_alpha\n"); - png_set_invert_alpha(m_png); - } -#endif - -#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) - void set_filler(uint_32 filler, filler_type type) const - { - TRACE_IO_TRANSFORM("png_set_filler: filler=%08x, type=%d\n", - filler, type); - - png_set_filler(m_png, filler, type); - } - -#if !defined(PNG_1_0_X) - void set_add_alpha(uint_32 filler, filler_type type) const - { - TRACE_IO_TRANSFORM("png_set_add_alpha: filler=%08x, type=%d\n", - filler, type); - - png_set_add_alpha(m_png, filler, type); - } -#endif -#endif // PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED - -#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) - void set_swap() const - { - TRACE_IO_TRANSFORM("png_set_swap\n"); - png_set_swap(m_png); - } -#endif - -#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) - void set_packing() const - { - TRACE_IO_TRANSFORM("png_set_packing\n"); - png_set_packing(m_png); - } -#endif - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) \ - || defined(PNG_WRITE_PACKSWAP_SUPPORTED) - void set_packswap() const - { - TRACE_IO_TRANSFORM("png_set_packswap\n"); - png_set_packswap(m_png); - } -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) - void set_shift(byte red_bits, byte green_bits, byte blue_bits, - byte alpha_bits = 0) const - { - TRACE_IO_TRANSFORM("png_set_shift: red_bits=%d, green_bits=%d," - " blue_bits=%d, alpha_bits=%d\n", - red_bits, green_bits, blue_bits, alpha_bits); - - if (get_color_type() != color_type_rgb - || get_color_type() != color_type_rgb_alpha) - { - throw error("set_shift: expected RGB or RGBA color type"); - } - color_info bits; - bits.red = red_bits; - bits.green = green_bits; - bits.blue = blue_bits; - bits.alpha = alpha_bits; - png_set_shift(m_png, & bits); - } - - void set_shift(byte gray_bits, byte alpha_bits = 0) const - { - TRACE_IO_TRANSFORM("png_set_shift: gray_bits=%d, alpha_bits=%d\n", - gray_bits, alpha_bits); - - if (get_color_type() != color_type_gray - || get_color_type() != color_type_gray_alpha) - { - throw error("set_shift: expected Gray or Gray+Alpha" - " color type"); - } - color_info bits; - bits.gray = gray_bits; - bits.alpha = alpha_bits; - png_set_shift(m_png, & bits); - } -#endif // PNG_READ_SHIFT_SUPPORTED || PNG_WRITE_SHIFT_SUPPORTED - -#if defined(PNG_READ_INTERLACING_SUPPORTED) \ - || defined(PNG_WRITE_INTERLACING_SUPPORTED) - int set_interlace_handling() const - { - TRACE_IO_TRANSFORM("png_set_interlace_handling\n"); - return png_set_interlace_handling(m_png); - } -#endif - -#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) - void set_invert_mono() const - { - TRACE_IO_TRANSFORM("png_set_invert_mono\n"); - png_set_invert_mono(m_png); - } -#endif - -#if defined(PNG_READ_16_TO_8_SUPPORTED) - void set_strip_16() const - { - TRACE_IO_TRANSFORM("png_set_strip_16\n"); - png_set_strip_16(m_png); - } -#endif - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - void set_read_user_transform(png_user_transform_ptr transform_fn) - { - TRACE_IO_TRANSFORM("png_set_read_user_transform_fn\n"); - png_set_read_user_transform_fn(m_png, transform_fn); - } -#endif - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) \ - || defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) - void set_user_transform_info(void* info, int bit_depth, int channels) - { - TRACE_IO_TRANSFORM("png_set_user_transform_info: bit_depth=%d," - " channels=%d\n", bit_depth, channels); - - png_set_user_transform_info(m_png, info, bit_depth, channels); - } -#endif - - protected: - void* get_io_ptr() const - { - return png_get_io_ptr(m_png); - } - - void set_error(char const* message) - { - assert(message); - m_error = message; - } - - void reset_error() - { - m_error.clear(); - } - -/* - std::string const& get_error() const - { - return m_error; - } -*/ - - bool is_error() const - { - return !m_error.empty(); - } - - void raise_error() - { - longjmp(png_jmpbuf(m_png), -1); - } - - static void raise_error(png_struct* png, char const* message) - { - io_base* io = static_cast< io_base* >(png_get_error_ptr(png)); - io->set_error(message); - io->raise_error(); - } - - png_struct* m_png; - info m_info; - end_info m_end_info; - std::string m_error; - }; - -} // namespace png - -#endif // PNGPP_IO_BASE_HPP_INCLUDED diff --git a/src/png++-0.2.5/packed_pixel.hpp b/src/png++-0.2.5/packed_pixel.hpp deleted file mode 100644 index 7202b4f..0000000 --- a/src/png++-0.2.5/packed_pixel.hpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_PACKED_PIXEL_HPP_INCLUDED -#define PNGPP_PACKED_PIXEL_HPP_INCLUDED - -#include "types.hpp" - -namespace png -{ - - namespace detail - { - template< size_t bits > class allowed_bit_depth; - - template<> class allowed_bit_depth< 1 > {}; - template<> class allowed_bit_depth< 2 > {}; - template<> class allowed_bit_depth< 4 > {}; - } // namespace detail - - /** - * \brief The packed pixel class template. - * - * \see packed_gray_pixel, packed_index_pixel - */ - template< size_t bits > - class packed_pixel - : detail::allowed_bit_depth< bits > - { - public: - packed_pixel(byte value = 0) - : m_value(value & get_bit_mask()) - { - } - - operator byte() const - { - return m_value; - } - - static size_t const get_bit_depth() - { - return bits; - } - - static byte const get_bit_mask() - { - return (1 << bits) - 1; - } - - private: - byte m_value; - }; - -} // namespace png - -#endif // PNGPP_PACKED_PIXEL_HPP_INCLUDED diff --git a/src/png++-0.2.5/palette.hpp b/src/png++-0.2.5/palette.hpp deleted file mode 100644 index 917f280..0000000 --- a/src/png++-0.2.5/palette.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_PALETTE_HPP_INCLUDED -#define PNGPP_PALETTE_HPP_INCLUDED - -#include -#include "color.hpp" - -namespace png -{ - - /** - * \brief The palette type. Currently implemented as \c std::vector - * of png::color. - */ - typedef std::vector< color > palette; - -} // namespace png - -#endif // PNGPP_PALETTE_HPP_INCLUDED diff --git a/src/png++-0.2.5/pixel_buffer.hpp b/src/png++-0.2.5/pixel_buffer.hpp deleted file mode 100644 index 4aa16e0..0000000 --- a/src/png++-0.2.5/pixel_buffer.hpp +++ /dev/null @@ -1,495 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_PIXEL_BUFFER_HPP_INCLUDED -#define PNGPP_PIXEL_BUFFER_HPP_INCLUDED - -#include -#include -#include -#include - -#include "packed_pixel.hpp" -#include "gray_pixel.hpp" -#include "index_pixel.hpp" - -namespace png -{ - - /** - * \brief The pixel row traits class template. Provides a common - * way to get starting address of the row for packed and unpacked - * row types. - * - * Not implemented--see specializations. - */ - template< typename row > class row_traits; - - /** - * \brief The basic class template to represent image pixel data. - */ - template< typename pixel, - typename row, - class traits = row_traits< row > > - class basic_pixel_buffer - { - public: - /** - * \brief A row of pixel data. - */ - typedef row row_type; - typedef traits row_traits; - - /** - * \brief Constructs an empty 0x0 pixel buffer object. - */ - basic_pixel_buffer() - : m_width(0), - m_height(0) - { - } - - /** - * \brief Constructs an empty pixel buffer object. - */ - basic_pixel_buffer(size_t width, size_t height) - : m_width(0), - m_height(0) - { - resize(width, height); - } - - size_t get_width() const - { - return m_width; - } - - size_t get_height() const - { - return m_height; - } - - /** - * \brief Resizes the pixel buffer. - * - * If new width or height is greater than the original, - * expanded pixels are filled with value of \a pixel(). - */ - void resize(size_t width, size_t height) - { - m_width = width; - m_height = height; - m_rows.resize(height); - for (typename row_vec::iterator r = m_rows.begin(); - r != m_rows.end(); - ++r) - { - r->resize(width); - } - } - - /** - * \brief Returns a reference to the row of image data at - * specified index. - * - * Checks the index before returning a row: an instance of - * std::out_of_range is thrown if \c index is greater than \c - * height. - */ - row_type& get_row(size_t index) - { - return m_rows.at(index); - } - - /** - * \brief Returns a const reference to the row of image data at - * specified index. - * - * The checking version. - */ - row_type const& get_row(size_t index) const - { - return m_rows.at(index); - } - - /** - * \brief The non-checking version of get_row() method. - */ - row_type& operator[](size_t index) - { - return m_rows[index]; - } - - /** - * \brief The non-checking version of get_row() method. - */ - row_type const& operator[](size_t index) const - { - return m_rows[index]; - } - - /** - * \brief Replaces the row at specified index. - */ - void put_row(size_t index, row_type const& r) - { - assert(r.size() == m_width); - m_rows.at(index) = r; - } - - /** - * \brief Returns a pixel at (x,y) position. - */ - pixel get_pixel(size_t x, size_t y) const - { - return get_row(y).at(x); - } - - /** - * \brief Replaces a pixel at (x,y) position. - */ - void set_pixel(size_t x, size_t y, pixel p) - { - get_row(y).at(x) = p; - } - - protected: - size_t m_width; - size_t m_height; - typedef std::vector< row_type > row_vec; - row_vec m_rows; - }; - - /** - * \brief The row_traits specialization for unpacked pixel rows. - */ - template< typename pixel > - class row_traits< std::vector< pixel > > - { - public: - /** - * \brief Returns the starting address of the row. - */ - static pixel* get_data(std::vector< pixel >& vec) - { - assert(vec.size()); - return & vec[0]; - } - }; - - /** - * The pixel_buffer specialization for unpacked pixels. - */ - template< typename pixel > - class pixel_buffer - : public basic_pixel_buffer< pixel, std::vector< pixel > > - { - public: - pixel_buffer() - { - } - - pixel_buffer(size_t width, size_t height) - : basic_pixel_buffer< pixel, std::vector< pixel > >(width, height) - { - } - }; - - namespace detail - { - - template< class pixel, typename reference > - class basic_packed_pixel_proxy - { - public: - explicit basic_packed_pixel_proxy(reference ref) - : m_ref(ref), - m_shift(0) - { - } - - basic_packed_pixel_proxy(reference ref, size_t index) - : m_ref(ref), - m_shift(get_shift(index)) - { - } - - operator pixel() const - { - return pixel((m_ref >> m_shift) & pixel::get_bit_mask()); - } - - protected: - /* - * bits: . . . - * 1: 7 6 5 4 3 2 1 0 - * 2: 6 4 2 0 - * 4: 4 0 - */ - static size_t get_shift(size_t index) - { - size_t const bits = pixel::get_bit_depth(); - return (8 - bits) - (index % get_pixels_per_byte()) * bits; - } - - static size_t get_pixels_per_byte() - { - return 8 / pixel::get_bit_depth(); - } - - reference m_ref; - size_t m_shift; - }; - - template< class pixel > - class const_packed_pixel_proxy - : public basic_packed_pixel_proxy< pixel, byte const& > - { - public: - const_packed_pixel_proxy(byte const& ref, size_t index) - : basic_packed_pixel_proxy< pixel, byte const& >(ref, index) - { - } - }; - - template< class pixel > - class packed_pixel_proxy - : public basic_packed_pixel_proxy< pixel, byte& > - { - public: - typedef basic_packed_pixel_proxy< pixel, byte& > basic_proxy; - - packed_pixel_proxy(byte& ref, size_t index) - : basic_proxy(ref, index) - { - } - - packed_pixel_proxy(packed_pixel_proxy const& other) - : basic_proxy(other.m_ref) - { - this->m_shift = other.m_shift; - } - - packed_pixel_proxy& operator=(packed_pixel_proxy const& other) - { - return *this = static_cast< pixel >(other); - } - - template< typename reference > - packed_pixel_proxy& - operator=(basic_packed_pixel_proxy< pixel, reference > const& other) - { - return *this = static_cast< pixel >(other); - } - - packed_pixel_proxy& operator=(pixel p) - { - this->m_ref = (this->m_ref - & ~(pixel::get_bit_mask() << this->m_shift)) - | (p << this->m_shift); - - return *this; - } - }; - - } // namespace detail - - /** - * \brief The packed pixel row class template. - * - * Stores the pixel row as a std::vector of byte-s, providing - * access to individual packed pixels via proxy objects. - */ - template< class pixel > - class packed_pixel_row - { - public: - /** - * \brief Constructs a pixel row object for \c size packed pixels. - */ - explicit packed_pixel_row(size_t size = 0) - { - resize(size); - } - - size_t size() const - { - return m_size; - } - - /** - * \brief Resizes the pixel row to hold up to \c size packed pixels. - */ - void resize(size_t size) - { - m_vec.resize(size / get_pixels_per_byte() - + (size % get_pixels_per_byte() ? 1 : 0)); - m_size = size; - } - - /** - * \brief The immutable packed pixel proxy type. - */ - typedef detail::const_packed_pixel_proxy< pixel > const_pixel_proxy; - - /** - * \brief The mutable packed pixel proxy type. - */ - typedef detail::packed_pixel_proxy< pixel > pixel_proxy; - - /** - * \brief Returns an immutable proxy the to the pixel at \c - * index. - */ - const_pixel_proxy at(size_t index) const - { - return const_pixel_proxy(m_vec.at(index / get_pixels_per_byte()), - index); - } - - /** - * \brief Returns a mutable proxy the to the pixel at \c - * index. - */ - pixel_proxy at(size_t index) - { - return pixel_proxy(m_vec.at(index / get_pixels_per_byte()), - index); - } - - /** - * \brief Returns an immutable proxy the to the pixel at \c - * index. The non-checking version. - */ - const_pixel_proxy operator[](size_t index) const - { - return const_pixel_proxy(m_vec[index / get_pixels_per_byte()], - index); - } - - /** - * \brief Returns n mutable proxy the to the pixel at \c - * index. The non-checking version. - */ - pixel_proxy operator[](size_t index) - { - return pixel_proxy(m_vec[index / get_pixels_per_byte()], - index); - } - - /** - * \brief Returns the starting address of the row. - */ - byte* get_data() - { - assert(m_vec.size()); - return & m_vec[0]; - } - - private: - static size_t get_pixels_per_byte() - { - return 8 / pixel::get_bit_depth(); - } - - std::vector< byte > m_vec; - size_t m_size; - }; - - /** - * \brief The row_traits class template specialization for packed - * pixel row type. - */ - template< typename pixel > - class row_traits< packed_pixel_row< pixel > > - { - public: - /** - * \brief Returns the starting address of the row. - */ - static byte* get_data(packed_pixel_row< pixel >& row) - { - return row.get_data(); - } - }; - - /** - * \brief The pixel buffer class template specialization for the - * packed_gray_pixel type. - */ - template< size_t bits > - class pixel_buffer< packed_gray_pixel< bits > > - : public basic_pixel_buffer< packed_gray_pixel< bits >, - packed_pixel_row< packed_gray_pixel - < bits > > > - { - public: - typedef packed_gray_pixel< bits > pixel_type; - typedef packed_pixel_row< pixel_type > pixel_row_type; - - pixel_buffer() - { - } - - pixel_buffer(size_t width, size_t height) - : basic_pixel_buffer< pixel_type, - pixel_row_type >(width, height) - { - } - }; - - /** - * \brief The pixel buffer class template specialization for the - * packed_index_pixel type. - */ - template< size_t bits > - class pixel_buffer< packed_index_pixel< bits > > - : public basic_pixel_buffer< packed_index_pixel< bits >, - packed_pixel_row< packed_index_pixel - < bits > > > - { - public: - typedef packed_index_pixel< bits > pixel_type; - typedef packed_pixel_row< pixel_type > pixel_row_type; - - pixel_buffer() - { - } - - pixel_buffer(size_t width, size_t height) - : basic_pixel_buffer< pixel_type, - pixel_row_type >(width, height) - { - } - }; - -} // namespace png - -#endif // PNGPP_PIXEL_BUFFER_HPP_INCLUDED diff --git a/src/png++-0.2.5/pixel_traits.hpp b/src/png++-0.2.5/pixel_traits.hpp deleted file mode 100644 index 6500691..0000000 --- a/src/png++-0.2.5/pixel_traits.hpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_PIXEL_TRAITS_HPP_INCLUDED -#define PNGPP_PIXEL_TRAITS_HPP_INCLUDED - -#include -#include "types.hpp" - -namespace png -{ - - /** - * \brief Pixel traits class template. - * - * Provides information about pixel color type and components bit depth. - * Not implemented--see specializations. - * - * \see pixel_traits, pixel_traits - */ - template< typename pixel > struct pixel_traits; - - /** - * \brief Basic pixel traits class template. - * - * Provides common implementation for various pixel_traits<> - * specializations. - */ - template< typename pixel, - typename component, - color_type pixel_color_type, - size_t channels = sizeof(pixel) / sizeof(component), - size_t bit_depth = std::numeric_limits< component >::digits > - struct basic_pixel_traits - { - typedef pixel pixel_type; - typedef component component_type; - - static color_type get_color_type() - { - return pixel_color_type; - } - static size_t get_channels() - { - return channels; - } - static size_t get_bit_depth() - { - return bit_depth; - } - }; - - /** - * \brief Basic pixel traits class template for pixels with alpha - * channel. - */ - template< typename component > - struct basic_alpha_pixel_traits - { - /** - * \brief Returns the default alpha channel filler for full - * opacity. - */ - static component get_alpha_filler() - { - return std::numeric_limits< component >::max(); - } - }; - -} // namespace png - -#endif // PNGPP_PIXEL_TRAITS_HPP_INCLUDED diff --git a/src/png++-0.2.5/png.hpp b/src/png++-0.2.5/png.hpp deleted file mode 100644 index 1e82c04..0000000 --- a/src/png++-0.2.5/png.hpp +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_PNG_HPP_INCLUDED -#define PNGPP_PNG_HPP_INCLUDED - -#include - -#include "config.hpp" -#include "types.hpp" -#include "error.hpp" -#include "color.hpp" -#include "palette.hpp" -#include "tRNS.hpp" -#include "packed_pixel.hpp" -#include "rgb_pixel.hpp" -#include "rgba_pixel.hpp" -#include "gray_pixel.hpp" -#include "ga_pixel.hpp" -#include "index_pixel.hpp" -#include "info_base.hpp" -#include "info.hpp" -#include "end_info.hpp" -#include "io_base.hpp" -#include "reader.hpp" -#include "writer.hpp" -#include "generator.hpp" -#include "consumer.hpp" -#include "pixel_buffer.hpp" -#include "require_color_space.hpp" -#include "convert_color_space.hpp" -#include "image.hpp" - -/** - * \mainpage - * - * \section sec_intro Introduction - * - * This is the documentation for png++ the C++ wrapper for libpng. - * This page documents png++ version 0.2. - * - * PNG++ aims to provide simple yet powerful C++ interface to libpng, - * the PNG reference implementation library. PNG++ is free software - * distributed under a modified variant of BSD license. - * - * \section sec_news News - * - * - Added support for tRNS chunk. - * - Added non-std IO streams support. - * - Fixed 16-bit endianness problems. - * - Improved test script. - * - * \section sec_getting_started Getting started - * - * The following code demonstrates how to read and write PNG images - * using png++: - * - * \code - * png::image< png::rgb_pixel > image("input.png"); - * image.write("output.png"); - * \endcode - * - * The code reads an image from the file named \c input.png, then - * writes the image to a file named \c output.png. The image class - * template allows you to specify the desired pixel type for the image - * data. The available pixel types include: RGB, Grayscale and - * Indexed pixels. Some of the pixel types can have an alpha channel. - * - * The png++ naturally supports reading PNG images of any %color type - * into RGB or Grayscale pixel buffers (with optional alpha channel). - * This is particularly useful for an image viewer if it needs to - * display the PNG image on, for example, RGB device regardless of the - * image %color type. - * - * On the other hand one might want to read only images of particular - * type. With png++ you can specify it this way: - * - * \code - * png::image< png::rgb_pixel > image("rgb.png", png::require_color_space< png::rgb_pixel >()); - * \endcode - * - * \section sec_installing Installing - * - * PNG++ comes as a set of header files and does not require - * compilation to be installed. For the same reason there are no - * binary packages for png++. - * - * \subsection subs_prerequisites Prerequisites - * - * - png++ works with libpng-1.2.x. - * - png++ compiles with g++-4.1 and g++-4.2. Other version should - * work well too. - * - png++ relies on GNU make for compiling tests and examples; in - * particular it uses "remaking makefiles" feature - * - Documentation is produced using doxygen. See the bottom of - * this page for doxygen version used to compile these docs. - * - * \subsection subs_installing_pngpp Installing png++ - * - * Follow these instructions in order to install png++: - * - * -# Unpack source package: - * \verbatim $ tar -zxf png++-0.2.x.tar.gz -C ~/src \endverbatim - * -# Go to your brand new png++ sources directory: - * \verbatim $ cd ~/src/png++-0.2.x \endverbatim - * -# Issue \c make to test how it's doing: - * \verbatim $ make \endverbatim - * This will compile examples in the \c example directory. If everything - * goes well, try \verbatim $ make test \endverbatim (or \c make \c - * check which is the same as above) to run the test suite. If tests - * do not produce error messages then probably all is OK. - * -# Now you can create documentation (optional). Use - * \verbatim $ make docs \endverbatim - * to run \c doxygen in the sources directory. - * -# Now it is time to become \c root and install png++ into your - * system. It's OK to issue \c make \c install under ordinary user - * permissions if you want to install png++ into your home - * directory. Run the following command: - * \verbatim $ make install PREFIX=$HOME \endverbatim - * to copy png++ header files to \c ~/include/png++ and documentation - * files to ~/share/doc/png++-0.2.x. Without a \c PREFIX png++ - * installs to \c /usr/local. - * - * \section sec_working_with_images Working with images - * - * In png++ you can create new images like this: - * - * \code - * #include - * //... - * png::image< png::rgb_pixel > image(128, 128); - * for (size_t y = 0; y < image.get_height(); ++y) - * { - * for (size_t x = 0; x < image.get_width(); ++x) - * { - * image[y][x] = png::rgb_pixel(x, y, x + y); - * // non-checking equivalent of image.set_pixel(x, y, ...); - * } - * } - * image.write("rgb.png"); - * \endcode - * - * Optionally, you may specify - * \code - * image.set_interlace_type(png::interlace_adam7) - * \endcode - * to produce an interlaced image. - * - * If you are writing an indexed colors image, you should provide a - * palette (colormap). One of the ways to do this is the following: - * - * \code - * #include - * //... - * png::image< png::index_pixel > image; - * png::palette pal(256); - * for (size_t i = 0; i < pal.size(); ++i) - * { - * pal[i] = png::color(i, 255 - i, i); - * } - * image.set_palette(pal); - * ... - * image.write("palette.png"); - * \endcode - * - * It is not absolutely necessary to have the whole image data in - * memory in order to write a PNG file. You can use generator class - * template to write the image row-by-row. An example of this is - * provided in \c example/pixel_generator.cpp bundled with the sources - * package. - * - * The same holds for reading images too. You can use consumer class - * template in order to read the image data row-by-row. This might - * help in applications which have to deal with large PNG images but - * do not want to read the entire image into memory. - * - * You can read or write images from/to generic IO stream, not only - * file on disk. Check out \c image::read(std::istream&), - * \c image::write(std::ostream&) overloads in the reference manual. - * - * \section sec_compiling_user Compiling your programs - * - * Use the following command to compile your program: - * - * \verbatim $ g++ -c example.cpp `libpng-config --cflags` \endverbatim - * - * and the following to link it: - * - * \verbatim $ g++ -o example example.o `libpng-config --ldflags` \endverbatim - * - * When compiling you should add \c -I \c $PREFIX/include if you have - * installed png++ to non-standard location, like your home directory. - * - * In your program, the line - * - * \code - * #include - * \endcode - * - * brings in all the header files in png++ which should be suitable - * for the most of the applications. You may include only the headers - * you really use, for example: - * - * \code - * #include - * #include - * \endcode - * - * If do not want to install png++ headers you still can compile your - * programs. Just create a subdirectory named \c png++ somewhere in - * your project tree and copy all of the \c .hpp files in png++ - * distribution there. Then use appropriate compiler options to add - * this directory into the header search path. - * - * \section sec_further Further reading - * - * - To get information about specific features, use reference (can be - * reached from the top of this page). - * - If you are looking for more example code, please go to the \c - * example/ directory of the source distribution. You may also find - * sources in the \c test/ directory insightful (well, somewhat). - * - Have a question? Check out \ref sec_help section below. - * - Of course, your ultimate source for learning is the source - * code. :-) - * - * \section sec_download Download - * - * The project is hosted at Savannah: - * http://savannah.nongnu.org/projects/pngpp/ - * - * Released source packages can be found here: - * http://download.savannah.nongnu.org/releases/pngpp/ - * - * Also, you can check out sources directly from SVN repository: - * svn://svn.sv.nongnu.org/pngpp/trunk/ or - * http://svn.sv.nongnu.org/pngpp/trunk/ (for people w/o outgoing svn). - * - * Online version of this documentation can be found here: - * http://www.nongnu.org/pngpp/doc/0.2.3/index.html - * - * \section sec_bugs Bugs - * - * The following is a list of known bugs and limitations: - * - * - Lacks support for output transformations - * - Lacks support for optional/unknown chunks in PNG data stream - * - Documentation sucks ;-) - * - * To report bugs, please use Savannah bug tracker: - * http://savannah.nongnu.org/bugs/?group=pngpp&func=additem - * - * Do not forget to check if the bug was already filed. :-) - * - * \section sec_help Getting help - * - * There is a mailing list for developers: - * http://lists.nongnu.org/mailman/listinfo/pngpp-devel - * - * You can also contact me by dropping a mail to . - * - * Happy hacking! - * - * Alex Shulgin - */ - -#endif // PNGPP_PNG_HPP_INCLUDED diff --git a/src/png++-0.2.5/reader.hpp b/src/png++-0.2.5/reader.hpp deleted file mode 100644 index 5c122dd..0000000 --- a/src/png++-0.2.5/reader.hpp +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_READER_HPP_INCLUDED -#define PNGPP_READER_HPP_INCLUDED - -#include -#include "io_base.hpp" - -namespace png -{ - - /** - * \brief The PNG reader class template. This is the low-level - * reading interface--use image class or consumer class to - * actually read images. - * - * The \c istream template parameter specifies the type of input - * stream to work with. The \c istream class should implement the - * minimum of the following interface: - * - * \code - * class my_istream - * { - * public: - * void read(char*, size_t); - * bool good(); - * }; - * \endcode - * - * With the semantics similar to the \c std::istream. Naturally, - * \c std::istream fits this requirement and can be used with the - * reader class as is. - * - * \see image, consumer, writer, io_base - */ - template< class istream > - class reader - : public io_base - { - public: - /** - * \brief Constructs a reader prepared to read PNG image from - * a \a stream. - */ - explicit reader(istream& stream) - : io_base(png_create_read_struct(PNG_LIBPNG_VER_STRING, - static_cast< io_base* >(this), - raise_error, - 0)) - { - png_set_read_fn(m_png, & stream, read_data); - } - - ~reader() - { - png_destroy_read_struct(& m_png, - m_info.get_png_info_ptr(), - m_end_info.get_png_info_ptr()); - } - - /** - * \brief Reads the whole PNG data stream into memory. Not - * particularly useful. - */ - void read_png() - { - if (setjmp(png_jmpbuf(m_png))) - { - throw error(m_error); - } - png_read_png(m_png, - m_info.get_png_info(), - /* transforms = */ 0, - /* params = */ 0); - } - - /** - * \brief Reads info about PNG image. - */ - void read_info() - { - if (setjmp(png_jmpbuf(m_png))) - { - throw error(m_error); - } - m_info.read(); - } - - /** - * \brief Reads a row of image data at a time. - */ - void read_row(byte* bytes) - { - if (setjmp(png_jmpbuf(m_png))) - { - throw error(m_error); - } - png_read_row(m_png, bytes, 0); - } - - /** - * \brief Reads ending info about PNG image. - */ - void read_end_info() - { - if (setjmp(png_jmpbuf(m_png))) - { - throw error(m_error); - } - m_end_info.read(); - } - - void update_info() - { - m_info.update(); - } - - private: - static void read_data(png_struct* png, byte* data, size_t length) - { - io_base* io = static_cast< io_base* >(png_get_error_ptr(png)); - reader* rd = static_cast< reader* >(io); - rd->reset_error(); - istream* stream = reinterpret_cast< istream* >(png_get_io_ptr(png)); - try - { - stream->read(reinterpret_cast< char* >(data), length); - if (!stream->good()) - { - rd->set_error("istream::read() failed"); - } - } - catch (std::exception const& error) - { - rd->set_error(error.what()); - } - catch (...) - { - assert(!"read_data: caught something wrong"); - rd->set_error("read_data: caught something wrong"); - } - if (rd->is_error()) - { - rd->raise_error(); - } - } - }; - -} // namespace png - -#endif // PNGPP_READER_HPP_INCLUDED diff --git a/src/png++-0.2.5/require_color_space.hpp b/src/png++-0.2.5/require_color_space.hpp deleted file mode 100644 index c339dfb..0000000 --- a/src/png++-0.2.5/require_color_space.hpp +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_REQUIRE_COLOR_SPACE_HPP_INCLUDED -#define PNGPP_REQUIRE_COLOR_SPACE_HPP_INCLUDED - -#include "error.hpp" -#include "rgb_pixel.hpp" -#include "rgba_pixel.hpp" -#include "gray_pixel.hpp" -#include "ga_pixel.hpp" -#include "index_pixel.hpp" -#include "io_base.hpp" - -namespace png -{ - - namespace detail - { - - template< typename pixel > - struct wrong_color_space - { - inline static char const* error_msg(); - }; - - template<> inline char const* - wrong_color_space< rgb_pixel >::error_msg() - { - return "8-bit RGB color space required"; - } - - template<> inline char const* - wrong_color_space< rgb_pixel_16 >::error_msg() - { - return "16-bit RGB color space required"; - } - - template<> inline char const* - wrong_color_space< rgba_pixel >::error_msg() - { - return "8-bit RGBA color space required"; - } - - template<> inline char const* - wrong_color_space< rgba_pixel_16 >::error_msg() - { - return "16-bit RGBA color space required"; - } - - template<> inline char const* - wrong_color_space< gray_pixel >::error_msg() - { - return "8-bit Grayscale color space required"; - } - - template<> inline char const* - wrong_color_space< gray_pixel_1 >::error_msg() - { - return "1-bit Grayscale color space required"; - } - - template<> inline char const* - wrong_color_space< gray_pixel_2 >::error_msg() - { - return "2-bit Grayscale color space required"; - } - - template<> inline char const* - wrong_color_space< gray_pixel_4 >::error_msg() - { - return "4-bit Grayscale color space required"; - } - - template<> inline char const* - wrong_color_space< gray_pixel_16 >::error_msg() - { - return "16-bit Grayscale color space required"; - } - - template<> inline char const* - wrong_color_space< ga_pixel >::error_msg() - { - return "8-bit Gray+Alpha color space required"; - } - - template<> inline char const* - wrong_color_space< ga_pixel_16 >::error_msg() - { - return "16-bit Gray+Alpha color space required"; - } - - template<> inline char const* - wrong_color_space< index_pixel >::error_msg() - { - return "8-bit Colormap color space required"; - } - - template<> inline char const* - wrong_color_space< index_pixel_1 >::error_msg() - { - return "1-bit Colormap color space required"; - } - - template<> inline char const* - wrong_color_space< index_pixel_2 >::error_msg() - { - return "2-bit Colormap color space required"; - } - - template<> inline char const* - wrong_color_space< index_pixel_4 >::error_msg() - { - return "4-bit Colormap color space required"; - } - - } // namespace detail - - /** - * \brief IO transformation class template. Enforces image color space. - * - * This IO transformation class template used to enforce source image - * color space. - * - * \see image, image::read - */ - template< typename pixel > - struct require_color_space - { - typedef pixel_traits< pixel > traits; - - void operator()(io_base& io) const - { - if (io.get_color_type() != traits::get_color_type() - || io.get_bit_depth() != traits::get_bit_depth()) - { - throw error(detail::wrong_color_space< pixel >::error_msg()); - } - } - }; - -} // namespace png - -#endif // PNGPP_REQUIRE_COLOR_SPACE_HPP_INCLUDED diff --git a/src/png++-0.2.5/rgb_pixel.hpp b/src/png++-0.2.5/rgb_pixel.hpp deleted file mode 100644 index cc45ac6..0000000 --- a/src/png++-0.2.5/rgb_pixel.hpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_RGB_PIXEL_HPP_INCLUDED -#define PNGPP_RGB_PIXEL_HPP_INCLUDED - -#include "types.hpp" -#include "pixel_traits.hpp" - -namespace png -{ - - /** - * \brief RGB pixel type. - */ - template< typename T > - struct basic_rgb_pixel - { - /** - * \brief Default constructor. Initializes all components - * with zeros. - */ - basic_rgb_pixel() - : red(0), green(0), blue(0) - { - } - - /** - * \brief Constructs rgb_pixel object from \a red, \a green - * and \a blue components passed as parameters. - */ - basic_rgb_pixel(T red, T green, T blue) - : red(red), green(green), blue(blue) - { - } - - T red; - T green; - T blue; - }; - - /** - * The 8-bit RGB pixel type. - */ - typedef basic_rgb_pixel< byte > rgb_pixel; - - /** - * The 16-bit RGB pixel type. - */ - typedef basic_rgb_pixel< uint_16 > rgb_pixel_16; - - /** - * \brief Pixel traits specialization for basic_rgb_pixel. - */ - template< typename T > - struct pixel_traits< basic_rgb_pixel< T > > - : basic_pixel_traits< basic_rgb_pixel< T >, T, color_type_rgb > - { - }; - -} // namespace png - -#endif // PNGPP_RGB_PIXEL_HPP_INCLUDED diff --git a/src/png++-0.2.5/rgba_pixel.hpp b/src/png++-0.2.5/rgba_pixel.hpp deleted file mode 100644 index 35b6bf0..0000000 --- a/src/png++-0.2.5/rgba_pixel.hpp +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_RGBA_PIXEL_HPP_INCLUDED -#define PNGPP_RGBA_PIXEL_HPP_INCLUDED - -#include "types.hpp" -#include "pixel_traits.hpp" - -namespace png -{ - - /** - * \brief RGBA pixel type. - */ - template< typename T > - struct basic_rgba_pixel - { - typedef pixel_traits< basic_rgba_pixel< T > > traits; - - /** - * \brief Default constructor. Initializes all components - * with zeros. - */ - basic_rgba_pixel() - : red(0), green(0), blue(0), alpha(0) - { - } - - /** - * \brief Constructs rgba_pixel object from \a red, \a green, - * \a blue and \a alpha components passed as parameters. - * Alpha defaults to full opacity. - */ - basic_rgba_pixel(T red, T green, T blue, - T alpha = traits::get_alpha_filler()) - : red(red), green(green), blue(blue), alpha(alpha) - { - } - - T red; - T green; - T blue; - T alpha; - }; - - /** - * The 8-bit RGBA pixel type. - */ - typedef basic_rgba_pixel< byte > rgba_pixel; - - /** - * The 16-bit RGBA pixel type. - */ - typedef basic_rgba_pixel< uint_16 > rgba_pixel_16; - - /** - * \brief Pixel traits specialization for basic_rgba_pixel. - */ - template< typename T > - struct pixel_traits< basic_rgba_pixel< T > > - : basic_pixel_traits< basic_rgba_pixel< T >, T, color_type_rgba >, - basic_alpha_pixel_traits< T > - { - }; - -} // namespace png - -#endif // PNGPP_RGBA_PIXEL_HPP_INCLUDED diff --git a/src/png++-0.2.5/streaming_base.hpp b/src/png++-0.2.5/streaming_base.hpp deleted file mode 100644 index 68a23dd..0000000 --- a/src/png++-0.2.5/streaming_base.hpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_STREAMING_BASE_HPP_INCLUDED -#define PNGPP_STREAMING_BASE_HPP_INCLUDED - -#include -#include "image_info.hpp" -#include "pixel_traits.hpp" - -namespace png -{ - - /** - * \brief The default image_info holder class. Stores image_info - * member object. - */ - class def_image_info_holder - { - public: - def_image_info_holder(image_info const& info) - : m_info(info) - { - } - - image_info& get_info() - { - return m_info; - } - - private: - image_info m_info; - }; - - /** - * \brief An image_info holder class. Stores a reference to the - * image_info object. The image_info object itself should be - * stored elsewhere. - */ - class image_info_ref_holder - { - public: - image_info_ref_holder(image_info& info) - : m_info(info) - { - } - - image_info& get_info() - { - return m_info; - } - - private: - image_info& m_info; - }; - - /** - * \brief A base class template for consumer and generator - * classes. Provides default \c reset() method implementation as - * well as \c info_holder policy. - */ - template< typename pixel, class info_holder > - class streaming_base - { - public: - typedef pixel_traits< pixel > traits; - - explicit streaming_base(image_info& info) - : m_info_holder(info) - { - } - - streaming_base(size_t width, size_t height) - : m_info_holder(make_image_info< pixel >()) - { - get_info().set_width(width); - get_info().set_height(height); - } - - image_info const& get_info() const - { - return m_info_holder.get_info(); - } - - protected: - void reset(size_t /*pass*/) - { - // nothing to do in the most general case - } - - image_info& get_info() - { - return m_info_holder.get_info(); - } - - info_holder m_info_holder; - }; - -} // namespace png - -#endif // PNGPP_STREAMING_BASE_HPP_INCLUDED diff --git a/src/png++-0.2.5/tRNS.hpp b/src/png++-0.2.5/tRNS.hpp deleted file mode 100644 index ff01816..0000000 --- a/src/png++-0.2.5/tRNS.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_TRNS_HPP_INCLUDED -#define PNGPP_TRNS_HPP_INCLUDED - -#include -#include "color.hpp" - -namespace png -{ - - /** - * \brief The palette transparency map type. Currently - * implemented as \c std::vector of png::byte. - */ - typedef std::vector< byte > tRNS; - -} // namespace png - -#endif // PNGPP_TRNS_HPP_INCLUDED diff --git a/src/png++-0.2.5/types.hpp b/src/png++-0.2.5/types.hpp deleted file mode 100644 index 1538d6b..0000000 --- a/src/png++-0.2.5/types.hpp +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_TYPES_HPP_INCLUDED -#define PNGPP_TYPES_HPP_INCLUDED - -#include - -namespace png -{ - - typedef png_byte byte; - typedef png_uint_16 uint_16; - typedef png_uint_32 uint_32; - typedef png_fixed_point fixed_point; - typedef png_color_8 color_info; - typedef png_color_16 color_info_16; - - enum color_type - { - color_type_none = -1, - color_type_gray = PNG_COLOR_TYPE_GRAY, - color_type_palette = PNG_COLOR_TYPE_PALETTE, - color_type_rgb = PNG_COLOR_TYPE_RGB, - color_type_rgb_alpha = PNG_COLOR_TYPE_RGB_ALPHA, - color_type_gray_alpha = PNG_COLOR_TYPE_GRAY_ALPHA, - color_type_rgba = PNG_COLOR_TYPE_RGBA, - color_type_ga = PNG_COLOR_TYPE_GA - }; - - enum color_mask - { - color_mask_palette = PNG_COLOR_MASK_PALETTE, - color_mask_color = PNG_COLOR_MASK_COLOR, - color_mask_rgb = color_mask_color, - color_mask_alpha = PNG_COLOR_MASK_ALPHA - }; - - enum filler_type - { - filler_before = PNG_FILLER_BEFORE, - filler_after = PNG_FILLER_AFTER - }; - - enum rgb_to_gray_error_action - { - rgb_to_gray_silent = 1, - rgb_to_gray_warning = 2, - rgb_to_gray_error = 3 - }; - - enum interlace_type - { - interlace_none = PNG_INTERLACE_NONE, - interlace_adam7 = PNG_INTERLACE_ADAM7 - }; - - enum compression_type - { - compression_type_base = PNG_COMPRESSION_TYPE_BASE, - compression_type_default = PNG_COMPRESSION_TYPE_DEFAULT - }; - - enum filter_type - { - filter_type_base = PNG_FILTER_TYPE_BASE, - intrapixel_differencing = PNG_INTRAPIXEL_DIFFERENCING, - filter_type_default = PNG_FILTER_TYPE_DEFAULT - }; - - enum chunk - { - chunk_gAMA = PNG_INFO_gAMA, - chunk_sBIT = PNG_INFO_sBIT, - chunk_cHRM = PNG_INFO_cHRM, - chunk_PLTE = PNG_INFO_PLTE, - chunk_tRNS = PNG_INFO_tRNS, - chunk_bKGD = PNG_INFO_bKGD, - chunk_hIST = PNG_INFO_hIST, - chunk_pHYs = PNG_INFO_pHYs, - chunk_oFFs = PNG_INFO_oFFs, - chunk_tIME = PNG_INFO_tIME, - chunk_pCAL = PNG_INFO_pCAL, - chunk_sRGB = PNG_INFO_sRGB, - chunk_iCCP = PNG_INFO_iCCP, - chunk_sPLT = PNG_INFO_sPLT, - chunk_sCAL = PNG_INFO_sCAL, - chunk_IDAT = PNG_INFO_IDAT - }; - -} // namespace png - -#endif // PNGPP_TYPES_HPP_INCLUDED diff --git a/src/png++-0.2.5/writer.hpp b/src/png++-0.2.5/writer.hpp deleted file mode 100644 index d278ffd..0000000 --- a/src/png++-0.2.5/writer.hpp +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (C) 2007,2008 Alex Shulgin - * - * This file is part of png++ the C++ wrapper for libpng. PNG++ is free - * software; the exact copying conditions are as follows: - * - * 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, - * this list of conditions and the following disclaimer. - * - * 2. 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. - * - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 PNGPP_WRITER_HPP_INCLUDED -#define PNGPP_WRITER_HPP_INCLUDED - -#include -#include "io_base.hpp" - -namespace png -{ - - /** - * \brief PNG writer class template. This is the low-level - * writing interface--use image class or generator class to - * actually write images. - * - * The \c ostream template parameter specifies the type of output - * stream to work with. The \c ostream class should implement the - * minimum of the following interface: - * - * \code - * class my_ostream - * { - * public: - * void write(char const*, size_t); - * void flush(); - * bool good(); - * }; - * \endcode - * - * With the semantics similar to the \c std::ostream. Naturally, - * \c std::ostream fits this requirement and can be used with the - * writer class as is. - * - * \see image, reader, generator, io_base - */ - template< class ostream > - class writer - : public io_base - { - public: - /** - * \brief Constructs a writer prepared to write PNG image into - * a \a stream. - */ - explicit writer(ostream& stream) - : io_base(png_create_write_struct(PNG_LIBPNG_VER_STRING, - static_cast< io_base* >(this), - raise_error, - 0)) - { - png_set_write_fn(m_png, & stream, write_data, flush_data); - } - - ~writer() - { - m_end_info.destroy(); - png_destroy_write_struct(& m_png, m_info.get_png_info_ptr()); - } - - void write_png() const - { - if (setjmp(png_jmpbuf(m_png))) - { - throw error(m_error); - } - png_write_png(m_png, - m_info.get_png_info(), - /* transforms = */ 0, - /* params = */ 0); - } - - /** - * \brief Write info about PNG image. - */ - void write_info() const - { - if (setjmp(png_jmpbuf(m_png))) - { - throw error(m_error); - } - m_info.write(); - } - - /** - * \brief Writes a row of image data at a time. - */ - void write_row(byte* bytes) - { - if (setjmp(png_jmpbuf(m_png))) - { - throw error(m_error); - } - png_write_row(m_png, bytes); - } - - /** - * \brief Reads ending info about PNG image. - */ - void write_end_info() const - { - if (setjmp(png_jmpbuf(m_png))) - { - throw error(m_error); - } - m_end_info.write(); - } - - private: - static void write_data(png_struct* png, byte* data, size_t length) - { - io_base* io = static_cast< io_base* >(png_get_error_ptr(png)); - writer* wr = static_cast< writer* >(io); - wr->reset_error(); - ostream* stream = reinterpret_cast< ostream* >(png_get_io_ptr(png)); - try - { - stream->write(reinterpret_cast< char* >(data), length); - if (!stream->good()) - { - wr->set_error("ostream::write() failed"); - } - } - catch (std::exception const& error) - { - wr->set_error(error.what()); - } - catch (...) - { - assert(!"caught something wrong"); - wr->set_error("write_data: caught something wrong"); - } - if (wr->is_error()) - { - wr->raise_error(); - } - } - - static void flush_data(png_struct* png) - { - io_base* io = static_cast< io_base* >(png_get_error_ptr(png)); - writer* wr = static_cast< writer* >(io); - wr->reset_error(); - ostream* stream = reinterpret_cast< ostream* >(png_get_io_ptr(png)); - try - { - stream->flush(); - if (!stream->good()) - { - wr->set_error("ostream::flush() failed"); - } - } - catch (std::exception const& error) - { - wr->set_error(error.what()); - } - catch (...) - { - assert(!"caught something wrong"); - wr->set_error("flush_data: caught something wrong"); - } - if (wr->is_error()) - { - wr->raise_error(); - } - } - }; - -} // namespace png - -#endif // PNGPP_WRITER_HPP_INCLUDED