Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to grab IconRef from a .tiff file.



On 8/22/03 3:09 PM, Mike Kluev didst favor us with:

> On 22/08/2003 21:45, Laurence Harris wrote:
>
>> 1) When you create the picture, you specify that it should use the alpha
>> channel with
>>
>> GraphicsImportSetGraphicsMode( gic, graphicsModeStraightAlpha, NULL );
>>
>> So when SetIconFamilyData creates the initial IconFamilyHandle, it draws the
>> image respecting the alpha channel.
>
> Is it? Previously you've said that GraphicsImportSetGraphicsMode(alpha)
> is ignored as far as subsequent SetIconFamilyData('PICT') is concerned.
> My testing shows that it is ignored.

Correction to my early statement: The alpha is ignored by
SetIconFamilyData() when creating the mask. It *is* used when drawing the
picture. In most pictures the difference is subtle, but I've tested it with
a TIFF file in which the difference is *not* subtle and it definitely makes
a difference in the image part of the icon.
>
>> Then the mask is created which basically
>> replicates the alpha channel, so when the icon is drawn, the alpha channel
>> is used twice, which doesn't yield the right image. I've changed it to
>> create two pictures: one without the alpha for creating the icon data, and
>> one *with* the alpha channel for use in creating the mask, and this yields a
>> more accurate result.
>
> If GraphicsImportSetGraphicsMode(alpha) is not really ignored as far
> as subsequent SetIconFamilyData('PICT') is concerned why do we need
> to manually create mask at all?

It's not ignored for the data, but it is for the mask. So you get icon data
that looks like the final image should appear, but you get a solid black
mask.
>
>> 2) The mask has significant banding in it. I haven't solved this yet, but I
>> have an idea or two I'm going to try.
>
> What kind of banding? The fragment I send was the final step of
> few iterations. Initially I was using 32 bit offscreen; that
> version required the secondary gray-scale offscreen to make
> final 32-bit to 8 bit conversion. Perhaps 32 bit offscreen will
> provide more accurate results.

That's what I'm hoping.
>
> I would appreciate if you send me the image(s) that causes these
> two problems.

Will do.

Larry
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: How to grab IconRef from a .tiff file. (From: Mike Kluev <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.