Makefile now creates a zipfile containing the DLLs.
Resulting DLL no longer contains a version number in its name. (The
Windows convention is to ship the DLL with the program using it.
Versioning the name just makes it harder for scripts to find the DLL.)
Tweaked the README a bit.
Specified calling convention on function pointers. (This matters
under Windows).
Switched from rindex() to strrchr() (oops!).
Tidied the formatting a bit.
This changeset imports documention for gdImage to gdImagePng*() into
Natural Docs. Documention is based on the text of the original
manual, version 2.0.36 but adapted to better suit the format.
Subsequent changesets will introduce docs for subsequent manual
entries.
naturaldocs, when present, is invoked by bootstrap.sh. The completed
manual will be in docs/naturaldocs/html/index.html. It can also be
explicitly invoked by running docs/naturaldocs/run_docs.sh.
This change also removed docs/naturaldocs/project/Menu.txt, since it
currently contains no non-generated content and is prone to introduce
noise into the changeset.
This retrieves the interpolation method set via
gdImageSetInterpolationMethod(). It is a function instead of a macro
for the benefit of VMs that need a function pointer to call.
These are convenience functions which load or save image data to a
file. They are roughly equivalent to opening a file handle with
fopen() and calling gdImageCreateFrom*() or gdImage*() on the FILE
pointer. However, these functions identify the input or output format
from the filename suffix and call the appropriate read or write
function accordingly.
gdSupportsFileType() can be used to test if a specific file format
is supported.
Most scripting interfaces already do something like this but now
there's support for doing it from C as well.
This change also adds test cases for the code and naturaldocs
documentation.
Removed non-exported prototypes from gd.h. Where possible, made the
functions static and moved the rest of the prototypes to gd_intern.h.
Also removed redundant macros MIN/MAX macros from gd_interpolation.c
(since they're also defined in gd_intern.h) and tidied the formatting
a little.
gdImageCopyGaussianBlurred() returns a blurred copy of its argument.
Blurring is done in two passes to take advantage of the Gaussian
function's separability for. This makes the algorithm much faster
than single-pass implementations, especially for larger radii.
This change also adds documentation for the new function and the
existing blur (gdImageGaussianBlur()).
_gdScaleOneAxis() was clamping the alpha channel to 0..255 when it
should be clamping it to 0..127. This sometimes caused artifacts.
This change fixes that.
This change adds naturaldoc comments for the above function and type.
Text was adapted from the 2.0.36 manual.
It also fixes the formatting of the comment for gdInterpolationMethod
so that naturaldoc will extract it.
This changeset adds scripts and frontmatter for a user manual
for LibGD. The manual is written using naturaldoc. That is, the
actual manual (minus some front-matter taken from the manual for
version 2.0.36) is generated from specially-formatted comments in
the source code.
bootstrap.sh has been modified to also trigger generation of the
manual.
This change adds a Makefile and bash script for building and testing
libgd on Windows with MinGW and MSYS. This was written after I
concluded that it was easier and faster to just write a new Makefile
from scratch than to get autotools or CMake to play nicely with my
Windows installation.
gdImageAALine_thickness.c didn't explicitly return 0 on success.
gdimageline_bug5.c was not an actual test at all. It now confirms that the
tested operation (a line draw) alters the image it draws on. (Not ideal
but better than what it did before.)
Makefile.netware (via an AWK script) used to pull the version numbers
from configure.ac. Since they are no longer there, 'configure.ac' puts
them into 'configure' for Makefile.netware to find. This change makes
it look there.
NOTE: This has not been tested on a Netware system.
Up to now, the version numbers were defined in configure.ac and put
into gd.h by generating it from gd.h.in, replacing the values of
several C macros. This violates the DRY principle, won't work on a
dumb build system, confuses some dev tools and is just a huge headache
in general.
This change makes gd.h (no longer generated) the home of the version
number and provides a script (config/getver.pl) which can extract the
requested version components from the header file. configure.ac now
gets the version number from gd.h instead of vice versa.
In addition, there are now C functions that return the values of the
version macros. This is for the benefit of non-C code using the
library without access to the header file. It also provides a way to
get the version number of the library currently linked rather than the
header the program was compiled against. (This could change if the
shared library is updated without recompiling the program using it.)
Creates and shrinks a bunch of images using gdImageScale(), once per
mode in both palette and truecolor. It does not use GD_DEFAULT (which
is equivalent to one of the others) or GD_WEIGHTED4 (unsupported for
scaling).
Note that this test does not check if the resulting image looks anything
like the source.
Scaling (i.e. _gdScaleOneAxis()) used to accumulate the weighted
samples in unsigned char variables. This truncated the floating-point
result toward zero, leading to a darker image and quantization of
colour gradients.
This change switches to keeping the values in doubles and only
coverting the final sums to unsigned char. In addition to producing a
better result, it is also about 10-15% faster.
The conversion uses a couple of casts for speed. The behaviour is
defined by ANSI but only correct on computers using twos-complement
arithmetic. As such, this may break on obscure microcontrollers or
1960's-era minicomputers.
This testcase does some basic resizing using bicubic
interpolation and ensures the result is sane. It does
not verify image quality, just that the functions return
acceptible values.
Assertions in gdtest.c do nothing on failure except print a message.
This change also makes them keep a count of failures which can be
retrieved with the function 'gdNumFailures()', making it easy to
return an error status if an assertion condition fails.
Also added gdMaxPixelDiff(), a function to return the largest
difference between two corresponding pixels. Used to detect pixels
that are similar except for a little color change.
These changes improve readability without negatively affecting
correctness or performance.
1) The code to do horizontal and vertical scaling were mostly
identical. This change merges them.
2) The case where the original and result sizes were identical were
handled inefficiently (and probably incorrectly) by copying the source
to the destination with memcpy. This change makes a simple copy if
both dimensions are the same (i.e. no resizing is requested) and skips
resizing in the unchanged dimension if only one dimension is
different.
3) Other cleanups: removed dead code, improved variable names, added
assertions to document expections, etc.
_gdContributionsCalc would compute a window size and then adjust
the left and right positions of the window to make a window within
that size. However, it was storing the values in the struct *before*
it made the adjustment. This change fixes that.