https://github.com/riccardobl/ddswriter
DDSWriter is a command-line utility and java library to write compressed and uncompressed DDS.
https://github.com/riccardobl/ddswriter
compression dds dxt java jmonkeyengine mipmaps rgtc s3tc
Last synced: 15 days ago
JSON representation
DDSWriter is a command-line utility and java library to write compressed and uncompressed DDS.
- Host: GitHub
- URL: https://github.com/riccardobl/ddswriter
- Owner: riccardobl
- License: mit
- Created: 2017-02-13T22:49:02.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-04-05T10:45:01.000Z (about 4 years ago)
- Last Synced: 2025-05-08T01:09:40.032Z (15 days ago)
- Topics: compression, dds, dxt, java, jmonkeyengine, mipmaps, rgtc, s3tc
- Language: Java
- Homepage: https://jmonkeystore.com/431158ae-adc8-421f-bd7d-dd1dc419c612
- Size: 11.5 MB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/riccardobl/DDSWriter)
# DDSWriter
DDSWriter is a command-line utility and java library to write DDS.
It supports extensions with the use of delegates and CLI modules.A delegate is a class to which is delegated the task to write the header and the body of the DDS, a CLI module is an extension for the CLI interface.
## The Java library
#### Requirements
````gradle
def jme_version = "v3.1"
def jme_group = "com.github.jMonkeyEngine.jmonkeyengine"repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
compile "${jme_group}:jme3-core:${jme_version}"
compile "${jme_group}:jme3-desktop:${jme_version}"
}
````#### Library
````gradle
def version = "1.0"repositories {
maven { url 'https://jitpack.io' }
}dependencies {
compile "com.github.riccardobl.DDSWriter:dds_writer:$version"
}````
#### Usage
```java
com.jme3.texture.Texture tx=...; // Texture loaded with jmonkey
OutputStream fo=...;
Map options=...; // Options for ddswriter and for the delegates
Collection delegates=...; // List of delegate (needs at least one)
DDSWriter.write(tx,options,delegates,fo);
```#### Options
```gen-mipmaps``` = ```true```/```false``` - Enable/Disable mipmap generation```debug``` = ```true```/```false``` - Enable/Disable debug info
```format``` - Output format. (See delegates for available formats)
## The Command line
```
Usage: --in path/file.png --out path/out.dds [options]
Options:
--in : Input file
--out : Output file
--format: Output format. Default: ARGB8 (uncompressed)
--gen-mipmaps: Generate mipmaps
--exit: Exit interactive console
--debug: Show debug informations
Input formats:
jpg,bmp,png,tga,dds
Output formats:
ARGB8,RGB8,RGB565
```To use one or more delegates in CLI, they must be added to the classpath.
--help will be updated to show informations related to the delegate.## Delegates
### Generic (uncompressed)
Delegate that provides the following uncompressed formats: *RGB8* *ARGB9* *RGB565*```ddswriter.delegates.GenericDelegate delegate=new ddswriter.delegates.GenericDelegate();```
#### Gradle depencency
None: included in dds writer### LWJGL2 S3TC (DXT compression)
Delegate that provides S3tc (DXT) compression, it requires graphical drivers that support such compression and works only in an LWJGL2 context.This delegate adds the formats *S3TC_DXT1*,*S3TC_DXT2*,*S3TC_DXT5*.
```java
ddswriter.delegates.lwjgl2_s3tc.S3TC_LWJGL2CompressionDelegate delegate=new ddswriter.delegates.lwjgl2_s3tc.S3TC_LWJGL2CompressionDelegate();
```#### Gradle depencency
```gradle
compile 'com.github.riccardobl.DDSWriter:dds_writer__s3tc_lwjgl2_delegate:$version'
```### LWJGL2 RGTC (ATI compression)
Delegate that provides RGTC (ATI) compression, it requires graphical drivers that support such compression and works only in an LWJGL2 context.This delegate adds the formats *`RGTC1*,*RGTC2*.
```java
ddswriter.delegates.lwjgl2_rgtc.RGTC_LWJGL2CompressionDelegate delegate=new ddswriter.delegates.lwjgl2_rgtc.RGTC_LWJGL2CompressionDelegate();
```
#### Gradle depencency
```gradle
compile 'com.github.riccardobl.DDSWriter:dds_writer__rgtc_lwjgl2_delegate:$version'
```## Usage examples
#### CLI with s3tc delegator
```
java -cp "dds_writer__cli-fat-1.0.jar:dds_writer__s3tc_ati_lwjgl2_delegate-fat-1.0.jar" ddswriter.cli.CLI109 --help
```## Write a delegate
TODO## Write a CLI module
TODO[TODO LIST](TODO.md)