diff --git a/.travis.yml b/.travis.yml index 582e779..c8d5c9b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ env: global: - VIPS_VERSION_MAJOR=8 - VIPS_VERSION_MINOR=6 - - VIPS_VERSION_MICRO=0 + - VIPS_VERSION_MICRO=3 - PATH=$HOME/vips/bin:$PATH - LD_LIBRARY_PATH=$HOME/vips/lib:$LD_LIBRARY_PATH - PKG_CONFIG_PATH=$HOME/vips/lib/pkgconfig:$PKG_CONFIG_PATH diff --git a/composer.json b/composer.json index e0fde80..ead46b0 100644 --- a/composer.json +++ b/composer.json @@ -19,12 +19,12 @@ "require": { "php": ">=7.0.11", "ext-vips": ">=0.1.2", - "psr/log": "^1.0.1" + "psr/log": "^1.0.2" }, "require-dev": { - "phpunit/phpunit": "^6.3", + "phpunit/phpunit": "^6.5", "phpdocumentor/phpdocumentor" : "^2.9", - "jakub-onderka/php-parallel-lint": "^0.9.2", + "jakub-onderka/php-parallel-lint": "^1.0.0", "squizlabs/php_codesniffer": "3.*" }, "autoload": { diff --git a/examples/generate_phpdoc.py b/examples/generate_phpdoc.py new file mode 100644 index 0000000..fd0f750 --- /dev/null +++ b/examples/generate_phpdoc.py @@ -0,0 +1,331 @@ +#!/usr/bin/env python + +from pyvips import Image, Operation, GValue, Error, \ + ffi, values_for_enum, vips_lib, gobject_lib, \ + type_map, type_name, type_from_name, nickname_find + +# This file generates the phpdoc comments for the magic methods and properties. +# It's in Python, since we use the whole of FFI, not just the +# small bit exposed by php-vips-ext. + +# Regenerate docs with something like: +# +# cd src +# python ../examples/generate_phpdoc.py + +# this needs pyvips +# +# pip install --user pyvips + +# map a Python gtype to PHP argument type names +gtype_to_php_arg = { + GValue.gbool_type: 'bool', + GValue.gint_type: 'integer', + GValue.gdouble_type: 'float', + GValue.gstr_type: 'string', + GValue.refstr_type: 'string', + GValue.genum_type: 'string', + GValue.gflags_type: 'integer', + GValue.gobject_type: 'string', + GValue.image_type: 'Image', + GValue.array_int_type: 'integer[]|integer', + GValue.array_double_type: 'float[]|float', + GValue.array_image_type: 'Image[]|Image', + GValue.blob_type: 'string' +} + +# php result type names are different, annoyingly, and very restricted +gtype_to_php_result = { + GValue.gbool_type: 'bool', + GValue.gint_type: 'integer', + GValue.gdouble_type: 'float', + GValue.gstr_type: 'string', + GValue.refstr_type: 'string', + GValue.genum_type: 'string', + GValue.gflags_type: 'integer', + GValue.gobject_type: 'string', + GValue.image_type: 'Image', + GValue.array_int_type: 'array', + GValue.array_double_type: 'array', + GValue.array_image_type: 'array', + GValue.blob_type: 'string' +} + +# values for VipsArgumentFlags +_REQUIRED = 1 +_INPUT = 16 +_OUTPUT = 32 +_DEPRECATED = 64 +_MODIFY = 128 + +# for VipsOperationFlags +_OPERATION_DEPRECATED = 8 + + +def gtype_to_php(gtype, result=False): + """Map a gtype to PHP type name we use to represent it. + """ + + fundamental = gobject_lib.g_type_fundamental(gtype) + + gtype_map = gtype_to_php_result if result else gtype_to_php_arg + + if gtype in gtype_map: + return gtype_map[gtype] + if fundamental in gtype_map: + return gtype_map[fundamental] + return '' + + +def remove_prefix(enum_str): + prefix = 'Vips' + + if enum_str.startswith(prefix): + return enum_str[len(prefix):] + + return enum_str + + +def generate_operation(operation_name): + op = Operation.new_from_name(operation_name) + + # we are only interested in non-deprecated args + args = [[name, flags] for name, flags in op.get_args() + if not flags & _DEPRECATED] + + # find the first required input image arg, if any ... that will be self + member_x = None + for name, flags in args: + if ((flags & _INPUT) != 0 and + (flags & _REQUIRED) != 0 and + op.get_typeof(name) == GValue.image_type): + member_x = name + break + + required_input = [name for name, flags in args + if (flags & _INPUT) != 0 and + (flags & _REQUIRED) != 0 and + name != member_x] + + required_output = [name for name, flags in args + if ((flags & _OUTPUT) != 0 and + (flags & _REQUIRED) != 0) or + ((flags & _INPUT) != 0 and + (flags & _REQUIRED) != 0 and + (flags & _MODIFY) != 0)] + + result = ' * @method ' + if member_x is None: + result += 'static ' + if len(required_output) == 0: + result += 'void ' + elif len(required_output) == 1: + result += '{0} '.format(gtype_to_php(op.get_typeof(required_output[0]), True)) + else: + # we generate a Returns: block for this case, see below + result += 'array ' + + result += '{0}('.format(operation_name) + for name in required_input: + gtype = op.get_typeof(name) + result += '{0} ${1}, '.format(gtype_to_php(gtype), name) + + result += 'array $options = []) ' + + description = op.get_description() + result += description[0].upper() + description[1:] + '.\n' + + # find any Enums we've referenced and output @see lines for them + for name in required_output + required_input: + gtype = op.get_typeof(name) + fundamental = gobject_lib.g_type_fundamental(gtype) + + if fundamental != GValue.genum_type: + continue + + result += ' * @see {0} for possible values for ${1}\n'.format(remove_prefix(type_name(gtype)), name) + + if len(required_output) > 1: + result += ' * Return array with: [\n' + for name in required_output: + gtype = op.get_typeof(name) + blurb = op.get_blurb(name) + result += ' * \'{0}\' => @type {1} {2}\n'.format(name, gtype_to_php(gtype), + blurb[0].upper() + blurb[1:]) + result += ' * ];\n' + + result += ' * @throws Exception\n' + + return result + + +preamble = """ + * @copyright 2016 John Cupitt + * @license https://opensource.org/licenses/MIT MIT + * @link https://github.com/jcupitt/php-vips + */ +""" + +class_header = """ * @category Images + * @package Jcupitt\\Vips + * @author John Cupitt + * @copyright 2016 John Cupitt + * @license https://opensource.org/licenses/MIT MIT + * @link https://github.com/jcupitt/php-vips +""" + + +def generate_auto_doc(filename): + all_nicknames = [] + + def add_nickname(gtype, a, b): + nickname = nickname_find(gtype) + try: + # can fail for abstract types + op = Operation.new_from_name(nickname) + + # we are only interested in non-deprecated operations + if (op.get_flags() & _OPERATION_DEPRECATED) == 0: + all_nicknames.append(nickname) + except Error: + pass + + type_map(gtype, add_nickname) + + return ffi.NULL + + type_map(type_from_name('VipsOperation'), add_nickname) + + # add 'missing' synonyms by hand + all_nicknames.append('crop') + + # make list unique and sort + all_nicknames = list(set(all_nicknames)) + all_nicknames.sort() + + # these have hand-written methods, don't autodoc them + no_generate = [ + 'bandjoin', + 'bandrank', + 'ifthenelse', + 'add', + 'subtract', + 'multiply', + 'divide', + 'remainder' + ] + all_nicknames = [x for x in all_nicknames if x not in no_generate] + + print('Generating {0} ...'.format(filename)) + + with open(filename, 'w') as f: + f.write(preamble) + f.write('\n') + f.write('namespace Jcupitt\\Vips;\n') + f.write('\n') + f.write('/**\n') + f.write(' * Autodocs for the Image class.\n') + f.write(class_header) + f.write(' *\n') + + for nickname in all_nicknames: + f.write(generate_operation(nickname)) + + f.write(' *\n') + + # all magic properties + tmp_file = Image.new_temp_file('%s.v') + all_properties = tmp_file.get_fields() + for name in all_properties: + php_name = name.replace('-', '_') + gtype = tmp_file.get_typeof(name) + fundamental = gobject_lib.g_type_fundamental(gtype) + + f.write(' * @property {0} ${1} {2}\n'.format(gtype_to_php(gtype), php_name, tmp_file.get_blurb(name))) + + if fundamental == GValue.genum_type: + f.write(' * @see {0} for possible values\n'.format(remove_prefix(type_name(gtype)))) + + f.write(' */\n') + f.write('abstract class ImageAutodoc\n') + f.write('{\n') + f.write('}\n') + + +def generate_enums(): + # otherwise we're missing some enums + vips_lib.vips_token_get_type() + vips_lib.vips_saveable_get_type() + vips_lib.vips_image_type_get_type() + + all_enums = [] + + def add_enum(gtype, a, b): + nickname = type_name(gtype) + all_enums.append(nickname) + + type_map(gtype, add_enum) + + return ffi.NULL + + type_map(type_from_name('GEnum'), add_enum) + + for name in all_enums: + gtype = type_from_name(name) + php_name = remove_prefix(name) + + print('Generating {0}.php ...'.format(php_name)) + + with open('{0}.php'.format(php_name), 'w') as f: + f.write(preamble) + f.write('\n') + f.write('namespace Jcupitt\\Vips;\n') + f.write('\n') + f.write('/**\n') + f.write(' * The {0} enum.\n'.format(php_name)) + f.write(class_header) + f.write(' */\n') + f.write('abstract class {0}\n'.format(php_name)) + f.write('{\n') + + for value in values_for_enum(gtype): + php_name = value.replace('-', '_').upper() + f.write(' const {0} = \'{1}\';\n'.format(php_name, value)) + + f.write('}\n') + + +generate_auto_doc('ImageAutodoc.php') +generate_enums() diff --git a/examples/generate_phpdoc.rb b/examples/generate_phpdoc.rb deleted file mode 100755 index 3d7fc16..0000000 --- a/examples/generate_phpdoc.rb +++ /dev/null @@ -1,347 +0,0 @@ -#!/usr/bin/env ruby - -require 'vips' - -# This file generates the phpdoc comments for the magic methods and properties. -# It's in Ruby, since we use the whole of gobject-introspection, not just the -# small bit exposed by php-vips-ext. - -# Regenerate docs with something like: -# -# cd src -# ../examples/generate_phpdoc.rb - -# this needs version 1.x of ruby-vips -# -# gem install ruby-vips -v 1.0.6 - -# gobject-introspection 3.0.7 crashes a lot if it GCs while doing -# something -GC.disable - -Vips::init("") - -# these have hand-written methods, don't autodoc them -$no_generate = %w( - bandjoin - bandrank - ifthenelse - add - subtract - multiply - divide - remainder - extract_area -) - -# Find all the vips enums -$enums = [] -Vips.constants.each do |name| - const = Vips.const_get name - if const.respond_to? :superclass and - const.superclass == GLib::Enum - $enums << name.to_s - end -end - -def enum?(name) - return true if $enums.include?(name) - - # is there a "Vips" at the front of the name? remove it and try the - # enums again - trim = name.to_s.tap{|s| s.slice!("Vips")} - return true if $enums.include?(trim) - - # is there a "::" at the front of the name? remove it and try the - # enums again - trim.slice! "::" - return true if $enums.include?(trim) - - return false -end - -# map Ruby type names to PHP argument type names -$to_php_map = { - "Vips::Image" => "Image", - "Image" => "Image", - "Array" => "integer[]|integer", - "Array" => "float[]|float", - "Array" => "Image[]|image", - "Integer" => "integer", - "gint" => "integer", - "guint64" => "integer", - "Double" => "float", - "gdouble" => "float", - "Float" => "float", - "String" => "string", - "Boolean" => "bool", - "gboolean" => "bool", - "Vips::Blob" => "string", - "gchararray" => "string", - "gpointer" => "string", -} - -# php result type names are different, annoyingly, and very restricted -$to_php_result_map = { - "Vips::Image" => "Image", - "Image" => "Image", - "Array" => "array", - "Array" => "array", - "Array" => "array", - "Integer" => "integer", - "gint" => "integer", - "guint64" => "integer", - "Double" => "float", - "gdouble" => "float", - "Float" => "float", - "String" => "string", - "Boolean" => "bool", - "gboolean" => "bool", - "Vips::Blob" => "string", - "gchararray" => "string", - "gpointer" => "string", -} - -def type_to_php(map, type) - return map[type] if map.include?(type) - return "string" if enum? type - - # no mapping found - puts "no mapping found for #{type}" - return "" -end - -class Vips::Argument - def to_php - type_to_php $to_php_map, type - end - - def to_php_result - type_to_php $to_php_result_map, type - end -end - -def generate_operation(file, op) - flags = op.flags - return if (flags & :deprecated) != 0 - nickname = Vips::nickname_find op.gtype - - return if $no_generate.include? nickname - - all_args = op.get_args.select {|arg| not arg.isset} - - # separate args into various categories - - required_input = all_args.select do |arg| - (arg.flags & :input) != 0 and - (arg.flags & :required) != 0 - end - - optional_input = all_args.select do |arg| - (arg.flags & :input) != 0 and - (arg.flags & :required) == 0 - end - - required_output = all_args.select do |arg| - (arg.flags & :output) != 0 and - (arg.flags & :required) != 0 - end - - # required input args with :modify are copied and appended to - # output - modified_required_input = required_input.select do |arg| - (arg.flags & :modify) != 0 - end - required_output += modified_required_input - - optional_output = all_args.select do |arg| - (arg.flags & :output) != 0 and - (arg.flags & :required) == 0 - end - - # optional input args with :modify are copied and appended to - # output - modified_optional_input = optional_input.select do |arg| - (arg.flags & :modify) != 0 - end - optional_output += modified_optional_input - - # find the first input image, if any ... we will be a method of this - # instance - member_x = required_input.find do |x| - x.gtype.type_is_a? GLib::Type["VipsImage"] - end - if member_x != nil - required_input.delete member_x - end - - file << " * @method " - file << "static " if not member_x - if required_output.length == 0 - file << "void " - elsif required_output.length == 1 - file << "#{required_output[0].to_php_result} " - else - # we generate a Returns: block for this case, see below - file << "array " - end - - file << "#{nickname}(" - - required_input.each do |arg| - file << "#{arg.to_php} $#{arg.name}, " - end - file << "array $options = []) " - - file << "#{op.description.capitalize}.\n" - - # find any Enums we've referenced and output @see lines for them - used_enums = [] - (required_output + required_input).each do |arg| - next if not enum? arg.type - file << " * @see #{arg.type} for possible values for $#{arg.name}\n" - end - - if required_output.length > 1 - file << " * Return array with: [\n" - required_output.each do |arg| - file << " * '#{arg.name}' => " - file << "@type #{arg.to_php} #{arg.blurb.capitalize}.\n" - end - file << " * ];\n" - end - - file << " * @throws Exception\n" -end - -def generate_class(file, gtype) - begin - # can fail for abstract types - # can't find a way to get to #abstract? from a gtype - op = Vips::Operation.new gtype.name - rescue - op = nil - end - - generate_operation(file, op) if op - - gtype.children.each {|x| generate_class file, x} -end - -preamble = < - * @copyright 2016 John Cupitt - * @license https://opensource.org/licenses/MIT MIT - * @link https://github.com/jcupitt/php-vips - */ -EOF - -class_header = < - * @copyright 2016 John Cupitt - * @license https://opensource.org/licenses/MIT MIT - * @link https://github.com/jcupitt/php-vips -EOF - -# The image class is the most complex -puts "Generating ImageAutodoc.php ..." -File.open("ImageAutodoc.php", "w") do |file| - file << preamble - file << "\n" - file << "namespace Jcupitt\\Vips;\n" - - file << "\n" - file << "/**\n" - file << " * Autodocs for the Image class.\n" - file << class_header - file << " *\n" - - generate_class file, GLib::Type["VipsOperation"] - -# extract_area is in there twice, once as "crop" ... do them by hand - file << < @type Image Sums of columns. - * 'rows' => @type Image Sums of rows. - * ]; + * @method Image boolean(Image $right, string $boolean, array $options = []) Boolean operation on two images. + * @see OperationBoolean for possible values for $boolean * @throws Exception - * @method array profile(array $options = []) Find image profiles. - * Return array with: [ - * 'columns' => @type Image First non-zero pixel in column. - * 'rows' => @type Image First non-zero pixel in row. - * ]; + * @method Image boolean_const(string $boolean, float[]|float $c, array $options = []) Boolean operations against a constant. + * @see OperationBoolean for possible values for $boolean * @throws Exception - * @method Image measure(integer $h, integer $v, array $options = []) Measure a set of patches on a colour chart. + * @method Image buildlut(array $options = []) Build a look-up table. * @throws Exception - * @method array getpoint(integer $x, integer $y, array $options = []) Read a point from an image. + * @method Image byteswap(array $options = []) Byteswap an image. * @throws Exception - * @method array find_trim(array $options = []) Search an image for non-edge areas. - * Return array with: [ - * 'left' => @type integer Left edge of image. - * 'top' => @type integer Top edge of extract area. - * 'width' => @type integer Width of extract area. - * 'height' => @type integer Height of extract area. - * ]; + * @method Image cache(array $options = []) Cache an image. * @throws Exception - * @method Image copy(array $options = []) Copy an image. + * @method Image cast(string $format, array $options = []) Cast an image. + * @see BandFormat for possible values for $format * @throws Exception - * @method Image tilecache(array $options = []) Cache an image as a set of tiles. + * @method Image colourspace(string $space, array $options = []) Convert to a new colorspace. + * @see Interpretation for possible values for $space * @throws Exception - * @method Image linecache(array $options = []) Cache an image as a set of lines. + * @method Image compass(Image $mask, array $options = []) Convolve with rotating mask. * @throws Exception - * @method Image sequential(array $options = []) Check sequential access. + * @method Image complex(string $cmplx, array $options = []) Perform a complex operation on an image. + * @see OperationComplex for possible values for $cmplx * @throws Exception - * @method Image cache(array $options = []) Cache an image. + * @method Image complex2(Image $right, string $cmplx, array $options = []) Complex binary operations on two images. + * @see OperationComplex2 for possible values for $cmplx * @throws Exception - * @method Image embed(integer $x, integer $y, integer $width, integer $height, array $options = []) Embed an image in a larger image. + * @method Image complexform(Image $right, array $options = []) Form a complex image from two real images. * @throws Exception - * @method Image gravity(string $direction, integer $width, integer $height, array $options = []) Place an image within a larger image with a certain gravity. - * @see CompassDirection for possible values for $direction + * @method Image complexget(string $get, array $options = []) Get a component from a complex image. + * @see OperationComplexget for possible values for $get * @throws Exception - * @method Image flip(string $direction, array $options = []) Flip an image. - * @see Direction for possible values for $direction + * @method static Image composite(Image[]|Image $in, integer[]|integer $mode, array $options = []) Blend an array of images with an array of blend modes. * @throws Exception - * @method Image insert(Image $sub, integer $x, integer $y, array $options = []) Insert image @sub into @main at @x, @y. + * @method Image composite2(Image $overlay, string $mode, array $options = []) Blend a pair of images with a blend mode. + * @see BlendMode for possible values for $mode * @throws Exception - * @method Image join(Image $in2, string $direction, array $options = []) Join a pair of images. - * @see Direction for possible values for $direction + * @method Image conv(Image $mask, array $options = []) Convolution operation. * @throws Exception - * @method static Image arrayjoin(Image[]|image $in, array $options = []) Join an array of images. + * @method Image conva(Image $mask, array $options = []) Approximate integer convolution. * @throws Exception - * @method Image smartcrop(integer $width, integer $height, array $options = []) Extract an area from an image. + * @method Image convasep(Image $mask, array $options = []) Approximate separable integer convolution. * @throws Exception - * @method Image extract_band(integer $band, array $options = []) Extract band from an image. + * @method Image convf(Image $mask, array $options = []) Float convolution operation. * @throws Exception - * @method Image bandjoin_const(float[]|float $c, array $options = []) Append a constant band to an image. + * @method Image convi(Image $mask, array $options = []) Int convolution operation. * @throws Exception - * @method Image bandmean(array $options = []) Band-wise average. + * @method Image convsep(Image $mask, array $options = []) Seperable convolution operation. * @throws Exception - * @method Image bandbool(string $boolean, array $options = []) Boolean operation across image bands. - * @see OperationBoolean for possible values for $boolean + * @method Image copy(array $options = []) Copy an image. * @throws Exception - * @method Image replicate(integer $across, integer $down, array $options = []) Replicate an image. + * @method float countlines(string $direction, array $options = []) Count lines in an image. + * @see Direction for possible values for $direction * @throws Exception - * @method Image cast(string $format, array $options = []) Cast an image. - * @see BandFormat for possible values for $format + * @method Image crop(integer $left, integer $top, integer $width, integer $height, array $options = []) Extract an area from an image. * @throws Exception - * @method Image rot(string $angle, array $options = []) Rotate an image. - * @see Angle for possible values for $angle + * @method static Image csvload(string $filename, array $options = []) Load csv from file. * @throws Exception - * @method Image rot45(array $options = []) Rotate an image. + * @method void csvsave(string $filename, array $options = []) Save image to csv file. * @throws Exception - * @method Image autorot(array $options = []) Autorotate image by exif tag. + * @method Image dE00(Image $right, array $options = []) Calculate dE00. * @throws Exception - * @method Image recomb(Image $m, array $options = []) Linear recombination with matrix. + * @method Image dE76(Image $right, array $options = []) Calculate dE76. * @throws Exception - * @method Image bandfold(array $options = []) Fold up x axis into bands. + * @method Image dECMC(Image $right, array $options = []) Calculate dECMC. * @throws Exception - * @method Image bandunfold(array $options = []) Unfold image bands into x axis. + * @method float deviate(array $options = []) Find image standard deviation. * @throws Exception - * @method Image flatten(array $options = []) Flatten alpha out of an image. + * @method Image draw_circle(float[]|float $ink, integer $cx, integer $cy, integer $radius, array $options = []) Draw a circle on an image. * @throws Exception - * @method Image premultiply(array $options = []) Premultiply image alpha. + * @method Image draw_flood(float[]|float $ink, integer $x, integer $y, array $options = []) Flood-fill an area. * @throws Exception - * @method Image unpremultiply(array $options = []) Unpremultiply image alpha. + * @method Image draw_image(Image $sub, integer $x, integer $y, array $options = []) Paint an image into another image. * @throws Exception - * @method Image grid(integer $tile_height, integer $across, integer $down, array $options = []) Grid an image. + * @method Image draw_line(float[]|float $ink, integer $x1, integer $y1, integer $x2, integer $y2, array $options = []) Draw a line on an image. * @throws Exception - * @method Image scale(array $options = []) Scale an image to uchar. + * @method Image draw_mask(float[]|float $ink, Image $mask, integer $x, integer $y, array $options = []) Draw a mask on an image. * @throws Exception - * @method Image wrap(array $options = []) Wrap image origin. + * @method Image draw_rect(float[]|float $ink, integer $left, integer $top, integer $width, integer $height, array $options = []) Paint a rectangle on an image. * @throws Exception - * @method Image zoom(integer $xfac, integer $yfac, array $options = []) Zoom an image. + * @method Image draw_smudge(integer $left, integer $top, integer $width, integer $height, array $options = []) Blur a rectangle on an image. * @throws Exception - * @method Image subsample(integer $xfac, integer $yfac, array $options = []) Subsample an image. + * @method void dzsave(string $filename, array $options = []) Save image to deepzoom file. * @throws Exception - * @method Image msb(array $options = []) Pick most-significant byte from an image. + * @method string dzsave_buffer(array $options = []) Save image to dz buffer. * @throws Exception - * @method Image byteswap(array $options = []) Byteswap an image. + * @method Image embed(integer $x, integer $y, integer $width, integer $height, array $options = []) Embed an image in a larger image. * @throws Exception - * @method Image falsecolour(array $options = []) False-colour an image. + * @method Image extract_area(integer $left, integer $top, integer $width, integer $height, array $options = []) Extract an area from an image. * @throws Exception - * @method Image gamma(array $options = []) Gamma an image. + * @method Image extract_band(integer $band, array $options = []) Extract band from an image. * @throws Exception - * @method static Image composite(Image[]|image $in, integer[]|integer $mode, array $options = []) Blend an array of images with an array of blend modes. + * @method static Image eye(integer $width, integer $height, array $options = []) Make an image showing the eye's spatial response. * @throws Exception - * @method Image composite2(Image $overlay, string $mode, array $options = []) Blend a pair of images with a blend mode. - * @see BlendMode for possible values for $mode + * @method Image falsecolour(array $options = []) False-color an image. * @throws Exception - * @method static Image black(integer $width, integer $height, array $options = []) Make a black image. + * @method Image fastcor(Image $ref, array $options = []) Fast correlation. * @throws Exception - * @method static Image gaussnoise(integer $width, integer $height, array $options = []) Make a gaussnoise image. + * @method Image fill_nearest(array $options = []) Fill image zeros with nearest non-zero pixel. * @throws Exception - * @method static Image text(string $text, array $options = []) Make a text image. + * @method array find_trim(array $options = []) Search an image for non-edge areas. + * Return array with: [ + * 'left' => @type integer Left edge of image + * 'top' => @type integer Top edge of extract area + * 'width' => @type integer Width of extract area + * 'height' => @type integer Height of extract area + * ]; * @throws Exception - * @method static Image xyz(integer $width, integer $height, array $options = []) Make an image where pixel values are coordinates. + * @method static Image fitsload(string $filename, array $options = []) Load a FITS image. * @throws Exception - * @method static Image gaussmat(float $sigma, float $min_ampl, array $options = []) Make a gaussian image. + * @method void fitssave(string $filename, array $options = []) Save image to fits file. * @throws Exception - * @method static Image logmat(float $sigma, float $min_ampl, array $options = []) Make a laplacian of gaussian image. + * @method Image flatten(array $options = []) Flatten alpha out of an image. * @throws Exception - * @method static Image eye(integer $width, integer $height, array $options = []) Make an image showing the eye's spatial response. + * @method Image flip(string $direction, array $options = []) Flip an image. + * @see Direction for possible values for $direction * @throws Exception - * @method static Image grey(integer $width, integer $height, array $options = []) Make a grey ramp image. + * @method Image float2rad(array $options = []) Transform float RGB to Radiance coding. * @throws Exception - * @method static Image zone(integer $width, integer $height, array $options = []) Make a zone plate. + * @method static Image fractsurf(integer $width, integer $height, float $fractal_dimension, array $options = []) Make a fractal surface. * @throws Exception - * @method static Image sines(integer $width, integer $height, array $options = []) Make a 2d sine wave. + * @method Image freqmult(Image $mask, array $options = []) Frequency-domain filtering. * @throws Exception - * @method static Image mask_ideal(integer $width, integer $height, float $frequency_cutoff, array $options = []) Make an ideal filter. + * @method Image fwfft(array $options = []) Forward FFT. * @throws Exception - * @method static Image mask_ideal_ring(integer $width, integer $height, float $frequency_cutoff, float $ringwidth, array $options = []) Make an ideal ring filter. + * @method Image gamma(array $options = []) Gamma an image. * @throws Exception - * @method static Image mask_ideal_band(integer $width, integer $height, float $frequency_cutoff_x, float $frequency_cutoff_y, float $radius, array $options = []) Make an ideal band filter. + * @method Image gaussblur(float $sigma, array $options = []) Gaussian blur. * @throws Exception - * @method static Image mask_butterworth(integer $width, integer $height, float $order, float $frequency_cutoff, float $amplitude_cutoff, array $options = []) Make a butterworth filter. + * @method static Image gaussmat(float $sigma, float $min_ampl, array $options = []) Make a gaussian image. * @throws Exception - * @method static Image mask_butterworth_ring(integer $width, integer $height, float $order, float $frequency_cutoff, float $amplitude_cutoff, float $ringwidth, array $options = []) Make a butterworth ring filter. + * @method static Image gaussnoise(integer $width, integer $height, array $options = []) Make a gaussnoise image. * @throws Exception - * @method static Image mask_butterworth_band(integer $width, integer $height, float $order, float $frequency_cutoff_x, float $frequency_cutoff_y, float $radius, float $amplitude_cutoff, array $options = []) Make a butterworth_band filter. + * @method array getpoint(integer $x, integer $y, array $options = []) Read a point from an image. * @throws Exception - * @method static Image mask_gaussian(integer $width, integer $height, float $frequency_cutoff, float $amplitude_cutoff, array $options = []) Make a gaussian filter. + * @method static Image gifload(string $filename, array $options = []) Load GIF with giflib. * @throws Exception - * @method static Image mask_gaussian_ring(integer $width, integer $height, float $frequency_cutoff, float $amplitude_cutoff, float $ringwidth, array $options = []) Make a gaussian ring filter. + * @method static Image gifload_buffer(string $buffer, array $options = []) Load GIF with giflib. * @throws Exception - * @method static Image mask_gaussian_band(integer $width, integer $height, float $frequency_cutoff_x, float $frequency_cutoff_y, float $radius, float $amplitude_cutoff, array $options = []) Make a gaussian filter. + * @method Image globalbalance(array $options = []) Global balance an image mosaic. * @throws Exception - * @method static Image mask_fractal(integer $width, integer $height, float $fractal_dimension, array $options = []) Make fractal filter. + * @method Image gravity(string $direction, integer $width, integer $height, array $options = []) Place an image within a larger image with a certain gravity. + * @see CompassDirection for possible values for $direction * @throws Exception - * @method Image buildlut(array $options = []) Build a look-up table. + * @method static Image grey(integer $width, integer $height, array $options = []) Make a grey ramp image. * @throws Exception - * @method Image invertlut(array $options = []) Build an inverted look-up table. + * @method Image grid(integer $tile_height, integer $across, integer $down, array $options = []) Grid an image. * @throws Exception - * @method static Image tonelut(array $options = []) Build a look-up table. + * @method Image hist_cum(array $options = []) Form cumulative histogram. * @throws Exception - * @method static Image identity(array $options = []) Make a 1d image where pixel values are indexes. + * @method float hist_entropy(array $options = []) Estimate image entropy. * @throws Exception - * @method static Image fractsurf(integer $width, integer $height, float $fractal_dimension, array $options = []) Make a fractal surface. + * @method Image hist_equal(array $options = []) Histogram equalisation. * @throws Exception - * @method static Image worley(integer $width, integer $height, array $options = []) Make a worley noise image. + * @method Image hist_find(array $options = []) Find image histogram. * @throws Exception - * @method static Image perlin(integer $width, integer $height, array $options = []) Make a perlin noise image. + * @method Image hist_find_indexed(Image $index, array $options = []) Find indexed image histogram. * @throws Exception - * @method static Image csvload(string $filename, array $options = []) Load csv from file. + * @method Image hist_find_ndim(array $options = []) Find n-dimensional image histogram. * @throws Exception - * @method static Image matrixload(string $filename, array $options = []) Load matrix from file. + * @method bool hist_ismonotonic(array $options = []) Test for monotonicity. * @throws Exception - * @method static Image rawload(string $filename, integer $width, integer $height, integer $bands, array $options = []) Load raw data from a file. + * @method Image hist_local(integer $width, integer $height, array $options = []) Local histogram equalisation. * @throws Exception - * @method static Image vipsload(string $filename, array $options = []) Load vips from file. + * @method Image hist_match(Image $ref, array $options = []) Match two histograms. * @throws Exception - * @method static Image analyzeload(string $filename, array $options = []) Load an analyze6 image. + * @method Image hist_norm(array $options = []) Normalise histogram. * @throws Exception - * @method static Image ppmload(string $filename, array $options = []) Load ppm from file. + * @method Image hist_plot(array $options = []) Plot histogram. * @throws Exception - * @method static Image radload(string $filename, array $options = []) Load a radiance image from a file. + * @method Image hough_circle(array $options = []) Find hough circle transform. * @throws Exception - * @method static Image pdfload(string $filename, array $options = []) Load pdf with libpoppler. + * @method Image hough_line(array $options = []) Find hough line transform. * @throws Exception - * @method static Image pdfload_buffer(string $buffer, array $options = []) Load pdf with libpoppler. + * @method Image icc_export(array $options = []) Output to device with ICC profile. * @throws Exception - * @method static Image svgload(string $filename, array $options = []) Load svg with rsvg. + * @method Image icc_import(array $options = []) Import from device with ICC profile. * @throws Exception - * @method static Image svgload_buffer(string $buffer, array $options = []) Load svg with rsvg. + * @method Image icc_transform(string $output_profile, array $options = []) Transform between devices with ICC profiles. * @throws Exception - * @method static Image gifload(string $filename, array $options = []) Load gif with giflib. + * @method static Image identity(array $options = []) Make a 1D image where pixel values are indexes. * @throws Exception - * @method static Image gifload_buffer(string $buffer, array $options = []) Load gif with giflib. + * @method Image insert(Image $sub, integer $x, integer $y, array $options = []) Insert image @sub into @main at @x, @y. * @throws Exception - * @method static Image pngload(string $filename, array $options = []) Load png from file. + * @method Image invert(array $options = []) Invert an image. * @throws Exception - * @method static Image pngload_buffer(string $buffer, array $options = []) Load png from buffer. + * @method Image invertlut(array $options = []) Build an inverted look-up table. * @throws Exception - * @method static Image matload(string $filename, array $options = []) Load mat from file. + * @method Image invfft(array $options = []) Inverse FFT. + * @throws Exception + * @method Image join(Image $in2, string $direction, array $options = []) Join a pair of images. + * @see Direction for possible values for $direction * @throws Exception * @method static Image jpegload(string $filename, array $options = []) Load jpeg from file. * @throws Exception * @method static Image jpegload_buffer(string $buffer, array $options = []) Load jpeg from buffer. * @throws Exception - * @method static Image webpload(string $filename, array $options = []) Load webp from file. + * @method void jpegsave(string $filename, array $options = []) Save image to jpeg file. * @throws Exception - * @method static Image webpload_buffer(string $buffer, array $options = []) Load webp from buffer. + * @method string jpegsave_buffer(array $options = []) Save image to jpeg buffer. * @throws Exception - * @method static Image tiffload(string $filename, array $options = []) Load tiff from file. + * @method void jpegsave_mime(array $options = []) Save image to jpeg mime. * @throws Exception - * @method static Image tiffload_buffer(string $buffer, array $options = []) Load tiff from buffer. + * @method Image labelregions(array $options = []) Label regions in an image. * @throws Exception - * @method static Image openslideload(string $filename, array $options = []) Load file with openslide. + * @method Image linear(float[]|float $a, float[]|float $b, array $options = []) Calculate (a * in + b). * @throws Exception - * @method static Image magickload(string $filename, array $options = []) Load file with imagemagick. + * @method Image linecache(array $options = []) Cache an image as a set of lines. * @throws Exception - * @method static Image magickload_buffer(string $buffer, array $options = []) Load buffer with imagemagick. + * @method static Image logmat(float $sigma, float $min_ampl, array $options = []) Make a laplacian of gaussian image. * @throws Exception - * @method static Image fitsload(string $filename, array $options = []) Load a fits image. + * @method static Image magickload(string $filename, array $options = []) Load file with ImageMagick. * @throws Exception - * @method static Image openexrload(string $filename, array $options = []) Load an openexr image. + * @method static Image magickload_buffer(string $buffer, array $options = []) Load buffer with ImageMagick. * @throws Exception - * @method void csvsave(string $filename, array $options = []) Save image to csv file. + * @method Image mapim(Image $index, array $options = []) Resample with an mapim image. * @throws Exception - * @method void matrixsave(string $filename, array $options = []) Save image to matrix file. + * @method Image maplut(Image $lut, array $options = []) Map an image though a lut. * @throws Exception - * @method void matrixprint(array $options = []) Print matrix. + * @method static Image mask_butterworth(integer $width, integer $height, float $order, float $frequency_cutoff, float $amplitude_cutoff, array $options = []) Make a butterworth filter. * @throws Exception - * @method void rawsave(string $filename, array $options = []) Save image to raw file. + * @method static Image mask_butterworth_band(integer $width, integer $height, float $order, float $frequency_cutoff_x, float $frequency_cutoff_y, float $radius, float $amplitude_cutoff, array $options = []) Make a butterworth_band filter. * @throws Exception - * @method void rawsave_fd(integer $fd, array $options = []) Write raw image to file descriptor. + * @method static Image mask_butterworth_ring(integer $width, integer $height, float $order, float $frequency_cutoff, float $amplitude_cutoff, float $ringwidth, array $options = []) Make a butterworth ring filter. * @throws Exception - * @method void vipssave(string $filename, array $options = []) Save image to vips file. + * @method static Image mask_fractal(integer $width, integer $height, float $fractal_dimension, array $options = []) Make fractal filter. * @throws Exception - * @method void ppmsave(string $filename, array $options = []) Save image to ppm file. + * @method static Image mask_gaussian(integer $width, integer $height, float $frequency_cutoff, float $amplitude_cutoff, array $options = []) Make a gaussian filter. * @throws Exception - * @method void radsave(string $filename, array $options = []) Save image to radiance file. + * @method static Image mask_gaussian_band(integer $width, integer $height, float $frequency_cutoff_x, float $frequency_cutoff_y, float $radius, float $amplitude_cutoff, array $options = []) Make a gaussian filter. * @throws Exception - * @method string radsave_buffer(array $options = []) Save image to radiance buffer. + * @method static Image mask_gaussian_ring(integer $width, integer $height, float $frequency_cutoff, float $amplitude_cutoff, float $ringwidth, array $options = []) Make a gaussian ring filter. * @throws Exception - * @method void dzsave(string $filename, array $options = []) Save image to deepzoom file. + * @method static Image mask_ideal(integer $width, integer $height, float $frequency_cutoff, array $options = []) Make an ideal filter. * @throws Exception - * @method string dzsave_buffer(array $options = []) Save image to dz buffer. + * @method static Image mask_ideal_band(integer $width, integer $height, float $frequency_cutoff_x, float $frequency_cutoff_y, float $radius, array $options = []) Make an ideal band filter. * @throws Exception - * @method void pngsave(string $filename, array $options = []) Save image to png file. + * @method static Image mask_ideal_ring(integer $width, integer $height, float $frequency_cutoff, float $ringwidth, array $options = []) Make an ideal ring filter. * @throws Exception - * @method string pngsave_buffer(array $options = []) Save image to png buffer. + * @method Image match(Image $sec, integer $xr1, integer $yr1, integer $xs1, integer $ys1, integer $xr2, integer $yr2, integer $xs2, integer $ys2, array $options = []) First-order match of two images. * @throws Exception - * @method void jpegsave(string $filename, array $options = []) Save image to jpeg file. + * @method Image math(string $math, array $options = []) Apply a math operation to an image. + * @see OperationMath for possible values for $math * @throws Exception - * @method string jpegsave_buffer(array $options = []) Save image to jpeg buffer. + * @method Image math2(Image $right, string $math2, array $options = []) Binary math operations. + * @see OperationMath2 for possible values for $math2 * @throws Exception - * @method void jpegsave_mime(array $options = []) Save image to jpeg mime. + * @method Image math2_const(string $math2, float[]|float $c, array $options = []) Binary math operations with a constant. + * @see OperationMath2 for possible values for $math2 * @throws Exception - * @method void webpsave(string $filename, array $options = []) Save image to webp file. + * @method static Image matload(string $filename, array $options = []) Load mat from file. * @throws Exception - * @method string webpsave_buffer(array $options = []) Save image to webp buffer. + * @method static Image matrixload(string $filename, array $options = []) Load matrix from file. * @throws Exception - * @method void tiffsave(string $filename, array $options = []) Save image to tiff file. + * @method void matrixprint(array $options = []) Print matrix. * @throws Exception - * @method string tiffsave_buffer(array $options = []) Save image to tiff buffer. + * @method void matrixsave(string $filename, array $options = []) Save image to matrix file. * @throws Exception - * @method void fitssave(string $filename, array $options = []) Save image to fits file. + * @method float max(array $options = []) Find image maximum. * @throws Exception - * @method static Image thumbnail(string $filename, integer $width, array $options = []) Generate thumbnail from file. + * @method Image measure(integer $h, integer $v, array $options = []) Measure a set of patches on a color chart. * @throws Exception - * @method static Image thumbnail_buffer(string $buffer, integer $width, array $options = []) Generate thumbnail from buffer. + * @method Image merge(Image $sec, string $direction, integer $dx, integer $dy, array $options = []) Merge two images. + * @see Direction for possible values for $direction * @throws Exception - * @method Image thumbnail_image(integer $width, array $options = []) Generate thumbnail from image. + * @method float min(array $options = []) Find image minimum. * @throws Exception - * @method Image mapim(Image $index, array $options = []) Resample with an mapim image. + * @method Image morph(Image $mask, string $morph, array $options = []) Morphology operation. + * @see OperationMorphology for possible values for $morph * @throws Exception - * @method Image shrink(float $hshrink, float $vshrink, array $options = []) Shrink an image. + * @method Image mosaic(Image $sec, string $direction, integer $xref, integer $yref, integer $xsec, integer $ysec, array $options = []) Mosaic two images. + * @see Direction for possible values for $direction * @throws Exception - * @method Image shrinkh(integer $hshrink, array $options = []) Shrink an image horizontally. + * @method Image mosaic1(Image $sec, string $direction, integer $xr1, integer $yr1, integer $xs1, integer $ys1, integer $xr2, integer $yr2, integer $xs2, integer $ys2, array $options = []) First-order mosaic of two images. + * @see Direction for possible values for $direction * @throws Exception - * @method Image shrinkv(integer $vshrink, array $options = []) Shrink an image vertically. + * @method Image msb(array $options = []) Pick most-significant byte from an image. * @throws Exception - * @method Image reduceh(float $hshrink, array $options = []) Shrink an image horizontally. + * @method static Image openexrload(string $filename, array $options = []) Load an OpenEXR image. * @throws Exception - * @method Image reducev(float $vshrink, array $options = []) Shrink an image vertically. + * @method static Image openslideload(string $filename, array $options = []) Load file with OpenSlide. * @throws Exception - * @method Image reduce(float $hshrink, float $vshrink, array $options = []) Reduce an image. + * @method static Image pdfload(string $filename, array $options = []) Load PDF with libpoppler. * @throws Exception - * @method Image quadratic(Image $coeff, array $options = []) Resample an image with a quadratic transform. + * @method static Image pdfload_buffer(string $buffer, array $options = []) Load PDF with libpoppler. * @throws Exception - * @method Image affine(float[]|float $matrix, array $options = []) Affine transform of an image. + * @method integer percent(float $percent, array $options = []) Find threshold for percent of pixels. * @throws Exception - * @method Image similarity(array $options = []) Similarity transform of an image. + * @method static Image perlin(integer $width, integer $height, array $options = []) Make a perlin noise image. * @throws Exception - * @method Image resize(float $scale, array $options = []) Resize an image. + * @method Image phasecor(Image $in2, array $options = []) Calculate phase correlation. * @throws Exception - * @method Image colourspace(string $space, array $options = []) Convert to a new colourspace. - * @see Interpretation for possible values for $space + * @method static Image pngload(string $filename, array $options = []) Load png from file. + * @throws Exception + * @method static Image pngload_buffer(string $buffer, array $options = []) Load png from buffer. * @throws Exception - * @method Image Lab2XYZ(array $options = []) Transform cielab to xyz. + * @method void pngsave(string $filename, array $options = []) Save image to png file. * @throws Exception - * @method Image XYZ2Lab(array $options = []) Transform xyz to lab. + * @method string pngsave_buffer(array $options = []) Save image to png buffer. * @throws Exception - * @method Image Lab2LCh(array $options = []) Transform lab to lch. + * @method static Image ppmload(string $filename, array $options = []) Load ppm from file. * @throws Exception - * @method Image LCh2Lab(array $options = []) Transform lch to lab. + * @method void ppmsave(string $filename, array $options = []) Save image to ppm file. * @throws Exception - * @method Image LCh2CMC(array $options = []) Transform lch to cmc. + * @method Image premultiply(array $options = []) Premultiply image alpha. * @throws Exception - * @method Image CMC2LCh(array $options = []) Transform lch to cmc. + * @method array profile(array $options = []) Find image profiles. + * Return array with: [ + * 'columns' => @type Image First non-zero pixel in column + * 'rows' => @type Image First non-zero pixel in row + * ]; * @throws Exception - * @method Image XYZ2Yxy(array $options = []) Transform xyz to yxy. + * @method array project(array $options = []) Find image projections. + * Return array with: [ + * 'columns' => @type Image Sums of columns + * 'rows' => @type Image Sums of rows + * ]; * @throws Exception - * @method Image Yxy2XYZ(array $options = []) Transform yxy to xyz. + * @method Image quadratic(Image $coeff, array $options = []) Resample an image with a quadratic transform. * @throws Exception - * @method Image scRGB2XYZ(array $options = []) Transform scrgb to xyz. + * @method Image rad2float(array $options = []) Unpack Radiance coding to float RGB. * @throws Exception - * @method Image XYZ2scRGB(array $options = []) Transform xyz to scrgb. + * @method static Image radload(string $filename, array $options = []) Load a Radiance image from a file. * @throws Exception - * @method Image LabQ2Lab(array $options = []) Unpack a labq image to float lab. + * @method void radsave(string $filename, array $options = []) Save image to Radiance file. * @throws Exception - * @method Image Lab2LabQ(array $options = []) Transform float lab to labq coding. + * @method string radsave_buffer(array $options = []) Save image to Radiance buffer. * @throws Exception - * @method Image LabQ2LabS(array $options = []) Unpack a labq image to short lab. + * @method Image rank(integer $width, integer $height, integer $index, array $options = []) Rank filter. * @throws Exception - * @method Image LabS2LabQ(array $options = []) Transform short lab to labq coding. + * @method static Image rawload(string $filename, integer $width, integer $height, integer $bands, array $options = []) Load raw data from a file. * @throws Exception - * @method Image LabS2Lab(array $options = []) Transform signed short lab to float. + * @method void rawsave(string $filename, array $options = []) Save image to raw file. * @throws Exception - * @method Image Lab2LabS(array $options = []) Transform float lab to signed short. + * @method void rawsave_fd(integer $fd, array $options = []) Write raw image to file descriptor. * @throws Exception - * @method Image rad2float(array $options = []) Unpack radiance coding to float rgb. + * @method Image recomb(Image $m, array $options = []) Linear recombination with matrix. * @throws Exception - * @method Image float2rad(array $options = []) Transform float rgb to radiance coding. + * @method Image reduce(float $hshrink, float $vshrink, array $options = []) Reduce an image. * @throws Exception - * @method Image LabQ2sRGB(array $options = []) Convert a labq image to srgb. + * @method Image reduceh(float $hshrink, array $options = []) Shrink an image horizontally. * @throws Exception - * @method Image sRGB2HSV(array $options = []) Transform srgb to hsv. + * @method Image reducev(float $vshrink, array $options = []) Shrink an image vertically. * @throws Exception - * @method Image HSV2sRGB(array $options = []) Transform hsv to srgb. + * @method Image relational(Image $right, string $relational, array $options = []) Relational operation on two images. + * @see OperationRelational for possible values for $relational * @throws Exception - * @method Image icc_import(array $options = []) Import from device with icc profile. + * @method Image relational_const(string $relational, float[]|float $c, array $options = []) Relational operations against a constant. + * @see OperationRelational for possible values for $relational * @throws Exception - * @method Image icc_export(array $options = []) Output to device with icc profile. + * @method Image remainder_const(float[]|float $c, array $options = []) Remainder after integer division of an image and a constant. * @throws Exception - * @method Image icc_transform(string $output_profile, array $options = []) Transform between devices with icc profiles. + * @method Image replicate(integer $across, integer $down, array $options = []) Replicate an image. * @throws Exception - * @method Image dE76(Image $right, array $options = []) Calculate de76. + * @method Image resize(float $scale, array $options = []) Resize an image. * @throws Exception - * @method Image dE00(Image $right, array $options = []) Calculate de00. + * @method Image rot(string $angle, array $options = []) Rotate an image. + * @see Angle for possible values for $angle * @throws Exception - * @method Image dECMC(Image $right, array $options = []) Calculate decmc. + * @method Image rot45(array $options = []) Rotate an image. * @throws Exception - * @method Image sRGB2scRGB(array $options = []) Convert an srgb image to scrgb. + * @method Image round(string $round, array $options = []) Perform a round function on an image. + * @see OperationRound for possible values for $round * @throws Exception - * @method Image scRGB2BW(array $options = []) Convert scrgb to bw. + * @method Image sRGB2HSV(array $options = []) Transform sRGB to HSV. * @throws Exception - * @method Image scRGB2sRGB(array $options = []) Convert an scrgb image to srgb. + * @method Image sRGB2scRGB(array $options = []) Convert an sRGB image to scRGB. * @throws Exception - * @method Image maplut(Image $lut, array $options = []) Map an image though a lut. + * @method Image scRGB2BW(array $options = []) Convert scRGB to BW. * @throws Exception - * @method integer percent(float $percent, array $options = []) Find threshold for percent of pixels. + * @method Image scRGB2XYZ(array $options = []) Transform scRGB to XYZ. * @throws Exception - * @method Image stdif(integer $width, integer $height, array $options = []) Statistical difference. + * @method Image scRGB2sRGB(array $options = []) Convert an scRGB image to sRGB. * @throws Exception - * @method Image hist_cum(array $options = []) Form cumulative histogram. + * @method Image scale(array $options = []) Scale an image to uchar. * @throws Exception - * @method Image hist_match(Image $ref, array $options = []) Match two histograms. + * @method Image sequential(array $options = []) Check sequential access. * @throws Exception - * @method Image hist_norm(array $options = []) Normalise histogram. + * @method Image sharpen(array $options = []) Unsharp masking for print. * @throws Exception - * @method Image hist_equal(array $options = []) Histogram equalisation. + * @method Image shrink(float $hshrink, float $vshrink, array $options = []) Shrink an image. * @throws Exception - * @method Image hist_plot(array $options = []) Plot histogram. + * @method Image shrinkh(integer $hshrink, array $options = []) Shrink an image horizontally. * @throws Exception - * @method Image hist_local(integer $width, integer $height, array $options = []) Local histogram equalisation. + * @method Image shrinkv(integer $vshrink, array $options = []) Shrink an image vertically. * @throws Exception - * @method bool hist_ismonotonic(array $options = []) Test for monotonicity. + * @method Image sign(array $options = []) Unit vector of pixel. * @throws Exception - * @method float hist_entropy(array $options = []) Estimate image entropy. + * @method Image similarity(array $options = []) Similarity transform of an image. * @throws Exception - * @method Image conv(Image $mask, array $options = []) Convolution operation. + * @method static Image sines(integer $width, integer $height, array $options = []) Make a 2D sine wave. * @throws Exception - * @method Image conva(Image $mask, array $options = []) Approximate integer convolution. + * @method Image smartcrop(integer $width, integer $height, array $options = []) Extract an area from an image. * @throws Exception - * @method Image convf(Image $mask, array $options = []) Float convolution operation. + * @method Image spcor(Image $ref, array $options = []) Spatial correlation. * @throws Exception - * @method Image convi(Image $mask, array $options = []) Int convolution operation. + * @method Image spectrum(array $options = []) Make displayable power spectrum. * @throws Exception - * @method Image compass(Image $mask, array $options = []) Convolve with rotating mask. + * @method Image stats(array $options = []) Find image average. * @throws Exception - * @method Image convsep(Image $mask, array $options = []) Seperable convolution operation. + * @method Image stdif(integer $width, integer $height, array $options = []) Statistical difference. * @throws Exception - * @method Image convasep(Image $mask, array $options = []) Approximate separable integer convolution. + * @method Image subsample(integer $xfac, integer $yfac, array $options = []) Subsample an image. * @throws Exception - * @method Image fastcor(Image $ref, array $options = []) Fast correlation. + * @method static Image sum(Image[]|Image $in, array $options = []) Sum an array of images. * @throws Exception - * @method Image spcor(Image $ref, array $options = []) Spatial correlation. + * @method static Image svgload(string $filename, array $options = []) Load SVG with rsvg. * @throws Exception - * @method Image sharpen(array $options = []) Unsharp masking for print. + * @method static Image svgload_buffer(string $buffer, array $options = []) Load SVG with rsvg. * @throws Exception - * @method Image gaussblur(float $sigma, array $options = []) Gaussian blur. + * @method static void system(string $cmd_format, array $options = []) Run an external command. * @throws Exception - * @method Image fwfft(array $options = []) Forward fft. + * @method static Image text(string $text, array $options = []) Make a text image. * @throws Exception - * @method Image invfft(array $options = []) Inverse fft. + * @method static Image thumbnail(string $filename, integer $width, array $options = []) Generate thumbnail from file. * @throws Exception - * @method Image freqmult(Image $mask, array $options = []) Frequency-domain filtering. + * @method static Image thumbnail_buffer(string $buffer, integer $width, array $options = []) Generate thumbnail from buffer. * @throws Exception - * @method Image spectrum(array $options = []) Make displayable power spectrum. + * @method Image thumbnail_image(integer $width, array $options = []) Generate thumbnail from image. * @throws Exception - * @method Image phasecor(Image $in2, array $options = []) Calculate phase correlation. + * @method static Image tiffload(string $filename, array $options = []) Load tiff from file. * @throws Exception - * @method Image morph(Image $mask, string $morph, array $options = []) Morphology operation. - * @see OperationMorphology for possible values for $morph + * @method static Image tiffload_buffer(string $buffer, array $options = []) Load tiff from buffer. * @throws Exception - * @method Image rank(integer $width, integer $height, integer $index, array $options = []) Rank filter. + * @method void tiffsave(string $filename, array $options = []) Save image to tiff file. * @throws Exception - * @method float countlines(string $direction, array $options = []) Count lines in an image. - * @see Direction for possible values for $direction + * @method string tiffsave_buffer(array $options = []) Save image to tiff buffer. * @throws Exception - * @method Image labelregions(array $options = []) Label regions in an image. + * @method Image tilecache(array $options = []) Cache an image as a set of tiles. * @throws Exception - * @method Image fill_nearest(array $options = []) Fill image zeros with nearest non-zero pixel. + * @method static Image tonelut(array $options = []) Build a look-up table. * @throws Exception - * @method Image draw_rect(float[]|float $ink, integer $left, integer $top, integer $width, integer $height, array $options = []) Paint a rectangle on an image. + * @method Image unpremultiply(array $options = []) Unpremultiply image alpha. * @throws Exception - * @method Image draw_mask(float[]|float $ink, Image $mask, integer $x, integer $y, array $options = []) Draw a mask on an image. + * @method static Image vipsload(string $filename, array $options = []) Load vips from file. * @throws Exception - * @method Image draw_line(float[]|float $ink, integer $x1, integer $y1, integer $x2, integer $y2, array $options = []) Draw a line on an image. + * @method void vipssave(string $filename, array $options = []) Save image to vips file. * @throws Exception - * @method Image draw_circle(float[]|float $ink, integer $cx, integer $cy, integer $radius, array $options = []) Draw a circle on an image. + * @method static Image webpload(string $filename, array $options = []) Load webp from file. * @throws Exception - * @method Image draw_flood(float[]|float $ink, integer $x, integer $y, array $options = []) Flood-fill an area. + * @method static Image webpload_buffer(string $buffer, array $options = []) Load webp from buffer. * @throws Exception - * @method Image draw_image(Image $sub, integer $x, integer $y, array $options = []) Paint an image into another image. + * @method void webpsave(string $filename, array $options = []) Save image to webp file. * @throws Exception - * @method Image draw_smudge(integer $left, integer $top, integer $width, integer $height, array $options = []) Blur a rectangle on an image. + * @method string webpsave_buffer(array $options = []) Save image to webp buffer. * @throws Exception - * @method Image merge(Image $sec, string $direction, integer $dx, integer $dy, array $options = []) Merge two images. - * @see Direction for possible values for $direction + * @method static Image worley(integer $width, integer $height, array $options = []) Make a worley noise image. * @throws Exception - * @method Image mosaic(Image $sec, string $direction, integer $xref, integer $yref, integer $xsec, integer $ysec, array $options = []) Mosaic two images. - * @see Direction for possible values for $direction + * @method Image wrap(array $options = []) Wrap image origin. * @throws Exception - * @method Image mosaic1(Image $sec, string $direction, integer $xr1, integer $yr1, integer $xs1, integer $ys1, integer $xr2, integer $yr2, integer $xs2, integer $ys2, array $options = []) First-order mosaic of two images. - * @see Direction for possible values for $direction + * @method static Image xyz(integer $width, integer $height, array $options = []) Make an image where pixel values are coordinates. * @throws Exception - * @method Image match(Image $sec, integer $xr1, integer $yr1, integer $xs1, integer $ys1, integer $xr2, integer $yr2, integer $xs2, integer $ys2, array $options = []) First-order match of two images. + * @method static Image zone(integer $width, integer $height, array $options = []) Make a zone plate. * @throws Exception - * @method Image globalbalance(array $options = []) Global balance an image mosaic. + * @method Image zoom(integer $xfac, integer $yfac, array $options = []) Zoom an image. * @throws Exception - * @method Image extract_area(integer $left, integer $top, integer $width, integer $height, array $options = []) Extract an area from an image. - * @method Image crop(integer $left, integer $top, integer $width, integer $height, array $options = []) Extract an area from an image. * - * @property string $nickname Class nickname - * @property string $description Class description * @property integer $width Image width in pixels * @property integer $height Image height in pixels * @property integer $bands Number of bands in image @@ -571,17 +571,11 @@ * @see Coding for possible values * @property string $interpretation Pixel interpretation * @see Interpretation for possible values - * @property float $xres Horizontal resolution in pixels/mm - * @property float $yres Vertical resolution in pixels/mm * @property integer $xoffset Horizontal offset of origin * @property integer $yoffset Vertical offset of origin + * @property float $xres Horizontal resolution in pixels/mm + * @property float $yres Vertical resolution in pixels/mm * @property string $filename Image filename - * @property string $mode Open mode - * @property bool $kill Block evaluation on this image - * @property string $demand Preferred demand style for this image - * @see DemandStyle for possible values - * @property integer $sizeof_header Offset in bytes from start of file - * @property string $foreign_buffer Pointer to foreign pixels */ abstract class ImageAutodoc { diff --git a/src/ImageType.php b/src/ImageType.php index 83648f5..3678d22 100644 --- a/src/ImageType.php +++ b/src/ImageType.php @@ -57,5 +57,4 @@ abstract class ImageType const MMAPIN = 'mmapin'; const MMAPINRW = 'mmapinrw'; const OPENOUT = 'openout'; - const PARTIAL = 'partial'; } diff --git a/src/Token.php b/src/Token.php index b48aa2c..40df593 100644 --- a/src/Token.php +++ b/src/Token.php @@ -53,5 +53,4 @@ abstract class Token const RIGHT = 'right'; const STRING = 'string'; const EQUALS = 'equals'; - const COMMA = 'comma'; }