Il 21/01/2017 15:02, Иван Комиссаров ha scritto: > Do I understand correctly that all is needed is to scan header of the > texture, get some info from it and than load whole texture to the byte > array?
Yes, get some metadata from the file, and no, not necessarily extract the images as byte arrays. It would actually be a total waste to copy it in CPU memory if you can avoid that. The ideal and easy path would be getting a QOpenGLTexture out of such a file with 0 CPU copies (e.g.: mmap the file, upload into texture). > It may be reasonable to create separate libraries that handle specific > textures (dds, etc1, …). I don't see the point at this stage, nor what advantage it would bring to the user if she has to identify the file format first, and then use a specific loader. (Side note: DDS is a file format, ETC1 is a compression format. We want to parse/load data from the file, not decode or decompress such data.) > For now, I see some duplication of the code - there are similar > structures in qt3d/src/threed/textures/qgltextureutils.cpp and > qtimageformats/src/plugins/imageformats/dds/ddsheader.h, for example. Yes, the one in qt3d should be extracted and reused, alongside with the KTX format reader. The one in qtimageformats is currently dead. Cheers, -- Giuseppe D'Angelo | [email protected] | Senior Software Engineer KDAB (UK) Ltd., a KDAB Group company | Tel: UK +44-1625-809908 KDAB - Qt, C++ and OpenGL Experts
smime.p7s
Description: Firma crittografica S/MIME
_______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
