Mozilla2:Image Encoding: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
== Interface == | == Interface == | ||
We need to add a new interface. | We need to add a new interface. When you read from the stream should we encode just that much? Thoughts? | ||
Something like: | Something like: | ||
| Line 6: | Line 6: | ||
interface imgIEncoder : nsISupports | interface imgIEncoder : nsISupports | ||
{ | { | ||
void encode(imgIContainer in, nsIInputStream out); | |||
/* Output width/height */ | /* Output width/height */ | ||
Revision as of 01:22, 8 March 2005
Interface
We need to add a new interface. When you read from the stream should we encode just that much? Thoughts?
Something like:
interface imgIEncoder : nsISupports
{
void encode(imgIContainer in, nsIInputStream out);
/* Output width/height */
attribute unsigned long width;
attribute unsigned long height;
/* type of scaling */
const unsigned long SCALE_BAD = 0;
const unsigned long SCALE_NORMAL = 1;
const unsigned long SCALE_GOOD = 2;
attribute unsigned long scaling;
};
You would create one by doing:
createInstance("@mozilla.org/image/encoder;2?type=image/png");