Vixen
02b45cc4
csharp
public sealed class TextureImportView

A texture, open for editing: the pixels, the mip ladder, and the import settings.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Doc 11 asks for four things and three of them are here in full. Import settings and the platform-override matrix are ImportSettingsView's; the mip inspector is TextureLadder's arithmetic, drawn as the ladder the settings will produce with what each level costs in the format it will ship in.

⚠ The channel viewer says which channels to show and does not draw them. Nothing in this assembly has a graphics device: a texture reaches the interface as a number a UiRenderer handed out for a registered texture, and registering one means uploading it. So the view decodes the file — that much is CPU work and belongs here — exposes Source, Channels and MipLevel, and the application uploads and sets Preview's number. It is exactly the split ScenePresenter already has with the scene panel, and for the same reason.

⚠ What is decoded is the source, not the artefact. An author editing import settings wants to see what they are about to compress, and a preview of the last build's output would be a picture of settings that have since been changed. The consequence worth knowing about is that the preview never shows compression artefacts — comparing those needs the artefact store and a second image beside this one, which is not built.

Fields and properties (13)

  • protected override string TagName

    The element name this type answers to when a caller does not choose one.

  • protected override bool AcceptsFocus

    Whether the focus can rest on this kind of control at all.

  • public Image Preview

    Where the pixels are drawn once something has uploaded them.

  • public UiElement Facts

    What the file is, in numbers: extent, format, and what it will ship as.

  • public UiElement Ladder

    The mip ladder, one row a level.

  • public Alert Undecodable

    Shown when the file has no decoder in this build, or would not decode.

  • public ImportSettingsView SettingsView

    The settings, the overrides and the addressable block.

  • public Tabs Tabs

    The two halves of a texture: what it ships as, and what is cut out of it.

  • public SpriteSheetView Sprites

    The sprite editor, over this same document.

  • public TextureData? Source

    The decoded source, or if nothing could decode it.

  • public TextureChannels Channels

    Which channels the viewer is asking for.

  • public int MipLevel

    Which mip level the viewer is asking for.

  • public IReadOnlyList<TextureMipLevel> Levels

    The ladder the current settings produce.

Events (1)

  • public Action<TextureImportView>? ViewChanged

    Raised when the channels or the level change, for whatever is uploading the picture.

Methods (5)

  • protected override void OnCreated()
  • public void Show(TextureImportDocument texture)

    Shows a texture.

  • public void SetChannel(TextureChannels channel, bool shown)

    Turns a channel on or off.

  • public void SetMipLevel(int level)

    Shows a different level of the chain.

  • public void Refresh()

    Recomputes the ladder and the facts from the settings as they stand.

Used by (3)

  • ImportViewTestsVixen.Editor.AssetEditors.Tests
  • SpriteViewTestsVixen.Editor.AssetEditors.Tests
  • TextureEditorFactoryVixen.Editor.AssetEditors