RE: First stab at the Capture API (aka Camera API)

> >
> > An ability to set a [lower] resolution would also help to minimize
> the run-time memory allocation which should make apps more responsive
> and generally perform better. I'm sure using a canvas element is not
> the most efficient way to resize images albeit I like your creative
> approach ;)
> Right :) I was merely trying to push back (gently) to see if we didn't
> have a simpler solution. I agree that there is value in controlling the
> options (though I'd rather see them limited, given the complexity that
> we can open up).
> > [NoInterfaceObject]
> > interface captureImageOptions {
> >   attribute unsigned long limit;
> >   attribute double duration;
> >   attribute unsigned short width;  // [0, 65535] should be enough?
> >   attribute unsigned short height; // ditto ("640k is enough for
> everyone" etc.)
> > };
> Writing the WebIDL is always going to be the easy part here :) Do
> devices support setting width and height independently? If not which
> one determines which resolution is chosen? How does one fallback? There
> are plenty of annoying details to sort out here.

Here's the Flash/ActionScript API:

They have a method: public function setMode(width:int, height:int, fps:Number, favorArea:Boolean = true):void

width:int - The requested capture width, in pixels. The default value is 160.

height:int - The requested capture height, in pixels. The default value is 120.

fps:Number - The requested rate at which the camera should capture data, in frames per second. The default value is 15.

favorArea:Boolean (default = true) - Specifies whether to manipulate the width, height, and frame rate if the camera does not have a native mode that meets the specified requirements. The default value is true, which means that maintaining capture size is favored; using this parameter selects the mode that most closely matches width and height values, even if doing so adversely affects performance by reducing the frame rate. To maximize frame rate at the expense of camera height and width, pass false for the favorArea parameter.


IMPORTANT: This e-mail, including any attachments, may contain private or confidential information. If you think you may not be the intended recipient, or if you have received this e-mail in error, please contact the sender immediately and delete all copies of this e-mail. If you are not the intended recipient, you must not reproduce any part of this e-mail or disclose its contents to any other party. This email represents the views of the individual sender, which do not necessarily reflect those of except where the sender expressly states otherwise. It is your responsibility to scan this email and any files transmitted with it for viruses or any other defects. limited will not be liable for any loss, damage or consequence caused directly or indirectly by this email.

Received on Monday, 7 December 2009 22:29:55 UTC