QLMesh - mipmaps preview for compressed textures
For the new version of QLMesh I have added preview of compressed textures. No big thing, but with mipmaps support it is quite handy solution.
Turned out to be not so complex:
CGContextRef kcontext = QLPreviewRequestCreatePDFContext(preview, NULL, NULL, properties);
...
CGImageRef cimage = ...;
// Fill 3/4 of the rect
const float enlarge = 1.0 + 0.48*i*i;
CGRect canvasRect = CGRectMake((image[0].width - w*enlarge)/2, (image[0].height - h*enlarge)/2, w*enlarge, h*enlarge);
CGContextBeginPage(kcontext, &pageRect);
CGContextDrawImage(kcontext, canvasRect, cimage);
CGContextEndPage(kcontext);
Comments