[Development] qdds image format

Sean Harmer sean.harmer at kdab.com
Thu Apr 19 12:36:01 CEST 2018

On 17/04/2018 15:33, Иван Комиссаров wrote:
> At the point i wrote the plugin, my usecase was simple - to convert 
> plain QImages to and from DDS icons (used in starcraft2, which uses 
> quite a few formats DDS can handle).
> But yes, i forgot floating point textures.
> Compressed textures (DXTN/ATI2) are just compressed (a)rgb32, nobody 
> uses compressed jpeg, it is decompressed before usage (correct me if i'm 
> wrong, but videocards uses DDS because it's decompression algorithm can 
> be easily implemented in hardware)

DDS is just a container format. Peppe's point stands, QImage and friends 
are the wrong vehicle for supporting this. They simply do not offer 
enough degrees of freedom in the API to do so properly. And adding them 
would be changing what QImage is designed for.

QImage is designed to represent a single image in one of a few supported 
formats. Proper texture support needs to be able to address images by 
mip level, array layer and cubemap face in any of the formats supported.

The compressions used by various formats supported within a DDS (or KTX) 
file are designed so they can be decompressed on the fly for a small 
block of pixels. These block compression algorithms do not offer such 
on-disk savings as png/jpeg but are much easier to sample from in access 
patterns typically required by fragment shaders.

I'm not saying a tool to convert to/from dds/some other format would not 
be useful. Just that QImage is the wrong way to approach this due to the 


> 2018-04-17 14:28 GMT+03:00 Giuseppe D'Angelo <giuseppe.dangelo at kdab.com 
> <mailto:giuseppe.dangelo at kdab.com>>:
>     On 17/04/18 13:21, Иван Комиссаров wrote:
>         Ok, there's another problem with QImage - ARGB64 and friends...
>         This can be solved adding QImage::pixel64() or something like
>         that... or use QTexture with 64bit "pixel"
>     And a bunch of packed formats not currently supported, and floating
>     point channels, and compressed texture formats. I stand my point:
>     DDS files are not meant to be handled by QImage.
>     What is your use case exactly for wanting this support?
>     Cheers,
>     -- 
>     Giuseppe D'Angelo | giuseppe.dangelo at kdab.com
>     <mailto:giuseppe.dangelo at kdab.com> | Senior Software Engineer
>     KDAB (France) S.A.S., a KDAB Group company
>     Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
>     KDAB - The Qt, C++ and OpenGL Experts
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development

Dr Sean Harmer | sean.harmer at kdab.com | Managing Director UK
KDAB (UK) Ltd, a KDAB Group company
Tel. +44 (0)1625 809908; Sweden (HQ) +46-563-540090
Mobile: +44 (0)7545 140604
KDAB - Qt Experts

More information about the Development mailing list