docs.unity3d.com
    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.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: GLTFast.Export
    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, Boolean, 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

    Boolean 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[]

    Write(String, Boolean)

    Writes image file

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

    Destination file path

    Boolean overwrite

    If true, existing files will be overwritten

    Returns
    Type Description
    Boolean

    True if writing succeeded, false otherwise

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023