Commit Graph

13 Commits

Author SHA1 Message Date
Paul Allen e95d403a5f Don't need to expose classes outside the package
DDSHeader, DDSReader, DDSType
2024-09-24 11:02:13 +01:00
Paul Allen a648d1a327 Convert 4byte array into %08x string format. 2024-09-24 10:58:25 +01:00
Paul Allen bcfab45977 Format tabs -> 4 spaces 2024-09-24 10:39:12 +01:00
Paul Allen 771e486b59 Update imageio/imageio-dds/src/main/java/com/twelvemonkeys/imageio/plugins/dds/DDSHeader.java
Improve Magic IIOException

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>
2024-09-24 09:56:19 +01:00
Paul Allen be2d6d6053 Update imageio/imageio-dds/src/main/java/com/twelvemonkeys/imageio/plugins/dds/DDSHeader.java
Improve IIOException "Invalid DDS header size"

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>
2024-09-24 09:55:27 +01:00
Paul Allen dede5eabb5 Use Enum DDSType instead of int values.
Pass imageIndex into mipmap.
2024-09-19 19:03:33 +01:00
Paul Allen 7eb45b1245 Code cleanup and added exception handling. 2024-09-19 13:43:27 +01:00
Paul Allen 79aef6e14a Remove offset and use imageInput.readFully
Reads next image calculating/updating width/height from mipmapLevel.
Probably will never get used as we only want the largest image returned.
2024-09-18 16:57:56 +01:00
Paul Allen 7082a5310f Added processImageStarted and stubbed out processImageProgress and processReadAborted
Added all DDS format test cases to getTestData
2024-09-17 16:57:54 +01:00
Paul Allen 0cd056ac54 Push ImageInputStream into DDSReader
Unable to determine buffer length (so as a hack I over allocate buffer and read)

```
byte[] buffer = new byte[width * height * 4];
int len = imageInput.read(buffer);
```

Added test files for all supported formats.
2024-09-17 16:37:11 +01:00
Paul Allen 120d6eba54 Fix pixel order to ARGB 2024-09-16 17:29:35 +01:00
Paul Allen ec7635d7d8 Read header (DDSHeader) and pass into DDSReader
Remove header methods using buffer offset addressing.
Switch endian for DX1-DX5 types
2024-09-16 17:28:56 +01:00
Paul Allen 82bf4851ab Basic wrapper around DDSReader.
Nasty hack to get initial plugin working...
Mark and Reset the imageinput stream when reading the header.  Then read the whole buffer into DDSReader and generate a fixed BufferedImage ignoring the getDestination() BufferedImage.
2024-09-13 15:51:00 +01:00