docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct TextureTransform

    Represents settings for converting between textures and tensors.

    Create an instance of TextureTransform using the constructor, then use the TextureTransform object as a parameter in TextureConverter methods.

    For example: TextureTransform settings = new TextureTransform().SetDimensions(256, 256, 4).SetTensorLayout(TensorLayout.NHWC);

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Unity.Sentis
    Assembly: solution.dll
    Syntax
    public struct TextureTransform

    Methods

    Name Description
    SetBroadcastChannels(bool)

    Sets the default behaviour when the output texture has more channels than the input tensor.

    When broadcastChannels is true, Sentis broadcasts the tensor values to additional channels in the render texture. For example, a tensor with a single channel R maps to (R, R, R, R) if the number of channels is 4.

    When broadcastChannels is false, Sentis applies a (0, 0, 0, 1) color mask to additional channels in the render texture. For example, a tensor with a single channel R becomes (R, 0, 0, 1) if the number of channels is 4.

    SetChannelColorMask(bool, bool, bool, bool, Color)

    Sets which channels in the output texture ignore input tensor values and write a specific color instead.

    The method returns a TextureTransform that you can use to chain other methods.

    SetChannelColorMask(Channel, bool, float)

    Sets a specific texture channel, for example Channel.R, to a specific color. The channel ignores input tensor values.

    SetChannelSwizzle(int, int, int, int)

    Sets which channels in the tensor map to which RGBA channels in the texture, using four channel position values.

    A color mask for tensor to texture conversions might override this setting.

    SetChannelSwizzle(Channel, int)

    Sets a specific texture channel, for example Channel.R, to a specific position in the tensor.

    A color mask for tensor to texture conversions might override this setting.

    SetChannelSwizzle(ChannelSwizzle)

    Sets which channels in the tensor map to which RGBA channels in the texture, using a ChannelSwizzle enum value.

    A color mask for tensor to texture conversions might override this setting.

    SetCoordOrigin(CoordOrigin)

    Sets the position of the origin (0, 0) in the tensor.

    SetDimensions(int, int, int)

    Sets the dimensions of the output texture or tensor. The default value is -1, which means Sentis infers the dimensions from the input texture or tensor.

    If the width and height of the input don't match the width and height of the output, Sentis applies linear resampling.

    If you use SetDimensions in a blit to an existing texture, Sentis ignores width, height, and channels.

    The method returns a TextureTransform that you can use to chain other methods.

    SetTensorLayout(int, int, int, int)

    Sets the layout of the input tensor with four int values.

    SetTensorLayout(TensorLayout)

    Sets the layout of the input tensor with a TensorLayout object, for example TensorLayout.NHWC. The default is TensorLayout.NCHW.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)