clean up trailing whitespace/newlines

This is preparation for adding some linting checks for new commits from
people.  Shouldn't be any functional changes here (tests still pass!).
master
Mike Frysinger 2018-06-21 22:47:42 -04:00
parent aac77143dd
commit fd06f7f83c
102 changed files with 356 additions and 423 deletions

View File

@ -32,24 +32,24 @@ endif(BUILD_TEST)
IF(CMAKE_COMPILER_IS_GNUCC) IF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_C_FLAGS_DEBUG "-g -Wall -Wextra -O0") # will be added to CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" SET(CMAKE_C_FLAGS_DEBUG "-g -Wall -Wextra -O0") # will be added to CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug"
ENDIF(CMAKE_COMPILER_IS_GNUCC) ENDIF(CMAKE_COMPILER_IS_GNUCC)
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY
${PROJECT_BINARY_DIR}/Bin ${PROJECT_BINARY_DIR}/Bin
CACHE PATH CACHE PATH
"Single Directory for all Libraries" "Single Directory for all Libraries"
) )
# --------- Setup the Executable output Directory ------------- # --------- Setup the Executable output Directory -------------
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY
${PROJECT_BINARY_DIR}/Bin ${PROJECT_BINARY_DIR}/Bin
CACHE PATH CACHE PATH
"Single Directory for all Executables." "Single Directory for all Executables."
) )
# --------- Setup the Executable output Directory ------------- # --------- Setup the Executable output Directory -------------
SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY
${PROJECT_BINARY_DIR}/Bin ${PROJECT_BINARY_DIR}/Bin
CACHE PATH CACHE PATH
"Single Directory for all static libraries." "Single Directory for all static libraries."
) )
if (USE_EXT_GD) if (USE_EXT_GD)
@ -106,7 +106,7 @@ else (USE_EXT_GD)
if (ENABLE_PNG) if (ENABLE_PNG)
FIND_PACKAGE(PNG REQUIRED) FIND_PACKAGE(PNG REQUIRED)
endif (ENABLE_PNG) endif (ENABLE_PNG)
if (ENABLE_ICONV) if (ENABLE_ICONV)
FIND_PACKAGE(ICONV REQUIRED) FIND_PACKAGE(ICONV REQUIRED)
endif (ENABLE_ICONV) endif (ENABLE_ICONV)
@ -167,7 +167,7 @@ else (USE_EXT_GD)
INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
SET(HAVE_LIBPNG 1) SET(HAVE_LIBPNG 1)
ENDIF(PNG_FOUND) ENDIF(PNG_FOUND)
IF(ICONV_FOUND) IF(ICONV_FOUND)
INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR})
SET(HAVE_ICONV 1) SET(HAVE_ICONV 1)
@ -302,4 +302,3 @@ set(CPACK_SOURCE_IGNORE_FILES
) )
install(FILES ${top_level_DOCFILES} DESTINATION ${DOC_DIR}) install(FILES ${top_level_DOCFILES} DESTINATION ${DOC_DIR})
INCLUDE(CPack) INCLUDE(CPack)

View File

@ -18,7 +18,7 @@
* [Git Commit Messages](#git-commit-messages) * [Git Commit Messages](#git-commit-messages)
* [Coding standard](#coding-standard) * [Coding standard](#coding-standard)
* [Documentation Styleguide](#documentation-styleguide) * [Documentation Styleguide](#documentation-styleguide)
## What should I know before I get started? ## What should I know before I get started?
### Code of Conduct ### Code of Conduct
@ -49,7 +49,7 @@ Before creating bug reports, please check [this list](#before-submitting-a-bug-r
#### How Do I Submit A (Good) Bug Report? #### How Do I Submit A (Good) Bug Report?
For security related bugs, github does not support private issues, that's why we have to handle security issues outside the issues tracker for now. Please drop a mail to [security@libg.org](mailto:security@libgd.org). For security related bugs, github does not support private issues, that's why we have to handle security issues outside the issues tracker for now. Please drop a mail to [security@libg.org](mailto:security@libgd.org).
Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined [which repository](#repositories) your bug is related to, create an issue on that repository and provide the following information. Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined [which repository](#repositories) your bug is related to, create an issue on that repository and provide the following information.

View File

@ -70,4 +70,3 @@ documentation.
Although their code does not appear in the current release, the Although their code does not appear in the current release, the
authors wish to thank David Koblas, David Rowley, and Hutchison authors wish to thank David Koblas, David Rowley, and Hutchison
Avenue Software Corporation for their prior contributions. Avenue Software Corporation for their prior contributions.

12
NEWS
View File

@ -12,7 +12,7 @@ GD 2.0.36 (2007-11-xx)
(Pierre, Mark Fisher) (Pierre, Mark Fisher)
88, Fixed support of PNG grayscale image with alpha channel (Pierre) 88, Fixed support of PNG grayscale image with alpha channel (Pierre)
95, Added Netware builds script (Guenter) 95, Added Netware builds script (Guenter)
97, ease the creation of regexp to match symbols/functions in the sources 97, ease the creation of regexp to match symbols/functions in the sources
(Guenter) (Guenter)
100, spurious horizontal line drawn by gdImageFilledPolygon (Takeshi Abe) 100, spurious horizontal line drawn by gdImageFilledPolygon (Takeshi Abe)
101, _gdCreateFromFile() can crash if gdImageCreate fails (Mattias Bengtsson) 101, _gdCreateFromFile() can crash if gdImageCreate fails (Mattias Bengtsson)
@ -37,17 +37,17 @@ GD 2.0.36 (2007-11-xx)
198, Fixed useFontConfig() to work as documented (Mojca Miklavec, Ethan Merritt) 198, Fixed useFontConfig() to work as documented (Mojca Miklavec, Ethan Merritt)
GD 2.0.35 (2007-06-21) GD 2.0.35 (2007-06-21)
41, Fix valgrind error in gdImageFillTiled (Nuno Lopes) 41, Fix valgrind error in gdImageFillTiled (Nuno Lopes)
45, Add missing custom cmake macros (required for the tests suite) 45, Add missing custom cmake macros (required for the tests suite)
51, Avoid signature buffer copy in gd_gif_c (Nuno Lopes) 51, Avoid signature buffer copy in gd_gif_c (Nuno Lopes)
48, Race condition in gdImageStringFTEx (Antony Dogval, Pierre 48, Race condition in gdImageStringFTEx (Antony Dogval, Pierre
Scott MacVicar) Scott MacVicar)
52, Reading GIF images is not thread safe (static usage in private 52, Reading GIF images is not thread safe (static usage in private
functions) (Roman Nemecek, Nuno Lopes, Pierre) functions) (Roman Nemecek, Nuno Lopes, Pierre)
60, GIF Local palette is read twice 60, GIF Local palette is read twice
66, GIF, Use local frame dimension when possible instead of the 66, GIF, Use local frame dimension when possible instead of the
logical screen size (Pierre) logical screen size (Pierre)
68, OpenVMS build support, see VMS/README.VMS for the details 68, OpenVMS build support, see VMS/README.VMS for the details
(Alexey Chupahin) (Alexey Chupahin)
70, GIF, do not try to use the global colmap if it does not exist 70, GIF, do not try to use the global colmap if it does not exist
(Nuno Lopes, Pierre) (Nuno Lopes, Pierre)
@ -58,7 +58,7 @@ GD 2.0.35 (2007-06-21)
(Pierre) (Pierre)
86, Possible infinite loop in libgd/gd_png.c, flaw found by Xavier Roche 86, Possible infinite loop in libgd/gd_png.c, flaw found by Xavier Roche
(Pierre) (Pierre)
87, Fixed segfault when an invalid color index is present in a GIF 87, Fixed segfault when an invalid color index is present in a GIF
image data, reported by Elliot <wccode at gmail dot com> (Pierre) image data, reported by Elliot <wccode at gmail dot com> (Pierre)
89, Possible integer overflow in gdImageCreateTrueColor (Pierre) 89, Possible integer overflow in gdImageCreateTrueColor (Pierre)
94, gdImageCreateXbm can crash if gdImageCreate fails (Pierre) 94, gdImageCreateXbm can crash if gdImageCreate fails (Pierre)

View File

@ -1,6 +1,6 @@
$! (c) Alexey Chupahin 18-APR-2006, 15-DEC-2007 $! (c) Alexey Chupahin 18-APR-2006, 15-DEC-2007
$! OpenVMS 8.2 Alpha DEC 2000 model 300 $! OpenVMS 8.2 Alpha DEC 2000 model 300
$! OpenVMS 8.3 Itanium rx1620 $! OpenVMS 8.3 Itanium rx1620
$! GNU $! GNU
$! $!
$! $!
@ -26,9 +26,9 @@ $ SHARED=32
$ENDIF $ENDIF
$DECC = F$SEARCH("SYS$SYSTEM:DECC$COMPILER.EXE") .NES. "" $DECC = F$SEARCH("SYS$SYSTEM:DECC$COMPILER.EXE") .NES. ""
$IF (DECC) THEN $WRITE SYS$OUTPUT "Compiler ... DEC C" $IF (DECC) THEN $WRITE SYS$OUTPUT "Compiler ... DEC C"
$IF (.NOT. DECC) THEN $WRITE SYS$OUTPUT "BAD compiler" GOTO EXIT $IF (.NOT. DECC) THEN $WRITE SYS$OUTPUT "BAD compiler" GOTO EXIT
$MMS = F$SEARCH("SYS$SYSTEM:MMS.EXE") .NES. "" $MMS = F$SEARCH("SYS$SYSTEM:MMS.EXE") .NES. ""
$MMK = F$TYPE(MMK) $MMK = F$TYPE(MMK)
$IF (MMS .OR. MMK.NES."") THEN GOTO TEST_LIBRARIES $IF (MMS .OR. MMK.NES."") THEN GOTO TEST_LIBRARIES
$WRITE SYS$OUTPUT "Please install MMS from DECSET or MMK" $WRITE SYS$OUTPUT "Please install MMS from DECSET or MMK"
$! I cant find any make tool $! I cant find any make tool
@ -150,7 +150,7 @@ $ CC/OBJECT=TEST.OBJ/INCLUDE=(FREETYPE2) SYS$INPUT
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR <= 1 #if FREETYPE_MAJOR == 2 && FREETYPE_MINOR <= 1
printf("This version is too old. Please get newest\n"); printf("This version is too old. Please get newest\n");
printf("From fafner.dyndns.org/~alexey/libsdl/required.html\n"); printf("From fafner.dyndns.org/~alexey/libsdl/required.html\n");
exit(2); exit(2);
@ -220,8 +220,8 @@ $ CC/OBJECT=TEST.OBJ/INCLUDE=(PNG,ZLIB) SYS$INPUT
n=png_access_version_number(); n=png_access_version_number();
n3=n%100; n=n/100; n3=n%100; n=n/100;
n2=n%100; n=n/100; n2=n%100; n=n/100;
n1=n%100; n1=n%100;
if ( (n1<=1)&&(n2<2) ) if ( (n1<=1)&&(n2<2) )
{ printf("checking version libPNG: %d.%d.%d\n",n1,n2,n3); { printf("checking version libPNG: %d.%d.%d\n",n1,n2,n3);
printf("This version is too old. Please get newest\n"); printf("This version is too old. Please get newest\n");
printf("From fafner.dyndns.org/~alexey/libsdl/public.html\n"); printf("From fafner.dyndns.org/~alexey/libsdl/public.html\n");
@ -252,7 +252,7 @@ $ LIBPNG_STATIC=0
$ HAVE_LIBPNG=0 $ HAVE_LIBPNG=0
$ GOTO NEXT2 $ GOTO NEXT2
$ ELSE $ ELSE
$ HAVE_LIBPNG=1 $ HAVE_LIBPNG=1
$ LIBPNG_STATIC=1 $ LIBPNG_STATIC=1
$ ENDIF $ ENDIF
$ ELSE $ ELSE
@ -287,7 +287,7 @@ $ CC/OBJECT=TEST.OBJ/INCLUDE=(JPEG) SYS$INPUT
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <jpeglib.h> #include <jpeglib.h>
#include <jversion.h> #include <jversion.h>
int main() int main()
{ {
printf("checking version jpeg: %s\n",JVERSION); printf("checking version jpeg: %s\n",JVERSION);
@ -805,7 +805,7 @@ $ THEN
$ IF (ZLIB_STATIC.EQ.0) $ IF (ZLIB_STATIC.EQ.0)
$ THEN $ THEN
$ APP SYS$INPUT [.SRC]LIBGD.OPT $ APP SYS$INPUT [.SRC]LIBGD.OPT
SYS$SHARE:LIBZSHR/SHARE SYS$SHARE:LIBZSHR/SHARE
$ ELSE $ ELSE
$ APP SYS$INPUT [.SRC]LIBGD.OPT $ APP SYS$INPUT [.SRC]LIBGD.OPT
ZLIB:LIBZ/LIB ZLIB:LIBZ/LIB
@ -954,29 +954,29 @@ $ APP SYS$INPUT [.SRC]CONFIG.H
/* Define if <iconv.h> defines iconv_t. */ /* Define if <iconv.h> defines iconv_t. */
#define HAVE_ICONV_T_DEF 1 #define HAVE_ICONV_T_DEF 1
$ENDIF $ENDIF
$IF HAVE_TIFF.EQ.1 $IF HAVE_TIFF.EQ.1
$ THEN $ THEN
$ APP SYS$INPUT [.SRC]CONFIG.H $ APP SYS$INPUT [.SRC]CONFIG.H
#define HAVE_LIBTIFF 1 #define HAVE_LIBTIFF 1
$ENDIF $ENDIF
$IF HAVE_LIBPNG.EQ.1 $IF HAVE_LIBPNG.EQ.1
$ THEN $ THEN
$ APP SYS$INPUT [.SRC]CONFIG.H $ APP SYS$INPUT [.SRC]CONFIG.H
#define HAVE_LIBPNG 1 #define HAVE_LIBPNG 1
$ENDIF $ENDIF
$IF HAVE_FREETYPE.EQ.1 $IF HAVE_FREETYPE.EQ.1
$ THEN $ THEN
$ APP SYS$INPUT [.SRC]CONFIG.H $ APP SYS$INPUT [.SRC]CONFIG.H
#define HAVE_LIBFREETYPE 1 #define HAVE_LIBFREETYPE 1
#define HAVE_FT2BUILD_H 1 #define HAVE_FT2BUILD_H 1
$ENDIF $ENDIF
$IF HAVE_JPEG.EQ.1 $IF HAVE_JPEG.EQ.1
$ THEN $ THEN
$ APP SYS$INPUT [.SRC]CONFIG.H $ APP SYS$INPUT [.SRC]CONFIG.H
#define HAVE_LIBJPEG 1 #define HAVE_LIBJPEG 1
$ENDIF $ENDIF
$IF HAVE_ZLIB.EQ.1 $IF HAVE_ZLIB.EQ.1
$ THEN $ THEN
$ APP SYS$INPUT [.SRC]CONFIG.H $ APP SYS$INPUT [.SRC]CONFIG.H
#define HAVE_LIBZ 1 #define HAVE_LIBZ 1
$ENDIF $ENDIF
@ -994,7 +994,7 @@ $COP SYS$INPUT [.SRC]DESCRIP.MMS
# Alexey Chupahin elvis_75@mail.ru # Alexey Chupahin elvis_75@mail.ru
# OpenVMS 7.3-1,8.2 DEC 2000 mod.300 # OpenVMS 7.3-1,8.2 DEC 2000 mod.300
# OpenVMS 8.3 HP rx1620 # OpenVMS 8.3 HP rx1620
.FIRST .FIRST
DEF LIBGD [] DEF LIBGD []

View File

@ -1,6 +1,6 @@
Dear OpenVMS user, Dear OpenVMS user,
Installation process is identical to one in *nix* world and consist to Installation process is identical to one in *nix* world and consist to
four simple steps: four simple steps:
1. Installing required libraries 1. Installing required libraries
2. Configuration 2. Configuration
@ -18,7 +18,7 @@ four simple steps:
All may be found at OpenVMS libSDL porting project site All may be found at OpenVMS libSDL porting project site
http://fafner.dyndns.org/~alexey/libsdl/required.html http://fafner.dyndns.org/~alexey/libsdl/required.html
Also, system should have MMS make utility from DEC or Also, system should have MMS make utility from DEC or
free analogue MMK. And C compiler with runtime, of course. ;) free analogue MMK. And C compiler with runtime, of course. ;)
@ -27,14 +27,14 @@ free analogue MMK. And C compiler with runtime, of course. ;)
$@[.VMS]CONFIGURE $@[.VMS]CONFIGURE
The script detects hardware,system and required libraries have been installed. The script detects hardware,system and required libraries have been installed.
Compilation stage will be prepeared to create shared and static libraries. Compilation stage will be prepeared to create shared and static libraries.
Alpha,IA64 or VAX platform are supported. Optional argument "static" Alpha,IA64 or VAX platform are supported. Optional argument "static"
tells to configurator to make static libraries only: tells to configurator to make static libraries only:
$@[.VMS]CONFIGURE STATIC $@[.VMS]CONFIGURE STATIC
CONFIGURE script checks your ZLIB, FREETYPE, JPEG, PNG libraries. CONFIGURE script checks your ZLIB, FREETYPE, JPEG, PNG libraries.
If it detects any troubles, you may get and install good and tested ones If it detects any troubles, you may get and install good and tested ones
from OpenVMS libSDL porting project site: from OpenVMS libSDL porting project site:
http://fafner.dyndns.org/~alexey/libsdl/required.html http://fafner.dyndns.org/~alexey/libsdl/required.html
@ -54,7 +54,7 @@ $@LIBGD$STARTUP
LIBGD and its utilites are ready to using. LIBGD and its utilites are ready to using.
Optionally you may insert this startup file into your LOGIN.COM Optionally you may insert this startup file into your LOGIN.COM
to set libGD environment every time you login automatically. to set libGD environment every time you login automatically.
To learn libGD please refer libGD official documentation. To learn libGD please refer libGD official documentation.

View File

@ -69,16 +69,16 @@
# #
# * Redistributions of source code must retain the above copyright notice, # * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer. # this list of conditions and the following disclaimer.
# #
# * Redistributions in binary form must reproduce the above copyright notice, # * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation # this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution. # and/or other materials provided with the distribution.
# #
# * The names of Kitware, Inc., the Insight Consortium, or the names of # * The names of Kitware, Inc., the Insight Consortium, or the names of
# any consortium members, or of any contributors, may not be used to # any consortium members, or of any contributors, may not be used to
# endorse or promote products derived from this software without # endorse or promote products derived from this software without
# specific prior written permission. # specific prior written permission.
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE

View File

@ -7,16 +7,16 @@
# #
# * Redistributions of source code must retain the above copyright notice, # * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer. # this list of conditions and the following disclaimer.
# #
# * Redistributions in binary form must reproduce the above copyright notice, # * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation # this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution. # and/or other materials provided with the distribution.
# #
# * The names of Kitware, Inc., the Insight Consortium, or the names of # * The names of Kitware, Inc., the Insight Consortium, or the names of
# any consortium members, or of any contributors, may not be used to # any consortium members, or of any contributors, may not be used to
# endorse or promote products derived from this software without # endorse or promote products derived from this software without
# specific prior written permission. # specific prior written permission.
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@ -39,7 +39,7 @@
# the AC_HEADER_DIRENT test programme rather than the CheckSymbolExists.cmake # the AC_HEADER_DIRENT test programme rather than the CheckSymbolExists.cmake
# test programme which always fails since DIR tends to be typedef'd # test programme which always fails since DIR tends to be typedef'd
# rather than #define'd. # rather than #define'd.
# #
# The following variables may be set before calling this macro to # The following variables may be set before calling this macro to
# modify the way the check is run: # modify the way the check is run:
# #
@ -53,7 +53,7 @@ MACRO(CHECK_DIRSYMBOL_EXISTS FILES VARIABLE)
SET(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n") SET(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
SET(MACRO_CHECK_DIRSYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS}) SET(MACRO_CHECK_DIRSYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS})
IF(CMAKE_REQUIRED_LIBRARIES) IF(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_DIRSYMBOL_EXISTS_LIBS SET(CHECK_DIRSYMBOL_EXISTS_LIBS
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES) ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_DIRSYMBOL_EXISTS_LIBS) SET(CHECK_DIRSYMBOL_EXISTS_LIBS)
@ -79,7 +79,7 @@ MACRO(CHECK_DIRSYMBOL_EXISTS FILES VARIABLE)
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckDIRSymbolExists.c ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckDIRSymbolExists.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
CMAKE_FLAGS CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_DIRSYMBOL_EXISTS_FLAGS} -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_DIRSYMBOL_EXISTS_FLAGS}
"${CHECK_DIRSYMBOL_EXISTS_LIBS}" "${CHECK_DIRSYMBOL_EXISTS_LIBS}"
"${CMAKE_DIRSYMBOL_EXISTS_INCLUDES}" "${CMAKE_DIRSYMBOL_EXISTS_INCLUDES}"
@ -87,7 +87,7 @@ MACRO(CHECK_DIRSYMBOL_EXISTS FILES VARIABLE)
IF(${VARIABLE}) IF(${VARIABLE})
MESSAGE(STATUS "Looking for DIR in ${FILES} - found") MESSAGE(STATUS "Looking for DIR in ${FILES} - found")
SET(${VARIABLE} 1 CACHE INTERNAL "Have symbol DIR") SET(${VARIABLE} 1 CACHE INTERNAL "Have symbol DIR")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
"Determining if the DIR symbol is defined as in AC_HEADER_DIRENT " "Determining if the DIR symbol is defined as in AC_HEADER_DIRENT "
"passed with the following output:\n" "passed with the following output:\n"
"${OUTPUT}\nFile ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckDIRSymbolExists.c:\n" "${OUTPUT}\nFile ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckDIRSymbolExists.c:\n"
@ -95,7 +95,7 @@ MACRO(CHECK_DIRSYMBOL_EXISTS FILES VARIABLE)
ELSE(${VARIABLE}) ELSE(${VARIABLE})
MESSAGE(STATUS "Looking for DIR in ${FILES} - not found.") MESSAGE(STATUS "Looking for DIR in ${FILES} - not found.")
SET(${VARIABLE} "" CACHE INTERNAL "Have symbol DIR") SET(${VARIABLE} "" CACHE INTERNAL "Have symbol DIR")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
"Determining if the DIR symbol is defined as in AC_HEADER_DIRENT " "Determining if the DIR symbol is defined as in AC_HEADER_DIRENT "
"failed with the following output:\n" "failed with the following output:\n"
"${OUTPUT}\nFile ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckDIRSymbolExists.c:\n" "${OUTPUT}\nFile ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckDIRSymbolExists.c:\n"

View File

@ -7,16 +7,16 @@
# #
# * Redistributions of source code must retain the above copyright notice, # * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer. # this list of conditions and the following disclaimer.
# #
# * Redistributions in binary form must reproduce the above copyright notice, # * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation # this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution. # and/or other materials provided with the distribution.
# #
# * The names of Kitware, Inc., the Insight Consortium, or the names of # * The names of Kitware, Inc., the Insight Consortium, or the names of
# any consortium members, or of any contributors, may not be used to # any consortium members, or of any contributors, may not be used to
# endorse or promote products derived from this software without # endorse or promote products derived from this software without
# specific prior written permission. # specific prior written permission.
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@ -66,4 +66,3 @@ int main()
") ")
CHECK_CXX_SOURCE_COMPILES("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT}) CHECK_CXX_SOURCE_COMPILES("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
ENDMACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT) ENDMACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)

View File

@ -1,17 +1,17 @@
# Copyright (c) 2006,2007 Laurent Montel, <montel@kde.org> # Copyright (c) 2006,2007 Laurent Montel, <montel@kde.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions # modification, are permitted provided that the following conditions
# are met: # are met:
# #
# 1. Redistributions of source code must retain the copyright # 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer. # notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright # 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the # notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution. # documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products # 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission. # derived from this software without specific prior written permission.
# #
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.

View File

@ -21,16 +21,16 @@
# #
# * Redistributions of source code must retain the above copyright notice, # * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer. # this list of conditions and the following disclaimer.
# #
# * Redistributions in binary form must reproduce the above copyright notice, # * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation # this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution. # and/or other materials provided with the distribution.
# #
# * The names of Kitware, Inc., the Insight Consortium, or the names of # * The names of Kitware, Inc., the Insight Consortium, or the names of
# any consortium members, or of any contributors, may not be used to # any consortium members, or of any contributors, may not be used to
# endorse or promote products derived from this software without # endorse or promote products derived from this software without
# specific prior written permission. # specific prior written permission.
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE

View File

@ -1,11 +1,11 @@
# - Try to find Iconv # - Try to find Iconv
# Once done this will define # Once done this will define
# #
# ICONV_FOUND - system has Iconv # ICONV_FOUND - system has Iconv
# ICONV_INCLUDE_DIR - the Iconv include directory # ICONV_INCLUDE_DIR - the Iconv include directory
# ICONV_LIBRARIES - Link these to use Iconv # ICONV_LIBRARIES - Link these to use Iconv
# ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const # ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const
# #
include(CheckCCompilerFlag) include(CheckCCompilerFlag)
include(CheckCSourceCompiles) include(CheckCSourceCompiles)
@ -14,13 +14,13 @@ IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
SET(ICONV_FIND_QUIETLY TRUE) SET(ICONV_FIND_QUIETLY TRUE)
ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
FIND_PATH(ICONV_INCLUDE_DIR iconv.h HINTS /sw/include/ PATHS /opt/local) FIND_PATH(ICONV_INCLUDE_DIR iconv.h HINTS /sw/include/ PATHS /opt/local)
FIND_LIBRARY(ICONV_LIBRARIES NAMES libiconv_a iconv libiconv c PATHS /opt/local) FIND_LIBRARY(ICONV_LIBRARIES NAMES libiconv_a iconv libiconv c PATHS /opt/local)
IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
SET(ICONV_FOUND TRUE) SET(ICONV_FOUND TRUE)
ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES}) set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
@ -47,18 +47,18 @@ ENDIF(ICONV_FOUND)
set(CMAKE_REQUIRED_INCLUDES) set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_LIBRARIES) set(CMAKE_REQUIRED_LIBRARIES)
IF(ICONV_FOUND) IF(ICONV_FOUND)
IF(NOT ICONV_FIND_QUIETLY) IF(NOT ICONV_FIND_QUIETLY)
MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}") MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}")
ENDIF(NOT ICONV_FIND_QUIETLY) ENDIF(NOT ICONV_FIND_QUIETLY)
ELSE(ICONV_FOUND) ELSE(ICONV_FOUND)
IF(Iconv_FIND_REQUIRED) IF(Iconv_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Iconv") MESSAGE(FATAL_ERROR "Could not find Iconv")
ENDIF(Iconv_FIND_REQUIRED) ENDIF(Iconv_FIND_REQUIRED)
ENDIF(ICONV_FOUND) ENDIF(ICONV_FOUND)
MARK_AS_ADVANCED( MARK_AS_ADVANCED(
ICONV_INCLUDE_DIR ICONV_INCLUDE_DIR
ICONV_LIBRARIES ICONV_LIBRARIES
ICONV_SECOND_ARGUMENT_IS_CONST ICONV_SECOND_ARGUMENT_IS_CONST
) )

View File

@ -16,16 +16,16 @@
# #
# * Redistributions of source code must retain the above copyright notice, # * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer. # this list of conditions and the following disclaimer.
# #
# * Redistributions in binary form must reproduce the above copyright notice, # * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation # this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution. # and/or other materials provided with the distribution.
# #
# * The names of Kitware, Inc., the Insight Consortium, or the names of # * The names of Kitware, Inc., the Insight Consortium, or the names of
# any consortium members, or of any contributors, may not be used to # any consortium members, or of any contributors, may not be used to
# endorse or promote products derived from this software without # endorse or promote products derived from this software without
# specific prior written permission. # specific prior written permission.
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE

View File

@ -25,16 +25,16 @@
# #
# * Redistributions of source code must retain the above copyright notice, # * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer. # this list of conditions and the following disclaimer.
# #
# * Redistributions in binary form must reproduce the above copyright notice, # * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation # this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution. # and/or other materials provided with the distribution.
# #
# * The names of Kitware, Inc., the Insight Consortium, or the names of # * The names of Kitware, Inc., the Insight Consortium, or the names of
# any consortium members, or of any contributors, may not be used to # any consortium members, or of any contributors, may not be used to
# endorse or promote products derived from this software without # endorse or promote products derived from this software without
# specific prior written permission. # specific prior written permission.
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE

View File

@ -85,16 +85,16 @@
# #
# * Redistributions of source code must retain the above copyright notice, # * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer. # this list of conditions and the following disclaimer.
# #
# * Redistributions in binary form must reproduce the above copyright notice, # * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation # this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution. # and/or other materials provided with the distribution.
# #
# * The names of Kitware, Inc., the Insight Consortium, or the names of # * The names of Kitware, Inc., the Insight Consortium, or the names of
# any consortium members, or of any contributors, may not be used to # any consortium members, or of any contributors, may not be used to
# endorse or promote products derived from this software without # endorse or promote products derived from this software without
# specific prior written permission. # specific prior written permission.
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE

View File

@ -17,16 +17,16 @@
# #
# * Redistributions of source code must retain the above copyright notice, # * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer. # this list of conditions and the following disclaimer.
# #
# * Redistributions in binary form must reproduce the above copyright notice, # * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation # this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution. # and/or other materials provided with the distribution.
# #
# * The names of Kitware, Inc., the Insight Consortium, or the names of # * The names of Kitware, Inc., the Insight Consortium, or the names of
# any consortium members, or of any contributors, may not be used to # any consortium members, or of any contributors, may not be used to
# endorse or promote products derived from this software without # endorse or promote products derived from this software without
# specific prior written permission. # specific prior written permission.
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE

View File

@ -17,16 +17,16 @@
# #
# * Redistributions of source code must retain the above copyright notice, # * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer. # this list of conditions and the following disclaimer.
# #
# * Redistributions in binary form must reproduce the above copyright notice, # * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation # this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution. # and/or other materials provided with the distribution.
# #
# * The names of Kitware, Inc., the Insight Consortium, or the names of # * The names of Kitware, Inc., the Insight Consortium, or the names of
# any consortium members, or of any contributors, may not be used to # any consortium members, or of any contributors, may not be used to
# endorse or promote products derived from this software without # endorse or promote products derived from this software without
# specific prior written permission. # specific prior written permission.
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE

View File

@ -1,4 +1,4 @@
/* /*
* Copyright (C) 2006 Alan W. Irwin * Copyright (C) 2006 Alan W. Irwin
* *
* This file is part of PLplot. * This file is part of PLplot.

View File

@ -19,11 +19,11 @@
# Check if ctype.h macros work on characters with the high bit set. # Check if ctype.h macros work on characters with the high bit set.
if(NOT DEFINED CMAKE_HIGH_BIT_CHARACTERS) if(NOT DEFINED CMAKE_HIGH_BIT_CHARACTERS)
message(STATUS message(STATUS
"Check for whether ctype.h macros work on characters with the\n" "Check for whether ctype.h macros work on characters with the\n"
" high bit set." " high bit set."
) )
try_compile(CMAKE_HIGH_BIT_CHARACTERS try_compile(CMAKE_HIGH_BIT_CHARACTERS
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/CMakeModules/TestForHighBitCharacters.c ${CMAKE_SOURCE_DIR}/CMakeModules/TestForHighBitCharacters.c
OUTPUT_VARIABLE OUTPUT) OUTPUT_VARIABLE OUTPUT)

View File

@ -367,4 +367,3 @@ operates.
`configure' also accepts some other, not widely useful, options. Run `configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details. `configure --help' for more details.

View File

@ -25,7 +25,7 @@ export CMAKE_LIBRARY_PATH=/path/to/the/gd/lib
then call cmake using: then call cmake using:
$ cmake -DUSE_EXT_GD=1 -DBUILD_TEST=1 $ cmake -DUSE_EXT_GD=1 -DBUILD_TEST=1
$ make $ make
and finally: and finally:
@ -33,10 +33,10 @@ $ ctest .
I will certainly add a nice CMake option to give prefix later. I will certainly add a nice CMake option to give prefix later.
What to do if tests fail on your platform and you use the last GD release? What to do if tests fail on your platform and you use the last GD release?
either from your favorite distributions or from http://www.libgd.org or git? either from your favorite distributions or from http://www.libgd.org or git?
If you use a packaged version of the GD Library (installed from RPM, deb or If you use a packaged version of the GD Library (installed from RPM, deb or
ports, gentoo packages or any other packages format or distribution), please try ports, gentoo packages or any other packages format or distribution), please try
to run the tests using the source releases available at: to run the tests using the source releases available at:

View File

@ -55,7 +55,7 @@ you can use the following command line options:
--with-xpm=DIR --with-xpm=DIR
Dto. for xpm library. Dto. for xpm library.
--with-tiff=DIR --with-tiff=DIR
Dto. for TIFF library. Dto. for TIFF library.

View File

@ -55,4 +55,3 @@ sub unslurp {
or die "Error writing file '$filename'\n"; or die "Error writing file '$filename'\n";
close ($fh); close ($fh);
} }

View File

@ -62,14 +62,14 @@ program; it demonstrates additional features!)
> /* Allocate the color black (red, green and blue all minimum). > /* Allocate the color black (red, green and blue all minimum).
> Since this is the first color in a new image, it will > Since this is the first color in a new image, it will
> be the background color. */ > be the background color. */
> black = gdImageColorAllocate(im, 0, 0, 0); > black = gdImageColorAllocate(im, 0, 0, 0);
> >
> /* Allocate the color white (red, green and blue all maximum). */ > /* Allocate the color white (red, green and blue all maximum). */
> white = gdImageColorAllocate(im, 255, 255, 255); > white = gdImageColorAllocate(im, 255, 255, 255);
> >
> /* Draw a line from the upper left to the lower right, > /* Draw a line from the upper left to the lower right,
> using white color index. */ > using white color index. */
> gdImageLine(im, 0, 0, 63, 63, white); > gdImageLine(im, 0, 0, 63, 63, white);
> >
> /* Open a file for writing. "wb" means "write binary", important > /* Open a file for writing. "wb" means "write binary", important
> under MSDOS, harmless under Unix. */ > under MSDOS, harmless under Unix. */

View File

@ -27,22 +27,22 @@ Format: 1.52
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# #
# Cut and paste the lines below to change the order in which your files # Cut and paste the lines below to change the order in which your files
# appear on the menu. Don't worry about adding or removing files, Natural # appear on the menu. Don't worry about adding or removing files, Natural
# Docs will take care of that. # Docs will take care of that.
# #
# You can further organize the menu by grouping the entries. Add a # You can further organize the menu by grouping the entries. Add a
# "Group: [name] {" line to start a group, and add a "}" to end it. # "Group: [name] {" line to start a group, and add a "}" to end it.
# #
# You can add text and web links to the menu by adding "Text: [text]" and # You can add text and web links to the menu by adding "Text: [text]" and
# "Link: [name] ([URL])" lines, respectively. # "Link: [name] ([URL])" lines, respectively.
# #
# The formatting and comments are auto-generated, so don't worry about # The formatting and comments are auto-generated, so don't worry about
# neatness when editing the file. Natural Docs will clean it up the next # neatness when editing the file. Natural Docs will clean it up the next
# time it is run. When working with groups, just deal with the braces and # time it is run. When working with groups, just deal with the braces and
# forget about the indentation and comments. # forget about the indentation and comments.
# #
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
@ -106,4 +106,3 @@ Group: Index {
Macro Index: Macros Macro Index: Macros
Type Index: Types Type Index: Types
} # Group: Index } # Group: Index

View File

@ -74,5 +74,3 @@ $(nd) --rebuild --rebuild-output --documented-only \
# And cleanup the temp files. # And cleanup the temp files.
rm -rf Data tmp rm -rf Data tmp

View File

@ -49,4 +49,4 @@ int main(void)
fclose(out); fclose(out);
return 0; return 0;
} }

View File

@ -56,4 +56,4 @@ int main (int argc, char *argv[]) {
gdImageDestroy(out); gdImageDestroy(out);
return 0; return 0;
} }

View File

@ -18,7 +18,7 @@ endif
ifndef LIBBASE ifndef LIBBASE
LIBBASE = ../.. LIBBASE = ../..
endif endif
# All library code is statically linked to avoid problems with other lib NLMs. # All library code is statically linked to avoid problems with other lib NLMs.
# Edit the path below to point to your libpng sources or set environment var. # Edit the path below to point to your libpng sources or set environment var.
ifndef LIBPNG ifndef LIBPNG
@ -135,7 +135,7 @@ NDK_ROOT = $(NDKBASE)/ndk
SDK_CLIB = $(NDK_ROOT)/nwsdk SDK_CLIB = $(NDK_ROOT)/nwsdk
SDK_LIBC = $(NDK_ROOT)/libc SDK_LIBC = $(NDK_ROOT)/libc
INCLUDES = -I. -I$(LIBGD) -I$(LIBPNG) -I$(LIBJPEG) -I$(LIBFT2)/include -I$(ZLIBSDK) INCLUDES = -I. -I$(LIBGD) -I$(LIBPNG) -I$(LIBJPEG) -I$(LIBFT2)/include -I$(ZLIBSDK)
ifeq ($(LIBARCH),LIBC) ifeq ($(LIBARCH),LIBC)
INCLUDES += -I$(SDK_LIBC)/include INCLUDES += -I$(SDK_LIBC)/include
@ -549,5 +549,3 @@ help:
@echo $(DL)$(MAKE) test-cmds$(DL) @echo $(DL)$(MAKE) test-cmds$(DL)
@echo $(DL)$(MAKE) patch$(DL) @echo $(DL)$(MAKE) patch$(DL)
@echo $(DL)===========================================================$(DL) @echo $(DL)===========================================================$(DL)

View File

@ -33,5 +33,3 @@ BEGIN {
print " " $0 ","; print " " $0 ",";
} }
} }

View File

@ -24,5 +24,3 @@ BEGIN {
print "LIBGD_VERSION = " libgd_ver ""; print "LIBGD_VERSION = " libgd_ver "";
print "LIBGD_VERSION_STR = " libgd_ver_str ""; print "LIBGD_VERSION_STR = " libgd_ver_str "";
} }

View File

@ -23,5 +23,3 @@ void _NonAppStop()
printf("<Press any key to close screen> "); printf("<Press any key to close screen> ");
getcharacter(); getcharacter();
} }

View File

@ -286,5 +286,3 @@ void DisposeThreadData
free(data); free(data);
} }
} }

View File

@ -21,7 +21,7 @@ INSTDIR = ../libgd-$(LIBGD_VERSION_STR)-bin-nw
endif endif
# Edit the vars below to change NLM target settings. # Edit the vars below to change NLM target settings.
TARGETS = gddemo.nlm gdtest.nlm gdtestft.nlm gdtopng.nlm gdcmpgif.nlm TARGETS = gddemo.nlm gdtest.nlm gdtestft.nlm gdtopng.nlm gdcmpgif.nlm
TARGETS += gd2time.nlm gd2togif.nlm gd2topng.nlm gd2copypal.nlm TARGETS += gd2time.nlm gd2togif.nlm gd2topng.nlm gd2copypal.nlm
TARGETS += gifanimtest.nlm giftogd2.nlm pngtogd2.nlm pngtogd.nlm webpng.nlm TARGETS += gifanimtest.nlm giftogd2.nlm pngtogd2.nlm pngtogd.nlm webpng.nlm
TARGETS += annotate.nlm circletexttest.nlm fontsizetest.nlm fontwheeltest.nlm TARGETS += annotate.nlm circletexttest.nlm fontsizetest.nlm fontwheeltest.nlm
@ -159,7 +159,7 @@ endif
.PHONY: all prebuild dist install clean .PHONY: all prebuild dist install clean
.PRECIOUS: $(OBJDIR)/%.o $(OBJDIR)/%.def $(OBJDIR)/%.xdc $(LTARGET) $(DTARGET) .PRECIOUS: $(OBJDIR)/%.o $(OBJDIR)/%.def $(OBJDIR)/%.xdc $(LTARGET) $(DTARGET)
all: prebuild $(TARGETS) all: prebuild $(TARGETS)
prebuild: $(OBJDIR) $(OBJDIR)/version.inc prebuild: $(OBJDIR) $(OBJDIR)/version.inc
ifdef LSTATIC ifdef LSTATIC
@ -281,5 +281,3 @@ ifdef LSTATIC
endif endif
@echo $(DL)output $(notdir $(@:.def=.nlm))$(DL) >> $@ @echo $(DL)output $(notdir $(@:.def=.nlm))$(DL) >> $@
endif endif

View File

@ -1,25 +1,25 @@
Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002 by Cold Spring Harbor Laboratory. Funded under Grant 2002 by Cold Spring Harbor Laboratory. Funded under Grant
P41-RR02188 by the National Institutes of Health. P41-RR02188 by the National Institutes of Health.
Portions copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 by Portions copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 by
Boutell.Com, Inc. Boutell.Com, Inc.
Portions relating to GD2 format copyright 1999, 2000, 2001, 2002 Portions relating to GD2 format copyright 1999, 2000, 2001, 2002
Philip Warner. Philip Warner.
Portions relating to PNG copyright 1999, 2000, 2001, 2002 Greg
Roelofs.
Portions relating to gdttf.c copyright 1999, 2000, 2001, 2002 John Portions relating to PNG copyright 1999, 2000, 2001, 2002 Greg
Roelofs.
Portions relating to gdttf.c copyright 1999, 2000, 2001, 2002 John
Ellson (ellson@lucent.com). Ellson (ellson@lucent.com).
Portions relating to gdft.c copyright 2001, 2002 John Ellson Portions relating to gdft.c copyright 2001, 2002 John Ellson
(ellson@lucent.com). (ellson@lucent.com).
Portions copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Portions copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
2008 Pierre-Alain Joye (pierre@libgd.org). 2008 Pierre-Alain Joye (pierre@libgd.org).
Portions relating to JPEG and to color quantization copyright 2000, Portions relating to JPEG and to color quantization copyright 2000,
2001, 2002, Doug Becker and copyright (C) 1994, 1995, 1996, 1997, 2001, 2002, Doug Becker and copyright (C) 1994, 1995, 1996, 1997,
@ -35,19 +35,18 @@
provided that this notice is present in user-accessible supporting provided that this notice is present in user-accessible supporting
documentation. documentation.
This does not affect your ownership of the derived work itself, and This does not affect your ownership of the derived work itself, and
the intent is to assure proper credit for the authors of gd, not to the intent is to assure proper credit for the authors of gd, not to
interfere with your productive use of gd. If you have questions, interfere with your productive use of gd. If you have questions,
ask. "Derived works" includes all programs that utilize the ask. "Derived works" includes all programs that utilize the
library. Credit must be given in user-accessible documentation. library. Credit must be given in user-accessible documentation.
This software is provided "AS IS." The copyright holders disclaim This software is provided "AS IS." The copyright holders disclaim
all warranties, either express or implied, including but not all warranties, either express or implied, including but not
limited to implied warranties of merchantability and fitness for a limited to implied warranties of merchantability and fitness for a
particular purpose, with respect to this code and accompanying particular purpose, with respect to this code and accompanying
documentation. documentation.
Although their code does not appear in gd, the authors wish to thank Although their code does not appear in gd, the authors wish to thank
David Koblas, David Rowley, and Hutchison Avenue Software Corporation David Koblas, David Rowley, and Hutchison Avenue Software Corporation
for their prior contributions. for their prior contributions.

View File

@ -126,4 +126,3 @@ libgd_la_LDFLAGS = -version-info $(GDLIB_LT_CURRENT):$(GDLIB_LT_REVISION):$(GDLI
libgd_la_LIBADD = $(LTLIBICONV) libgd_la_LIBADD = $(LTLIBICONV)
LDADD = libgd.la $(LIBICONV) LDADD = libgd.la $(LIBICONV)

View File

@ -46,18 +46,18 @@ while (<>)
my ($tag, $value) = split / /, $_, 2; my ($tag, $value) = split / /, $_, 2;
die "Font is not fixed width\n" die "Font is not fixed width\n"
if $tag eq 'SPACING' and not $value =~ /[CM]/i; if $tag eq 'SPACING' and not $value =~ /[CM]/i;
$currentchar = $value if $tag eq 'ENCODING'; $currentchar = $value if $tag eq 'ENCODING';
$minchar = $currentchar if not defined $minchar $minchar = $currentchar if not defined $minchar
or $currentchar < $minchar; or $currentchar < $minchar;
$maxchar = $currentchar if not defined $maxchar $maxchar = $currentchar if not defined $maxchar
or $currentchar > $maxchar; or $currentchar > $maxchar;
if ($tag eq 'ENDCHAR') if ($tag eq 'ENDCHAR')
{ {
$gobitmap = 0; $gobitmap = 0;
my $bottom = $globaltop - $bottom[$currentchar]; my $bottom = $globaltop - $bottom[$currentchar];
if ($bottom > 0) if ($bottom > 0)
{ $data[$currentchar] = substr $data[$currentchar], 0, length($data[$currentchar]) - $bottom * $width; } { $data[$currentchar] = substr $data[$currentchar], 0, length($data[$currentchar]) - $bottom * $width; }
@ -80,7 +80,7 @@ while (<>)
{ $fontdef = $value; } { $fontdef = $value; }
if ($tag eq 'COPYRIGHT' and not defined $copyright) if ($tag eq 'COPYRIGHT' and not defined $copyright)
{ $copyright = $value; } { $copyright = $value; }
if ($tag eq 'BBX') if ($tag eq 'BBX')
{ {
my ($tag, $wid, $hei, $left, $bottom) = split / /; my ($tag, $wid, $hei, $left, $bottom) = split / /;
@ -100,7 +100,7 @@ while (<>)
$bits = substr $bits, 0, $width; $bits = substr $bits, 0, $width;
$data[$currentchar] .= $bits; $data[$currentchar] .= $bits;
} }
if ($tag eq 'BITMAP') if ($tag eq 'BITMAP')
{ {
$gobitmap = 1; $gobitmap = 1;
@ -150,7 +150,7 @@ for (my $i = $minchar; $i <= $maxchar; $i++)
{ {
$data[$i] = '' unless defined $data[$i]; $data[$i] = '' unless defined $data[$i];
$data[$i] = '0' x ($width * $height - length $data[$i]) . $data[$i]; $data[$i] = '0' x ($width * $height - length $data[$i]) . $data[$i];
print FILEC "/* Char $i */\n"; print FILEC "/* Char $i */\n";
for my $line (0 .. $height - 1) for my $line (0 .. $height - 1)
{ print FILEC join ',', split(//, substr($data[$i], $line * $width, $width)), "\n"; } { print FILEC join ',', split(//, substr($data[$i], $line * $width, $width)), "\n"; }
@ -158,7 +158,7 @@ for (my $i = $minchar; $i <= $maxchar; $i++)
print FILEC "\n"; print FILEC "\n";
next; next;
for my $line (0 .. $height - 1) for my $line (0 .. $height - 1)
{ print substr($data[$i], $line * $width, $width), "\n"; } { print substr($data[$i], $line * $width, $width), "\n"; }
} }
@ -202,4 +202,3 @@ extern gdFontPtr $gdname;
EOF EOF
1; 1;

View File

@ -11,7 +11,7 @@
<body> <body>
<div class="navbar" align="center">&nbsp;<a href="http://www.w3.org/TR/REC-html40/sgml/framesetdtd.html"> <div class="navbar" align="center">&nbsp;<a href="http://www.w3.org/TR/REC-html40/sgml/framesetdtd.html">
previous</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/appendix/changes.html">next</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/cover.html#minitoc">contents</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/index/elements.html"> previous</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/appendix/changes.html">next</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/cover.html#minitoc">contents</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/index/elements.html">
elements</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/index/attributes.html">attributes</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/index/list.html">index</a> elements</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/index/attributes.html">attributes</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/index/list.html">index</a>
<hr></div> <hr></div>
@ -26,7 +26,7 @@ references in HTML 4</a></h1>
references</a></li> references</a></li>
<li><a class="tocxref" href="#h-24.2">Character entity references for ISO <li><a class="tocxref" href="#h-24.2">Character entity references for ISO
8859-1 characters</a> 8859-1 characters</a>
<ol> <ol>
<li><a class="tocxref" href="#h-24.2.1">The list of characters</a></li> <li><a class="tocxref" href="#h-24.2.1">The list of characters</a></li>
@ -34,7 +34,7 @@ references</a></li>
</li> </li>
<li><a class="tocxref" href="#h-24.3">Character entity references for symbols, <li><a class="tocxref" href="#h-24.3">Character entity references for symbols,
mathematical symbols, and Greek letters</a> mathematical symbols, and Greek letters</a>
<ol> <ol>
<li><a class="tocxref" href="#h-24.3.1">The list of characters</a></li> <li><a class="tocxref" href="#h-24.3.1">The list of characters</a></li>
@ -42,7 +42,7 @@ mathematical symbols, and Greek letters</a>
</li> </li>
<li><a class="tocxref" href="#h-24.4">Character entity references for <li><a class="tocxref" href="#h-24.4">Character entity references for
markup-significant and internationalization characters</a> markup-significant and internationalization characters</a>
<ol> <ol>
<li><a class="tocxref" href="#h-24.4.1">The list of characters</a></li> <li><a class="tocxref" href="#h-24.4.1">The list of characters</a></li>
@ -55,7 +55,7 @@ markup-significant and internationalization characters</a>
A <a href="http://www.w3.org/TR/REC-html40/charset.html#entities">character entity reference</a> is an SGML A <a href="http://www.w3.org/TR/REC-html40/charset.html#entities">character entity reference</a> is an SGML
construct that references a character of the <a href="http://www.w3.org/TR/REC-html40/charset.html">document construct that references a character of the <a href="http://www.w3.org/TR/REC-html40/charset.html">document
character set.</a> character set.</a>
<p>This version of HTML supports several sets of character entity <p>This version of HTML supports several sets of character entity
references:</p> references:</p>
@ -345,7 +345,7 @@ occasional Greek letters used in technical and mathematical works.</em></p>
existing ISO 8879 entity names. ISO 10646 character numbers existing ISO 8879 entity names. ISO 10646 character numbers
are given for each character, in hex. CDATA values are decimal are given for each character, in hex. CDATA values are decimal
conversions of the ISO 10646 values and refer to the document conversions of the ISO 10646 values and refer to the document
character set. Names are ISO 10646 names. character set. Names are ISO 10646 names.
--&gt; --&gt;
@ -472,7 +472,7 @@ occasional Greek letters used in technical and mathematical works.</em></p>
&lt;!ENTITY uArr CDATA "&amp;#8657;" -- upwards double arrow, U+21D1 ISOamsa --&gt; &lt;!ENTITY uArr CDATA "&amp;#8657;" -- upwards double arrow, U+21D1 ISOamsa --&gt;
&lt;!ENTITY rArr CDATA "&amp;#8658;" -- rightwards double arrow, &lt;!ENTITY rArr CDATA "&amp;#8658;" -- rightwards double arrow,
U+21D2 ISOtech --&gt; U+21D2 ISOtech --&gt;
&lt;!-- ISO 10646 does not say this is the 'implies' character but does not have &lt;!-- ISO 10646 does not say this is the 'implies' character but does not have
another character with this function so ? another character with this function so ?
rArr can be used for 'implies' as ISOtech suggests --&gt; rArr can be used for 'implies' as ISOtech suggests --&gt;
&lt;!ENTITY dArr CDATA "&amp;#8659;" -- downwards double arrow, U+21D3 ISOamsa --&gt; &lt;!ENTITY dArr CDATA "&amp;#8659;" -- downwards double arrow, U+21D3 ISOamsa --&gt;
@ -525,9 +525,9 @@ occasional Greek letters used in technical and mathematical works.</em></p>
U+2265 ISOtech --&gt; U+2265 ISOtech --&gt;
&lt;!ENTITY sub CDATA "&amp;#8834;" -- subset of, U+2282 ISOtech --&gt; &lt;!ENTITY sub CDATA "&amp;#8834;" -- subset of, U+2282 ISOtech --&gt;
&lt;!ENTITY sup CDATA "&amp;#8835;" -- superset of, U+2283 ISOtech --&gt; &lt;!ENTITY sup CDATA "&amp;#8835;" -- superset of, U+2283 ISOtech --&gt;
&lt;!-- note that nsup, 'not a superset of, U+2283' is not covered by the Symbol &lt;!-- note that nsup, 'not a superset of, U+2283' is not covered by the Symbol
font encoding and is not included. Should it be, for symmetry? font encoding and is not included. Should it be, for symmetry?
It is in ISOamsn --&gt; It is in ISOamsn --&gt;
&lt;!ENTITY nsub CDATA "&amp;#8836;" -- not a subset of, U+2284 ISOamsn --&gt; &lt;!ENTITY nsub CDATA "&amp;#8836;" -- not a subset of, U+2284 ISOamsn --&gt;
&lt;!ENTITY sube CDATA "&amp;#8838;" -- subset of or equal to, U+2286 ISOtech --&gt; &lt;!ENTITY sube CDATA "&amp;#8838;" -- subset of or equal to, U+2286 ISOtech --&gt;
&lt;!ENTITY supe CDATA "&amp;#8839;" -- superset of or equal to, &lt;!ENTITY supe CDATA "&amp;#8839;" -- superset of or equal to,
@ -550,11 +550,11 @@ occasional Greek letters used in technical and mathematical works.</em></p>
&lt;!ENTITY rfloor CDATA "&amp;#8971;" -- right floor, U+230B ISOamsc --&gt; &lt;!ENTITY rfloor CDATA "&amp;#8971;" -- right floor, U+230B ISOamsc --&gt;
&lt;!ENTITY lang CDATA "&amp;#9001;" -- left-pointing angle bracket = bra, &lt;!ENTITY lang CDATA "&amp;#9001;" -- left-pointing angle bracket = bra,
U+2329 ISOtech --&gt; U+2329 ISOtech --&gt;
&lt;!-- lang is NOT the same character as U+003C 'less than' &lt;!-- lang is NOT the same character as U+003C 'less than'
or U+2039 'single left-pointing angle quotation mark' --&gt; or U+2039 'single left-pointing angle quotation mark' --&gt;
&lt;!ENTITY rang CDATA "&amp;#9002;" -- right-pointing angle bracket = ket, &lt;!ENTITY rang CDATA "&amp;#9002;" -- right-pointing angle bracket = ket,
U+232A ISOtech --&gt; U+232A ISOtech --&gt;
&lt;!-- rang is NOT the same character as U+003E 'greater than' &lt;!-- rang is NOT the same character as U+003E 'greater than'
or U+203A 'single right-pointing angle quotation mark' --&gt; or U+203A 'single right-pointing angle quotation mark' --&gt;
&lt;!-- Geometric Shapes --&gt; &lt;!-- Geometric Shapes --&gt;
@ -614,7 +614,7 @@ that contains the requisite glyphs.</p>
existing ISO 8879 entity names. ISO 10646 character numbers existing ISO 8879 entity names. ISO 10646 character numbers
are given for each character, in hex. CDATA values are decimal are given for each character, in hex. CDATA values are decimal
conversions of the ISO 10646 values and refer to the document conversions of the ISO 10646 values and refer to the document
character set. Names are ISO 10646 names. character set. Names are ISO 10646 names.
--&gt; --&gt;
@ -679,4 +679,4 @@ that contains the requisite glyphs.</p>
<div class="navbar" align="center"> <div class="navbar" align="center">
<hr><a href="http://www.w3.org/TR/REC-html40/sgml/framesetdtd.html">previous</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/appendix/changes.html">next</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/cover.html#minitoc"> <hr><a href="http://www.w3.org/TR/REC-html40/sgml/framesetdtd.html">previous</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/appendix/changes.html">next</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/cover.html#minitoc">
contents</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/index/elements.html">elements</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/index/attributes.html">attributes</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/index/list.html">index</a></div> contents</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/index/elements.html">elements</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/index/attributes.html">attributes</a> &nbsp; <a href="http://www.w3.org/TR/REC-html40/index/list.html">index</a></div>
</body></html> </body></html>

View File

@ -40,4 +40,3 @@ int main (int argc, char *argv[])
#endif /* HAVE_LIBPNG */ #endif /* HAVE_LIBPNG */
return 0; return 0;
} }

View File

@ -177,7 +177,7 @@ BGD_DECLARE(int) gdImageGetTrueColorPixel (gdImagePtr im, int x, int y);
See Also: See Also:
<gdImageCreateTrueColor> <gdImageCreateTrueColor>
*/ */
BGD_DECLARE(gdImagePtr) gdImageCreate (int sx, int sy) BGD_DECLARE(gdImagePtr) gdImageCreate (int sx, int sy)
@ -285,7 +285,7 @@ BGD_DECLARE(gdImagePtr) gdImageCreate (int sx, int sy)
See Also: See Also:
<gdImageCreateTrueColor> <gdImageCreateTrueColor>
*/ */
BGD_DECLARE(gdImagePtr) gdImageCreateTrueColor (int sx, int sy) BGD_DECLARE(gdImagePtr) gdImageCreateTrueColor (int sx, int sy)
@ -416,7 +416,7 @@ BGD_DECLARE(void) gdImageDestroy (gdImagePtr im)
/** /**
* Function: gdImageColorClosest * Function: gdImageColorClosest
* *
* Gets the closest color of the image * Gets the closest color of the image
* *
* This is a simplified variant of <gdImageColorClosestAlpha> where the alpha * This is a simplified variant of <gdImageColorClosestAlpha> where the alpha
@ -1489,7 +1489,7 @@ BGD_DECLARE(int) gdImageGetTrueColorPixel (gdImagePtr im, int x, int y)
/* /*
Function: gdImageAABlend Function: gdImageAABlend
NO-OP, kept for library compatibility. NO-OP, kept for library compatibility.
*/ */
BGD_DECLARE(void) gdImageAABlend (gdImagePtr im) BGD_DECLARE(void) gdImageAABlend (gdImagePtr im)
@ -1542,7 +1542,7 @@ static void gdImageVLine(gdImagePtr im, int x, int y1, int y2, int col)
/* /*
Function: gdImageLine Function: gdImageLine
Bresenham as presented in Foley & Van Dam. Bresenham as presented in Foley & Van Dam.
*/ */
BGD_DECLARE(void) gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color) BGD_DECLARE(void) gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
@ -1587,7 +1587,7 @@ BGD_DECLARE(void) gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, in
if (dy <= dx) { if (dy <= dx) {
/* More-or-less horizontal. use wid for vertical stroke */ /* More-or-less horizontal. use wid for vertical stroke */
/* Doug Claar: watch out for NaN in atan2 (2.0.5) */ /* Doug Claar: watch out for NaN in atan2 (2.0.5) */
/* 2.0.12: Michael Schwartz: divide rather than multiply; /* 2.0.12: Michael Schwartz: divide rather than multiply;
TBB: but watch out for /0! */ TBB: but watch out for /0! */
double ac = cos (atan2 (dy, dx)); double ac = cos (atan2 (dy, dx));
@ -1940,7 +1940,7 @@ BGD_DECLARE(void) gdImageCharUp (gdImagePtr im, gdFontPtr f, int x, int y, int c
/** /**
* Function: gdImageString * Function: gdImageString
* *
* Draws a character string. * Draws a character string.
* *
* Parameters: * Parameters:
@ -2299,7 +2299,7 @@ BGD_DECLARE(void) gdImageFillToBorder (gdImagePtr im, int x, int y, int border,
} else if (y < 0) { } else if (y < 0) {
y = 0; y = 0;
} }
for (i = x; (i >= 0); i--) { for (i = x; (i >= 0); i--) {
if (gdImageGetPixel (im, i, y) == border) { if (gdImageGetPixel (im, i, y) == border) {
break; break;
@ -3094,7 +3094,7 @@ BGD_DECLARE(void) gdImageCopyMerge (gdImagePtr dst, gdImagePtr src, int dstX, in
* Note: * Note:
* This function is a substitute for real alpha channel operations, * This function is a substitute for real alpha channel operations,
* so it doesn't pay attention to the alpha channel. * so it doesn't pay attention to the alpha channel.
* *
* Parameters: * Parameters:
* dst - The destination image. * dst - The destination image.
* src - The source image. * src - The source image.
@ -3175,7 +3175,7 @@ BGD_DECLARE(void) gdImageCopyMergeGray (gdImagePtr dst, gdImagePtr src, int dstX
* *
* If the source and destination area differ in size, the area will be resized * If the source and destination area differ in size, the area will be resized
* using nearest-neighbor interpolation. * using nearest-neighbor interpolation.
* *
* Parameters: * Parameters:
* dst - The destination image. * dst - The destination image.
* src - The source image. * src - The source image.
@ -3432,7 +3432,7 @@ BGD_DECLARE(void) gdImageCopyRotated (gdImagePtr dst,
* If the source and destination area differ in size, the area will be resized * If the source and destination area differ in size, the area will be resized
* using bilinear interpolation for truecolor images, and nearest-neighbor * using bilinear interpolation for truecolor images, and nearest-neighbor
* interpolation for palette images. * interpolation for palette images.
* *
* Parameters: * Parameters:
* dst - The destination image. * dst - The destination image.
* src - The source image. * src - The source image.
@ -4340,8 +4340,8 @@ static void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int co
/* keep them as 32bits */ /* keep them as 32bits */
long x, y, inc, frac; long x, y, inc, frac;
long dx, dy,tmp; long dx, dy,tmp;
int w, wid, wstart; int w, wid, wstart;
int thick = im->thick; int thick = im->thick;
if (!im->trueColor) { if (!im->trueColor) {
/* TBB: don't crash when the image is of the wrong type */ /* TBB: don't crash when the image is of the wrong type */

View File

@ -29,7 +29,7 @@ extern "C" {
GDXXX_STR(GD_RELEASE_VERSION), \ GDXXX_STR(GD_RELEASE_VERSION), \
GD_EXTRA_VERSION) GD_EXTRA_VERSION)
/* Do the DLL dance: dllexport when building the DLL, /* Do the DLL dance: dllexport when building the DLL,
dllimport when importing from it, nothing when dllimport when importing from it, nothing when
not on Silly Silly Windows (tm Aardman Productions). */ not on Silly Silly Windows (tm Aardman Productions). */
@ -79,20 +79,20 @@ extern "C" {
#define BGD_DECLARE(rt) BGD_EXPORT_DATA_PROT rt BGD_STDCALL #define BGD_DECLARE(rt) BGD_EXPORT_DATA_PROT rt BGD_STDCALL
/* VS2012+ disable keyword macroizing unless _ALLOW_KEYWORD_MACROS is set /* VS2012+ disable keyword macroizing unless _ALLOW_KEYWORD_MACROS is set
We define inline, snprintf, and strcasecmp if they're missing We define inline, snprintf, and strcasecmp if they're missing
*/ */
#ifdef _MSC_VER #ifdef _MSC_VER
# define _ALLOW_KEYWORD_MACROS # define _ALLOW_KEYWORD_MACROS
# ifndef inline # ifndef inline
# define inline __inline # define inline __inline
# endif # endif
# ifndef strcasecmp # ifndef strcasecmp
# define strcasecmp _stricmp # define strcasecmp _stricmp
# endif # endif
#if _MSC_VER < 1900 #if _MSC_VER < 1900
extern int snprintf(char*, size_t, const char*, ...); extern int snprintf(char*, size_t, const char*, ...);
#endif #endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
@ -131,9 +131,9 @@ extern "C" {
must be 32 bits wide or more. must be 32 bits wide or more.
True colors are repsented as follows: True colors are repsented as follows:
ARGB ARGB
Where 'A' (alpha channel) occupies only the Where 'A' (alpha channel) occupies only the
LOWER 7 BITS of the MSB. This very small LOWER 7 BITS of the MSB. This very small
loss of alpha channel resolution allows gd 2.x loss of alpha channel resolution allows gd 2.x
@ -209,7 +209,7 @@ extern "C" {
* Group: Effects * Group: Effects
* *
* The layering effect * The layering effect
* *
* When pixels are drawn the new colors are "mixed" with the background * When pixels are drawn the new colors are "mixed" with the background
* depending on the effect. * depending on the effect.
* *
@ -286,7 +286,7 @@ enum gdPaletteQuantizationMethod {
* *
* GD_BELL - Bell * GD_BELL - Bell
* GD_BESSEL - Bessel * GD_BESSEL - Bessel
* GD_BILINEAR_FIXED - fixed point bilinear * GD_BILINEAR_FIXED - fixed point bilinear
* GD_BICUBIC - Bicubic * GD_BICUBIC - Bicubic
* GD_BICUBIC_FIXED - fixed point bicubic integer * GD_BICUBIC_FIXED - fixed point bicubic integer
* GD_BLACKMAN - Blackman * GD_BLACKMAN - Blackman
@ -346,7 +346,7 @@ typedef double (* interpolation_method )(double);
/* /*
Group: Types Group: Types
typedef: gdImage typedef: gdImage
typedef: gdImagePtr typedef: gdImagePtr
@ -513,7 +513,7 @@ gdPointF, *gdPointFPtr;
structure. structure.
Please see the files gdfontl.c and gdfontl.h for an example of Please see the files gdfontl.c and gdfontl.h for an example of
the proper declaration of this structure. the proper declaration of this structure.
> typedef struct { > typedef struct {
> // # of characters in font > // # of characters in font
@ -710,7 +710,7 @@ BGD_DECLARE(void) gdImageDestroy (gdImagePtr im);
alpha channel value of 'color'; default is to overwrite. alpha channel value of 'color'; default is to overwrite.
Tiling and line styling are also implemented Tiling and line styling are also implemented
here. All other gd drawing functions pass through this call, here. All other gd drawing functions pass through this call,
allowing for many useful effects. allowing for many useful effects.
Overlay and multiply effects are used when gdImageAlphaBlending Overlay and multiply effects are used when gdImageAlphaBlending
is passed gdEffectOverlay and gdEffectMultiply */ is passed gdEffectOverlay and gdEffectMultiply */
@ -808,7 +808,7 @@ typedef struct {
then, on return, xshow is a malloc'ed then, on return, xshow is a malloc'ed
string containing xshow position data for string containing xshow position data for
the last string. the last string.
NB. The caller is responsible for gdFree'ing NB. The caller is responsible for gdFree'ing
the xshow string. the xshow string.
*/ */
@ -817,7 +817,7 @@ typedef struct {
string containing the actual font file path name string containing the actual font file path name
used, which can be interesting when fontconfig used, which can be interesting when fontconfig
is in use. is in use.
The caller is responsible for gdFree'ing the The caller is responsible for gdFree'ing the
fontpath string. fontpath string.
*/ */
@ -977,16 +977,16 @@ BGD_DECLARE(void) gdImageColorDeallocate (gdImagePtr im, int color);
anything up to 256. If the original source image anything up to 256. If the original source image
includes photographic information or anything that includes photographic information or anything that
came out of a JPEG, 256 is strongly recommended. came out of a JPEG, 256 is strongly recommended.
Better yet, don't use these function -- write real Better yet, don't use these function -- write real
truecolor PNGs and JPEGs. The disk space gain of truecolor PNGs and JPEGs. The disk space gain of
conversion to palette is not great (for small images conversion to palette is not great (for small images
it can be negative) and the quality loss is ugly. it can be negative) and the quality loss is ugly.
DIFFERENCES: gdImageCreatePaletteFromTrueColor creates and DIFFERENCES: gdImageCreatePaletteFromTrueColor creates and
returns a new image. gdImageTrueColorToPalette modifies returns a new image. gdImageTrueColorToPalette modifies
an existing image, and the truecolor pixels are discarded. an existing image, and the truecolor pixels are discarded.
gdImageTrueColorToPalette() returns TRUE on success, FALSE on failure. gdImageTrueColorToPalette() returns TRUE on success, FALSE on failure.
*/ */
@ -1092,7 +1092,7 @@ BGD_DECLARE(void) gdImageWebpCtx (gdImagePtr im, gdIOCtx * outfile, int quantiza
/** /**
* Group: GifAnim * Group: GifAnim
* *
* Legal values for Disposal. gdDisposalNone is always used by * Legal values for Disposal. gdDisposalNone is always used by
* the built-in optimizer if previm is passed. * the built-in optimizer if previm is passed.
* *
@ -1318,7 +1318,7 @@ BGD_DECLARE(gdImagePtr) gdImageCopyGaussianBlurred(gdImagePtr src, int radius,
* Macro: gdImageSX * Macro: gdImageSX
* *
* Gets the width (in pixels) of an image. * Gets the width (in pixels) of an image.
* *
* Parameters: * Parameters:
* im - The image. * im - The image.
*/ */

View File

@ -43,4 +43,3 @@ int main(int argc, char **argv)
return 0; return 0;
} }

View File

@ -6,7 +6,7 @@
* Some functions to crop images, automatically (auto detection of the border * Some functions to crop images, automatically (auto detection of the border
* color), using a given color (with or without tolerance) or using a given * color), using a given color (with or without tolerance) or using a given
* rectangle. * rectangle.
* *
* Example: * Example:
* (start code) * (start code)
* im2 = gdImageAutoCrop(im, GD_CROP_SIDES); * im2 = gdImageAutoCrop(im, GD_CROP_SIDES);
@ -183,7 +183,7 @@ BGD_DECLARE(gdImagePtr) gdImageCropAuto(gdImagePtr im, const unsigned int mode)
* im - The image. * im - The image.
* color - The crop color. * color - The crop color.
* threshold - The crop threshold. * threshold - The crop threshold.
* *
* Returns: * Returns:
* The newly created cropped image, or NULL on failure. * The newly created cropped image, or NULL on failure.
* *

View File

@ -28,7 +28,7 @@ static void BGD_STDCALL writejpeg(gdImagePtr im, FILE *out) {
static void BGD_STDCALL writewbmp(gdImagePtr im, FILE *out) { static void BGD_STDCALL writewbmp(gdImagePtr im, FILE *out) {
int fg = gdImageColorClosest(im, 0, 0, 0); int fg = gdImageColorClosest(im, 0, 0, 0);
gdImageWBMP(im, fg, out); gdImageWBMP(im, fg, out);
}/* writejpeg*/ }/* writejpeg*/
@ -61,7 +61,7 @@ static struct FileType {
{".jpeg", gdImageCreateFromJpeg, writejpeg, NULL}, {".jpeg", gdImageCreateFromJpeg, writejpeg, NULL},
#endif #endif
#ifdef HAVE_LIBTIFF #ifdef HAVE_LIBTIFF
{".tiff", gdImageCreateFromTiff, gdImageTiff, NULL}, {".tiff", gdImageCreateFromTiff, gdImageTiff, NULL},
{".tif" , gdImageCreateFromTiff, gdImageTiff, NULL}, {".tif" , gdImageCreateFromTiff, gdImageTiff, NULL},
#endif #endif
@ -90,7 +90,7 @@ ftype(const char *filename) {
/* Find the file extension (i.e. the last period in the string. */ /* Find the file extension (i.e. the last period in the string. */
ext = strrchr(filename, '.'); ext = strrchr(filename, '.');
if (!ext) return NULL; if (!ext) return NULL;
for (n = 0; Types[n].ext; n++) { for (n = 0; Types[n].ext; n++) {
if (strcasecmp(ext, Types[n].ext) == 0) { if (strcasecmp(ext, Types[n].ext) == 0) {
return &Types[n]; return &Types[n];
@ -103,7 +103,7 @@ ftype(const char *filename) {
/* /*
Function: gdSupportsFileType Function: gdSupportsFileType
Tests if a given file type is supported by GD. Tests if a given file type is supported by GD.
Given the name of an image file (which does not have to exist), Given the name of an image file (which does not have to exist),
@ -145,7 +145,7 @@ ftype(const char *filename) {
GD_TRUE (1) if the file type is supported, GD_FALSE (0) if not. GD_TRUE (1) if the file type is supported, GD_FALSE (0) if not.
*/ */
BGD_DECLARE(int) BGD_DECLARE(int)
gdSupportsFileType(const char *filename, int writing) { gdSupportsFileType(const char *filename, int writing) {
struct FileType *entry = ftype(filename); struct FileType *entry = ftype(filename);
return !!entry && (!writing || !!entry->writer); return !!entry && (!writing || !!entry->writer);
@ -159,7 +159,7 @@ gdSupportsFileType(const char *filename, int writing) {
Given the path to a file, <gdImageCreateFromFile> will open the Given the path to a file, <gdImageCreateFromFile> will open the
file, read its contents with the appropriate _gdImageCreateFrom*_ file, read its contents with the appropriate _gdImageCreateFrom*_
function and return it. function and return it.
File type is determined by the filename extension, so having an File type is determined by the filename extension, so having an
incorrect extension will probably not work. For example, renaming incorrect extension will probably not work. For example, renaming
@ -179,12 +179,12 @@ gdSupportsFileType(const char *filename, int writing) {
*/ */
BGD_DECLARE(gdImagePtr) BGD_DECLARE(gdImagePtr)
gdImageCreateFromFile(const char *filename) { gdImageCreateFromFile(const char *filename) {
struct FileType *entry = ftype(filename); struct FileType *entry = ftype(filename);
FILE *fh; FILE *fh;
gdImagePtr result; gdImagePtr result;
if (!entry) return NULL; if (!entry) return NULL;
if (entry->loader) return entry->loader((char *)filename); if (entry->loader) return entry->loader((char *)filename);
if (!entry->reader) return NULL; if (!entry->reader) return NULL;
@ -193,7 +193,7 @@ gdImageCreateFromFile(const char *filename) {
if (!fh) return NULL; if (!fh) return NULL;
result = entry->reader(fh); result = entry->reader(fh);
fclose(fh); fclose(fh);
return result; return result;
@ -235,7 +235,7 @@ gdImageCreateFromFile(const char *filename) {
*/ */
BGD_DECLARE(int) BGD_DECLARE(int)
gdImageFile(gdImagePtr im, const char *filename) { gdImageFile(gdImagePtr im, const char *filename) {
struct FileType *entry = ftype(filename); struct FileType *entry = ftype(filename);
FILE *fh; FILE *fh;
@ -251,4 +251,3 @@ gdImageFile(gdImagePtr im, const char *filename) {
return GD_TRUE; return GD_TRUE;
}/* gdImageFile*/ }/* gdImageFile*/

View File

@ -898,7 +898,7 @@ applyCoeffsLine(gdImagePtr src, gdImagePtr dst, int line, int linelen,
const int srcpx = (axis == HORIZONTAL) ? const int srcpx = (axis == HORIZONTAL) ?
src->tpixels[line][rndx] : src->tpixels[line][rndx] :
src->tpixels[rndx][line]; src->tpixels[rndx][line];
r += coeff * (double)gdTrueColorGetRed(srcpx); r += coeff * (double)gdTrueColorGetRed(srcpx);
g += coeff * (double)gdTrueColorGetGreen(srcpx); g += coeff * (double)gdTrueColorGetGreen(srcpx);
b += coeff * (double)gdTrueColorGetBlue(srcpx); b += coeff * (double)gdTrueColorGetBlue(srcpx);
@ -912,7 +912,7 @@ applyCoeffsLine(gdImagePtr src, gdImagePtr dst, int line, int linelen,
static void static void
applyCoeffs(gdImagePtr src, gdImagePtr dst, double *coeffs, int radius, applyCoeffs(gdImagePtr src, gdImagePtr dst, double *coeffs, int radius,
gdAxis axis) gdAxis axis)
{ {
int line, numlines, linelen; int line, numlines, linelen;
@ -939,7 +939,7 @@ applyCoeffs(gdImagePtr src, gdImagePtr dst, double *coeffs, int radius,
_radius_ is a radius, not a diameter so a radius of 2 (for _radius_ is a radius, not a diameter so a radius of 2 (for
example) will blur across a region 5 pixels across (2 to the example) will blur across a region 5 pixels across (2 to the
center, 1 for the center itself and another 2 to the other edge). center, 1 for the center itself and another 2 to the other edge).
_sigma_ represents the "fatness" of the curve (lower == fatter). _sigma_ represents the "fatness" of the curve (lower == fatter).
If _sigma_ is less than or equal to 0, If _sigma_ is less than or equal to 0,
<gdImageCopyGaussianBlurred> ignores it and instead computes an <gdImageCopyGaussianBlurred> ignores it and instead computes an
@ -987,10 +987,10 @@ applyCoeffs(gdImagePtr src, gdImagePtr dst, double *coeffs, int radius,
FILE *in; FILE *in;
gdImagePtr result, src; gdImagePtr result, src;
in = fopen("foo.png", "rb"); in = fopen("foo.png", "rb");
src = gdImageCreateFromPng(in); src = gdImageCreateFromPng(in);
result = gdImageCopyGaussianBlurred(im, src->sx / 10, -1.0); result = gdImageCopyGaussianBlurred(im, src->sx / 10, -1.0);
(end code) (end code)
@ -1034,7 +1034,7 @@ gdImageCopyGaussianBlurred(gdImagePtr src, int radius, double sigma)
gdFree(coeffs); gdFree(coeffs);
return NULL; return NULL;
}/* if */ }/* if */
freeSrc = 1; freeSrc = 1;
}/* if */ }/* if */
@ -1059,4 +1059,3 @@ gdImageCopyGaussianBlurred(gdImagePtr src, int radius, double sigma)
return result; return result;
}/* gdImageCopyGaussianBlurred*/ }/* gdImageCopyGaussianBlurred*/

View File

@ -24,7 +24,7 @@
* count - 1 byte (the number of used palette colors) * count - 1 byte (the number of used palette colors)
* transparent - 1 word (257 signals no transparency) * transparent - 1 word (257 signals no transparency)
* palette - 256×3 bytes (RGB triplets) * palette - 256×3 bytes (RGB triplets)
* *
* GD 2.x file header structure: * GD 2.x file header structure:
* signature - 1 word ("\xFF\xFE" for truecolor, "\xFF\xFF" for palette) * signature - 1 word ("\xFF\xFE" for truecolor, "\xFF\xFF" for palette)
* width - 1 word * width - 1 word
@ -234,7 +234,7 @@ fail1:
> in = fopen("mygd.gd", "rb"); > in = fopen("mygd.gd", "rb");
> im = gdImageCreateFromGd(in); > im = gdImageCreateFromGd(in);
> fclose(in); > fclose(in);
> // ... Use the image ... > // ... Use the image ...
> gdImageDestroy(im); > gdImageDestroy(im);
*/ */
BGD_DECLARE(gdImagePtr) gdImageCreateFromGd (FILE * inFile) BGD_DECLARE(gdImagePtr) gdImageCreateFromGd (FILE * inFile)

View File

@ -47,7 +47,7 @@
* offset - 1 dword * offset - 1 dword
* size - 1 dword * size - 1 dword
* *
* There are x_chunk_count * y_chunk_count chunk headers. * There are x_chunk_count * y_chunk_count chunk headers.
* *
* Truecolor image color header: * Truecolor image color header:
* truecolor - 1 byte (always "\001") * truecolor - 1 byte (always "\001")
@ -407,7 +407,7 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2Ptr (int size, void *data)
Function: gdImageCreateFromGd2Ctx Function: gdImageCreateFromGd2Ctx
Reads in a GD2 image via a <gdIOCtx> struct. See Reads in a GD2 image via a <gdIOCtx> struct. See
<gdImageCreateFromGd2>. <gdImageCreateFromGd2>.
*/ */
BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2Ctx (gdIOCtxPtr in) BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2Ctx (gdIOCtxPtr in)
{ {

View File

@ -149,7 +149,7 @@ static void ReadImage (gdImagePtr im, gdIOCtx *fd, int len, int height, unsigned
> in = fopen("mygif.gif", "rb"); > in = fopen("mygif.gif", "rb");
> im = gdImageCreateFromGif(in); > im = gdImageCreateFromGif(in);
> fclose(in); > fclose(in);
> // ... Use the image ... > // ... Use the image ...
> gdImageDestroy(im); > gdImageDestroy(im);
*/ */

View File

@ -546,18 +546,18 @@ BGD_DECLARE(void *) gdImageGifAnimAddPtr(gdImagePtr im, int *size, int LocalCM,
gdImagePtr im, im2, im3; gdImagePtr im, im2, im3;
int black, white, trans; int black, white, trans;
FILE *out; FILE *out;
im = gdImageCreate(100, 100); // Create the image im = gdImageCreate(100, 100); // Create the image
white = gdImageColorAllocate(im, 255, 255, 255); // Allocate background white = gdImageColorAllocate(im, 255, 255, 255); // Allocate background
black = gdImageColorAllocate(im, 0, 0, 0); // Allocate drawing color black = gdImageColorAllocate(im, 0, 0, 0); // Allocate drawing color
trans = gdImageColorAllocate(im, 1, 1, 1); // trans clr for compression trans = gdImageColorAllocate(im, 1, 1, 1); // trans clr for compression
gdImageRectangle(im, 0, 0, 10, 10, black); // Draw rectangle gdImageRectangle(im, 0, 0, 10, 10, black); // Draw rectangle
out = fopen("anim.gif", "wb");// Open output file in binary mode out = fopen("anim.gif", "wb");// Open output file in binary mode
gdImageGifAnimBegin(im, out, 1, 3);// Write GIF hdr, global clr map,loops gdImageGifAnimBegin(im, out, 1, 3);// Write GIF hdr, global clr map,loops
// Write the first frame. No local color map. Delay = 1s // Write the first frame. No local color map. Delay = 1s
gdImageGifAnimAdd(im, out, 0, 0, 0, 100, 1, NULL); gdImageGifAnimAdd(im, out, 0, 0, 0, 100, 1, NULL);
// construct the second frame // construct the second frame
im2 = gdImageCreate(100, 100); im2 = gdImageCreate(100, 100);
(void)gdImageColorAllocate(im2, 255, 255, 255); // White background (void)gdImageColorAllocate(im2, 255, 255, 255); // White background
@ -566,7 +566,7 @@ BGD_DECLARE(void *) gdImageGifAnimAddPtr(gdImagePtr im, int *size, int LocalCM,
// Allow animation compression with transparent pixels // Allow animation compression with transparent pixels
gdImageColorTransparent (im2, trans); gdImageColorTransparent (im2, trans);
gdImageGifAnimAdd(im2, out, 0, 0, 0, 100, 1, im); // Add second frame gdImageGifAnimAdd(im2, out, 0, 0, 0, 100, 1, im); // Add second frame
// construct the third frame // construct the third frame
im3 = gdImageCreate(100, 100); im3 = gdImageCreate(100, 100);
(void)gdImageColorAllocate(im3, 255, 255, 255); // white background (void)gdImageColorAllocate(im3, 255, 255, 255); // white background
@ -578,7 +578,7 @@ BGD_DECLARE(void *) gdImageGifAnimAddPtr(gdImagePtr im, int *size, int LocalCM,
gdImageGifAnimAdd(im3, out, 0, 0, 0, 100, 1, im2); gdImageGifAnimAdd(im3, out, 0, 0, 0, 100, 1, im2);
gdImageGifAnimEnd(out); // End marker, same as putc(';', out); gdImageGifAnimEnd(out); // End marker, same as putc(';', out);
fclose(out); // Close file fclose(out); // Close file
// Destroy images // Destroy images
gdImageDestroy(im); gdImageDestroy(im);
gdImageDestroy(im2); gdImageDestroy(im2);

View File

@ -87,4 +87,3 @@ gdImagePtr gdImageRotate270(gdImagePtr src, int ignoretransparent);
#endif #endif

View File

@ -41,8 +41,8 @@
downscaling using the fixed point implementations are usually much faster downscaling using the fixed point implementations are usually much faster
than the existing gdImageCopyResampled while having a similar or better than the existing gdImageCopyResampled while having a similar or better
quality. quality.
For image rotations, the optimized versions have a lazy antialiasing for For image rotations, the optimized versions have a lazy antialiasing for
the edges of the images. For a much better antialiased result, the affine the edges of the images. For a much better antialiased result, the affine
function is recommended. function is recommended.
*/ */
@ -78,7 +78,7 @@ TODO:
# include <emmintrin.h> # include <emmintrin.h>
#endif #endif
static gdImagePtr gdImageScaleBilinear(gdImagePtr im, static gdImagePtr gdImageScaleBilinear(gdImagePtr im,
const unsigned int new_width, const unsigned int new_width,
const unsigned int new_height); const unsigned int new_height);
static gdImagePtr gdImageScaleBicubicFixed(gdImagePtr src, static gdImagePtr gdImageScaleBicubicFixed(gdImagePtr src,
@ -278,7 +278,7 @@ static double KernelBessel_Q1(const double x)
static double KernelBessel_Order1(double x) static double KernelBessel_Order1(double x)
{ {
double p, q; double p, q;
if (x == 0.0) if (x == 0.0)
return (0.0f); return (0.0f);
p = x; p = x;
@ -617,7 +617,7 @@ static double filter_welsh(const double x)
#if defined(_MSC_VER) && !defined(inline) #if defined(_MSC_VER) && !defined(inline)
# define inline __inline # define inline __inline
#endif #endif
/* keep it for future usage for affine copy over an existing image, targetting fix for 2.2.2 */ /* keep it for future usage for affine copy over an existing image, targetting fix for 2.2.2 */
#ifdef FUNCTION_NOT_USED_YET #ifdef FUNCTION_NOT_USED_YET
@ -654,7 +654,7 @@ static inline int _color_blend (const int dst, const int src)
} }
} }
static inline int _setEdgePixel(const gdImagePtr src, unsigned int x, unsigned int y, gdFixed coverage, const int bgColor) static inline int _setEdgePixel(const gdImagePtr src, unsigned int x, unsigned int y, gdFixed coverage, const int bgColor)
{ {
const gdFixed f_127 = gd_itofx(127); const gdFixed f_127 = gd_itofx(127);
register int c = src->tpixels[y][x]; register int c = src->tpixels[y][x];
@ -948,8 +948,8 @@ _gdScaleOneAxis(gdImagePtr pSrc, gdImagePtr dst,
double r = 0, g = 0, b = 0, a = 0; double r = 0, g = 0, b = 0, a = 0;
const int left = contrib->ContribRow[ndx].Left; const int left = contrib->ContribRow[ndx].Left;
const int right = contrib->ContribRow[ndx].Right; const int right = contrib->ContribRow[ndx].Right;
int *dest = (axis == HORIZONTAL) ? int *dest = (axis == HORIZONTAL) ?
&dst->tpixels[row][ndx] : &dst->tpixels[row][ndx] :
&dst->tpixels[ndx][row]; &dst->tpixels[ndx][row];
int i; int i;
@ -958,7 +958,7 @@ _gdScaleOneAxis(gdImagePtr pSrc, gdImagePtr dst,
for (i = left; i <= right; i++) { for (i = left; i <= right; i++) {
const int left_channel = i - left; const int left_channel = i - left;
const int srcpx = (axis == HORIZONTAL) ? const int srcpx = (axis == HORIZONTAL) ?
pSrc->tpixels[row][i] : pSrc->tpixels[row][i] :
pSrc->tpixels[i][row]; pSrc->tpixels[i][row];
r += contrib->ContribRow[ndx].Weights[left_channel] r += contrib->ContribRow[ndx].Weights[left_channel]
@ -1686,7 +1686,7 @@ static int gdRotatedImageSize(gdImagePtr src, const float angle, gdRectPtr bbox)
return GD_TRUE; return GD_TRUE;
} }
static gdImagePtr static gdImagePtr
gdImageRotateNearestNeighbour(gdImagePtr src, const float degrees, gdImageRotateNearestNeighbour(gdImagePtr src, const float degrees,
const int bgColor) const int bgColor)
{ {
@ -1799,7 +1799,7 @@ gdImageRotateGeneric(gdImagePtr src, const float degrees, const int bgColor)
return dst; return dst;
} }
/** /**
* Function: gdImageRotateInterpolated * Function: gdImageRotateInterpolated
* *
* Rotate an image * Rotate an image
@ -1821,7 +1821,7 @@ gdImageRotateGeneric(gdImagePtr src, const float degrees, const int bgColor)
*/ */
BGD_DECLARE(gdImagePtr) gdImageRotateInterpolated(const gdImagePtr src, const float angle, int bgcolor) BGD_DECLARE(gdImagePtr) gdImageRotateInterpolated(const gdImagePtr src, const float angle, int bgcolor)
{ {
/* round to two decimals and keep the 100x multiplication to use it in the common square angles /* round to two decimals and keep the 100x multiplication to use it in the common square angles
case later. Keep the two decimal precisions so smaller rotation steps can be done, useful for case later. Keep the two decimal precisions so smaller rotation steps can be done, useful for
slow animations, f.e. */ slow animations, f.e. */
const int angle_rounded = fmod((int) floorf(angle * 100), 360 * 100); const int angle_rounded = fmod((int) floorf(angle * 100), 360 * 100);
@ -1953,7 +1953,7 @@ BGD_DECLARE(int) gdTransformAffineGetImage(gdImagePtr *dst,
if (!src->trueColor) { if (!src->trueColor) {
gdImagePaletteToTrueColor(src); gdImagePaletteToTrueColor(src);
} }
/* Translate to dst origin (0,0) */ /* Translate to dst origin (0,0) */
gdAffineTranslate(m, -bbox.x, -bbox.y); gdAffineTranslate(m, -bbox.x, -bbox.y);
gdAffineConcat(m, affine, m); gdAffineConcat(m, affine, m);
@ -2010,7 +2010,7 @@ BGD_DECLARE(int) gdTransformAffineCopy(gdImagePtr dst,
/* These methods use special implementations */ /* These methods use special implementations */
if (src->interpolation_id == GD_BILINEAR_FIXED || src->interpolation_id == GD_BICUBIC_FIXED || src->interpolation_id == GD_NEAREST_NEIGHBOUR) { if (src->interpolation_id == GD_BILINEAR_FIXED || src->interpolation_id == GD_BICUBIC_FIXED || src->interpolation_id == GD_NEAREST_NEIGHBOUR) {
interpolation_id_bak = src->interpolation_id; interpolation_id_bak = src->interpolation_id;
gdImageSetInterpolationMethod(src, GD_BICUBIC); gdImageSetInterpolationMethod(src, GD_BICUBIC);
} }

View File

@ -17,7 +17,7 @@ extern "C" {
typedef: gdIOCtx typedef: gdIOCtx
gdIOCtx structures hold function pointers for doing image IO. gdIOCtx structures hold function pointers for doing image IO.
Most of the gd functions that read and write files, such as Most of the gd functions that read and write files, such as
<gdImagePng> also have variants that accept a <gdIOCtx> structure; <gdImagePng> also have variants that accept a <gdIOCtx> structure;
see <gdImagePngCtx> and <gdImageCreateFromJpegCtx>. see <gdImagePngCtx> and <gdImageCreateFromJpegCtx>.
@ -45,14 +45,14 @@ extern "C" {
> { > {
> int (*getC) (struct gdIOCtx *); > int (*getC) (struct gdIOCtx *);
> int (*getBuf) (struct gdIOCtx *, void *, int wanted); > int (*getBuf) (struct gdIOCtx *, void *, int wanted);
> >
> void (*putC) (struct gdIOCtx *, int); > void (*putC) (struct gdIOCtx *, int);
> int (*putBuf) (struct gdIOCtx *, const void *, int wanted); > int (*putBuf) (struct gdIOCtx *, const void *, int wanted);
> >
> // seek must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek! > // seek must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek!
> int (*seek) (struct gdIOCtx *, const int); > int (*seek) (struct gdIOCtx *, const int);
> long (*tell) (struct gdIOCtx *); > long (*tell) (struct gdIOCtx *);
> >
> void (*gd_free) (struct gdIOCtx *); > void (*gd_free) (struct gdIOCtx *);
> } gdIOCtx; > } gdIOCtx;

View File

@ -6,7 +6,7 @@
*******************************************************************************/ *******************************************************************************/
/** \file gd_io_stream.cxx /** \file gd_io_stream.cxx
\brief Implementation of the methods of the gdIOCtx std stream specialization. \brief Implementation of the methods of the gdIOCtx std stream specialization.
Implements the derived specializations of gdIOCtx. Implements the derived specializations of gdIOCtx.
These methods are not called by users of libgd, they These methods are not called by users of libgd, they
are internal implementation. are internal implementation.
@ -22,7 +22,7 @@
#include "gd_io_stream.h" #include "gd_io_stream.h"
/** Read into buffer from stream /** Read into buffer from stream
Return the number of bytes successfully read. Return the number of bytes successfully read.
If an error occurs, or the end-of-file is reached, the return value If an error occurs, or the end-of-file is reached, the return value
is a short byte count (or zero). is a short byte count (or zero).
*/ */
@ -33,7 +33,7 @@ int istreamIOCtx::Getbuf (struct gdIOCtx * ctx, void * buf, int size)
return _str->gcount(); return _str->gcount();
} }
/** Write from buffer to stream /** Write from buffer to stream
Return the number of bytes successfully written. Return the number of bytes successfully written.
If an error occurs, or the end-of-file is reached, the return value If an error occurs, or the end-of-file is reached, the return value
is a short byte count (or zero). is a short byte count (or zero).
*/ */
@ -58,7 +58,7 @@ void istreamIOCtx::Putchar (struct gdIOCtx * , int )
} }
/** Seek to position offset from the beginning of the stream /** Seek to position offset from the beginning of the stream
must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek! must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek!
*/ */
int istreamIOCtx::Seek (struct gdIOCtx * ctx, const int pos) int istreamIOCtx::Seek (struct gdIOCtx * ctx, const int pos)
{ {
@ -82,7 +82,7 @@ void istreamIOCtx::FreeCtx (struct gdIOCtx * ctx)
} }
/** Read into buffer from stream /** Read into buffer from stream
Return the number of bytes successfully read. Return the number of bytes successfully read.
If an error occurs, or the end-of-file is reached, the return value If an error occurs, or the end-of-file is reached, the return value
is a short byte count (or zero). is a short byte count (or zero).
*/ */
@ -91,7 +91,7 @@ int ostreamIOCtx::Getbuf (struct gdIOCtx * , void * , int )
return 0; return 0;
} }
/** Write from buffer to stream /** Write from buffer to stream
Return the number of bytes successfully written. Return the number of bytes successfully written.
If an error occurs, or the end-of-file is reached, the return value If an error occurs, or the end-of-file is reached, the return value
is a short byte count (or zero). is a short byte count (or zero).
*/ */
@ -119,7 +119,7 @@ void ostreamIOCtx::Putchar (struct gdIOCtx * ctx, int c)
} }
/** Seek to position offset from the beginning of the stream /** Seek to position offset from the beginning of the stream
must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek! must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek!
*/ */
int ostreamIOCtx::Seek (struct gdIOCtx * ctx, const int pos) int ostreamIOCtx::Seek (struct gdIOCtx * ctx, const int pos)
{ {

View File

@ -255,7 +255,7 @@ void jpeg_gdIOCtx_dest(j_compress_ptr cinfo, gdIOCtx *outfile);
im - The image to write. im - The image to write.
outfile - The output sink. outfile - The output sink.
quality - Image quality. quality - Image quality.
*/ */
BGD_DECLARE(void) gdImageJpegCtx(gdImagePtr im, gdIOCtx *outfile, int quality) BGD_DECLARE(void) gdImageJpegCtx(gdImagePtr im, gdIOCtx *outfile, int quality)
@ -496,7 +496,7 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegEx(FILE *inFile, int ignore_warning
Function: gdImageCreateFromJpegPtr Function: gdImageCreateFromJpegPtr
Parameters: Parameters:
size - size of JPEG data in bytes. size - size of JPEG data in bytes.
data - pointer to JPEG data. data - pointer to JPEG data.
@ -511,7 +511,7 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegPtr(int size, void *data)
Function: gdImageCreateFromJpegPtrEx Function: gdImageCreateFromJpegPtrEx
Parameters: Parameters:
size - size of JPEG data in bytes. size - size of JPEG data in bytes.
data - pointer to JPEG data. data - pointer to JPEG data.
ignore_warning - if true, ignore recoverable warnings ignore_warning - if true, ignore recoverable warnings

View File

@ -333,4 +333,3 @@ BGD_DECLARE(int) gdAffineEqual (const double m1[6], const double m2[6])
fabs (m1[4] - m2[4]) < GD_EPSILON && fabs (m1[4] - m2[4]) < GD_EPSILON &&
fabs (m1[5] - m2[5]) < GD_EPSILON); fabs (m1[5] - m2[5]) < GD_EPSILON);
} }

View File

@ -464,7 +464,7 @@ int verbose;
radius = initradius; radius = initradius;
rad = radius >> radiusbiasshift; rad = radius >> radiusbiasshift;
for (i=0; i<rad; i++) for (i=0; i<rad; i++)
nnq->radpower[i] = alpha*(((rad*rad - i*i)*radbias)/(rad*rad)); nnq->radpower[i] = alpha*(((rad*rad - i*i)*radbias)/(rad*rad));

View File

@ -15,5 +15,3 @@
#define prime4 503 #define prime4 503
#define minpicturebytes (4*prime4) /* minimum size for input image */ #define minpicturebytes (4*prime4) /* minimum size for input image */

View File

@ -592,7 +592,7 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromPngCtx (gdIOCtx * infile)
gdImagePtr im; gdImagePtr im;
int black, white; int black, white;
FILE *out; FILE *out;
im = gdImageCreate(100, 100); // Create the image im = gdImageCreate(100, 100); // Create the image
white = gdImageColorAllocate(im, 255, 255, 255); // Alloc background white = gdImageColorAllocate(im, 255, 255, 255); // Alloc background
black = gdImageColorAllocate(im, 0, 0, 0); // Allocate drawing color black = gdImageColorAllocate(im, 0, 0, 0); // Allocate drawing color

View File

@ -790,7 +790,7 @@ static int createFromTiffRgba(TIFF * tif, gdImagePtr im)
rgba = buffer[(y * width + x)]; rgba = buffer[(y * width + x)];
a = (0xff - TIFFGetA(rgba)) / 2; a = (0xff - TIFFGetA(rgba)) / 2;
color = gdTrueColorAlpha(TIFFGetR(rgba), TIFFGetG(rgba), TIFFGetB(rgba), a); color = gdTrueColorAlpha(TIFFGetR(rgba), TIFFGetG(rgba), TIFFGetB(rgba), a);
/* set pixel colour to this colour */ /* set pixel colour to this colour */
gdImageSetPixel(im, x, height - y - 1, color); gdImageSetPixel(im, x, height - y - 1, color);
} }
@ -993,10 +993,10 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromTiffCtx(gdIOCtx *infile)
goto error; goto error;
} }
if (TIFFGetField(tif, TIFFTAG_XRESOLUTION, &res_float)) { if (TIFFGetField(tif, TIFFTAG_XRESOLUTION, &res_float)) {
im->res_x = (unsigned int)res_float; //truncate im->res_x = (unsigned int)res_float; //truncate
} }
if (TIFFGetField(tif, TIFFTAG_YRESOLUTION, &res_float)) { if (TIFFGetField(tif, TIFFTAG_YRESOLUTION, &res_float)) {
im->res_y = (unsigned int)res_float; //truncate im->res_y = (unsigned int)res_float; //truncate
} }

View File

@ -1383,7 +1383,7 @@ zeroHistogram (hist3d histogram)
* method - The quantization method, see <gdPaletteQuantizationMethod>. * method - The quantization method, see <gdPaletteQuantizationMethod>.
* speed - The quantization speed between 1 (highest quality) and * speed - The quantization speed between 1 (highest quality) and
* 10 (fastest). 0 selects a method-specific default (recommended). * 10 (fastest). 0 selects a method-specific default (recommended).
* *
* Returns: * Returns:
* Zero if the given method is invalid or not available; non-zero otherwise. * Zero if the given method is invalid or not available; non-zero otherwise.
* *
@ -1451,7 +1451,7 @@ static int gdImageTrueColorToPaletteBody (gdImagePtr oim, int dither, int colors
* *
* Returns: * Returns:
* A newly create palette image; NULL on failure. * A newly create palette image; NULL on failure.
* *
* See also: * See also:
* - <gdImageCreatePaletteFromTrueColor> * - <gdImageCreatePaletteFromTrueColor>
* - <gdImageTrueColorToPaletteSetMethod> * - <gdImageTrueColorToPaletteSetMethod>
@ -1586,7 +1586,7 @@ static int gdImageTrueColorToPaletteBody (gdImagePtr oim, int dither, int colors
nim = gdImageNeuQuant(oim, colorsWanted, oim->paletteQuantizationSpeed ? oim->paletteQuantizationSpeed : 2); nim = gdImageNeuQuant(oim, colorsWanted, oim->paletteQuantizationSpeed ? oim->paletteQuantizationSpeed : 2);
if (cimP) { if (cimP) {
*cimP = nim; *cimP = nim;
} }
if (!nim) { if (!nim) {
return FALSE; return FALSE;
} else { } else {

View File

@ -120,5 +120,3 @@ BGD_DECLARE(void) gdImageFlipBoth(gdImagePtr im)
gdImageFlipVertical(im); gdImageFlipVertical(im);
gdImageFlipHorizontal(im); gdImageFlipHorizontal(im);
} }

View File

@ -134,7 +134,7 @@ BGD_DECLARE(void) gdImageWBMPCtx(gdImagePtr image, int fg, gdIOCtx *out)
Function: gdImageCreateFromWBMPCtx Function: gdImageCreateFromWBMPCtx
Reads in a WBMP image via a <gdIOCtx> struct. See Reads in a WBMP image via a <gdIOCtx> struct. See
<gdImageCreateFromWBMP>. <gdImageCreateFromWBMP>.
*/ */
BGD_DECLARE(gdImagePtr) gdImageCreateFromWBMPCtx(gdIOCtx *infile) BGD_DECLARE(gdImagePtr) gdImageCreateFromWBMPCtx(gdIOCtx *infile)
{ {

View File

@ -212,7 +212,7 @@ static int _gdImageWebpCtx (gdImagePtr im, gdIOCtx * outfile, int quality)
} }
*(p++) = gdTrueColorGetRed(c); *(p++) = gdTrueColorGetRed(c);
*(p++) = gdTrueColorGetGreen(c); *(p++) = gdTrueColorGetGreen(c);
*(p++) = gdTrueColorGetBlue(c); *(p++) = gdTrueColorGetBlue(c);
*(p++) = a; *(p++) = a;
} }
} }

View File

@ -220,7 +220,7 @@ static void gdCtxPrintf(gdIOCtx * out, const char *format, ...)
* gd - Which color to use as forground color. All pixels with another * gd - Which color to use as forground color. All pixels with another
* color are unset. * color are unset.
* out - The <gdIOCtx> to write the image file to. * out - The <gdIOCtx> to write the image file to.
* *
*/ */
BGD_DECLARE(void) gdImageXbmCtx(gdImagePtr image, char* file_name, int fg, gdIOCtx * out) BGD_DECLARE(void) gdImageXbmCtx(gdImagePtr image, char* file_name, int fg, gdIOCtx * out)
{ {

View File

@ -89,5 +89,3 @@ void CompareImages(char *msg, gdImagePtr im1, gdImagePtr im2)
printf("-%s: INFO actual colours of pixels differ\n",msg); printf("-%s: INFO actual colours of pixels differ\n",msg);
} }
} }

View File

@ -973,13 +973,13 @@ BGD_DECLARE(int) gdFontCacheSetup (void)
typedef struct { typedef struct {
// logical OR of gdFTEX_ values // logical OR of gdFTEX_ values
int flags; int flags;
// fine tune line spacing for '\n' // fine tune line spacing for '\n'
double linespacing; double linespacing;
// Preferred character mapping // Preferred character mapping
int charmap; int charmap;
// Rendering resolution // Rendering resolution
int hdpi; int hdpi;
int vdpi; int vdpi;
@ -1083,7 +1083,7 @@ BGD_DECLARE(int) gdFontCacheSetup (void)
> flags | gdFTEX_FONTPATHNAME; > flags | gdFTEX_FONTPATHNAME;
For more information, see <gdImageStringFT>. For more information, see <gdImageStringFT>.
*/ */
/* the platform-independent resolution used for size and position calculations */ /* the platform-independent resolution used for size and position calculations */
@ -1923,4 +1923,3 @@ BGD_DECLARE(int) gdFTUseFontConfig(int flag)
return 0; return 0;
#endif /* HAVE_LIBFONTCONFIG */ #endif /* HAVE_LIBFONTCONFIG */
} }

View File

@ -522,4 +522,3 @@ gdImageSharpen (gdImagePtr im, int pct)
} }
} }
} }

View File

@ -114,5 +114,3 @@ BGD_DECLARE(void) gdFree (void *ptr)
{ {
free (ptr); free (ptr);
} }

View File

@ -6,7 +6,7 @@
*******************************************************************************/ *******************************************************************************/
/** \file gdpp.cxx /** \file gdpp.cxx
\brief Implements the non-trivial methods of GD::Image. \brief Implements the non-trivial methods of GD::Image.
Implementation of the more complex methods defined Implementation of the more complex methods defined
in gdpp.h. in gdpp.h.
Notably includes the methods which determine the image file Notably includes the methods which determine the image file
@ -19,13 +19,13 @@ namespace GD
{ {
/** /**
Load an image from a file, after attempting to Load an image from a file, after attempting to
determine it's image file format. determine it's image file format.
Invoke CreateFrom with an already opened Invoke CreateFrom with an already opened
pointer to a file containing the desired image. pointer to a file containing the desired image.
CreateFrom does not close the file. CreateFrom does not close the file.
\param[in] in An opened FILE * pointer. \param[in] in An opened FILE * pointer.
\return true for success, or false if unable to load the image (most often because the \return true for success, or false if unable to load the image (most often because the
file is corrupt or does not contain a recognized image format). file is corrupt or does not contain a recognized image format).
You can call Width() and Height() member functions of the image to determine its size. You can call Width() and Height() member functions of the image to determine its size.
*/ */
bool Image::CreateFrom(FILE * in) bool Image::CreateFrom(FILE * in)
@ -54,36 +54,36 @@ namespace GD
#ifdef HAVE_LIBJPEG #ifdef HAVE_LIBJPEG
/* JPEG /* JPEG
A JFIF-standard file will start with the four bytes (hex) FF D8 FF E0, A JFIF-standard file will start with the four bytes (hex) FF D8 FF E0,
followed by two variable bytes (often hex 00 10), followed by 'JFIF'. followed by two variable bytes (often hex 00 10), followed by 'JFIF'.
*/ */
case 0xFF: // JPEG case 0xFF: // JPEG
rtn = CreateFromJpeg(in); rtn = CreateFromJpeg(in);
break; break;
#endif #endif
/* WBMP /* WBMP
WBMP Type 0: B/W, Uncompressed bitmap is the only gd supported type WBMP Type 0: B/W, Uncompressed bitmap is the only gd supported type
*/ */
case 0x00: // WBMP case 0x00: // WBMP
rtn = CreateFromWBMP(in); rtn = CreateFromWBMP(in);
break; break;
/* GD2 /* GD2
0x67 0x64 0x32 0x00 0x67 0x64 0x32 0x00
== GD2\0 == GD2\0
Starts with gd2 Starts with gd2
*/ */
case 0x67: // GD2 case 0x67: // GD2
rtn = CreateFromGd2(in); rtn = CreateFromGd2(in);
break; break;
/* GD /* GD
0xFF 0xFE 0xFF 0xFE
or or
0xFF 0xFF 0xFF 0xFF
Conflicts with Jpeg Conflicts with Jpeg
*/ */
/* XBM /* XBM
#define test_width 16 #define test_width 16
#define test_height 7 #define test_height 7
*/ */
case 0x23: // XBM case 0x23: // XBM
rtn = CreateFromXbm(in); rtn = CreateFromXbm(in);
break; break;
@ -91,18 +91,18 @@ namespace GD
rtn = false; rtn = false;
break; break;
} }
return rtn; return rtn;
} }
/** /**
Load an image from a standard input stream, after attempting to Load an image from a standard input stream, after attempting to
determine it's image file format. determine it's image file format.
Invoke CreateFrom with an already opened stream Invoke CreateFrom with an already opened stream
containing the desired image. containing the desired image.
CreateFrom does not close the stream. CreateFrom does not close the stream.
\param[in] in An opened standard library input stream. \param[in] in An opened standard library input stream.
\return true for success, or false if unable to load the image (most often because the \return true for success, or false if unable to load the image (most often because the
file is corrupt or does not contain a recognized image format). file is corrupt or does not contain a recognized image format).
You can call Width() and Height() member functions of the image to determine its size. You can call Width() and Height() member functions of the image to determine its size.
Example usage, convert anything to gif: Example usage, convert anything to gif:
#include <fstream> #include <fstream>
@ -143,7 +143,7 @@ namespace GD
#ifdef HAVE_LIBJPEG #ifdef HAVE_LIBJPEG
/* JPEG /* JPEG
A JFIF-standard file will start with the four bytes (hex) FF D8 FF E0, A JFIF-standard file will start with the four bytes (hex) FF D8 FF E0,
followed by two variable bytes (often hex 00 10), followed by 'JFIF'. followed by two variable bytes (often hex 00 10), followed by 'JFIF'.
*/ */
case 0xFF: // JPEG case 0xFF: // JPEG
rtn = CreateFromJpeg(in); rtn = CreateFromJpeg(in);
@ -151,40 +151,40 @@ namespace GD
#endif #endif
/* WBMP /* WBMP
WBMP Type 0: B/W, Uncompressed bitmap is the only gd supported type WBMP Type 0: B/W, Uncompressed bitmap is the only gd supported type
*/ */
case 0x00: // WBMP case 0x00: // WBMP
rtn = CreateFromWBMP(in); rtn = CreateFromWBMP(in);
break; break;
/* GD2 /* GD2
0x67 0x64 0x32 0x00 0x67 0x64 0x32 0x00
== GD2\0 == GD2\0
Starts with gd2 Starts with gd2
*/ */
case 0x67: // GD2 case 0x67: // GD2
rtn = CreateFromGd2(in); rtn = CreateFromGd2(in);
break; break;
/* GD /* GD
0xFF 0xFE 0xFF 0xFE
or or
0xFF 0xFF 0xFF 0xFF
Conflicts with Jpeg Conflicts with Jpeg
*/ */
default: default:
rtn = false; rtn = false;
break; break;
} }
return rtn; return rtn;
} }
/** /**
Load an image from an in-RAM memory block, after attempting to Load an image from an in-RAM memory block, after attempting to
determine it's image format. determine it's image format.
CreateFrom does not de-allocate the memory. CreateFrom does not de-allocate the memory.
\param[in] size The byte count of the memory block. \param[in] size The byte count of the memory block.
\param[in] data A pointer to the memory block. \param[in] data A pointer to the memory block.
\return true for success, or false if unable to load the image (most often because the \return true for success, or false if unable to load the image (most often because the
formatting is corrupt or does not contain a recognized image format). formatting is corrupt or does not contain a recognized image format).
You can call Width() and Height() member functions of the image to determine its size. You can call Width() and Height() member functions of the image to determine its size.
*/ */
bool Image::CreateFrom(int size, void * data) bool Image::CreateFrom(int size, void * data)
@ -213,7 +213,7 @@ namespace GD
#ifdef HAVE_LIBJPEG #ifdef HAVE_LIBJPEG
/* JPEG /* JPEG
A JFIF-standard file will start with the four bytes (hex) FF D8 FF E0, A JFIF-standard file will start with the four bytes (hex) FF D8 FF E0,
followed by two variable bytes (often hex 00 10), followed by 'JFIF'. followed by two variable bytes (often hex 00 10), followed by 'JFIF'.
*/ */
case 0xFF: // JPEG case 0xFF: // JPEG
rtn = CreateFromJpeg(size, data); rtn = CreateFromJpeg(size, data);
@ -221,34 +221,34 @@ namespace GD
#endif #endif
/* WBMP /* WBMP
WBMP Type 0: B/W, Uncompressed bitmap is the only gd supported type WBMP Type 0: B/W, Uncompressed bitmap is the only gd supported type
*/ */
case 0x00: // WBMP case 0x00: // WBMP
rtn = CreateFromWBMP(size, data); rtn = CreateFromWBMP(size, data);
break; break;
/* GD2 /* GD2
0x67 0x64 0x32 0x00 0x67 0x64 0x32 0x00
== GD2\0 == GD2\0
Starts with gd2 Starts with gd2
*/ */
case 0x67: // GD2 case 0x67: // GD2
rtn = CreateFromGd2(size, data); rtn = CreateFromGd2(size, data);
break; break;
/* GD /* GD
0xFF 0xFE 0xFF 0xFE
or or
0xFF 0xFF 0xFF 0xFF
Conflicts with Jpeg Conflicts with Jpeg
*/ */
default: default:
rtn = false; rtn = false;
break; break;
} }
return rtn; return rtn;
} }
} // namespace GD } // namespace GD
/** /**
Load an image from a standard input stream, regardless of it's image file format. Load an image from a standard input stream, regardless of it's image file format.
You can call Width() and Height() member functions of the image to determine its size. You can call Width() and Height() member functions of the image to determine its size.
Example usage, convert anything to gif: Example usage, convert anything to gif:
#include <fstream> #include <fstream>

View File

@ -87,12 +87,12 @@ main (int argc, char **argv)
} }
im2 = gdImageCreateFromPng (in); im2 = gdImageCreateFromPng (in);
fclose (in); fclose (in);
if (!im2) { if (!im2) {
fprintf(stderr, "gdImageCreateFromPng failed.\n"); fprintf(stderr, "gdImageCreateFromPng failed.\n");
exit (1); exit (1);
} }
CompareImages ("GD->PNG File->GD", ref, im2); CompareImages ("GD->PNG File->GD", ref, im2);
unlink (of); unlink (of);
@ -196,7 +196,7 @@ main (int argc, char **argv)
fprintf(stderr, "gdImageCreateFromGdPtr failed.\n"); fprintf(stderr, "gdImageCreateFromGdPtr failed.\n");
exit (1); exit (1);
} }
CompareImages ("GD->GD ptr->GD", ref, im2); CompareImages ("GD->GD ptr->GD", ref, im2);
gdImageDestroy (im2); gdImageDestroy (im2);

View File

@ -32,4 +32,3 @@ int main(void)
gdImageDestroy(im); gdImageDestroy(im);
return 0; return 0;
} }

View File

@ -49,4 +49,3 @@ int main(int argc, char **argv)
return 0; return 0;
} }

View File

@ -1,32 +1,32 @@
// ISO C9x compliant inttypes.h for Microsoft Visual Studio // ISO C9x compliant inttypes.h for Microsoft Visual Studio
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
// //
// Copyright (c) 2006 Alexander Chemeris // Copyright (c) 2006 Alexander Chemeris
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
// //
// 1. Redistributions of source code must retain the above copyright notice, // 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
// //
// 2. Redistributions in binary form must reproduce the above copyright // 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the // notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution. // documentation and/or other materials provided with the distribution.
// //
// 3. The name of the author may be used to endorse or promote products // 3. The name of the author may be used to endorse or promote products
// derived from this software without specific prior written permission. // derived from this software without specific prior written permission.
// //
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// //
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#ifndef _MSC_VER // [ #ifndef _MSC_VER // [

View File

@ -1,32 +1,32 @@
// ISO C9x compliant stdint.h for Microsoft Visual Studio // ISO C9x compliant stdint.h for Microsoft Visual Studio
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
// //
// Copyright (c) 2006-2008 Alexander Chemeris // Copyright (c) 2006-2008 Alexander Chemeris
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
// //
// 1. Redistributions of source code must retain the above copyright notice, // 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
// //
// 2. Redistributions in binary form must reproduce the above copyright // 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the // notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution. // documentation and/or other materials provided with the distribution.
// //
// 3. The name of the author may be used to endorse or promote products // 3. The name of the author may be used to endorse or promote products
// derived from this software without specific prior written permission. // derived from this software without specific prior written permission.
// //
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// //
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#ifndef _MSC_VER // [ #ifndef _MSC_VER // [

View File

@ -1,5 +1,5 @@
if HAVE_LIBFREETYPE if HAVE_LIBFREETYPE
if HAVE_LIBPNG if HAVE_LIBPNG
libgd_test_programs += \ libgd_test_programs += \
freetype/bug00132 freetype/bug00132
endif endif

View File

@ -1,10 +1,10 @@
/** /**
* Test that invalid transparent colors can't be read * Test that invalid transparent colors can't be read
* *
* We're reading a corrupt palette image in GD format, which has only a single * We're reading a corrupt palette image in GD format, which has only a single
* palette entry, but claims that the transparent color would be 1. We check * palette entry, but claims that the transparent color would be 1. We check
* that the transparency is simply ignored in this case. * that the transparency is simply ignored in this case.
* *
* See also <https://github.com/libgd/libgd/issues/383> * See also <https://github.com/libgd/libgd/issues/383>
*/ */

View File

@ -1,10 +1,10 @@
/** /**
* Test that invalid transparent colors can't be read * Test that invalid transparent colors can't be read
* *
* We're reading a corrupt palette image in GD2 format, which has only a single * We're reading a corrupt palette image in GD2 format, which has only a single
* palette entry, but claims that the transparent color would be 1. We check * palette entry, but claims that the transparent color would be 1. We check
* that the transparency is simply ignored in this case. * that the transparency is simply ignored in this case.
* *
* See also <https://github.com/libgd/libgd/issues/383> * See also <https://github.com/libgd/libgd/issues/383>
*/ */

View File

@ -29,7 +29,7 @@ int main()
im = gdImageCreateFromGd2(fp); im = gdImageCreateFromGd2(fp);
fclose(fp); fclose(fp);
gdTestAssertMsg(im == NULL, "Image should have failed to be loaded\n"); gdTestAssertMsg(im == NULL, "Image should have failed to be loaded\n");
return gdNumFailures(); return gdNumFailures();

View File

@ -48,23 +48,23 @@ int main()
fp = gdTestFileOpen2("gdimagecopyresampled", "bug00201_src.png"); fp = gdTestFileOpen2("gdimagecopyresampled", "bug00201_src.png");
logo_source = gdImageCreateFromPng(fp); logo_source = gdImageCreateFromPng(fp);
fclose(fp); fclose(fp);
logo = blank_image(SRC_WIDTH,SRC_HEIGHT); logo = blank_image(SRC_WIDTH,SRC_HEIGHT);
gdImageAlphaBlending(logo, 0); gdImageAlphaBlending(logo, 0);
gdImageCopy(logo, logo_source, 0,0, 0,0, SRC_WIDTH,SRC_HEIGHT); gdImageCopy(logo, logo_source, 0,0, 0,0, SRC_WIDTH,SRC_HEIGHT);
gdImageDestroy(logo_source); gdImageDestroy(logo_source);
scaled_logo = blank_image(DEST_WIDTH,DEST_HEIGHT); scaled_logo = blank_image(DEST_WIDTH,DEST_HEIGHT);
gdImageAlphaBlending(scaled_logo, 0); gdImageAlphaBlending(scaled_logo, 0);
gdImageCopyResampled(scaled_logo, logo, 0,0, 0,0, 200,105, SRC_WIDTH,SRC_HEIGHT); gdImageCopyResampled(scaled_logo, logo, 0,0, 0,0, 200,105, SRC_WIDTH,SRC_HEIGHT);
gdImageDestroy(logo); gdImageDestroy(logo);
layers[0] = background; layers[0] = background;
layers[1] = scaled_logo; layers[1] = scaled_logo;
img = flatten(layers, 2, DEST_WIDTH, DEST_HEIGHT); img = flatten(layers, 2, DEST_WIDTH, DEST_HEIGHT);
gdImageDestroy(background); gdImageDestroy(background);
gdImageDestroy(scaled_logo); gdImageDestroy(scaled_logo);
gdAssertImageEqualsToFile("gdimagecopyresampled/bug00201_exp.png", img); gdAssertImageEqualsToFile("gdimagecopyresampled/bug00201_exp.png", img);
gdImageDestroy(img); gdImageDestroy(img);
return gdNumFailures(); return gdNumFailures();

View File

@ -1,6 +1,6 @@
/** /**
* Test that gdImageCrop() retains transparency * Test that gdImageCrop() retains transparency
* *
* We create an image with transparent pixels, crop the image, and check whether * We create an image with transparent pixels, crop the image, and check whether
* all pixels are identical to the respective source image. * all pixels are identical to the respective source image.
* *
@ -26,7 +26,7 @@ int main()
src = gdImageCreateTrueColor(WIDTH, HEIGHT); src = gdImageCreateTrueColor(WIDTH, HEIGHT);
gdImageAlphaBlending(src, gdEffectReplace); gdImageAlphaBlending(src, gdEffectReplace);
gdImageFilledRectangle(src, 0, 0, WIDTH-1, HEIGHT-1, gdImageFilledRectangle(src, 0, 0, WIDTH-1, HEIGHT-1,
gdTrueColorAlpha(gdRedMax, gdGreenMax, gdBlueMax, gdAlphaMax)); gdTrueColorAlpha(gdRedMax, gdGreenMax, gdBlueMax, gdAlphaMax));
dst = gdImageCrop(src, &crop); dst = gdImageCrop(src, &crop);

View File

@ -37,4 +37,3 @@ int main()
return error; return error;
} }

View File

@ -46,4 +46,3 @@ int main()
gdImageDestroy(tile); gdImageDestroy(tile);
return error; return error;
} }

View File

@ -51,4 +51,3 @@ int main()
gdImageDestroy(tile); gdImageDestroy(tile);
return error; return error;
} }

View File

@ -8,26 +8,26 @@ int main()
gdImagePtr im, tile; gdImagePtr im, tile;
int tile_red, tile_blue; int tile_red, tile_blue;
int error = 0; int error = 0;
im = gdImageCreate(200, 150); im = gdImageCreate(200, 150);
tile = gdImageCreateTrueColor(2, 2); tile = gdImageCreateTrueColor(2, 2);
tile_red = gdImageColorAllocate(tile, 255, 0, 0); tile_red = gdImageColorAllocate(tile, 255, 0, 0);
tile_blue = gdImageColorAllocate(tile, 0, 0, 255); tile_blue = gdImageColorAllocate(tile, 0, 0, 255);
gdImageSetPixel(tile, 0, 0, tile_red); gdImageSetPixel(tile, 0, 0, tile_red);
gdImageSetPixel(tile, 1, 1, tile_red); gdImageSetPixel(tile, 1, 1, tile_red);
gdImageSetPixel(tile, 1, 0, tile_blue); gdImageSetPixel(tile, 1, 0, tile_blue);
gdImageSetPixel(tile, 0, 1, tile_blue); gdImageSetPixel(tile, 0, 1, tile_blue);
gdImageSetTile(im, tile); gdImageSetTile(im, tile);
gdImageFill(im, 11, 12, gdTiled); gdImageFill(im, 11, 12, gdTiled);
if (!gdAssertImageEqualsToFile("gdimagefill/bug00104_1_exp.png", im)) { if (!gdAssertImageEqualsToFile("gdimagefill/bug00104_1_exp.png", im)) {
error = 1; error = 1;
} }
gdImageDestroy(im); gdImageDestroy(im);
gdImageDestroy(tile); gdImageDestroy(tile);
return error; return error;

View File

@ -12,7 +12,7 @@ int main()
goto exit; goto exit;
} }
gdImageAlphaBlending(im, gdEffectNormal); gdImageAlphaBlending(im, gdEffectNormal);
gdImageFilledRectangle(im, 0, 0, 140, 199, gdTrueColorAlpha(0,0,0,127)); gdImageFilledRectangle(im, 0, 0, 140, 199, gdTrueColorAlpha(0,0,0,127));
gdImageAlphaBlending(im, gdEffectAlphaBlend); gdImageAlphaBlending(im, gdEffectAlphaBlend);

View File

@ -24,4 +24,3 @@ int main()
return 1; return 1;
} }
} }

View File

@ -36,4 +36,3 @@ int main()
gdImageDestroy(im); gdImageDestroy(im);
return 0; return 0;
} }

View File

@ -24,4 +24,3 @@ int main()
return 1; return 1;
} }
} }

View File

@ -27,4 +27,3 @@ int main()
} }
} }

View File

@ -143,7 +143,7 @@ void do_crosstest()
{ {
gdImagePtr im = mkcross(); gdImagePtr im = mkcross();
gdImagePtr blurred; gdImagePtr blurred;
const int RADIUS = 16; const int RADIUS = 16;
gdTestAssert(!!im); gdTestAssert(!!im);

View File

@ -15,7 +15,7 @@ int main()
return 1; return 1;
} }
gdImageSetInterpolationMethod(im, GD_BELL); gdImageSetInterpolationMethod(im, GD_BELL);
/* here the call may pass if the system has enough memory (physical or swap) /* here the call may pass if the system has enough memory (physical or swap)
or fails (overflow check or alloc fails. or fails (overflow check or alloc fails.
in both cases the tests pass */ in both cases the tests pass */

View File

@ -5,7 +5,7 @@
* GD_QUANT_NEUQUANT has its trueColor flag unset. * GD_QUANT_NEUQUANT has its trueColor flag unset.
*/ */
#include "gd.h" #include "gd.h"
#include "gdtest.h" #include "gdtest.h"

View File

@ -60,7 +60,7 @@ gdImagePtr gdTestImageFromPng(const char *filename)
if (fp == NULL) { if (fp == NULL) {
return NULL; return NULL;
} }
image = gdImageCreateFromPng(fp); image = gdImageCreateFromPng(fp);
fclose(fp); fclose(fp);
return image; return image;
@ -306,7 +306,7 @@ char *gdTestTempFile(const char *template)
ret); ret);
gdTestAssert(error != 0); gdTestAssert(error != 0);
} else { } else {
sprintf(ret, "%s\\%s", tempdir, template); sprintf(ret, "%s\\%s", tempdir, template);
} }
} }
#else #else

View File

@ -29,4 +29,3 @@ int main()
gdImageDestroy(tile); gdImageDestroy(tile);
return 0; return 0;
} }

View File

@ -10,7 +10,7 @@ int main()
gdRect bbox; gdRect bbox;
gdRect area; gdRect area;
double affine[6]; double affine[6];
affine[0] = -0.965926; affine[0] = -0.965926;
affine[1] = -0.258819; affine[1] = -0.258819;
affine[2] = 0.258819; affine[2] = 0.258819;

View File

@ -1,6 +1,6 @@
/** /**
* Test that GIF reading does not loop infinitely * Test that GIF reading does not loop infinitely
* *
* We are reading a crafted GIF image which has been truncated. This would * We are reading a crafted GIF image which has been truncated. This would
* trigger an infinite loop formerly, but know bails out early, returning * trigger an infinite loop formerly, but know bails out early, returning
* NULL from gdImageCreateFromGif(). * NULL from gdImageCreateFromGif().

View File

@ -24,7 +24,7 @@ int main()
gdImageDestroy(im); gdImageDestroy(im);
return 1; return 1;
} }
gdImageDestroy(im); gdImageDestroy(im);
return 0; return 0;
} }

View File

@ -47,4 +47,4 @@ int main()
gdTestAssertMsg(length == 250, "expected to write 250 bytes; %jd bytes written", (intmax_t) length); gdTestAssertMsg(length == 250, "expected to write 250 bytes; %jd bytes written", (intmax_t) length);
return gdNumFailures(); return gdNumFailures();
} }
#endif #endif

View File

@ -38,7 +38,7 @@ BEGIN
VALUE "FileDescription", "LIBGD" "\0" VALUE "FileDescription", "LIBGD" "\0"
VALUE "FileVersion", GD_VERSION_STRING "\0" VALUE "FileVersion", GD_VERSION_STRING "\0"
VALUE "InternalName", "bgd.dll" "\0" VALUE "InternalName", "bgd.dll" "\0"
VALUE "LegalCopyright", "Copyright © 1997-2008 Thomas Boutell, Pierre A. Joye and contributors, see COPYING\0" VALUE "LegalCopyright", "Copyright © 1997-2008 Thomas Boutell, Pierre A. Joye and contributors, see COPYING\0"
VALUE "LegalTrademarks", "Thomas Boutell, Pierre A. Joye and contributors\0" VALUE "LegalTrademarks", "Thomas Boutell, Pierre A. Joye and contributors\0"
VALUE "OriginalFilename", "bgd.dll" "\0" VALUE "OriginalFilename", "bgd.dll" "\0"
VALUE "PrivateBuild", "\0" VALUE "PrivateBuild", "\0"
@ -56,4 +56,3 @@ END
#ifdef MC_INCLUDE #ifdef MC_INCLUDE
#include MC_INCLUDE #include MC_INCLUDE
#endif #endif

View File

@ -131,13 +131,3 @@ $(TARGET): $(OBJ)
$(OBJ) $(LIBS) $(OBJ) $(LIBS)
include deps.mk include deps.mk

Some files were not shown because too many files have changed in this diff Show More