Mozilla2:Image Encoding

Revision as of 01:08, 8 March 2005 by Pavlov (talk | contribs)

Interface

We need to add a new interface. Do we want to support passing in an output stream? When you read from the stream should we encode just that much? Thoughts?

Something like:

interface imgIEncoder : nsISupports
{
  nsIOutputStream encode(imgIContainer image);

  /* Output width/height */
  attribute unsigned long width;
  attribute unsigned long height;

  /* scaling */
  ??
};

You would create one by doing:

createInstance("@mozilla.org/image/encoder;2?type=image/png");