[html5] r8067 - [giow] (0) expose ImageBitmap dimensions Affected topics: Canvas

whatwg at whatwg.org whatwg at whatwg.org
Wed Jul 17 17:10:35 PDT 2013


Author: ianh
Date: 2013-07-17 17:10:34 -0700 (Wed, 17 Jul 2013)
New Revision: 8067

Modified:
   complete.html
   index
   source
Log:
[giow] (0) expose ImageBitmap dimensions
Affected topics: Canvas

Modified: complete.html
===================================================================
--- complete.html	2013-07-17 22:44:39 UTC (rev 8066)
+++ complete.html	2013-07-18 00:10:34 UTC (rev 8067)
@@ -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 — Last Updated 17 July 2013</h2>
+    <h2 class="no-num no-toc">Living Standard — 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>
@@ -75272,7 +75272,9 @@
   <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);
@@ -75307,11 +75309,11 @@
     <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
@@ -75327,10 +75329,34 @@
 
    </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
@@ -75589,8 +75615,17 @@
 
    <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>
 
    <p>Using this API, a sprite sheet can be precut and prepared:</p>

Modified: index
===================================================================
--- index	2013-07-17 22:44:39 UTC (rev 8066)
+++ index	2013-07-18 00:10:34 UTC (rev 8067)
@@ -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 — Last Updated 17 July 2013</h2>
+    <h2 class="no-num no-toc">Living Standard — 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>
@@ -75272,7 +75272,9 @@
   <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);
@@ -75307,11 +75309,11 @@
     <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
@@ -75327,10 +75329,34 @@
 
    </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
@@ -75589,8 +75615,17 @@
 
    <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>
 
    <p>Using this API, a sprite sheet can be precut and prepared:</p>

Modified: source
===================================================================
--- source	2013-07-17 22:44:39 UTC (rev 8066)
+++ source	2013-07-18 00:10:34 UTC (rev 8067)
@@ -84295,7 +84295,9 @@
   <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);
@@ -84332,11 +84334,11 @@
     <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
@@ -84353,12 +84355,36 @@
 
    </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>
 
@@ -84669,6 +84695,15 @@
 
   </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">




More information about the Commit-Watchers mailing list