Re: Image processing in Cocoa
Re: Image processing in Cocoa
- Subject: Re: Image processing in Cocoa
- From: "Christian Giordano" <email@hidden>
- Date: Thu, 25 Sep 2008 11:52:08 +0100
I think I found what to do. I need to create a bitmap context from the
bitmap and drawing there. It makes sense that everything drawn is
handled by contexts of course, I'm just a bit concerned about
performances.
Thanks, chr
On Thu, Sep 25, 2008 at 7:35 AM, Christian Giordano
<email@hidden> wrote:
> Hi Helder, I found this post that can be really helpful when I will
> have to do my pixel operations:
>
> http://www.rodgutierrez.com/blog/2008/07/how-to-create-a-rgba-cgimagere.html
>
> I still have to find how to draw an CGImageRef in another one
> regardless the current context, I'm still wondering if this is the
> right approach.
>
> I will look better in the documentation.
>
>
> Thanks, chr
>
>
>
> On Thu, Sep 25, 2008 at 5:06 AM, Helder da Rocha
> <email@hidden> wrote:
>> Since you can't use NSImage, you could try Core Image.
>>
>> You can do all that with CGImage in your restricted environment. You can use
>> a bitmap or layer context and then later render it on whatever view you
>> wish.
>>
>> There is a good Core Graphics Quartz tutorial at
>> http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_intro/chapter_1_section_1.html
>>
>> Helder.
>>
>> --
>> Helder da Rocha (email@hidden)
>> Sao Paulo, Brazil
>>
>>
>> Christian Giordano wrote:
>>>
>>> Thanks Mike, I can't use NSImage (guess why) but a subset. Btw, the
>>> problem I have is that I have a view which contains an image. I would
>>> like to draw in the image, not in the container view so I need to
>>> provide to the draw method the image context. Is this a good approach
>>> or all the drawing should happen in the view context? Should I extend
>>> the image view and handle the routing internally?
>>>
>>> Thanks, chr
>>>
>>>
>>> On Wed, Sep 24, 2008 at 11:08 AM, Mike Abdullah
>>> <email@hidden> wrote:
>>>
>>>>
>>>> On 24 Sep 2008, at 10:50, Christian Giordano wrote:
>>>>
>>>>
>>>>>
>>>>> Hi guys, is there some good tutorial around about how to manipulate
>>>>> bitmaps in Cocoa?
>>>>>
>>>>> I would be interested on:
>>>>>
>>>>> - copy portion of image over another with a mask (this should be
>>>>> pretty straight forward with quartz2d)
>>>>>
>>>>
>>>> [[NSImage alloc] initWithSize:]
>>>> [image lockFocus]
>>>> [sourceImage drawAtPoint:point fromRect:imagePortionRect
>>>> operation:operation
>>>> fraction:1.0]
>>>> [image unlockFocus]
>>>>
>>>>
>>>>>
>>>>> - apply threshold
>>>>> - apply effects like blur
>>>>>
>>>>
>>>> Core Image is your friend
>>>>
>>>>>
>>>>> Not sure if some of this, like the blur, is recommended to do from an
>>>>> higher level instead of doing it pixel by pixel. In case of the
>>>>> latter, how to get the bytearray with all the pixels info?
>>>>>
>>>>> Thanks a lot, chr
>>>>> _______________________________________________
>>>>>
>>>>> Cocoa-dev mailing list (email@hidden)
>>>>>
>>>>> Please do not post admin requests or moderator comments to the list.
>>>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>>>>
>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>
>>>>>
>>>>>
>>>>> This email sent to email@hidden
>>>>>
>>>>
>>>>
>>>
>>> _______________________________________________
>>>
>>> Cocoa-dev mailing list (email@hidden)
>>>
>>> Please do not post admin requests or moderator comments to the list.
>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>>
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>>
>>> This email sent to email@hidden
>>>
>>>
>>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden