Mozilla2:Image Encoding: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 21: Line 21:
=== Brendan's comments ===
=== Brendan's comments ===
A reader should get the bytes requested, if not greater than length of encoded image, and it's up to the encoder to buffer more if it encodes more bytes, reading from the buffer on next read.
A reader should get the bytes requested, if not greater than length of encoded image, and it's up to the encoder to buffer more if it encodes more bytes, reading from the buffer on next read.
=== Darin's comments ===
Since imgIEncoder is something users CreateInstance, how about changing the interface to be something like this:
interface imgIEncoder : nsIInputStream
{
  void init(in imgIContainer input, in unsigned long width, in unsigned long height);
};
This expresses the idea that the encoder is something you read from.


== Use ==
== Use ==
You would create one by doing:
You would create one by doing:
  createInstance("@mozilla.org/image/encoder;2?type=image/png");
  createInstance("@mozilla.org/image/encoder;2?type=image/png");
272

edits

Navigation menu