radames/OpenAI-CLIP-JavaScript
7
1declare namespace vips {2 3 // Allow single pixels/images as input.4 type Array<T> = T | T[];5 6 type Enum = string | number;7 type Flag = string | number;8 type Blob = string | ArrayBuffer | Uint8Array | Uint8ClampedArray | Int8Array;9 type ArrayConstant = Array<number>;10 type ArrayImage = Array<Image> | Vector<Image>;11 12 /**13 * Get the major, minor or patch version number of the libvips library.14 * When the flag is omitted, the entire version number is returned as a string.15 * @param flag 0 to get the major version number, 1 to get minor, 2 to get patch.16 * @return The version number of libvips.17 */18 function version(flag?: number): string | number;19 20 /**21 * Returns a string identifying the Emscripten version used for compiling wasm-vips.22 * @return The version number of Emscripten.23 */24 function emscriptenVersion(): string;25 26 /**27 * Get detailed information about the installation of libvips.28 * @return Information about how libvips is configured.29 */30 function config(): string;31 32 /**33 * Gets or, when a parameter is provided, sets the number of worker threads libvips' should create to34 * process each image.35 * @param concurrency The number of worker threads.36 * @return The number of worker threads libvips uses for image evaluation.37 */38 function concurrency(concurrency?: number): void | number;39 40 /**41 * Call this to shutdown libvips and the runtime of Emscripten.42 * This is only needed on Node.js, as the thread pool of43 * Emscripten prevents the event loop from exiting.44 */45 function shutdown(): void;46 47 /**48 * A sequence container representing an array that can change in size.49 */50 export interface Vector<T> {51 /**52 * Adds a new element at the end of the vector, after its current last element.53 * @param val The value to be appended at the end of the container.54 */55 push_back(val: T): void;56 57 /**58 * Resizes the container so that it contains n elements.59 * @param n New size of the container.60 * @param val The value to initialize the new elements with.61 */62 resize(n: number, val: T): void;63 64 /**65 * Returns the number of elements in the container.66 * @return The number of elements in the container.67 */68 size(): number;69 70 /**71 * Access a specified element with bounds checking.72 * @param pos Position of the element to return.73 * @return The requested element or `undefined`.74 */75 get(pos: number): T | undefined;76 77 /**78 * Update a specified element at a certain position.79 * @param pos Position of the element to update.80 * @param val Value to be stored at the specified position.81 * @return `true` if successfully updated.82 */83 set(pos: number, val: T): boolean;84 }85 86 /**87 * A class around libvips' operation cache.88 */89 export class Cache {90 /**91 * Gets or, when a parameter is provided, sets the maximum number of operations libvips keeps in cache.92 * @param max Maximum number of operations.93 * @return The maximum number of operations libvips keeps in cache.94 */95 static max(max?: number): void | number;96 97 /**98 * Gets or, when a parameter is provided, sets the maximum amount of tracked memory allowed.99 * @param mem Maximum amount of tracked memory.100 * @return The maximum amount of tracked memory libvips allows.101 */102 static maxMem(mem?: number): void | number;103 104 /**105 * Gets or, when a parameter is provided, sets the maximum amount of tracked files allowed.106 * @param maxFiles Maximum amount of tracked files.107 * @return The maximum amount of tracked files libvips allows.108 */109 static maxFiles(maxFiles?: number): void | number;110 111 /**112 * Get the current number of operations in cache.113 * @return The current number of operations in cache.114 */115 static size(): number;116 }117 118 /**119 * A class that provides the statistics of memory usage and opened files.120 * libvips watches the total amount of live tracked memory and121 * uses this information to decide when to trim caches.122 */123 export class Stats {124 /**125 * Get the number of active allocations.126 * @return The number of active allocations.127 */128 static allocations(): number;129 130 /**131 * Get the number of bytes currently allocated `vips_malloc()` and friends.132 * libvips uses this figure to decide when to start dropping cache.133 * @return The number of bytes currently allocated.134 */135 static mem(): number;136 137 /**138 * Get the largest number of bytes simultaneously allocated via `vips_tracked_malloc()`.139 * Handy for estimating max memory requirements for a program.140 * @return The largest number of currently allocated bytes.141 */142 static memHighwater(): number;143 144 /**145 * Get the number of open files.146 * @return The number of open files.147 */148 static files(): number;149 }150 151 /**152 * A class for error messages and error handling.153 */154 export class Error {155 /**156 * Get the error buffer as a string.157 * @return The error buffer as a string.158 */159 static buffer(): string;160 161 /**162 * Clear and reset the error buffer.163 * This is typically called after presenting an error to the user.164 */165 static clear(): void;166 }167 168 /**169 * Handy utilities.170 */171 export class Utils {172 /**173 * Get the GType for a name.174 * Looks up the GType for a nickname. Types below basename in the type hierarchy are searched.175 * @param basename Name of base class.176 * @param nickname Search for a class with this nickname.177 * @return The GType of the class, or `0` if the class is not found.178 */179 static typeFind(basename: string, nickname: string): number;180 181 /**182 * Make a temporary file name. The format parameter is something like `"%s.jpg"`183 * and will be expanded to something like `"/tmp/vips-12-34587.jpg"`.184 * @param format The filename format.185 */186 static tempName(format: string): string;187 }188 189 /**190 * The abstract base Connection class.191 */192 export class Connection {193 /**194 * Get the filename associated with a connection.195 */196 readonly filename: string;197 198 /**199 * Make a human-readable name for a connection suitable for error messages.200 */201 readonly nick: string;202 }203 204 /**205 * An input connection.206 */207 export class Source extends Connection {208 /**209 * Make a new source from a file.210 *211 * Make a new source that is attached to the named file. For example:212 * ```js213 * const source = vips.Source.newFromFile('myfile.jpg');214 * ```215 * You can pass this source to (for example) [[Image.newFromSource]].216 * @param filename The file.217 * @return A new source.218 */219 static newFromFile(filename: string): Source;220 221 /**222 * Make a new source from a memory object.223 *224 * Make a new source that is attached to the memory object. For example:225 * ```js226 * const data = image.writeToBuffer('.jpg');227 * const source = vips.Source.newFromMemory(data);228 * ```229 * You can pass this source to (for example) [[Image.newFromSource]].230 * @param memory The memory object.231 * @return A new source.232 */233 static newFromMemory(memory: Blob): Source;234 }235 236 /**237 * A source that can be attached to callbacks to implement behavior.238 */239 export class SourceCustom extends Source {240 /**241 * Attach a read handler.242 * @param ptr A pointer to an array of bytes where the read content is stored.243 * @param size The maximum number of bytes to be read.244 * @return The total number of bytes read into the buffer.245 */246 onRead: (ptr: number, size: number) => number;247 248 /**249 * Attach a seek handler.250 * Seek handlers are optional. If you do not set one, your source will be251 * treated as unseekable and libvips will do extra caching.252 * @param offset A byte offset relative to the whence parameter.253 * @param size A value indicating the reference point used to obtain the new position.254 * @return The new position within the current source.255 */256 onSeek: (offset: number, whence: number) => number;257 }258 259 /**260 * An output connection.261 */262 export class Target extends Connection {263 /**264 * Make a new target to write to a file.265 *266 * Make a new target that will write to the named file. For example::267 * ```js268 * const target = vips.Target.newToFile('myfile.jpg');269 * ```270 * You can pass this target to (for example) [[image.writeToTarget]].271 * @param filename Write to this this file.272 * @return A new target.273 */274 static newToFile(filename: string): Target;275 276 /**277 * Make a new target to write to an area of memory.278 *279 * Make a new target that will write to memory. For example:280 * ```js281 * const target = vips.Target.newToMemory();282 * ```283 * You can pass this target to (for example) [[image.writeToTarget]].284 *285 * After writing to the target, fetch the bytes from the target object with [[getBlob]].286 * @return A new target.287 */288 static newToMemory(): Target;289 290 /**291 * Fetch the typed array of 8-bit unsigned integer values292 * from the target object.293 *294 * @return A typed array of 8-bit unsigned integer values.295 */296 getBlob(): Uint8Array;297 }298 299 /**300 * A target that can be attached to callbacks to implement behavior.301 */302 export class TargetCustom extends Target {303 /**304 * Attach a write handler.305 * @param ptr A pointer to an array of bytes which will be written to.306 * @param length The number of bytes to write.307 * @return The number of bytes that were written.308 */309 onWrite: (ptr: number, size: number) => number;310 311 /**312 * Attach a finish handler.313 * This optional handler is called at the end of write. It should do any314 * cleaning up, if necessary.315 */316 onFinish: () => void;317 }318 319 /**320 * A class to build various interpolators.321 * For e.g. nearest, bilinear, and some non-linear.322 */323 export class Interpolate {324 /**325 * Look up an interpolator from a nickname and make one.326 * @param nickname Nickname for interpolator.327 * @return An interpolator.328 */329 static newFromName(nickname: string): Interpolate;330 }331 332 /**333 * An image class.334 */335 export class Image extends ImageAutoGen {336 /**337 * Image width in pixels.338 */339 readonly width: number;340 341 /**342 * Image height in pixels.343 */344 readonly height: number;345 346 /**347 * Number of bands in image.348 */349 readonly bands: number;350 351 /**352 * Pixel format in image.353 */354 readonly format: string;355 356 /**357 * Pixel coding.358 */359 readonly coding: string;360 361 /**362 * Pixel interpretation.363 */364 readonly interpretation: string;365 366 /**367 * Horizontal offset of origin.368 */369 readonly xoffset: number;370 371 /**372 * Vertical offset of origin.373 */374 readonly yoffset: number;375 376 /**377 * Horizontal resolution in pixels/mm.378 */379 readonly xres: number;380 381 /**382 * Vertical resolution in pixels/mm.383 */384 readonly yres: number;385 386 /**387 * Image filename.388 */389 readonly filename: string;390 391 // constructors392 393 /**394 * Creates a new image which, when written to, will create a memory image.395 * @return A new image.396 */397 static newMemory(): Image;398 399 /**400 * Make a new temporary image.401 *402 * Returns an image backed by a temporary file. When written to with403 * [[write]], a temporary file will be created on disc in the404 * specified format. When the image is closed, the file will be deleted405 * automatically.406 *407 * The file is created in the temporary directory. This is set with408 * the environment variable `TMPDIR`. If this is not set, vips will409 * default to `/tmp`.410 *411 * libvips uses `g_mkstemp()` to make the temporary filename. They412 * generally look something like `"vips-12-EJKJFGH.v"`.413 * @param format The format for the temp file, defaults to a vips414 * format file (`"%s.v"`). The `%s` is substituted by the file path.415 * @return A new image.416 */417 static newTempFile(format?: string): Image;418 419 /**420 * Load an image from a file.421 *422 * This method can load images in any format supported by libvips. The423 * filename can include load options, for example:424 * ```js425 * const image = vips.Image.newFromFile('fred.jpg[shrink=2]');426 * ```427 * You can also supply options as keyword arguments, for example:428 * ```js429 * const image = vips.Image.newFromFile('fred.jpg', {430 * shrink: 2431 * });432 * ```433 * The full set of options available depend upon the load operation that434 * will be executed. Try something like:435 * ```bash436 * $ vips jpegload437 * ```438 * at the command-line to see a summary of the available options for the439 * JPEG loader.440 *441 * Loading is fast: only enough of the image is loaded to be able to fill442 * out the header. Pixels will only be decompressed when they are needed.443 * @param vipsFilename The file to load the image from, with optional appended arguments.444 * @param options Optional options that depend on the load operation.445 * @return A new image.446 */447 static newFromFile(vipsFilename: string, options?: {448 /**449 * Force open via memory.450 */451 memory?: boolean452 /**453 * Hint the expected access pattern for the image454 */455 access?: Access | Enum456 /**457 * Fail on first error.458 */459 fail?: boolean460 }): Image;461 462 /**463 * Wrap an image around a memory array.464 *465 * Wraps an Image around an area of memory containing a C-style array. For466 * example, if the `data` memory array contains four bytes with the467 * values 1, 2, 3, 4, you can make a one-band, 2x2 uchar image from468 * it like this:469 * ```js470 * const data = new Uint8Array([1, 2, 3, 4]);471 * const image = vips.Image.newFromMemory(data, 2, 2, 1, vips.BandFormat.uchar);472 * ```473 * The data object will internally be copied from JavaScript to WASM.474 *475 * This method is useful for efficiently transferring images from WebGL into476 * libvips.477 *478 * See [[writeToMemory]] for the opposite operation.479 * Use [[copy]] to set other image attributes.480 * @param data A C-style JavaScript array.481 * @param width Image width in pixels.482 * @param height Image height in pixels.483 * @param bands Number of bands.484 * @param format Band format.485 * @return A new image.486 */487 static newFromMemory(data: Blob, width: number, height: number, bands: number, format: BandFormat): Image;488 489 /**490 * Wrap an image around a pointer.491 *492 * This behaves exactly as [[newFromMemory]], but the image is493 * loaded from a pointer rather than from a JavaScript array.494 * @param ptr A memory address.495 * @param size Length of memory area.496 * @param width Image width in pixels.497 * @param height Image height in pixels.498 * @param bands Number of bands.499 * @param format Band format.500 * @return A new image.501 */502 static newFromMemory(ptr: number, size: number, width: number, height: number, bands: number, format: BandFormat): Image;503 504 /**505 * Load a formatted image from memory.506 *507 * This behaves exactly as [[newFromFile]], but the image is508 * loaded from the memory object rather than from a file. The509 * memory object can be a string or buffer.510 * @param data The memory object to load the image from.511 * @param strOptions Load options as a string.512 * @param options Optional options that depend on the load operation.513 * @return A new image.514 */515 static newFromBuffer(data: Blob, strOptions?: string, options?: {516 /**517 * Hint the expected access pattern for the image518 */519 access?: Access | Enum520 /**521 * Fail on first error.522 */523 fail?: boolean524 }): Image;525 526 /**527 * Load a formatted image from a source.528 *529 * This behaves exactly as [[newFromFile]], but the image is530 * loaded from a source rather than from a file.531 * @param source The source to load the image from.532 * @param strOptions Load options as a string.533 * @param options Optional options that depend on the load operation.534 * @return A new image.535 */536 static newFromSource(source: Source, strOptions?: string, options?: {537 /**538 * Hint the expected access pattern for the image539 */540 access?: Access | Enum541 /**542 * Fail on first error.543 */544 fail?: boolean545 }): Image;546 547 /**548 * Create an image from a 1D array.549 *550 * A new one-band image with [[BandFormat.double]] pixels is551 * created from the array. These image are useful with the libvips552 * convolution operator [[conv]].553 * @param width Image width.554 * @param height Image height.555 * @param array Create the image from these values.556 * @return A new image.557 */558 static newMatrix(width: number, height: number, array?: ArrayConstant): Image;559 560 /**561 * Create an image from a 2D array.562 *563 * A new one-band image with [[BandFormat.double]] pixels is564 * created from the array. These image are useful with the libvips565 * convolution operator [[conv]].566 * @param array Create the image from these values.567 * @param scale Default to 1.0. What to divide each pixel by after568 * convolution. Useful for integer convolution masks.569 * @param offset Default to 0.0. What to subtract from each pixel570 * after convolution. Useful for integer convolution masks.571 * @return A new image.572 */573 static newFromArray(array: ArrayConstant, scale?: number, offset?: number): Image;574 575 /**576 * Make a new image from an existing one.577 *578 * A new image is created which has the same size, format, interpretation579 * and resolution as itself, but with every pixel set to `value`.580 * @param value The value for the pixels. Use a single number to make a581 * one-band image; use an array constant to make a many-band image.582 * @return A new image.583 */584 newFromImage(value: ArrayConstant): Image;585 586 /**587 * Copy an image to memory.588 *589 * A large area of memory is allocated, the image is rendered to that590 * memory area, and a new image is returned which wraps that large memory591 * area.592 * @return A new image.593 */594 copyMemory(): Image;595 596 // writers597 598 /**599 * Write an image to another image.600 *601 * This function writes itself to another image. Use something like602 * [[newTempFile]] to make an image that can be written to.603 * @param other The image to write to.604 * @return A new image.605 */606 write(other: Image): Image;607 608 /**609 * Write an image to a file.610 *611 * This method can save images in any format supported by libvips. The format612 * is selected from the filename suffix. The filename can include embedded613 * save options, see [[newFromFile]].614 *615 * For example:616 * ```js617 * image.writeToFile('fred.jpg[Q=95]');618 * ```619 * You can also supply options as keyword arguments, for example:620 * ```js621 * image.writeToFile('.fred.jpg', {622 * Q: 95623 * });624 * ```625 * The full set of options available depend upon the save operation that626 * will be executed. Try something like:627 * ```bash628 * $ vips jpegsave629 * ```630 * at the command-line to see a summary of the available options for the631 * JPEG saver.632 * @param vipsFilename The file to save the image to, with optional appended arguments.633 * @param options Optional options that depend on the save operation.634 */635 writeToFile(vipsFilename: string, options?: {}): void;636 637 /**638 * Write an image to a typed array of 8-bit unsigned integer values.639 *640 * This method can save images in any format supported by libvips. The format641 * is selected from the suffix in the format string. This can include642 * embedded save options, see [[newFromFile]].643 *644 * For example:645 * ```js646 * const data = image.writeToBuffer('.jpg[Q=95]');647 * ```648 * You can also supply options as keyword arguments, for example:649 * ```js650 * const data = image.writeToBuffer('.jpg', {651 * Q: 85652 * });653 * ```654 * The full set of options available depend upon the load operation that655 * will be executed. Try something like:656 * ```bash657 * $ vips jpegsave_buffer658 * ```659 * at the command-line to see a summary of the available options for the660 * JPEG saver.661 * @param formatString The suffix, plus any string-form arguments.662 * @param options Optional options that depend on the save operation.663 * @return A typed array of 8-bit unsigned integer values.664 */665 writeToBuffer(formatString: string, options?: {}): Uint8Array;666 667 /**668 * Write an image to a target.669 *670 * This behaves exactly as [[writeToFile]], but the image is671 * written to a target rather than a file.672 * @param target Write to this target.673 * @param formatString The suffix, plus any string-form arguments.674 * @param options Optional options that depend on the save operation.675 */676 writeToTarget(target: Target, formatString: string, options?: {}): void;677 678 /**679 * Write the image to a large memory array.680 *681 * A large area of memory is allocated, the image is rendered to that682 * memory array, and the array is returned as a typed array.683 *684 * For example, if you have a 2x2 uchar image containing the bytes 1, 2,685 * 3, 4, read left-to-right, top-to-bottom, then:686 * ```js687 * const array = Uint8Array.of(1, 2, 3, 4);688 * const im = vips.Image.newFromMemory(array, 2, 2, 1, 'uchar');689 * const buf = im.writeToMemory();690 * ```691 * will return a four byte typed array containing the values 1, 2, 3, 4.692 * @return A typed array of 8-bit unsigned integer values.693 */694 writeToMemory(): Uint8Array;695 696 // get/set metadata697 698 /**699 * Set an integer on an image as metadata.700 * @param name The name of the piece of metadata to set the value of.701 * @param value The metadata value.702 */703 setInt(name: string, value: number): void;704 705 /**706 * Set an integer array on an image as metadata.707 * @param name The name of the piece of metadata to set the value of.708 * @param value The metadata value.709 */710 setArrayInt(name: string, value: ArrayConstant): void;711 712 /**713 * Set an double array on an image as metadata.714 * @param name The name of the piece of metadata to set the value of.715 * @param value The metadata value.716 */717 setArrayDouble(name: string, value: ArrayConstant): void;718 719 /**720 * Set an double on an image as metadata.721 * @param name The name of the piece of metadata to set the value of.722 * @param value The metadata value.723 */724 setDouble(name: string, value: number): void;725 726 /**727 * Set an string on an image as metadata.728 * @param name The name of the piece of metadata to set the value of.729 * @param value The metadata value.730 */731 setString(name: string, value: string): void;732 733 /**734 * Set an blob on an image as metadata.735 * The value will internally be copied from JavaScript to WASM.736 * @param name The name of the piece of metadata to set the value of.737 * @param value The metadata value.738 */739 setBlob(name: string, value: Blob): void;740 741 /**742 * Set an blob pointer on an image as metadata.743 * @param name The name of the piece of metadata to set the value of.744 * @param ptr The metadata value as memory address.745 * @param size Length of blob.746 */747 setBlob(name: string, ptr: number, size: number): void;748 749 /**750 * Get the GType of an item of metadata.751 * Fetch the GType of a piece of metadata, or 0 if the named item does not exist.752 * @param name The name of the piece of metadata to get the type of.753 * @return The GType, or `0` if not found.754 */755 getTypeof(name: string): number;756 757 /**758 * Get an integer from an image.759 * @param name The name of the piece of metadata to get.760 * @return The metadata item as an integer.761 */762 getInt(name: string): number;763 764 /**765 * Get an integer array from an image.766 * @param name The name of the piece of metadata to get.767 * @return The metadata item as an integer array.768 */769 getArrayInt(name: string): number[];770 771 /**772 * Get an double array from an image.773 * @param name The name of the piece of metadata to get.774 * @return The metadata item as an double array.775 */776 getArrayDouble(name: string): number[];777 778 /**779 * Get an double from an image.780 * @param name The name of the piece of metadata to get.781 * @return The metadata item as an double.782 */783 getDouble(name: string): number;784 785 /**786 * Get an string from an image.787 * @param name The name of the piece of metadata to get.788 * @return The metadata item as an string.789 */790 getString(name: string): string;791 792 /**793 * Get an blob from an image.794 * @param name The name of the piece of metadata to get.795 * @return The metadata item as an typed array of 8-bit unsigned integer values.796 */797 getBlob(name: string): Uint8Array;798 799 /**800 * Get a list of all the metadata fields on an image.801 * @return All metadata fields as string vector.802 */803 getFields(): Vector<string>;804 805 /**806 * Remove an item of metadata.807 * @param name The name of the piece of metadata to remove.808 * @return `true` if successfully removed.809 */810 remove(name: string): string;811 812 // handwritten functions813 814 /**815 * Does this image have an alpha channel?816 * @return `true` if this image has an alpha channel.817 */818 hasAlpha(): boolean;819 820 /**821 * Sets the `delete_on_close` flag for the image.822 * If this flag is set, when image is finalized, the filename held in823 * [[image.filename]] at the time of this call is deleted.824 * This function is clearly extremely dangerous, use with great caution.825 */826 setDeleteOnClose(flag: boolean): void;827 828 /**829 * Search an image for non-edge areas.830 * @param options Optional options.831 * @return The bounding box of the non-background area.832 */833 findTrim(options?: {834 /**835 * Object threshold.836 */837 threshold?: number838 /**839 * Color for background pixels.840 */841 background?: ArrayConstant842 }): {843 /**844 * Output left edge.845 */846 left: number847 848 /**849 * Output top edge.850 */851 top: number852 853 /**854 * Output width.855 */856 width: number857 858 /**859 * Output width.860 */861 height: number862 };863 864 /**865 * Find image profiles.866 * @return First non-zero pixel in column/row.867 */868 profile(): {869 /**870 * Distances from top edge.871 */872 columns: Image873 874 /**875 * Distances from left edge.876 */877 rows: Image878 };879 880 /**881 * Find image projections.882 * @return Sums of columns/rows.883 */884 project(): {885 /**886 * Sums of columns.887 */888 columns: Image889 890 /**891 * Sums of rows.892 */893 rows: Image894 };895 896 /**897 * Split an n-band image into n separate images.898 * @return Vector of output images.899 */900 bandsplit(): Vector<Image>;901 902 /**903 * Append a set of images or constants bandwise904 * @param _in Array of input images.905 * @return Output image.906 */907 bandjoin(_in: ArrayImage | ArrayConstant): Image;908 909 /**910 * Band-wise rank filter a set of images or constants.911 * @param _in Array of input images.912 * @param options Optional options.913 * @return Output image.914 */915 bandrank(_in: ArrayImage | ArrayConstant, options?: {916 /**917 * Select this band element from sorted list.918 */919 index?: number920 }): Image;921 922 /**923 * Composite a set of images with a set of blend modes.924 * @param _in Images to composite.925 * @param mode Blend modes to use.926 * @param options Optional options.927 * @return Blended image.928 */929 static composite(_in: ArrayImage, mode: Array<Enum>, options?: {930 /**931 * Array of x coordinates to join at.932 */933 x?: ArrayConstant934 /**935 * Array of y coordinates to join at.936 */937 y?: ArrayConstant938 /**939 * Composite images in this colour space.940 */941 compositing_space?: Interpretation | Enum942 /**943 * Images have premultiplied alpha.944 */945 premultiplied?: boolean946 }): Image;947 948 /**949 * Composite a set of images with a set of blend modes.950 * @param overlay Images to composite.951 * @param mode Blend modes to use.952 * @param options Optional options.953 * @return Blended image.954 */955 composite(overlay: ArrayImage, mode: Array<Enum>, options?: {956 /**957 * Array of x coordinates to join at.958 */959 x?: ArrayConstant960 /**961 * Array of y coordinates to join at.962 */963 y?: ArrayConstant964 /**965 * Composite images in this colour space.966 */967 compositing_space?: Interpretation | Enum968 /**969 * Images have premultiplied alpha.970 */971 premultiplied?: boolean972 }): Image;973 974 /**975 * Return the coordinates of the image maximum.976 * @return Array of output values.977 */978 maxPos(): number[];979 980 /**981 * Return the coordinates of the image minimum.982 * @return Array of output values.983 */984 minPos(): number[];985 986 /**987 * Flip an image horizontally.988 * @return Output image.989 */990 flipHor(): Image;991 992 /**993 * Flip an image vertically.994 * @return Output image.995 */996 flipVer(): Image;997 998 /**999 * Rotate an image 90 degrees clockwise.1000 * @return Output image.1001 */1002 rot90(): Image;1003 1004 /**1005 * Rotate an image 180 degrees.1006 * @return Output image.1007 */1008 rot180(): Image;1009 1010 /**1011 * Rotate an image 270 degrees clockwise.1012 * @return Output image.1013 */1014 rot270(): Image;1015 1016 /**1017 * size x size median filter.1018 * @param size The size of the median filter, defaults to 3.1019 * @return Output image.1020 */1021 median(size?: number): Image;1022 1023 /**1024 * Return the largest integral value not greater than the argument.1025 * @return Output image.1026 */1027 floor(): Image;1028 1029 /**1030 * Return the smallest integral value not less than the argument.1031 * @return Output image.1032 */1033 ceil(): Image;1034 1035 /**1036 * Return the nearest integral value.1037 * @return Output image.1038 */1039 rint(): Image;1040 1041 /**1042 * AND image bands together.1043 * @return Output image.1044 */1045 bandand(): Image;1046 1047 /**1048 * OR image bands together.1049 * @return Output image.1050 */1051 bandor(): Image;1052 1053 /**1054 * EOR image bands together.1055 * @return Output image.1056 */1057 bandeor(): Image;1058 1059 /**1060 * Return the real part of a complex image.1061 * @return Output image.1062 */1063 real(): Image;1064 1065 /**1066 * Return the imaginary part of a complex image.1067 * @return Output image.1068 */1069 imag(): Image;1070 1071 /**1072 * Return an image converted to polar coordinates.1073 * @return Output image.1074 */1075 polar(): Image;1076 1077 /**1078 * Return an image converted to rectangular coordinates.1079 * @return Output image.1080 */1081 rect(): Image;1082 1083 /**1084 * Return the complex conjugate of an image.1085 * @return Output image.1086 */1087 conj(): Image;1088 1089 /**1090 * Return the sine of an image in degrees.1091 * @return Output image.1092 */1093 sin(): Image;1094 1095 /**1096 * Return the cosine of an image in degrees.1097 * @return Output image.1098 */1099 cos(): Image;1100 1101 /**1102 * Return the tangent of an image in degrees.1103 * @return Output image.1104 */1105 tan(): Image;1106 1107 /**1108 * Return the inverse sine of an image in degrees.1109 * @return Output image.1110 */1111 asin(): Image;1112 1113 /**1114 * Return the inverse cosine of an image in degrees.1115 * @return Output image.1116 */1117 acos(): Image;1118 1119 /**1120 * Return the inverse tangent of an image in degrees.1121 * @return Output image.1122 */1123 atan(): Image;1124 1125 /**1126 * Return the hyperbolic sine of an image in radians.1127 * @return Output image.1128 */1129 sinh(): Image;1130 1131 /**1132 * Return the hyperbolic cosine of an image in radians.1133 * @return Output image.1134 */1135 cosh(): Image;1136 1137 /**1138 * Return the hyperbolic tangent of an image in radians.1139 * @return Output image.1140 */1141 tanh(): Image;1142 1143 /**1144 * Return the inverse hyperbolic sine of an image in radians.1145 * @return Output image.1146 */1147 asinh(): Image;1148 1149 /**1150 * Return the inverse hyperbolic cosine of an image in radians.1151 * @return Output image.1152 */1153 acosh(): Image;1154 1155 /**1156 * Return the inverse hyperbolic tangent of an image in radians.1157 * @return Output image.1158 */1159 atanh(): Image;1160 1161 /**1162 * Return the natural log of an image.1163 * @return Output image.1164 */1165 log(): Image;1166 1167 /**1168 * Return the log base 10 of an image.1169 * @return Output image.1170 */1171 log10(): Image;1172 1173 /**1174 * Return e ** pixel.1175 * @return Output image.1176 */1177 exp(): Image;1178 1179 /**1180 * Return 10 ** pixel.1181 * @return Output image.1182 */1183 exp10(): Image;1184 1185 /**1186 * Erode with a structuring element.1187 * @param mask Input matrix image.1188 * @return Output image.1189 */1190 erode(mask: Image | ArrayConstant): Image;1191 1192 /**1193 * Dilate with a structuring element.1194 * @param mask Input matrix image.1195 * @return Output image.1196 */1197 dilate(mask: Image | ArrayConstant): Image;1198 1199 /**1200 * Raise to power of an image or constant.