Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Add support for Apple KTX format

Đang mở
#39 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
csharp
Lĩnh vực
computer-graphics

Hướng nghiên cứu

Start by reviewing the ImageSharp.Textures code and the proof-of-concept commit, then inspect the linked LzfseSharp implementation and the existing ASTC support. Done means loading the documented Apple KTX chunks, decoding the LZFSE payload, and exposing the result as standard ASTC texture data despite the unpublished format specification.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Would there be any interest in adding support for the Apple KTX format? It would be very useful, at least for us, to be able to use this directly in ImageSharp. I saw that a request for adding support for CgBI images (another internal Apple image format) had been accepted, and this is a very similar situation.

It is a supercompressed variant of KTX1 using LZFSE. Once decrompressed from LZFSE, the textures can be decompressed as a standard ASTC compressed KTX texture.

The main challenge would be incorporating an LZFSE decoder in ImageSharp.Textures. I have an implementation that could, with a little improvement, be incorporated in ImageSharp.Textures as I have done for ASTC. LZFSE is thankfully a lot simpler and the scope is therefore much smaller than ASTC.

The other challenge is that this is an internal Apple variant with no published spec (that I could find).

I have made a proof of concept implementation: https://github.com/Erik-White/ImageSharp.Textures/commit/163f828bd9801917e5fd542e59a1fff5f37c8c17

Layout
[8 bytes]  Magic: AAPL\r\n\x1A\n  (0x4141504C 0D0A1A0A)
[chunks]   Sequence of tagged chunks until end of file

Each chunk has an 8-byte header:

[4 bytes]  Data size (little-endian uint32)
[4 bytes]  Identifier (ASCII, e.g. "HEAD", "LZFS", "FILL")
[N bytes]  Chunk data

HEAD chunk (84 bytes) contains texture metadata. Key fields at byte offsets within the
chunk data:

Offset Size Field
16 4 Internal pixel format (OpenGL enum, e.g. 0x93B0 = ASTC 4x4)
24 4 Width
28 4 Height
32 4 Depth
36 4 Number of array elements
40 4 Number of faces
44 4 Number of mipmap levels

LZFS chunk holds the texture payload. The first 4 bytes after the chunk header are skipped,
and the remainder is LZFSE-compressed ASTC block data.

Ngôn ngữ chính
C#
Star
67
Fork
17
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của SixLabors/ImageSharp.Textures

Tất cả issue của SixLabors/ImageSharp.Textures

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.