GithubHelp home page GithubHelp logo

riccardobl / ddswriter Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 2.0 11.82 MB

DDSWriter is a command-line utility and java library to write compressed and uncompressed DDS.

Home Page: https://jmonkeystore.com/431158ae-adc8-421f-bd7d-dd1dc419c612

License: MIT License

Java 92.82% Shell 3.63% C 3.30% Batchfile 0.26%
dds compression dxt mipmaps jmonkeyengine java s3tc rgtc

ddswriter's Introduction

Build Status

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

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

def version = "1.0"

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    compile "com.github.riccardobl.DDSWriter:dds_writer:$version"
}

Usage

com.jme3.texture.Texture tx=...; // Texture loaded with jmonkey
OutputStream fo=...; 
 Map<String,String> options=...; // Options for ddswriter and for the delegates
Collection<DDSDelegate> 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: <CMD> --in path/file.png --out path/out.dds [options]
Options: 
   --in <FILE>: Input file
   --out <FILE.dds>: 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.

ddswriter.delegates.lwjgl2_s3tc.S3TC_LWJGL2CompressionDelegate delegate=new ddswriter.delegates.lwjgl2_s3tc.S3TC_LWJGL2CompressionDelegate();

Gradle depencency

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.

ddswriter.delegates.lwjgl2_rgtc.RGTC_LWJGL2CompressionDelegate delegate=new ddswriter.delegates.lwjgl2_rgtc.RGTC_LWJGL2CompressionDelegate();

Gradle depencency

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

ddswriter's People

Contributors

aegroto avatar riccardobl avatar tehleo avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

tehleo lm165678

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.