IPAD must-haves. And fun-to-haves.

Brighten your iPad with a colorful cover, stream to your TV, download pictures from your digital camera, and more. There’s already so much you can do with iPad and iPad mini

Apple Wireless Keyboard

The incredibly thin Apple Wireless Keyboard uses Bluetooth technology, which makes it compatible with iPad

Apple unveils iPad mini: ‘Thin as a pencil, light as paper’

iPad inspires creativity and hands-on learning with features you won’t find in any other educational tool

Lightning connector and FaceTime HD camera

Apple announces 4th generation iPad packing an A6X CPU

Pages

Showing posts with label CIImageAccumulator. Show all posts
Showing posts with label CIImageAccumulator. Show all posts

Sunday, February 3, 2013

Undo CIImageAccumulator

I have painting app witch works like that:

 

  • On mouseDown/mouseDragged event I draw a point in event location with CIRadialGradient
  • Take CIRadialGradient outputImage and use it in CICompositeSourceOver filter as inputImage (inputBackground at beggining is empty CIImage)
  • Set CICompositeSourceOver outputImage as brushAccumulator image (later brushAccumulator image is used as inputBackgroundImage in CICompositeSourceOver filter)
  • Set brushAccumulator image as CIBlendWithMask inputMaskImage
  • Set CIBlendWithMask outputImage as mainImageAccumulator image
  • Draw mainImageAccumulator to screen

 

And I want to implement undo method. Firstly I thought I could use brushAccumulator.image (CIImage) as undo object (add it to mutableArray, then when undo method is invoked set brushAccumulator image to one of mutableArray objects) but I found that:

A CIImage is not an image that contains pixels, it is simply the result of a series of instructions to build it, the output of a CIFilter for example. So if you copy the CIImage you just copy those instructions, which when modified would modify the ouput.

 

So I thought I could make NSBitmapImageRep from brushAccumulator's image and store it to NSMutableArray. But I met problems with updating brushAccumulator. I set the new CIImage wich is made from one of NSBitmapImageRep from NSMutableArray as brushAccumulator image, but brushAccumulator image doesn't changes.

 

What could you offer me to achieve undo/redo effect, while my painting app is based on CIImageAccumulator (similar to CIMicroPaint sample code)?


View the original article here

Saturday, February 2, 2013

Undo CIImageAccumulator

I have painting app witch works like that:

 

  • On mouseDown/mouseDragged event I draw a point in event location with CIRadialGradient
  • Take CIRadialGradient outputImage and use it in CICompositeSourceOver filter as inputImage (inputBackground at beggining is empty CIImage)
  • Set CICompositeSourceOver outputImage as brushAccumulator image (later brushAccumulator image is used as inputBackgroundImage in CICompositeSourceOver filter)
  • Set brushAccumulator image as CIBlendWithMask inputMaskImage
  • Set CIBlendWithMask outputImage as mainImageAccumulator image
  • Draw mainImageAccumulator to screen

 

And I want to implement undo method. Firstly I thought I could use brushAccumulator.image (CIImage) as undo object (add it to mutableArray, then when undo method is invoked set brushAccumulator image to one of mutableArray objects) but I found that:

A CIImage is not an image that contains pixels, it is simply the result of a series of instructions to build it, the output of a CIFilter for example. So if you copy the CIImage you just copy those instructions, which when modified would modify the ouput.

 

So I thought I could make NSBitmapImageRep from brushAccumulator's image and store it to NSMutableArray. But I met problems with updating brushAccumulator. I set the new CIImage wich is made from one of NSBitmapImageRep from NSMutableArray as brushAccumulator image, but brushAccumulator image doesn't changes.

 

What could you offer me to achieve undo/redo effect, while my painting app is based on CIImageAccumulator (similar to CIMicroPaint sample code)?


View the original article here