[Development] Imageformats v2
abbapoh at gmail.com
Tue May 19 20:56:46 CEST 2015
Thanks for reply.
Yes, frames should actually be renamed to something more generic (array element? page? resourceCount? - i couldn’t find the right name yet). Actually, DDS doesn’t support animation, but it supports texture arrays which should be implemented using "frames".
I didn’t think about reading pdf files as an image, but why not… Thumbnails seems pretty close to mipmaps. Can there be multiple thumbnails of the different size for a page?
19 мая 2015 г., в 21:12, Rutledge Shawn <Shawn.Rutledge at theqtcompany.com> написал(а):
> I think the new API should have multi-page support. It would be useful for pdf, djvu, multi-page tiff, and for looking at individual frames of animated gif, png, etc., to the extent that we write plugins for those.
> I wrote a QQuickImageProvider for PDF (using poppler), but requestImage takes only an “id” string to identify the image. So I had to make up a composite id containing both the filename and the page number. (much like a URL format would be, if you had to request multiple pages from a web server) So that’s the next API that needs to have some support for paging.
> Can “frame” be considered the same as “page”? But I see that you also have a subimage concept in mind.
> Sometimes (as in icon files, or in any kind of file that also includes a smaller preview image) the sub images would be the same thing at different resolution, right? That is orthogonal to the idea of paging: a PDF file can have multiple pages, and also embedded thumbnails for each page. In order for an image format plugin to be enough to write a PDF reader application, it would need to support paging, and also getting the thumbnails for the pages.
> In QQuickImageProvider::requestImage, requestedSize can also be given. So that’s one way to specify a thumbnail: if the available thumbnail is near enough to requestedSize, return that instead. The API anyway does not guarantee that you get exactly the size that you ask for.
> Eventually we could get to the point that a plain Image in QML could be used as a PDF viewer, all by itself. It would also need a paging API.
More information about the Development