Class NetVips
Basic utility stuff.
Inheritance
Inherited Members
Namespace: NetVips
Assembly: NetVips.dll
Syntax
public static class NetVips
Methods
| Improve this Doc View SourceAtLeastLibvips(Int32, Int32, Int32)
Is this at least libvips major.minor[.patch]?
Declaration
public static bool AtLeastLibvips(int x, int y, int z = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | Major component. |
System.Int32 | y | Minor component. |
System.Int32 | z | Patch component. |
Returns
Type | Description |
---|---|
System.Boolean | true if at least libvips major.minor[.patch]; otherwise, false. |
CacheSetMax(Int32)
Set the maximum number of operations libvips will cache.
Declaration
public static void CacheSetMax(int max)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | max | Maximum number of operations. |
CacheSetMaxFiles(Int32)
Limit the operation cache by number of open files.
Declaration
public static void CacheSetMaxFiles(int maxFiles)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | maxFiles | Maximum open files. |
CacheSetMaxMem(UInt64)
Limit the operation cache by memory use.
Declaration
public static void CacheSetMaxMem(ulong maxMem)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | maxMem | Maximum memory use. |
CacheSetTrace(Boolean)
Turn on libvips cache tracing.
Declaration
public static void CacheSetTrace(bool trace)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | trace | Bool indicating if tracing should be turned on. |
ConcurrencyGet()
Returns the number of worker threads that vips uses for image evaluation.
Declaration
public static int ConcurrencyGet()
Returns
Type | Description |
---|---|
System.Int32 | The number of worker threads. |
ConcurrencySet(Int32)
Set the size of the pools of worker threads vips uses for image evaluation.
Declaration
public static void ConcurrencySet(int concurrency)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | concurrency | The size of the pools of worker threads vips uses for image evaluation. |
Free(IntPtr)
Frees the memory pointed to by mem
.
Declaration
public static void Free(IntPtr mem)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | mem | The memory to free. |
Remarks
This is needed for WriteToMemory(out UInt64).
FundamentalType(IntPtr)
Extract the fundamental type ID portion.
Declaration
public static IntPtr FundamentalType(IntPtr type)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | type | A valid type ID. |
Returns
Type | Description |
---|---|
System.IntPtr | Fundamental type ID. |
GetEnums()
Get a list of enums available within the libvips library.
Declaration
public static List<string> GetEnums()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.String> | A list of enums. |
GetOperations()
Get a list of operations available within the libvips library.
Declaration
public static List<string> GetOperations()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.String> | A list of operations. |
Remarks
This can be useful for documentation generators.
GetSuffixes()
Get a list of all the filename suffixes supported by libvips.
Declaration
public static string[] GetSuffixes()
Returns
Type | Description |
---|---|
System.String[] | An array of strings or null. |
Remarks
At least libvips 8.8 is needed.
Init()
Init() starts up the world of VIPS.
Declaration
public static bool Init()
Returns
Type | Description |
---|---|
System.Boolean | true if successful started; otherwise, false. |
Remarks
This function will be automatically called by Initialize() once the assembly is loaded. You should only call this method in your own program if the ModuleInitializer fails to initialize libvips.
LeakSet(Boolean)
Enable or disable libvips leak checking.
Declaration
public static void LeakSet(bool leak)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | leak | Bool indicating if leak checking should be turned on. |
Remarks
With this enabled, libvips will check for object and area leaks on exit. Enabling this option will make libvips run slightly more slowly.
MemoryHigh()
Returns the largest number of bytes simultaneously allocated via vips_tracked_malloc(). Handy for estimating max memory requirements for a program.
Declaration
public static ulong MemoryHigh()
Returns
Type | Description |
---|---|
System.UInt64 | The largest number of bytes simultaneously allocated. |
MemoryStats()
Returns an array with:
- the number of active allocations.
- the number of bytes currently allocated via
vips_malloc()
and friends. - the number of open files.
Declaration
public static int[] MemoryStats()
Returns
Type | Description |
---|---|
System.Int32[] | An array with memory stats. Handy for debugging / leak testing. |
NicknameFind(IntPtr)
Return the nickname for a GType.
Declaration
public static string NicknameFind(IntPtr type)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | type | Type to return nickname for. |
Returns
Type | Description |
---|---|
System.String | Nickname. |
PathFilename7(String)
For testing only.
Declaration
public static string PathFilename7(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Path to split. |
Returns
Type | Description |
---|---|
System.String | The filename part of a vips7 path. |
PathMode7(String)
For testing only.
Declaration
public static string PathMode7(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Path to split. |
Returns
Type | Description |
---|---|
System.String | The mode part of a vips7 path. |
ProfileSet(Boolean)
Enable or disable libvips profile recording.
Declaration
public static void ProfileSet(bool profile)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | profile | Bool indicating if profile recording should be turned on. |
Remarks
If set, vips will record profiling information, and dump it on program
exit. These profiles can be analysed with the vipsprofile
program.
TypeFind(String, String)
Get the GType for a name.
Declaration
public static IntPtr TypeFind(string basename, string nickname)
Parameters
Type | Name | Description |
---|---|---|
System.String | basename | Name of base class. |
System.String | nickname | Search for a class with this nickname. |
Returns
Type | Description |
---|---|
System.IntPtr | The GType of the class, or System.IntPtr.Zero if the class is not found. |
Remarks
Looks up the GType for a nickname. Types below basename in the type hierarchy are searched.
TypeFromName(String)
Return the GType for a name.
Declaration
public static IntPtr TypeFromName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Type name to lookup. |
Returns
Type | Description |
---|---|
System.IntPtr | Corresponding type ID or System.IntPtr.Zero. |
TypeName(IntPtr)
Return the name for a GType.
Declaration
public static string TypeName(IntPtr type)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | type | Type to return name for. |
Returns
Type | Description |
---|---|
System.String | Type name. |
ValuesForEnum(IntPtr)
Get all values for a enum (GType).
Declaration
public static List<string> ValuesForEnum(IntPtr type)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | type | Type to return enum values for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.String> | A list of values. |
VectorSet(Boolean)
Enable or disable SIMD and the run-time compiler.
Declaration
public static void VectorSet(bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enabled | Bool indicating if SIMD and the run-time compiler should be turned on. |
Remarks
This can give a nice speed-up, but can also be unstable on some systems or with some versions of the run-time compiler.
Version(Int32, Boolean)
Get the major, minor or patch version number of the libvips library.
Declaration
public static int Version(int flag, bool fromModule = true)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | flag | Pass 0 to get the major version number, 1 to get minor, 2 to get patch. |
System.Boolean | fromModule | true to get this value from the pre-initialized Version variable. |
Returns
Type | Description |
---|---|
System.Int32 | The version number. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | If |
VipsInterpretationGetType()
For testing only.
Declaration
public static void VipsInterpretationGetType()
VipsOperationFlagsGetType()
For testing only.
Declaration
public static void VipsOperationFlagsGetType()