NPAPI:DrawImage: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 64: Line 64:
   } NPImageData;
   } NPImageData;


= NPImageFormat type negotiation =
= NPImageFormat Type Negotiation =


<pre>
* NPNVSupportedImageFormats (NPNVariable = ?)
NPNVsupportsImageFormat = 5000,
* NPPVImageFormat (NPPVariable = ?)
</pre>


Similar to Event types negotiation [[Plugins:IndependentEventModel#NPEventType_negotiation]]
Negotiating the image format will work similarly to [[NPAPI:Models|drawing and event model negotiation]], but the value of NPNVsupportsImageFormat will be a bitmap of supported types. Based on the browser's supported formats, the plugin should select a format.


<pre>
  NPImageFormat supportedFormats;
NPImageFormat aFormats;
  browserFuncs->getvalue(instance, NPNVsupportsImageFormat, &supportedFormats);
browser->getvalue(instance, NPNVsupportsImageFormat, &aFormats)
  ...
</pre>
  browserFuncs->setvalue(instance, NPPVImageFormat, (void*)selectedFormat);
 
Then the plugin should decide which formats supported by plugin and browser (remove bits which are not supported by plugin), and send a value to browser:
 
<pre>
browser->setvalue(instance, NPNVsupportsImageFormat, commonFormats);
</pre>
 
And then browser should use only formats enumerated in commonFormats value.
 
According to plugin state (transparency), and platform proffered depth/image-format browser will send event to plugin with specific format.
Confirmed users, Bureaucrats and Sysops emeriti
1,680

edits

Navigation menu