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);
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 .
|
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.