Bug 1197 - Texture and image API revamping
Summary: Texture and image API revamping
Status: UNCONFIRMED
Alias: None
Product: Jogl
Classification: JogAmp
Component: util (show other bugs)
Version: tbd
Hardware: All all
: P5 enhancement
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2015-08-20 17:23 CEST by Julien Gouesse
Modified: 2019-03-29 13:58 CET (History)
1 user (show)

See Also:
Type: FEATURE
SCM Refs:
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Gouesse 2015-08-20 17:23:55 CEST
com.jogamp.opengl.util.texture.ImageType should be used to represent the image type in several places in the API, in TextureIO and internally.

ImageType should contain the extensions of the image format. There isn't always a 1 to 1 match between the "file suffix" and the image type. For example, the files in JPEG format can use several filename extensions:
.jpg, .jpeg, .jpe, .jif, .jfif, .jfi

"(fileSuffix == null) ? IOUtil.getFileSuffix(file) : fileSuffix;" should be used in TextureIO in order to get the file suffix consistently and drive the input parameter final instead of modifying an input.

The interface TextureWriter supports only the writing of a single TextureData instance into a single file whereas some image format supports containing multiple images in a single file, for example ICNS and ICO. Another interface could be created or TextureWriter should be modified.

Maybe a conversion tool could be added into TextureIO. TextureIO has numerous readers and writers. An Ant task could be useful too (mine was refused in Apache Commons Imaging). This last feature might be moved into a separate bug report if it goes beyond the objectives of the version 2.4.