|
Boost : |
Subject: Re: [boost] [gil io_new review] Reading images fromin-memory sources
From: Domagoj Saric (domagoj.saric_at_[hidden])
Date: 2010-12-08 08:45:49
"Phil Endecott" <spam_from_boost_dev_at_[hidden]> wrote in message
news:1291755767785_at_dmwebmail.dmwebmail.chezphil.org...
> You're always reading 4 lines and asserting that rec_outbuf_height is not
> greater than this (as the docs say it will be). This is not unreasonably,
> but it's not exactly what I meant; in my code, I explicitly read exactly
> rec_outbuf_height lines.
Hmm, yes, this passage is definitely missing an implementation note :)
The assert is actually to be read the other way around, it is verifying that
I am providing enough scanlines for optimal reading (as recommended by the
documentation)...And the code does not actually read 4 lines, rather it
provides LibJPEG with the space to read up to 4 lines if it can/wants...it
is up to LibJPEG to decide how much to read...There is no need to read/use
the rec_outbuf_height value (unless you plan to dynamically allocate the
small scanlines buffer which would be self defeating) if the documentation
guarantees it will be between 1 and 4...
-- "What Huxley teaches is that in the age of advanced technology, spiritual devastation is more likely to come from an enemy with a smiling face than from one whose countenance exudes suspicion and hate." Neil Postman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk