Class Operation
Wrap a VipsOperation object.
Implements
Inherited Members
Namespace: NetVips
Assembly: NetVips.dll
Syntax
public class Operation : VipsObject, IDisposable
Methods
Block(string, bool)
Set the block state on all operations in the libvips class hierarchy at
name
and below.
Declaration
public static void Block(string name, bool state)
Parameters
Type | Name | Description |
---|---|---|
string | name | Set block state at this point and below. |
bool | state | The block state to set. |
Remarks
For example:
Operation.Block("VipsForeignLoad", true);
Operation.Block("VipsForeignLoadJpeg", false);
Will block all load operations, except JPEG. Use:
$ vips -l
at the command-line to see the class hierarchy. Use BlockUntrusted to set the block state on all untrusted operations.
This call does nothing if the named operation is not found. At least libvips 8.13 is needed.
Call(string, VOption, Image, params object[])
Call a libvips operation.
Declaration
public static object Call(string operationName, VOption kwargs = null, Image matchImage = null, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
string | operationName | Operation name. |
VOption | kwargs | Optional arguments. |
Image | matchImage | A Image used as guide. |
object[] | args | An arbitrary number and variety of arguments. |
Returns
Type | Description |
---|---|
object | A new object. |
Remarks
Use this method to call any libvips operation. For example:
using Image blackImage = Operation.Call("black", 10, 10) as Image;
See the Introduction for notes on how this works.
Call(string, VOption, params object[])
Call a libvips operation.
Declaration
public static object Call(string operationName, VOption kwargs = null, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
string | operationName | Operation name. |
VOption | kwargs | Optional arguments. |
object[] | args | An arbitrary number and variety of arguments. |
Returns
Type | Description |
---|---|
object | A new object. |
Remarks
Use this method to call any libvips operation. For example:
using Image blackImage = Operation.Call("black", 10, 10) as Image;
See the Introduction for notes on how this works.
Call(string, params object[])
Call a libvips operation.
Declaration
public static object Call(string operationName, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
string | operationName | Operation name. |
object[] | args | An arbitrary number and variety of arguments. |
Returns
Type | Description |
---|---|
object | A new object. |
Remarks
Use this method to call any libvips operation. For example:
using Image blackImage = Operation.Call("black", 10, 10) as Image;
See the Introduction for notes on how this works.
GetFlags()
Lookup the set of flags for this operation.
Declaration
public Enums.OperationFlags GetFlags()
Returns
Type | Description |
---|---|
Enums.OperationFlags | Flags for this operation. |
NewFromName(string)
Create a new VipsOperation with the specified nickname.
Declaration
public static Operation NewFromName(string operationName)
Parameters
Type | Name | Description |
---|---|---|
string | operationName | Nickname of operation to create. |
Returns
Type | Description |
---|---|
Operation | The new operation. |
Remarks
You'll need to set any arguments and build the operation before you can use it. See
Exceptions
Type | Condition |
---|---|
VipsException | If the operation doesn't exist. |