Ross,

thanks for pointing out this behaviour. I will change this in my code.
This message may be helpfull to the lcms list too. Therefore I crosspost.

As about libtiff fax coding I must pass. I am coming from the float side,
working on HDR imagery.

kind regards
Kai-Uwe Behrmann
                                + imaging development / panoramas
                                + color management
                                + email: [EMAIL PROTECTED]


Am 04.11.04, 00:38 -0800 schrieb Ross A. Finlayson:

>
>
> On Thu, 4 Nov 2004, Kai-Uwe Behrmann wrote:
>
> > Thanks, have found it. Testing of the pointers for zero should do.
> >
> > if (TIFFGetField (tiff, TIFFTAG_TRANSFERFUNCTION,
> >                   &r_uint16, &g_uint16, &b_uin16) )
> >     if (r_uin16)
> >         // there is at least one kurve
> >     if (r_uint16 && g_uin16 && b_uint16)
> >         // there are 3 curves
> >
> > regards
> > Kai-Uwe Behrmann
> >                                 + imaging development / panoramas
> >                                 + color management
> >                                 + email: [EMAIL PROTECTED]
> >
> >
> > Am 04.11.04, 07:42 +0100 schrieb Kai-Uwe Behrmann:
> >
> > > Hi,
> > >
> > > How can I determine the size of TIFFTAG_TRANSFERFUNCTION to calculate
> > > the number of curves used by the tag. As stated in the spec 1 and 3 curves
> > > are both possible for RGB. For GRAY I would expect 1 curve is allways ok.
> > >
> > > man TIFFGetField only says:
> > > TIFFTAG_TRANSFERFUNCTION    1 or 3- uint16**1<<BitsPerSample entry arrays
> > >
> > > Just to be shure, I dont exceede memory.
> > >
> > > regards
> > > Kai-Uwe Behrmann
>
> Hi Kai-Uwe,
>
> I'm uncertain of the answer for that.  I think instead you should compare
> the pointers to each other because if there is only one transfer function
> that each of the three pointers is set to the same value.  So tiff2pdf
> compares the first to the second pointer to see if they are different.  If
> they are the same, then there is only one transfer function, otherwise,
> three.  I looked at the source code where that is done before I coded
> that.
>
> Here is some copied code, from tif_dirread.c:
>
>                 case TIFFTAG_TRANSFERFUNCTION:
>                         /*
>                          * TransferFunction can have either 1x or 3x data
>                          * values; Colormap can have only 3x items.
>                          */
>                         v = 1L<<td->td_bitspersample;
>                         if (dp->tdir_tag == TIFFTAG_COLORMAP ||
>                             dp->tdir_count != (uint32) v) {
>                                 if (!CheckDirCount(tif, dp,
> (uint32)(3*v)))
>                                         break;
>                         }
>                         v *= sizeof (uint16);
>                         cp = CheckMalloc(tif, dp->tdir_count, sizeof
> (uint16),
>                             "to read \"TransferFunction\" tag");
>                         if (cp != NULL) {
>                                 if (TIFFFetchData(tif, dp, cp)) {
>                                         /*
>                                          * This deals with there being
> only
>                                          * one array to apply to all
> samples.
>                                          */
>                                         uint32 c =
>                                             (uint32)1 <<
> td->td_bitspersample;
>                                         if (dp->tdir_count == c)
>                                                 v = 0;
>                                         TIFFSetField(tif, dp->tdir_tag,
>                                             cp, cp+v, cp+2*v);
>                                 }
>                                 _TIFFfree(cp);
>                         }
>                         break;
>
> It sets the pointers to cp, cp+v, and cp+2*v.  So, if there is only one
> transfer function, then each pointer is set to cp, where v==0.  So, if cp
> != cp+v, then there are multiple transfer functions for the multiple
> channels, to get the transfer function count.
>
> The answer of one for all or three separate transfer functions is whether
> r_uint16 == g_uint16 in your example.  Is that not so?
>
> Then, I have a question, it is off-topic, but I wonder if the fax codec
> supports uncompressed mode anymore.  I tinker upon a fax codec, and want
> to understand libtiff's fax compression codec.  Are you familiar with any
> limits of the libtiff fax codec?
>
> Warm regards,
>
> Ross F.
>
>
> _______________________________________________
> Tiff mailing list
> [EMAIL PROTECTED]
> http://xserve.flids.com/mailman/listinfo/tiff
>

Mit freundlichen Grüßen

Kai-Uwe Behrmann
                                + Bildprogrammierung / Panoramen
                                + Farbmanagement
                                + email: [EMAIL PROTECTED]





-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id065&op=click
_______________________________________________
Lcms-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to