tacentview icon indicating copy to clipboard operation
tacentview copied to clipboard

Add a 'raw data' viewer like PVRTexTool

Open applecuckoo opened this issue 2 years ago • 1 comments

Basically something like this: raw

applecuckoo avatar Feb 24 '24 21:02 applecuckoo

This pvrtextool dialog is for wrapping existing raw data with the pvr header... tacentview does not yet support saving pvr files. However, it may be reasonable to allow display of 'raw' pixel data if you happen to know the pixel-format, dimensions, mipmaps etc. Will leave this request open but may not get to it for a while. Thx for the suggestion.

bluescan avatar Feb 25 '24 10:02 bluescan

Tentative plan here is to make a 'raw import' dialog. The dialog would allow specification of the filetype to create (only lossless filetypes much like the paste filetypes).

Fields of the raw-import dialog would include:

  • Filename
  • Pixel Data Offset (default 0)
  • Pixel format. Would include BC / ASTC / Packed / ETC / EAC / PVR but probably not palettized or vendor-specific formats.
  • Width / Height
  • Mipmaps (default off)
  • Colour profile (specifies both colour-space and LDR/HDR). This is less ambiguous than just a colour-space because quite often the space of the RGB components is sRGB while the alpha is linear.
  • Premultiplied alpha. For formats that support an alpha channel, if premult was true we would need to 'undo' it by multiplying by the reciprocal of the alpha.

Note: Updating display 'live' would be needed so different dimensions / offsets could be experimented with on the fly. Note: Care would have to be taken that we don't ever overrun the available data by pre-computing the needed buffer size given the width/height/mips/pixel-format. This would then be compared to the actual size of the data being imported (filesize - offset) and if too little data not performing an import. Would need a warning message of some kind.

bluescan avatar Jun 14 '24 09:06 bluescan

image

Still ToDo:

  • Allow changing filetype in same import session [done]
  • Support the remaining filetypes (TIFF, APNG, WEBP done, TGA, PNG, QOI, and BMP not). [done]
  • Implement the 'live' checkbox. [done]
  • Colour profile selection. [done]
  • Premultiplied alpha checkbox. [done]
  • Better messaging when import fails (decode error, not enough data, etc). [done]
  • Needs 4 buttons: Import, Cancel, OK, Reset. [done]
  • Cleanup UI layout. [done]
  • Need an option for row ordering (top to bottom or bottom to top) [done]
  • Figure out where to display the 'preview' and 'live preview' text. [done]
  • Create more test raw images with and without mipmaps/offsets.

bluescan avatar Jun 23 '24 22:06 bluescan

This is the final version of the import dialog. Will close this issue after testing a few more raw files. image

bluescan avatar Jul 01 '24 05:07 bluescan

Commit ee73529ed9d1bad6e72c18b0143dac7e9dc4c0fd includes various raw test images.

bluescan avatar Jul 01 '24 13:07 bluescan