Documentation

Support

Asset Transformer SDK


User Manual

Python API

C# API

Changelog

Discussions

Asset Transformer SDK


MaterialInterface

Class
Read time 27 minutesLast updated 21 days ago

Inheritance
Inherited Members
Namespace: UnityEngine.Pixyz.Material
public class MaterialInterface : Interface

Methods

GetLastError

public static string GetLastError()
Returns

Type

Description

string

AddUniformProperty

Add a shader uniform parameter to the given custom pattern.
[HandleProcessCorruptedStateExceptions]public void AddUniformProperty(uint pattern, string name, ShaderUniformType type)
Parameters

Type

Name

Description

uintpatternThe custom pattern to edit.
stringnameName of the new property.
ShaderUniformTypetypeType of the new uniform.

AreOpaques

Check if some materials are opaques. Function will return 'False' for each material if:
  • The 'Opacity' Coeff is not 1.0
  • The 'Opacity' property is a Texture
  • The 'Albedo' property is a Texture and at least one pixel of the texture has an alpha value.
[HandleProcessCorruptedStateExceptions]public BoolList AreOpaques(MaterialList materials)
Parameters

Type

Name

Description

MaterialListmaterialsMaterials to check opacity.
Returns

Type

Description

BoolList

ClearAllMaterials

Remove and delete all the materials.
[HandleProcessCorruptedStateExceptions]public void ClearAllMaterials()

ConfigureFunctionLogger

[HandleProcessCorruptedStateExceptions]public void ConfigureFunctionLogger(string functionName, bool enableFunction, bool enableParameters, bool enableExecutionTime)
Parameters

Type

Name

Description

stringfunctionName
boolenableFunction
boolenableParameters
boolenableExecutionTime

ConvertHeightMapToNormalMap

Convert a height map to a normal map.
[HandleProcessCorruptedStateExceptions]public uint ConvertHeightMapToNormalMap(uint hmap, double height = 0.5)
Parameters

Type

Name

Description

uinthmapHeight map reference.
doubleheightMaximum height.
Returns

Type

Description

uint

ConvertNormalMapToHeightMap

[HandleProcessCorruptedStateExceptions]public uint ConvertNormalMapToHeightMap(uint nmap, double height = 0.5)
Parameters

Type

Name

Description

uintnmapNormal map reference.
doubleheightMaximum height.
Returns

Type

Description

uint

CopyMaterial

Copies a material.
[HandleProcessCorruptedStateExceptions]public uint CopyMaterial(uint toCopy, bool addToMaterialLibrary)
Parameters

Type

Name

Description

uinttoCopyMaterial to copy.
booladdToMaterialLibraryAdd to material library.
Returns

Type

Description

uint

CreateCustomMaterialPattern

Create a new custom material pattern.
[HandleProcessCorruptedStateExceptions]public uint CreateCustomMaterialPattern(string name)
Parameters

Type

Name

Description

stringnameName of the pattern.
Returns

Type

Description

uint

CreateMaterial

Create a new material from pattern.
[HandleProcessCorruptedStateExceptions]public uint CreateMaterial(string name, string pattern, bool addToMaterialLibrary = true)
Parameters

Type

Name

Description

stringnameName of the material.
stringpatternName of the pattern.
booladdToMaterialLibraryName of the pattern.
Returns

Type

Description

uint

CreateMaterialFromDefinition

Create PBR material from a material definition.
[HandleProcessCorruptedStateExceptions]public uint CreateMaterialFromDefinition(MaterialDefinition materialDefinition)
Parameters

Type

Name

Description

MaterialDefinitionmaterialDefinitionThe structure containing all the PBR material information.
Returns

Type

Description

uint

CreateMaterialsFromDefinitions

Create PBR materials from material definitions.
[HandleProcessCorruptedStateExceptions]public MaterialList CreateMaterialsFromDefinitions(MaterialDefinitionList materialDefinitions)
Parameters

Type

Name

Description

MaterialDefinitionListmaterialDefinitionsMaterial definitions containing properties for each given material.
Returns

Type

Description

MaterialList

CreateMaterialsFromMaps

Automatically creates PBR materials when importing PBR texture maps from a folder.
[HandleProcessCorruptedStateExceptions]public MaterialFromMapsReturn CreateMaterialsFromMaps(string directory)
Parameters

Type

Name

Description

stringdirectoryDirectory path.
Returns

Type

Description

MaterialFromMapsReturn

FilterAO

Filter an AO map using ATrous method.
[HandleProcessCorruptedStateExceptions]public ImageList FilterAO(ImageList aoMaps, ImageList normalMaps, double sigmaPos = 2, double sigmaValue = 0.2, double sigmaNormal = 0.2, int levelCount = 4, bool filterLowValues = true, double lowValueThreshold = 0.01)
Parameters

Type

Name

Description

ImageListaoMapsInput AO Maps (the alpha component must be set to 0 for unused pixels).
ImageListnormalMapsInput Normal Maps (preferable to use World space normal maps, but Object space normal maps can be used too).
doublesigmaPosATrous Sigma pos.
doublesigmaValueATrous Sigma value.
doublesigmaNormalATrous Sigma normal.
intlevelCountAtrous #Levels.
boolfilterLowValuesRemove low values from the filtering (see: lowValuesThreshold parameter).
doublelowValueThresholdThreshold used if filterLowValues is enabled.
Returns

Type

Description

ImageList

FindCustomMaterialPatternByName

Returns the material pattern which has the given name.
[HandleProcessCorruptedStateExceptions]public uint FindCustomMaterialPatternByName(string name)
Parameters

Type

Name

Description

stringnameThe name of the material pattern.
Returns

Type

Description

uint

FindMaterialsByPattern

Returns all materials using the given pattern.
[HandleProcessCorruptedStateExceptions]public MaterialList FindMaterialsByPattern(string pattern)
Parameters

Type

Name

Description

stringpatternA material pattern.
Returns

Type

Description

MaterialList

FindMaterialsByProperty

Returns all materials which match a given property value.
[HandleProcessCorruptedStateExceptions]public MaterialList FindMaterialsByProperty(string propertyName, string propertyValue, bool caseInsensitive = false)
Parameters

Type

Name

Description

stringpropertyNameName of the property to match.
stringpropertyValueRegular expression to match for the property value.
boolcaseInsensitiveIf True, the regex will be insensitive to upper and lower cases.
Returns

Type

Description

MaterialList

GenerateColorFromIndex

Generate a unique color from an index (only 16M differents color can be generated, if index is greater than 16777216, the color is not guaranted to be unique).
[HandleProcessCorruptedStateExceptions]public Color GenerateColorFromIndex(int index)
Parameters

Type

Name

Description

intindexIndex.
Returns

Type

Description

Color

GenerateUniqueColors

Generate a set of unique colors (max 16M differents color can be generated, if count is greater than 16777216, the colors are not guaranted to be unique).
[HandleProcessCorruptedStateExceptions]public ColorList GenerateUniqueColors(int count)
Parameters

Type

Name

Description

intcountNumber of unique colors to generate.
Returns

Type

Description

ColorList

GetAllMaterialPatterns

Returns all the material patterns in the current session.
[HandleProcessCorruptedStateExceptions]public StringList GetAllMaterialPatterns()
Returns

Type

Description

StringList

GetAllMaterials

Retrieve the list of all the materials in the material library.
[HandleProcessCorruptedStateExceptions]public MaterialList GetAllMaterials()
Returns

Type

Description

MaterialList

GetColorMaterialInfos

Get color material properties.
[HandleProcessCorruptedStateExceptions]public ColorMaterialInfos GetColorMaterialInfos(uint material)
Parameters

Type

Name

Description

uintmaterialThe material to get properties.
Returns

Type

Description

ColorMaterialInfos

GetCustomMaterialPattern

Returns the custom material pattern associated to the custom material.
[HandleProcessCorruptedStateExceptions]public uint GetCustomMaterialPattern(uint material)
Parameters

Type

Name

Description

uintmaterialCustom material to get the pattern from.
Returns

Type

Description

uint

GetImpostorMaterialInfos

Get impostor texture material properties.
[HandleProcessCorruptedStateExceptions]public ImpostorMaterialInfos GetImpostorMaterialInfos(uint material)
Parameters

Type

Name

Description

uintmaterialThe material to get properties.
Returns

Type

Description

ImpostorMaterialInfos

GetMaterialDefinition

Returns the properties of a PBR Material.
[HandleProcessCorruptedStateExceptions]public MaterialDefinition GetMaterialDefinition(uint material)
Parameters

Type

Name

Description

uintmaterialThe PBR Material.
Returns

Type

Description

MaterialDefinition

GetMaterialDefinitions

Returns the properties of a set of PBR Materials.
[HandleProcessCorruptedStateExceptions]public MaterialDefinitionList GetMaterialDefinitions(MaterialList materials)
Parameters

Type

Name

Description

MaterialListmaterialsThe PBR Materials.
Returns

Type

Description

MaterialDefinitionList

GetMaterialMainColor

Get the main color on any material pattern type.
[HandleProcessCorruptedStateExceptions]public ColorAlpha GetMaterialMainColor(uint material)
Parameters

Type

Name

Description

uintmaterialThe material.
Returns

Type

Description

ColorAlpha

GetMaterialPattern

Gets the MaterialPattern name of the material.
[HandleProcessCorruptedStateExceptions]public string GetMaterialPattern(uint material)
Parameters

Type

Name

Description

uintmaterialThe material to find the pattern.
Returns

Type

Description

string

GetMaterialPatternType

Returns the MaterialPatternType name of the material.
[HandleProcessCorruptedStateExceptions]public MaterialPatternType GetMaterialPatternType(uint material)
Parameters

Type

Name

Description

uintmaterialThe material to find the pattern.
Returns

Type

Description

MaterialPatternType

GetPBRMaterialInfos

Get PBR material properties.
[HandleProcessCorruptedStateExceptions]public PBRMaterialInfos GetPBRMaterialInfos(uint material)
Parameters

Type

Name

Description

uintmaterialThe material to get properties.
Returns

Type

Description

PBRMaterialInfos

GetPointsAndMaterialFromText

Returns a list of 3D Points and a material from a string and a fontname.
[HandleProcessCorruptedStateExceptions]public GetPointsAndMaterialFromTextReturn GetPointsAndMaterialFromText(string text, string fontName, int fontSize, Matrix4 matrix, Color colorInput, double offset = 0, double height3D = 0)
Parameters

Type

Name

Description

stringtextInput text.
stringfontNameFontname.
intfontSizeFontSize.
Matrix4matrixInput matrix for the text.
ColorcolorInputColor of the font needed.
doubleoffsetInput offset for the text.
doubleheight3DInput height in 3D which will be a ratio from the textSize.
Returns

GetStandardMaterialInfos

Get standard material properties.
[HandleProcessCorruptedStateExceptions]public StandardMaterialInfos GetStandardMaterialInfos(uint material)
Parameters

Type

Name

Description

uintmaterialThe material to get properties.
Returns

Type

Description

StandardMaterialInfos

GetUniformPropertyType

Get a shader uniform shader property type.
[HandleProcessCorruptedStateExceptions]public ShaderUniformType GetUniformPropertyType(uint pattern, string name)
Parameters

Type

Name

Description

uintpatternThe custom pattern.
stringnameName of the property to get the type from.
Returns

Type

Description

ShaderUniformType

GetUnlitTextureMaterialInfos

Get unlit texture material properties.
[HandleProcessCorruptedStateExceptions]public UnlitTextureMaterialInfos GetUnlitTextureMaterialInfos(uint material)
Parameters

Type

Name

Description

uintmaterialThe material to get properties.
Returns

IsOpaque

Check if material is opaque. Function will return 'False' if:
  • The 'Opacity' Coeff is not 1.0
  • The 'Opacity' property is a Texture
  • The 'Albedo' property is a Texture and at least one pixel of the texture has an alpha value.
[HandleProcessCorruptedStateExceptions]public bool IsOpaque(uint material)
Parameters

Type

Name

Description

uintmaterialMaterial to check opacity.
Returns

Type

Description

bool

MakeMaterialNamesUnique

Rename materials to have a unique name for each one.
[HandleProcessCorruptedStateExceptions]public void MakeMaterialNamesUnique(MaterialList materials = null)
Parameters

Type

Name

Description

MaterialListmaterialsMaterials to rename (rename all materials if empty).

RemapIndexMap

Create remapped versions of index maps.
[HandleProcessCorruptedStateExceptions]public RemapIndexMapReturn RemapIndexMap(ImageList maps, int maxIndices)
Parameters

Type

Name

Description

ImageListmapsInput Images.
intmaxIndicesNumber max of indices remapped.
Returns

Type

Description

RemapIndexMapReturn

SetCoeffOrTextureProperty

Set a CoeffOrTexture property.
[HandleProcessCorruptedStateExceptions]public void SetCoeffOrTextureProperty(uint material, string name, CoeffOrTexture coeffOrTexture)
Parameters

Type

Name

Description

uintmaterialThe material to apply the color on.
stringnameThe property to set.
CoeffOrTexturecoeffOrTextureThe CoeffOrTexture to apply.

SetColorAlphaProperty

Set a ColorAlpha property.
[HandleProcessCorruptedStateExceptions]public void SetColorAlphaProperty(uint material, string name, ColorAlpha color)
Parameters

Type

Name

Description

uintmaterialThe material to apply the color on.
stringnameThe property to set.
ColorAlphacolorThe color to apply.

SetColorOrTextureProperty

Set a ColorOrTexture property.
[HandleProcessCorruptedStateExceptions]public void SetColorOrTextureProperty(uint material, string name, ColorOrTexture colorOrTexture)
Parameters

Type

Name

Description

uintmaterialThe material to apply the color on.
stringnameThe property to set.
ColorOrTexturecolorOrTextureThe ColorOrTexture to apply.

SetFragmentShader

Set the fragment shader of a custom pattern.
[HandleProcessCorruptedStateExceptions]public void SetFragmentShader(uint pattern, string code)
Parameters

Type

Name

Description

uintpatternThe custom pattern to edit.
stringcodeThe GLSL code of the fragment shader.

SetMaterialMainColor

Set the main color on any material pattern type.
[HandleProcessCorruptedStateExceptions]public void SetMaterialMainColor(uint material, ColorAlpha color)
Parameters

Type

Name

Description

uintmaterialThe material to apply the color on.
ColorAlphacolorThe color to apply.

SetMaterialPattern

Sets the MaterialPattern name of the material.
[HandleProcessCorruptedStateExceptions]public void SetMaterialPattern(uint material, string pattern)
Parameters

Type

Name

Description

uintmaterialThe material to find the pattern.
stringpatternThe pattern of the material.

SetPBRMaterialInfos

Set PBR material properties.
[HandleProcessCorruptedStateExceptions]public void SetPBRMaterialInfos(uint material, PBRMaterialInfos infos)
Parameters

Type

Name

Description

uintmaterialThe material to set properties.
PBRMaterialInfosinfosThe PBRMaterialInfos properties.

SetVertexShader

Set the vertex shader of a custom pattern.
[HandleProcessCorruptedStateExceptions]public void SetVertexShader(uint pattern, string code)
Parameters

Type

Name

Description

uintpatternThe custom pattern to edit.
stringcodeThe GLSL code of the vertex shader.

AddImageChangedCallback

public uint AddImageChangedCallback(MaterialInterface.ImageChangedDelegate callback, IntPtr userData)
Parameters

Type

Name

Description

MaterialInterface.ImageChangedDelegatecallback
IntPtruserData
Returns

Type

Description

uint

RemoveImageChangedCallback

public void RemoveImageChangedCallback(uint id)
Parameters

Type

Name

Description

uintid

AddMaterialChangedCallback

public uint AddMaterialChangedCallback(MaterialInterface.MaterialChangedDelegate callback, IntPtr userData)
Parameters

Type

Name

Description

MaterialInterface.MaterialChangedDelegatecallback
IntPtruserData
Returns

Type

Description

uint

RemoveMaterialChangedCallback

public void RemoveMaterialChangedCallback(uint id)
Parameters

Type

Name

Description

uintid

ApplyFactorOnImage

Aplly a factor to an image.
[HandleProcessCorruptedStateExceptions]public void ApplyFactorOnImage(uint image, bool imageIsLinear, ColorAlpha factor)
Parameters

Type

Name

Description

uintimageImage to be modified.
boolimageIsLinearImage is linear or not.
ColorAlphafactorFactor to apply.

BlurImage

Applies a blurring to the given image.
[HandleProcessCorruptedStateExceptions]public void BlurImage(uint image, int radius, BlurFilter blurType, EdgeFilter edgeFilter)
Parameters

Type

Name

Description

uintimageImage to blur.
intradiusRadius in pixels of the Gaussian kernel.
BlurFilterblurTypeKernel of the blur filter to apply.
EdgeFilteredgeFilterMethod to use for the management of boundary pixels.

ClearImageRoI

Removes the region of interest from an image.
[HandleProcessCorruptedStateExceptions]public void ClearImageRoI(uint image)
Parameters

Type

Name

Description

uintimageImage to process.

ConvertFloat32To8BitsImage

Returns a new image from the given converter from 32bits float to a 8Bits (e.g. depth render map).
[HandleProcessCorruptedStateExceptions]public uint ConvertFloat32To8BitsImage(uint image32F, double minValue = -1, double maxValue = 1, bool inPlace = false)
Parameters

Type

Name

Description

uintimage32FImage to convert.
doubleminValueMinimal value of the floats (will be 0 in 8bits).
doublemaxValueMinimal value of the floats (will be 255 in 8bits).
boolinPlaceIf true, the given image is modified instead of creating a new one.
Returns

Type

Description

uint

ConvertImage

Converts the given image to a new format.
[HandleProcessCorruptedStateExceptions]public uint ConvertImage(uint image, ImageLayout layout, ImageComponentType type, bool inPlace = false)
Parameters

Type

Name

Description

uintimageImage to convert.
ImageLayoutlayoutLayout (components definition) of the new image format. Accepted values are combinations of the following: 'R' (red), 'G' (green), 'B' (blue), 'A' (alpha), 'L' (luminance), 'S' (stencil index) and 'D' (depth component).
ImageComponentTypetypeComponent data type of the new image format.
boolinPlaceIf true, the given image is modified instead of creating a new one.
Returns

Type

Description

uint

ConvertImageToDefinition

Returns an image definition which contains data corresponding to the given image converted to a new format.
[HandleProcessCorruptedStateExceptions]public ImageDefinition ConvertImageToDefinition(uint image, ImageLayout layout, ImageComponentType type)
Parameters

Type

Name

Description

uintimageImage to convert.
ImageLayoutlayoutLayout (components definition) of the new image format. Accepted values are combinations of the following: 'R' (red), 'G' (green), 'B' (blue), 'A' (alpha), 'L' (luminance), 'S' (stencil index) and 'D' (depth component).
ImageComponentTypetypeComponent data type of the new image format.
Returns

Type

Description

ImageDefinition

CreateCheckerboardImage

Create an image consisting in a black and white checkerboard.
[HandleProcessCorruptedStateExceptions]public uint CreateCheckerboardImage(int width, int height, int cellSize, ColorAlpha? color1 = null, ColorAlpha? color2 = null, ImageLayout layout = ImageLayout.RGB, ImageComponentType type = ImageComponentType.UInt8_Norm)
Parameters

Type

Name

Description

intwidthWidth desired for the created image.
intheightHeight desired for the created image.
intcellSizeSize of checkerboard cells (in pixels).
ColorAlphacolor1First checkerboard color.
ColorAlphacolor2Second checkerboard color.
ImageLayoutlayoutDesired image layout.
ImageComponentTypetypeDesired image component type.
Returns

Type

Description

uint

CreateImageFromData

Import an Image from only its data.
[HandleProcessCorruptedStateExceptions]public uint CreateImageFromData(ByteList data, string name = "img")
Parameters

Type

Name

Description

ByteListdataThe raw data as input.
stringnameIf need of a name.
Returns

Type

Description

uint

CreateImageFromDefinition

Import an image from its raw data.
[HandleProcessCorruptedStateExceptions]public uint CreateImageFromDefinition(ImageDefinition imageDefinition)
Parameters

Type

Name

Description

ImageDefinitionimageDefinitionThe image definition.
Returns

Type

Description

uint

CreateImagesFromDefinitions

Import images from their raw data.
[HandleProcessCorruptedStateExceptions]public ImageList CreateImagesFromDefinitions(ImageDefinitionList imageDefinitions)
Parameters

Type

Name

Description

ImageDefinitionListimageDefinitionsThe image definitions.
Returns

Type

Description

ImageList

ExportImage

Export an image.
[HandleProcessCorruptedStateExceptions]public void ExportImage(uint image, string filename)
Parameters

Type

Name

Description

uintimageIdentifier of the image to export.
stringfilenameFilename of the file to export.

ExtractImageChannels

Creates new images from individual channels of the given image.
[HandleProcessCorruptedStateExceptions]public ImageList ExtractImageChannels(uint image, int channel = -1)
Parameters

Type

Name

Description

uintimageImage to convert.
intchannelNumber of the channel to extract. -1 extracts all channels.
Returns

Type

Description

ImageList

ExtractImageComponents

Creates new images from individual components of the given image.
[HandleProcessCorruptedStateExceptions]public ImageList ExtractImageComponents(uint image, ImageLayout components)
Parameters

Type

Name

Description

uintimageImage to convert.
ImageLayoutcomponentsName of the components to extract. Accepted values: 'R' (red), 'G' (green), 'B' (blue), 'A' (alpha), 'L' (luminance).
Returns

Type

Description

ImageList

FillImageWithColor

Fills an image (or a sub-part of it) with the provided color.
[HandleProcessCorruptedStateExceptions]public void FillImageWithColor(uint image, ColorAlpha color, int x = 0, int y = 0, int w = -1, int h = -1)
Parameters

Type

Name

Description

uintimageImage from which type has to be fetched.
ColorAlphacolorFilling color.
intxImage X coordinate of the sub-image to fill.
intyImage Y coordinate of the sub-image to fill.
intwWidth of the sub-image to fill (-1 means infinite width).
inthHeight of the sub-image to fill (-1 means infinite height).

FillUnusedPixels

Fill unused pixels by propagating and averaging used pixels.
[HandleProcessCorruptedStateExceptions]public uint FillUnusedPixels(uint image, ColorAlpha? unusedColor = null, int size = -1, uint validityMask = 0, bool inPlace = false)
Parameters

Type

Name

Description

uintimageImage to process.
ColorAlphaunusedColorColor used to identify unused pixels.
intsizeDilation size in pixels.
uintvalidityMaskImage describing which texels are valid (color set to white) and which ones need to be filled (color set to black). If zero, unusedColor is used instead.
boolinPlaceIf True, the source image is modified. Otherwise, a new one is created.
Returns

Type

Description

uint

FlipImageY

Applies a vertical flip to an image.
[HandleProcessCorruptedStateExceptions]public void FlipImageY(uint image)
Parameters

Type

Name

Description

uintimageImage to flip.

GetAllImages

Returns all the images loaded in the current session or from a list of materials.
[HandleProcessCorruptedStateExceptions]public ImageList GetAllImages(MaterialList materials = null)
Parameters

Type

Name

Description

MaterialListmaterialsMaterials to retrieve the images from (returns all images loaded in the current session if empty).
Returns

Type

Description

ImageList

GetExportImageFormats

Returns image format names and extensions which can be exported in Pixyz.
[HandleProcessCorruptedStateExceptions]public FormatList GetExportImageFormats()
Returns

Type

Description

FormatList

GetImageColorBilinear

Returns the color at a specific image point, in real coordinates, using bi-linear interpolation.
[HandleProcessCorruptedStateExceptions]public ColorAlpha GetImageColorBilinear(uint image, double x, double y, EdgeFilter edgeFilter = EdgeFilter.Clamp)
Parameters

Type

Name

Description

uintimageThe image to get the color from.
doublexImage X coordinate (real).
doubleyImage Y coordinate (real).
EdgeFilteredgeFilterMethod to use for the management of boundary pixels.
Returns

Type

Description

ColorAlpha

GetImageColorRange

Gets the min and max bounds of each image color component.
[HandleProcessCorruptedStateExceptions]public ColorAlphaList GetImageColorRange(uint image)
Parameters

Type

Name

Description

uintimageSource image.
Returns

Type

Description

ColorAlphaList

GetImageComponentType

Gets the component data type of the given image.
[HandleProcessCorruptedStateExceptions]public ImageComponentType GetImageComponentType(uint image)
Parameters

Type

Name

Description

uintimageImage from which type has to be fetched.
Returns

Type

Description

ImageComponentType

GetImageComponentTypeName

Gets the name of a given component data type ID.
[HandleProcessCorruptedStateExceptions]public string GetImageComponentTypeName(ImageComponentType type)
Parameters

Type

Name

Description

ImageComponentTypetype
Returns

Type

Description

string

GetImageDefinition

Returns the raw data of an image.
[HandleProcessCorruptedStateExceptions]public ImageDefinition GetImageDefinition(uint image)
Parameters

Type

Name

Description

uintimageSource image.
Returns

Type

Description

ImageDefinition

GetImageDefinitions

Returns the raw data of a set of images.
[HandleProcessCorruptedStateExceptions]public ImageDefinitionList GetImageDefinitions(ImageList images)
Parameters

Type

Name

Description

ImageListimagesThe images.
Returns

Type

Description

ImageDefinitionList

GetImageFormatName

Gets a comprenhensive name from an image format.
[HandleProcessCorruptedStateExceptions]public string GetImageFormatName(ImageLayout layout, ImageComponentType type)
Parameters

Type

Name

Description

ImageLayoutlayout
ImageComponentTypetype
Returns

Type

Description

string

GetImageLayout

Gets the layout (component definitions) of the given image.
[HandleProcessCorruptedStateExceptions]public ImageLayout GetImageLayout(uint image)
Parameters

Type

Name

Description

uintimageImage from which layout has to be fetched.
Returns

Type

Description

ImageLayout

GetImagePixelColor

Returns the color of a given pixel in an image.
[HandleProcessCorruptedStateExceptions]public ColorAlpha GetImagePixelColor(uint image, int x, int y)
Parameters

Type

Name

Description

uintimageThe image to get the pixel from.
intxThe X pixel coordinate.
intyThe Y pixel coordinate.
Returns

Type

Description

ColorAlpha

GetImagePixelInfo

Returns info about the image pixel format.
[HandleProcessCorruptedStateExceptions]public PixelInfo GetImagePixelInfo(uint image)
Parameters

Type

Name

Description

uintimageSource image.
Returns

Type

Description

PixelInfo

GetImagePixelInfoFromDefinition

Returns info about the image pixel format.
[HandleProcessCorruptedStateExceptions]public PixelInfo GetImagePixelInfoFromDefinition(ImageDefinition imageDefinition)
Parameters

Type

Name

Description

ImageDefinitionimageDefinitionSource image.
Returns

Type

Description

PixelInfo

GetImagePixelInfoFromLayoutAndType

Returns info about the image pixel format for a given combination of image layout and component type.
[HandleProcessCorruptedStateExceptions]public PixelInfo GetImagePixelInfoFromLayoutAndType(ImageLayout layout, ImageComponentType type)
Parameters

Type

Name

Description

ImageLayoutlayoutImage layout (components definition).
ImageComponentTypetypeImage component data type.
Returns

Type

Description

PixelInfo

GetImageRoI

Returns the region of interest of an image.
[HandleProcessCorruptedStateExceptions]public RoI GetImageRoI(uint image)
Parameters

Type

Name

Description

uintimageImage to process.
Returns

Type

Description

RoI

GetImageSize

Returns the size of an image.
[HandleProcessCorruptedStateExceptions]public GetImageSizeReturn GetImageSize(uint image)
Parameters

Type

Name

Description

uintimageThe image to get the size from.
Returns

Type

Description

GetImageSizeReturn

GetImagesSizes

Returns the sizes of multiple images.
[HandleProcessCorruptedStateExceptions]public GetImagesSizesReturn GetImagesSizes(ImageList images)
Parameters

Type

Name

Description

ImageListimagesThe image to get the size from.
Returns

Type

Description

GetImagesSizesReturn

GetImportImageFormats

Returns the image format names and extensions which can be imported in Pixyz.
[HandleProcessCorruptedStateExceptions]public FormatList GetImportImageFormats()
Returns

Type

Description

FormatList

GetSubImage

Extracts a sub-part of the given image.
[HandleProcessCorruptedStateExceptions]public uint GetSubImage(uint image, int x, int y, int w, int h)
Parameters

Type

Name

Description

uintimageSource image.
intxImage X coordinate of the sub-image to extract.
intyImage Y coordinate of the sub-image to extract.
intwWidth of the sub-image to extract.
inthHeight of the sub-image to extract.
Returns

Type

Description

uint

ImportImage

Import an image.
[HandleProcessCorruptedStateExceptions]public uint ImportImage(string filename)
Parameters

Type

Name

Description

stringfilenameFilename of the image to import.
Returns

Type

Description

uint

InvertImageColor

Inverts the color of all image pixels.
[HandleProcessCorruptedStateExceptions]public void InvertImageColor(uint image)
Parameters

Type

Name

Description

uintimageImage to invert.

OverrideImageFormat

Changes the way image channels are interpreted by assigning a new format without modifying the data. Note that the new format must be compatible with the previous one, which means that they have to have the same number of bytes per pixel.
[HandleProcessCorruptedStateExceptions]public bool OverrideImageFormat(uint image, ImageLayout layout = ImageLayout.Undefined, ImageComponentType type = ImageComponentType.Undefined)
Parameters

Type

Name

Description

uintimageImage for format must be overridden.
ImageLayoutlayoutNew layout (keep the original one if set to Undefined).
ImageComponentTypetypeNew component type (keep the original one if set to Undefined).
Returns

Type

Description

bool

ResizeImage

Resize an image.
[HandleProcessCorruptedStateExceptions]public void ResizeImage(uint image, int width, int height, ResizeFilterMethod filteringMethod = ResizeFilterMethod.DEFAULT)
Parameters

Type

Name

Description

uintimageImage to be resize.
intwidthNew image width.
intheightNew image height.
ResizeFilterMethodfilteringMethodFiltering method for image resizing.

RotateImage

Applies a rotation to (the sub-part of) an image.
[HandleProcessCorruptedStateExceptions]public void RotateImage(uint image, double angle, double cx, double cy, EdgeFilter edgeFilter = EdgeFilter.Clamp, bool adjustSize = false)
Parameters

Type

Name

Description

uintimageImage to process.
doubleangleRotation angle (in degrees).
doublecxX coordinate of the transformation center.
doublecyY coordinate of the transformation center.
EdgeFilteredgeFilterMethod to use for the management of boundary pixels.
booladjustSizeAdjust the dimensions of the image to fit the transformation.

SetImageRoI

Defines the region of interest of an image.
[HandleProcessCorruptedStateExceptions]public void SetImageRoI(uint image, int x, int y, int w, int h)
Parameters

Type

Name

Description

uintimageImage to process.
intxX coordinate of the RoI origin.
intyY coordinate of the RoI origin.
intwWidth of the RoI.
inthHeight of the RoI.

SetSubImage

Replaces a part of a given image by another one.
[HandleProcessCorruptedStateExceptions]public void SetSubImage(uint destination, uint subImage, int x, int y, EdgeFilter edgeFilter = EdgeFilter.Clamp)
Parameters

Type

Name

Description

uintdestinationDestination image.
uintsubImageSource image.
intxX coordinate where to copy sub-image.
intyY coordinate where to copy sub-image.
EdgeFilteredgeFilterMethod to use for the management of boundary pixels.

StretchImage

Applies a non-uniform scale to (the sub-part of) an image.
[HandleProcessCorruptedStateExceptions]public void StretchImage(uint image, double sx, double sy, double cx, double cy, EdgeFilter edgeFilter = EdgeFilter.Clamp, bool adjustSize = false)
Parameters

Type

Name

Description

uintimageImage to process.
doublesxScale factor along X axis.
doublesyScale factor along Y axis.
doublecxX coordinate of the transformation center.
doublecyY coordinate of the transformation center.
EdgeFilteredgeFilterMethod to use for the management of boundary pixels.
booladjustSizeAdjust the dimensions of the image to fit the transformation.

TransformImage

Applies a transformation matrix to (the sub-part of) an image.
[HandleProcessCorruptedStateExceptions]public void TransformImage(uint image, Matrix3 matrix, EdgeFilter edgeFilter = EdgeFilter.Clamp, bool adjustSize = false)
Parameters

Type

Name

Description

uintimageImage to process.
Matrix3matrixTransformation matrix.
EdgeFilteredgeFilterMethod to use for the management of boundary pixels.
booladjustSizeAdjust the dimensions of the image to fit the transformation.

TranslateImage

Applies a translation to (the sub-part of) an image.
[HandleProcessCorruptedStateExceptions]public void TranslateImage(uint image, double tx, double ty, EdgeFilter edgeFilter = EdgeFilter.Clamp, bool adjustSize = false)
Parameters

Type

Name

Description

uintimageImage to process.
doubletxX translation.
doubletyY translation.
EdgeFilteredgeFilterMethod to use for the management of boundary pixels.
booladjustSizeAdjust the dimensions of the image to fit the transformation.

UpdateImageFromDefinition

Update an image from its raw data.
[HandleProcessCorruptedStateExceptions]public void UpdateImageFromDefinition(uint image, ImageDefinition imageDefinition)
Parameters

Type

Name

Description

uintimageThe image to update.
ImageDefinitionimageDefinitionThe new data to apply.

UpdateImagesFromDefinitions

Update images from their raw data.
[HandleProcessCorruptedStateExceptions]public void UpdateImagesFromDefinitions(ImageList image, ImageDefinitionList imageDefinitions)
Parameters

Type

Name

Description

ImageListimageThe image to update.
ImageDefinitionListimageDefinitionsThe new data to apply.

GetMaterialUserData

Set or replace a userdata stored on an material.
[HandleProcessCorruptedStateExceptions]public IntPtr GetMaterialUserData(uint userDataId, uint material)
Parameters

Type

Name

Description

uintuserDataIdUserData identifier provided by subscribeToMaterialUserData.
uintmaterialMaterial that store the user data.
Returns

Type

Description

IntPtr

GetMultipleMaterialUserData

Batch version of getMaterialUserData.
[HandleProcessCorruptedStateExceptions]public PtrList GetMultipleMaterialUserData(uint userDataId, MaterialList materials)
Parameters

Type

Name

Description

uintuserDataIdUserData identifier provided by subscribeToMaterialUserData.
MaterialListmaterialsMaterials that store the user data.
Returns

Type

Description

PtrList

HasMaterialUserData

Set or replace a userdata stored on an material.
[HandleProcessCorruptedStateExceptions]public bool HasMaterialUserData(uint userDataId, uint material)
Parameters

Type

Name

Description

uintuserDataIdUserData identifier provided by subscribeToMaterialUserData.
uintmaterialMaterial that potentially store the user data.
Returns

Type

Description

bool

HasMultipleMaterialUserData

Batch version of hasMaterialUserData.
[HandleProcessCorruptedStateExceptions]public BoolList HasMultipleMaterialUserData(uint userDataId, MaterialList materials)
Parameters

Type

Name

Description

uintuserDataIdUserData identifier provided by subscribeToMaterialUserData.
MaterialListmaterialsMaterials that potentially store the user data.
Returns

Type

Description

BoolList

SetMaterialUserData

Set or replace a userdata stored on an material.
[HandleProcessCorruptedStateExceptions]public void SetMaterialUserData(uint userDataId, uint material, IntPtr userData)
Parameters

Type

Name

Description

uintuserDataIdUserData identifier provided by subscribeToMaterialUserData.
uintmaterialMaterial that will store the user data.
IntPtruserDataUser data to store in the given material.

SetMultipleMaterialUserData

Batch version of setMaterialUserData.
[HandleProcessCorruptedStateExceptions]public void SetMultipleMaterialUserData(uint userDataId, MaterialList materials, PtrList userDataList)
Parameters

Type

Name

Description

uintuserDataIdUserData identifier provided by subscribeToMaterialUserData.
MaterialListmaterialsMaterials that will store the user data.
PtrListuserDataListUser data to store on each material.

SubscribeToMaterialUserData

Subscribe to material user data. multiple different userdata can be stored on the same materials if subscribeToMaterialUserData is called multiple times.
[HandleProcessCorruptedStateExceptions]public uint SubscribeToMaterialUserData()
Returns

Type

Description

uint

UnsetMaterialUserData

Unset the userdata stored on an material.
[HandleProcessCorruptedStateExceptions]public void UnsetMaterialUserData(uint userDataId, uint material)
Parameters

Type

Name

Description

uintuserDataIdUserData identifier provided by subscribeToMaterialUserData.
uintmaterialMaterial that will store the user data.

UnsetMultipleMaterialUserData

Batch version of unsetMaterialUserData.
[HandleProcessCorruptedStateExceptions]public void UnsetMultipleMaterialUserData(uint userDataId, MaterialList materials)
Parameters

Type

Name

Description

uintuserDataIdUserData identifier provided by subscribeToMaterialUserData.
MaterialListmaterialsMaterials that will store the user data.

UnsubscribeFromMaterialUserData

[HandleProcessCorruptedStateExceptions]public void UnsubscribeFromMaterialUserData(uint userDataId)
Parameters

Type

Name

Description

uintuserDataIdUserData identifier to unsubscribe.