Skip to content

Commit

Permalink
[giow] (0) expose ImageBitmap dimensions
Browse files Browse the repository at this point in the history
Affected topics: Canvas

git-svn-id: http://svn.whatwg.org/webapps@8067 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jul 18, 2013
1 parent 3f26dfd commit 43921e4
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 19 deletions.
49 changes: 42 additions & 7 deletions complete.html
Expand Up @@ -256,7 +256,7 @@

<header class=head id=head><p><a href=http://www.whatwg.org/ class=logo><img width=101 src=/images/logo alt=WHATWG height=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 17 July 2013</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 18 July 2013</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -75272,7 +75272,9 @@ <h4 id=the-external-interface><span class=secno>7.5.2 </span>The <code><a href=#
<h3 id=images><span class=secno>7.6 </span>Images</h3>

<pre class=idl>interface <dfn id=imagebitmap>ImageBitmap</dfn> {
// opaque object
readonly attribute unsigned long <a href=#dom-imagebitmap-width title=dom-ImageBitmap-width>width</a>;
readonly attribute unsigned long <a href=#dom-imagebitmap-height title=dom-ImageBitmap-height>height</a>;
readonly attribute double <a href=#dom-imagebitmap-resolution title=dom-ImageBitmap-resolution>resolution</a>;
};

callback <dfn id=imagebitmapcallback>ImageBitmapCallback</dfn> = void (<a href=#imagebitmap>ImageBitmap</a> image);
Expand Down Expand Up @@ -75307,11 +75309,11 @@ <h3 id=images><span class=secno>7.6 </span>Images</h3>
<p>Takes <var title="">image</var>, which can be an <code><a href=#the-img-element>img</a></code> element,
<code><a href=#the-video-element>video</a></code>, or <code><a href=#the-canvas-element>canvas</a></code> element, a <code><a href=#blob>Blob</a></code> object, an
<code><a href=#imagedata>ImageData</a></code> object, a <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object, or another
<code><a href=#imagebitmap>ImageBitmap</a></code> object, and return a <code><a href=#promise>Promise</a></code> that is resolved when a
<code><a href=#imagebitmap>ImageBitmap</a></code> object, and returns a <code><a href=#promise>Promise</a></code> that is resolved when a
new <code><a href=#imagebitmap>ImageBitmap</a></code> is created.</p>

<p>If no <code><a href=#imagebitmap>ImageBitmap</a></code> object can be constructed, for example because the provided
<var title="">image</var> data is not actually an image, then promise is rejected instead.</p>
<var title="">image</var> data is not actually an image, then the promise is rejected instead.</p>

<p>If <var title="">sx</var>, <var title="">sy</var>, <var title="">sw</var>, and <var title="">sh</var> arguments are provided, the source image is cropped to the given pixels, with
any pixels missing in the original replaced by transparent black. These coordinates are in the
Expand All @@ -75327,10 +75329,34 @@ <h3 id=images><span class=secno>7.6 </span>Images</h3>

</dd>

<dt><var title="">imageBitmap</var> . <code title=dom-ImageBitmap-width><a href=#dom-imagebitmap-width>width</a></code></dt>

<dd>

<p>Returns the intrinsic width of the image, in CSS pixels.</p>

</dd>

<dt><var title="">imageBitmap</var> . <code title=dom-ImageBitmap-height><a href=#dom-imagebitmap-height>height</a></code></dt>

<dd>

<p>Returns the intrinsic height of the image, in CSS pixels.</p>

</dd>

<dt><var title="">imageBitmap</var> . <code title=dom-ImageBitmap-resolution><a href=#dom-imagebitmap-resolution>resolution</a></code></dt>

<dd>

<p>Returns the intrinsic linear pixel density of the image, in image pixels per CSS pixels.</p>

</dd>

</dl><div class=impl>

<p>An <code><a href=#imagebitmap>ImageBitmap</a></code> object always has associated bitmap data, with a width and a
height. However, it is possible for this data to be corrupted. If an <code><a href=#imagebitmap>ImageBitmap</a></code>
<p>An <code><a href=#imagebitmap>ImageBitmap</a></code> object always has associated bitmap data, with a width, a
height, and a pixel density. However, it is possible for this data to be corrupted. If an <code><a href=#imagebitmap>ImageBitmap</a></code>
object's media data can be decoded without errors, it is said to be <dfn id=concept-imagebitmap-good title=concept-ImageBitmap-good>fully decodable</dfn>.</p>

<p>An <code><a href=#imagebitmap>ImageBitmap</a></code> object can be obtained from a variety of different objects, using
Expand Down Expand Up @@ -75589,7 +75615,16 @@ <h3 id=images><span class=secno>7.6 </span>Images</h3>

<li><p>Return <var title="">output</var>.</li>

</ol></div>
</ol><p>The <dfn id=dom-imagebitmap-width title=dom-ImageBitmap-width><code>width</code> attribute must return the
<code>ImageBitmap</code> object's width, in CSS pixels.</dfn>

<p>The <dfn id=dom-imagebitmap-height title=dom-ImageBitmap-height><code>height</code> attribute must return the
<code>ImageBitmap</code> object's height, in CSS pixels.</dfn>

<p>The <dfn id=dom-imagebitmap-resolution title=dom-ImageBitmap-resolution><code>resolution</code> attribute must return the
<code>ImageBitmap</code> object's linear pixel density, in image data pixels per CSS pixel.</dfn>

</div>

<div class=example>

Expand Down
49 changes: 42 additions & 7 deletions index
Expand Up @@ -256,7 +256,7 @@

<header class=head id=head><p><a href=http://www.whatwg.org/ class=logo><img width=101 src=/images/logo alt=WHATWG height=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 17 July 2013</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 18 July 2013</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -75272,7 +75272,9 @@ interface <dfn id=mimetype>MimeType</dfn> {
<h3 id=images><span class=secno>7.6 </span>Images</h3>

<pre class=idl>interface <dfn id=imagebitmap>ImageBitmap</dfn> {
// opaque object
readonly attribute unsigned long <a href=#dom-imagebitmap-width title=dom-ImageBitmap-width>width</a>;
readonly attribute unsigned long <a href=#dom-imagebitmap-height title=dom-ImageBitmap-height>height</a>;
readonly attribute double <a href=#dom-imagebitmap-resolution title=dom-ImageBitmap-resolution>resolution</a>;
};

callback <dfn id=imagebitmapcallback>ImageBitmapCallback</dfn> = void (<a href=#imagebitmap>ImageBitmap</a> image);
Expand Down Expand Up @@ -75307,11 +75309,11 @@ interface <dfn id=imagebitmapfactories>ImageBitmapFactories</dfn> {
<p>Takes <var title="">image</var>, which can be an <code><a href=#the-img-element>img</a></code> element,
<code><a href=#the-video-element>video</a></code>, or <code><a href=#the-canvas-element>canvas</a></code> element, a <code><a href=#blob>Blob</a></code> object, an
<code><a href=#imagedata>ImageData</a></code> object, a <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object, or another
<code><a href=#imagebitmap>ImageBitmap</a></code> object, and return a <code><a href=#promise>Promise</a></code> that is resolved when a
<code><a href=#imagebitmap>ImageBitmap</a></code> object, and returns a <code><a href=#promise>Promise</a></code> that is resolved when a
new <code><a href=#imagebitmap>ImageBitmap</a></code> is created.</p>

<p>If no <code><a href=#imagebitmap>ImageBitmap</a></code> object can be constructed, for example because the provided
<var title="">image</var> data is not actually an image, then promise is rejected instead.</p>
<var title="">image</var> data is not actually an image, then the promise is rejected instead.</p>

<p>If <var title="">sx</var>, <var title="">sy</var>, <var title="">sw</var>, and <var title="">sh</var> arguments are provided, the source image is cropped to the given pixels, with
any pixels missing in the original replaced by transparent black. These coordinates are in the
Expand All @@ -75327,10 +75329,34 @@ interface <dfn id=imagebitmapfactories>ImageBitmapFactories</dfn> {

</dd>

<dt><var title="">imageBitmap</var> . <code title=dom-ImageBitmap-width><a href=#dom-imagebitmap-width>width</a></code></dt>

<dd>

<p>Returns the intrinsic width of the image, in CSS pixels.</p>

</dd>

<dt><var title="">imageBitmap</var> . <code title=dom-ImageBitmap-height><a href=#dom-imagebitmap-height>height</a></code></dt>

<dd>

<p>Returns the intrinsic height of the image, in CSS pixels.</p>

</dd>

<dt><var title="">imageBitmap</var> . <code title=dom-ImageBitmap-resolution><a href=#dom-imagebitmap-resolution>resolution</a></code></dt>

<dd>

<p>Returns the intrinsic linear pixel density of the image, in image pixels per CSS pixels.</p>

</dd>

</dl><div class=impl>

<p>An <code><a href=#imagebitmap>ImageBitmap</a></code> object always has associated bitmap data, with a width and a
height. However, it is possible for this data to be corrupted. If an <code><a href=#imagebitmap>ImageBitmap</a></code>
<p>An <code><a href=#imagebitmap>ImageBitmap</a></code> object always has associated bitmap data, with a width, a
height, and a pixel density. However, it is possible for this data to be corrupted. If an <code><a href=#imagebitmap>ImageBitmap</a></code>
object's media data can be decoded without errors, it is said to be <dfn id=concept-imagebitmap-good title=concept-ImageBitmap-good>fully decodable</dfn>.</p>

<p>An <code><a href=#imagebitmap>ImageBitmap</a></code> object can be obtained from a variety of different objects, using
Expand Down Expand Up @@ -75589,7 +75615,16 @@ interface <dfn id=imagebitmapfactories>ImageBitmapFactories</dfn> {

<li><p>Return <var title="">output</var>.</li>

</ol></div>
</ol><p>The <dfn id=dom-imagebitmap-width title=dom-ImageBitmap-width><code>width</code> attribute must return the
<code>ImageBitmap</code> object's width, in CSS pixels.</dfn>

<p>The <dfn id=dom-imagebitmap-height title=dom-ImageBitmap-height><code>height</code> attribute must return the
<code>ImageBitmap</code> object's height, in CSS pixels.</dfn>

<p>The <dfn id=dom-imagebitmap-resolution title=dom-ImageBitmap-resolution><code>resolution</code> attribute must return the
<code>ImageBitmap</code> object's linear pixel density, in image data pixels per CSS pixel.</dfn>

</div>

<div class=example>

Expand Down
45 changes: 40 additions & 5 deletions source
Expand Up @@ -84295,7 +84295,9 @@ interface <dfn>MimeType</dfn> {
<h3>Images</h3>

<pre class="idl">interface <dfn>ImageBitmap</dfn> {
// opaque object
readonly attribute unsigned long <span title="dom-ImageBitmap-width">width</span>;
readonly attribute unsigned long <span title="dom-ImageBitmap-height">height</span>;
readonly attribute double <span title="dom-ImageBitmap-resolution">resolution</span>;
};

callback <dfn>ImageBitmapCallback</dfn> = void (<span>ImageBitmap</span> image);
Expand Down Expand Up @@ -84332,11 +84334,11 @@ interface <dfn>ImageBitmapFactories</dfn> {
<p>Takes <var title="">image</var>, which can be an <code>img</code> element,
<code>video</code>, or <code>canvas</code> element, a <code>Blob</code> object, an
<code>ImageData</code> object, a <code>CanvasRenderingContext2D</code> object, or another
<code>ImageBitmap</code> object, and return a <code>Promise</code> that is resolved when a
<code>ImageBitmap</code> object, and returns a <code>Promise</code> that is resolved when a
new <code>ImageBitmap</code> is created.</p>

<p>If no <code>ImageBitmap</code> object can be constructed, for example because the provided
<var title="">image</var> data is not actually an image, then promise is rejected instead.</p>
<var title="">image</var> data is not actually an image, then the promise is rejected instead.</p>

<p>If <var title="">sx</var>, <var title="">sy</var>, <var title="">sw</var>, and <var
title="">sh</var> arguments are provided, the source image is cropped to the given pixels, with
Expand All @@ -84353,12 +84355,36 @@ interface <dfn>ImageBitmapFactories</dfn> {

</dd>

<dt><var title="">imageBitmap</var> . <code title="dom-ImageBitmap-width">width</code></dt>

<dd>

<p>Returns the intrinsic width of the image, in CSS pixels.</p>

</dd>

<dt><var title="">imageBitmap</var> . <code title="dom-ImageBitmap-height">height</code></dt>

<dd>

<p>Returns the intrinsic height of the image, in CSS pixels.</p>

</dd>

<dt><var title="">imageBitmap</var> . <code title="dom-ImageBitmap-resolution">resolution</code></dt>

<dd>

<p>Returns the intrinsic linear pixel density of the image, in image pixels per CSS pixels.</p>

</dd>

</dl>

<div class="impl">

<p>An <code>ImageBitmap</code> object always has associated bitmap data, with a width and a
height. However, it is possible for this data to be corrupted. If an <code>ImageBitmap</code>
<p>An <code>ImageBitmap</code> object always has associated bitmap data, with a width, a
height, and a pixel density. However, it is possible for this data to be corrupted. If an <code>ImageBitmap</code>
object's media data can be decoded without errors, it is said to be <dfn
title="concept-ImageBitmap-good">fully decodable</dfn>.</p>

Expand Down Expand Up @@ -84669,6 +84695,15 @@ interface <dfn>ImageBitmapFactories</dfn> {

</ol>

<p>The <dfn title="dom-ImageBitmap-width"><code>width</code> attribute must return the
<code>ImageBitmap</code> object's width, in CSS pixels.</dfn>

<p>The <dfn title="dom-ImageBitmap-height"><code>height</code> attribute must return the
<code>ImageBitmap</code> object's height, in CSS pixels.</dfn>

<p>The <dfn title="dom-ImageBitmap-resolution"><code>resolution</code> attribute must return the
<code>ImageBitmap</code> object's linear pixel density, in image data pixels per CSS pixel.</dfn>

</div>

<div class="example">
Expand Down

0 comments on commit 43921e4

Please sign in to comment.