6 Replies Latest reply: Apr 22, 2013 1:23 PM by sinious RSS

    How can I apply camera live filters?

    BaCbDc Community Member

      I want to apply live filters on a smartphone camera

      (Android and iOS), so that you can see the filtered

      images on the display in real time.

       

      To get the camera images on the

      screen I've read I can use this code:

       

      var cam:Camera = Camera.getCamera();

      var vid:Video = new Video();

      vid.attachCamera(cam);

      addChild(vid);

       

      But how can I manipulte the camera pictures

      (turn them, set other colors, ...) real-time?

       

      Have I to manipulate the Camera object before

      the attachement to the Video object?, like this:

       

      class cam_fx extends Camera

      {

          public function filter1()

          {

          //manipulate image

          }

          public function filter2()

          {

          //manipulate image

          }

      }

       

      var cam:Camera = Camera.getCamera();

      var cam_fx:Camera = Camera.getCamera();

      var vid:Video = new Video();

      cam_fx = cam.filter1();

      vid.attachCamera(cam_fx);

      addChild(vid);

       

      And how can I then access the camera images in my filter routines?