docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ImageExportBase

    Wrapper to export a glTF image from one or more Unity textures

    Inheritance
    object
    ImageExportBase
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: GLTFast.Export
    Assembly: glTFast.Export.dll
    Syntax
    public abstract class ImageExportBase

    Properties

    FileName

    Exported texture's file name

    Declaration
    public abstract string FileName { get; }
    Property Value
    Type Description
    string

    FilterMode

    Source texture's filter mode

    Declaration
    public abstract FilterMode FilterMode { get; }
    Property Value
    Type Description
    FilterMode

    MimeType

    Exported texture's mime type

    Declaration
    public abstract string MimeType { get; }
    Property Value
    Type Description
    string

    WrapModeU

    Source texture's wrap mode (U direction)

    Declaration
    public abstract TextureWrapMode WrapModeU { get; }
    Property Value
    Type Description
    TextureWrapMode

    WrapModeV

    Source texture's wrap mode (V direction)

    Declaration
    public abstract TextureWrapMode WrapModeV { get; }
    Property Value
    Type Description
    TextureWrapMode

    Methods

    EncodeTexture(Texture2D, ImageFormat, bool, Material)

    Encodes the export texture

    Declaration
    protected static byte[] EncodeTexture(Texture2D texture, ImageFormat format, bool hasAlpha = true, Material blitMaterial = null)
    Parameters
    Type Name Description
    Texture2D texture

    Main texture to encode

    ImageFormat format

    Image format

    bool hasAlpha

    True if the texture has an alpha channel

    Material blitMaterial

    Custom blit material

    Returns
    Type Description
    byte[]

    Encoded texture data

    GetData()

    Returns the exported and encoded texture data

    Declaration
    public abstract byte[] GetData()
    Returns
    Type Description
    byte[]

    Encoded texture data.

    Write(string, bool)

    Writes image file

    Declaration
    public abstract bool Write(string filePath, bool overwrite)
    Parameters
    Type Name Description
    string filePath

    Destination file path

    bool overwrite

    If true, existing files will be overwritten

    Returns
    Type Description
    bool

    True if writing succeeded, false otherwise

    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)