Skip to content

Go library for Arma/DayZ EDDS (Enfusion DDS) read/write with optional LZ4 chunk‑stream compression

License

Notifications You must be signed in to change notification settings

WoozyMasta/edds

Repository files navigation

edds

Minimal EDDS reader/writer for Arma/DayZ with LZ4 chunk-stream support.

edds reads and writes EDDS files (DDS header + block table + block bodies), supports COPY/LZ4 blocks, and decodes the largest mipmap into RGBA.

Implemented

  • EDDS read (config + decode largest mip)
  • EDDS write (RGBA/BGRA and BC1/BC2/BC3, optional mipmaps)
  • Optional passthrough of bcn.EncodeOptions (quality/workers/etc.)
  • LZ4 Enfusion chunk-stream compress/decompress (COPY/LZ4 blocks)
  • DDS header interop via github.com/woozymasta/bcn

Usage

Read EDDS

img, err := edds.Read("atlas.edds")
if err != nil {
  /* handle */
}
_ = img

Read config only

cfg, err := edds.ReadConfig("atlas.edds")
if err != nil {
  /* handle */
}
_ = cfg

Write EDDS with mipmaps (BGRA8)

err := edds.WriteWithMipmaps(img, "atlas.edds", 0) // 0 = full chain
if err != nil {
  /* handle */
}

Write EDDS with format

err := edds.WriteWithFormat(img, "atlas_bc5.edds", bcn.FormatBC5, 0)
if err != nil {
  /* handle */
}

Write EDDS with full options

err := edds.WriteWithOptions(img, "atlas_dxt5.edds", &edds.WriteOptions{
  Format:     bcn.FormatDXT5,
  MaxMipMaps: 0,
  Compress:   true,
  EncodeOptions: &bcn.EncodeOptions{
    QualityLevel: 8,
    Workers: 0,
  },
})
if err != nil {
  /* handle */
}

Write EDDS from pre-encoded blocks

err := edds.WriteFromBlocks("atlas_bc3.edds", bcn.FormatDXT5, width, height, mipPayloads)
if err != nil {
  /* handle */
}

Notes

  • Package-level encode/decode supports BGRA8, RGBA8, DXT1/3/5, BC4, BC5.
  • DXT3, BC4, BC5 may decode in tooling but may not display correctly in-game/Workbench.
  • Only 2D textures are handled.

About

Go library for Arma/DayZ EDDS (Enfusion DDS) read/write with optional LZ4 chunk‑stream compression

Topics

Resources

License

Stars

Watchers

Forks

Contributors