[QT] Revisiting Crossplatform Scaling of GWorlds

[QT] Revisiting Crossplatform Scaling of GWorlds

Post by wormwoo » Fri, 26 Sep 2003 00:01:48

gt;A better way to perform scaling (it is more capable and gives better

Sorry for this delayed message, but I was off for a couple weeks...

I'm now using these calls for image scaling and they do work better.
However, the way QuickTime processes CMYK turned out not to be
acceptable. You called black processing "sophisticated," but by
having QuickTime ignore it completely causes loss of information
in the color conversion. Bolting on ColorSync after the fact would
be too late. I've submitted a bug report to Apple explaining the

A good online source for what I'm talking about is here...


...QT's current algorithm must cap convertion values to 255 for each
channel, since it's using a cruder add/subtract calculation, when
multiplication/division is required for accuracy.

As for QT 6.0's use of codecLosslessQuality for bicubic interpolation,
I'm only able to get it to work while using Graphics Importers, using
GraphicsImportSetQuality. I had to read Ice Floe Dispatch #8 before I
could grok what you were refering to as a "sequence"; I've tried using
both FDecompressImage and DecompressSequenceFrameS with bad results.
The former call still does point-sampling, and the latter always
produces garbage if I specify anything other than the identity matrix.

Here's the code excerpt I'm trying to get to work... The following
takes two GWorlds, inOldWorld and inNewWorld, as source and destination.
The source is either k24RGBPixelFormat, k8IndexedGrayPixelFormat, or
k32ARGBPixelFormat. (The last is after an in-place manual conversion
from CMYK.) The destination is k24RGBPixelFormat. Error checking
removed for clarity. Code fails under QT 6.0.3 under OS 9, and QT 6.3
under Windows XP. (My code base is also Carbon-compliant, but I don't
have access to a OS X system to test against just now.)

ImageDescriptionHandle imageDesc;
PixMapHandle theInMap, theOutMap;
MatrixRecord scaleMatrix;
/* ImageSequence theSequence;
CodecFlags theResults; */

SetGWorld((CGrafPtr)inNewWorld, NULL);

MakeImageDescriptionForPixMap(GetGWorldPixMap(inOldWorld), &imageDesc);

theInMap = GetGWorldPixMap(inOldWorld);
theOutMap = GetGWorldPixMap(inNewWorld);

RectMatrix(&scaleMatrix, &((**theInMap).bounds),

FDecompressImage(GetPixBaseAddr(theInMap), imageDesc,
theOutMap, NULL, &scaleMatrix, srcCopy, NULL, NULL, NULL,
codecLosslessQuality, anyCodec, (**imageDesc).dataSize,

/* DecompressSequenceBeginS(&theSequence, imageDesc, NULL, 0,
(CGrafPtr)inNewWorld, NULL, NULL, &scaleMatrix, srcCopy,
NULL, 0, codecLosslessQuality, NULL);

DecompressSequenceFrameS(theSequence, GetPixBaseAddr(theInMap),
(**imageDesc).dataSize, 0, &theResults, NULL);

CDSequenceEnd(theSequence); */

According to the QuickTime documentation, the Ice Floe note, as
well as info in the "What's New in QT 6" document, I appear to
be doing everything correctly... Any suggestions as to what I
could be doing wrong? I've tried changing "anyCodec" to specify
best fidelity, using MaxQuality instead of Lossless, using
ditherCopy instead of srcCopy, and expliciting passing the
identifier for the Raw/None codec. None of the variations worked.


1. NoMethodError: private method `load' called for Qt::UiLoader (was: Qt::UiLoader -> uninitialized constant Qt::QUiLoader)

2. Qt/Tcl, Qt-Tcl, Qt Tcl

in the moment, when it was first published, by some unexplainable
reason I named the page "qt_tcl_under_gpl". It must be renamed
because it's wrong.

It is not going to be published under GPL; The basic idea for this
licensing model is:
[1] User should not violate corresponding Tcl and Qt licenses terms.
[2] Author (i.e. myself or anyone who will join and write scripts for
Qtcl) does not have any responsibility for potential damages, that you
can do to your software systems, your body, home animals or the
environement by using this source code or binaries.
[3] if you liked it, the right to send me an e-mail with one word,
"thanks!", is reserved by you.

I am so impressed by Qt and Tcl possibilitites, used it for several
years and now willing to share what I figured with other people, for
Commercial companies will of course pay for the corresponded license
if they want to use the software, and it is only my responsiblitiy to
warn them about particular obligations when using a software under
particular licencse. Which I already did.

Thank you,

3. compiling Qt .... compiling Qt ....compiling Qt.... compiling Qt

4. Qt/Ruby bindings for Qt 4?

5. Qt::UiLoader -> uninitialized constant Qt::QUiLoader

6. Real Post: Upload Budapest Qt. "Sunrise" Qt.

7. Replacing a QT with another QT in Flash???

8. Problem: Compiling kernel: -lqt not found: qt not equal qt-mt?

9. QT application in linux (how to link dlls with QT(GUI) application

10. KDE / QT apps : configure error with QT

11. k3b 0.11.5 source wants Qt >= 3.1, but I just installed Qt 3.3

12. Qt vs. GTK+ (was: Qt Ada database support?)

13. new QT install made QT default ie6 player; how do I make it mplayer?

14. pre-configured panel pc with cf and qt or qt/e available?

15. #QT): We're "Outing" The Snake Oil Gurus #QT):vx