Search completed in 1.21 seconds.
WebGLRenderingContext.readPixels() - Web APIs
the webglrenderingcontext.rea
dpixels() method of the webgl api reads a block of pixels from a specified rectangle of the current color framebuffer into an arraybufferview object.
... syntax // webgl1: void gl.rea
dpixels(x, y, width, height, format, type, pixels); // webgl2: void gl.rea
dpixels(x, y, width, height, format, type, glintptr offset); void gl.rea
dpixels(x, y, width, height, format, type, arraybufferview pixels, gluint dstoffset); parameters x a glint specifying the first horizontal pixel that is read from the lower left corner of a rectangular block of pixels.
... examples var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var pixels = new uint8array(gl.drawingbufferwidth * gl.drawingbufferheight * 4); gl.rea
dpixels(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight, gl.rgba, gl.unsigned_byte, pixels); console.log(pixels); // uint8array specifications specification status comment webgl 1.0the definition of 'rea
dpixels' in that specification.
... opengl es 2.0the definition of 'glrea
dpixels' in that specification.
<resolution> - CSS: Cascading Style Sheets
units
dpi represents the number of dots per inch.
... screens typically contains 72 or 96 dots per inch, but the
dpi for printed documents is usually much greater.
... as 1 inch is 2.54 cm, 1
dpi ≈ 0.39dpcm.
...And 6 more matches
Using the viewport meta tag to control layout on mobile browsers
for example, recent smartphones generally have a 5-inch screens with resolutions upwards of 1920—1080 pixels (~400
dpi).
... on high
dpi screens, pages with initial-scale=1 will effectively be zoomed by browsers.
...it is recommended that the reference pixel be the visual angle of one pixel on a device with a pixel density of 96
dpi and a distance from the reader of an arm's length.
...And 3 more matches
Index - Web APIs
the created image is in a resolution of 96
dpi.
...the returned image is in a resolution of 96
dpi.
... 2849 paintworklet.devicepixelratio css paint api,
dpi, houdini, needsbrowsercompatibility, needsexample, needslivesample, property, reference, worklet, devicepixelratio, paintworklet the paintworklet.devicepixelratio read-only property of the paintworklet interface returns the current device's ratio of physical pixels to logical pixels.
...And 2 more matches
WebGL best practices - Web APIs
(this is okay for read buffers in conjunction with fences - see async data readback below.) rea
dpixels() to the cpu (i.e.
...instead, use gpu-gpu rea
dpixels in conjunction with async data readback.
...cbyteoffset, dstbuffer, /* optional */ dstoffset, /* optional */ length) { const sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); gl.flush(); await clientwaitasync(gl, sync, 0, 10); gl.deletesync(sync); gl.bindbuffer(target, buffer); gl.getbuffersubdata(target, srcbyteoffset, dstbuffer, dstoffset, length); gl.bindbuffer(target, null); return dest; } async function rea
dpixelsasync(gl, x, y, w, h, format, type, dest) { const buf = gl.createbuffer(); gl.bindbuffer(gl.pixel_pack_buffer, buf); gl.bufferdata(gl.pixel_pack_buffer, dest.bytelength, gl.stream_read); gl.rea
dpixels(x, y, w, h, format, type, 0); gl.bindbuffer(gl.pixel_pack_buffer, null); await getbuffersubdataasync(gl, gl.pixel_pack_buffer, buf, 0, dest); gl.deletebuffer(buf); return dest; ...
... devicepixelratio and high-
dpi rendering handling devicepixelratio != 1.0 is tricky.
Window.devicePixelRatio - Web APIs
this is useful when dealing with the difference between rendering on a standard display versus a hi
dpi or retina display, which use more screen pixels to draw the same objects, resulting in a sharper image.
...a value of 1 indicates a classic 96
dpi (76
dpi on some platforms) display, while a value of 2 is expected for hi
dpi/retina displays.
... other values may be returned as well in the case of unusually low resolution displays or, more often, when a screen has a higher pixel depth than simply double the standard resolution of 96 or 76
dpi.
...the media query, which begins as (resolution: 1dppx) (for standard displays) or (resolution: 2dppx) (for retina/hi
dpi displays), checks to see if the current display resolution matches a specific number of device dots per px.
Multimedia: Images - Learn web development
on top of that you'd also want to serve higher resolution images to those devices that boast a high
dpi screen (e.g.
... two interesting effects to keep in mind regarding high
dpi screens is that: with high
dpi screen, humans will spot compression artifacts a lot later, meaning that for images meant for these screens you can crank up compression beyond usual.
... only a very few people can spot an increase in resolution beyond 2×
dpi, which means you don't need to serve images resolving higher than 2×.
ui/button/action - Archive of obsolete content
on a high resolution screen (such as a hi
dpi display), these are doubled to 36 x 36 and 64 x 64 pixels, respectively.
...however, the icons in the toolbar will not quite fill the space available, so you can instead supply four icons: icon: { "18": "./addon18.png", // toolbar icon non hi
dpi "32": "./addon32.png", // menu panel icon non hi
dpi "36": "./addon36.png", // toolbar icon hi
dpi "64": "./addon64.png" // menu panel icon hi
dpi } optional options: name type disabled boolean determines whether the button is disabled.
ui/button/toggle - Archive of obsolete content
on a high resolution screen (such as a hi
dpi display), these are doubled to 36 x 36 and 64 x 64 pixels, respectively.
...however, the icons in the toolbar will not quite fill the space available, so you can instead supply four icons: icon: { "18": "./addon18.png", // toolbar icon non hi
dpi "32": "./addon32.png", // menu panel icon non hi
dpi "36": "./addon36.png", // toolbar icon hi
dpi "64": "./addon64.png" // menu panel icon hi
dpi } optional options: name type disabled boolean determines whether the button is disabled.
CSS pixel - MDN Web Docs Glossary: Definitions of Web-related terms
by definition, this is the physical size of a single pixel at a pixel density of 96
dpi, located an arm's length away from the viewer's eyes.
...in other words, if the user is on a phone with a pixel density of 266
dpi, and an element is placed on the screen with a width of 96px, the actual width of the element would be 266 device pixels.
The Firefox codebase: CSS Guidelines
h
dpi support it's recommended to use svg since it keeps the css clean when supporting multiple resolutions.
... however, if only 1x and 2x png assets are available, you can use this @media query to target higher density displays (h
dpi): @media (min-resolution: 1.1dppx) ...
image-set() - CSS: Cascading Style Sheets
<resolution> units include x or dppx, for dots per pixel unit,
dpi, for dots per inch, and dpcm for dots per centimeter.
... examples background-image: image-set( "cat.png" 1x, "cat-2x.png" 2x, "cat-print.png" 600
dpi); this example shows how to use image-set() to provide two alternative background-image options, chosen depending on the resolution needed: a normal version and a high-resolution version.
<length> - CSS: Cascading Style Sheets
for low-
dpi devices, the unit px represents the physical reference pixel; other units are defined relative to it.
... for high-
dpi devices, inches (in), centimeters (cm), and millimeters (mm) are the same as their physical counterparts.
<picture>: The Picture element - HTML: Hypertext Markup Language
if providing higher-density versions of an image for high-
dpi (retina) display, use srcset on the <img> element instead.
... a width descriptor, followed by a w (such as 300w); or a pixel density descriptor, followed by an x (such as 2x) to serve a high-res image for high-
dpi screens.
ui/frame - Archive of obsolete content
it occupies the whole width of the browser window and is 18 pixels high on a normal-resolution display or 36 pixels high on a high-resolution (hi
dpi) display.
NSC_SetPIN - Archive of obsolete content
syntax ck_rv nsc_setpin( ck_session_handle hsession, ck_char_ptr pol
dpin, ck_ulong uloldlen, ck_char_ptr pnewpin, ck_ulong ulnewlen ); parameters nsc_setpin takes five parameters: hsession [input] pol
dpin [input] .
PR_CreatePipe
syntax #include <prio.h> prstatus pr_createpipe( prfiledesc **rea
dpipe, prfiledesc **writepipe); parameters the function has the following parameters: rea
dpipe a pointer to a prfiledesc pointer.
FC_SetPIN
syntax ck_rv fc_setpin( ck_session_handle hsession, ck_char_ptr pol
dpin, ck_ulong uloldlen, ck_char_ptr pnewpin, ck_ulong ulnewlen ); parameters fc_setpin takes five parameters: hsession [input] the session's handle pol
dpin [input] points to the old pin.
SpiderMonkey 45
56264) js::isstopwatchactive (bug 674779) js::getperfmonitoringtestcpurescheduling (bug 1181175) js::addcpowperformancedelta (bug 1181175) js::setstopwatchstartcallback (bug 1208747) js::setstopwatchcommitcallback (bug 1208747) js::setgetperformancegroupscallback (bug 1208747) js_stringhasbeeninterned renamed to js_stringhasbeenpinned (bug 1178581) js_internjsstring renamed to js_atomizean
dpinjsstring (bug 1178581) js_internstringn renamed to js_atomizean
dpinstringn (bug 1178581) js_internstring renamed to js_atomizean
dpinstring (bug 1178581) js_internucstringn renamed to js_atomizean
dpinucstringn (bug 1178581) js_internucstring renamed to js_atomizean
dpinucstring (bug 1178581) deleted apis js_getcompartmentstats js_seticumemoryfunctions js_isgcmarkingtracer js_ismarkinggr...
nsIDOMWindowUtils
exceptions thrown ns_error_not_available there is no current inner window display
dpi float the
dpi of the display.
CSS numeric factory functions - Web APIs
w(number); css.vh(number); css.vi(number); css.vb(number); css.vmin(number); css.vmax(number); css.cm(number); css.mm(number); css.q(number); css.in(number); css.pt(number); css.pc(number); css.px(number); // <angle> css.deg(number); css.grad(number); css.rad(number); css.turn(number); // <time> css.s(number); css.ms(number); // <frequency> css.hz(number); css.khz(number); // <resolution> css.
dpi(number); css.dpcm(number); css.dppx(number); // <flex> css.fr(number); examples we use the css.vmax() numeric factory function to create a cssunitvalue: let height = css.vmax(50); console.log( height ); // cssunitvalue {value: 50, unit: "vmax"} console.log( height.value ) // 50 console.log( height.unit ) // vmax in this example, we set the margin on our element using the css.px() f...
HTMLImageElement.src - Web APIs
as an equivalent for specifying an image in srcset with the size multiplier 1x; that is, the image specified by src is used on low-density screens (such as typical 72
dpi or 96
dpi displays).
SVGLength - Web APIs
pe_in); console.log("value: " + val.value + ", valueinspecifiedunits " + val.unittype + ": " + val.valueinspecifiedunits + ", valueasstring: " + val.valueasstring); } ]]></script> <rect id="myrect" x="1cm" y="1cm" fill="green" stroke="black" stroke-width="1" width="1cm" height="1cm" /> </svg> results on a desktop monitor (pixel units will be
dpi-dependent): value: 37.7952766418457, valueinspecifiedunits: 6: 1, valueasstring: 1cm value: 26.66666603088379, valueinspecifiedunits 9: 20, valueasstring: 20pt value: 26.66666603088379, valueinspecifiedunits 8: 0.277777761220932, valueasstring: 0.277778in constants name value description svg_lengthtype_unknown 0 the unit type is not one of predefined unit typ...
SVGSVGElement - Web APIs
(if the parent uses css or xsl layout, then unitless values represent pixel units for the current css or xsl viewport.) svgsvgelement.pixelunittomillimeterx a float representing the size of the pixel unit (as defined by css2) along the x-axis of the viewport, which represents a unit somewhere in the range of 70
dpi to 120
dpi, and, on systems that support this, might actually match the characteristics of the target medium.
WebGL2RenderingContext.readBuffer() - Web APIs
the webgl2renderingcontext.readbuffer() method of the webgl 2 api selects a color buffer as the source for pixels for subsequent calls to copyteximage2d, copytexsubimage2d, copytexsubimage3d or rea
dpixels.
WebGLRenderingContext.pixelStorei() - Web APIs
gl.unpack_skip_rows number of rows of pixel locations skipped before the first pixel is read from memory glint 0 0 to infinity opengl es 3.0 gl.unpack_skip_images number of pixel images skipped before the first pixel is read from memory glint 0 0 to infinity opengl es 3.0 examples setting the pixel storage mode affects the webglrenderingcontext.rea
dpixels() operations, as well as unpacking of textures with the webglrenderingcontext.teximage2d() and webglrenderingcontext.texsubimage2d() methods.
-moz-device-pixel-ratio - CSS: Cascading Style Sheets
example: @media (-webkit-min-device-pixel-ratio: 2), /* webkit-based browsers */ (min--moz-device-pixel-ratio: 2), /* older firefox browsers (prior to firefox 16) */ (min-resolution: 2dppx), /* the standard way */ (min-resolution: 192
dpi) /* dppx fallback */ note: see this csswg article for compatibility good practices regarding resolution and dppx.
resolution - CSS: Cascading Style Sheets
examples html <p>this is a test of your device's pixel density.</p> css /* exact resolution */ @media (resolution: 150
dpi) { p { color: red; } } /* minimum resolution */ @media (min-resolution: 72
dpi) { p { text-decoration: underline; } } /* maximum resolution */ @media (max-resolution: 300
dpi) { p { background: yellow; } } result specifications specification status comment media queriesthe definition of 'resolution' in that specification.
@media - CSS: Cascading Style Sheets
<mf-value>where <mf-name> = <ident><mf-value> = <number> | <dimension> | <ident> | <ratio> examples testing for print and screen media types @media print { body { font-size: 10pt; } } @media screen { body { font-size: 13px; } } @media screen, print { body { line-height: 1.2; } } @media only screen and (min-width: 320px) and (max-width: 480px) and (resolution: 150
dpi) { body { line-height: 1.4; } } introduced in media queries level 4 is a new range syntax that allows for less verbose media queries when testing for any feature accepting a range, as shown in the below examples: @media (height > 600px) { body { line-height: 1.4; } } @media (400px <= width <= 700px) { body { line-height: 1.4; } } for more examples, please see using media queries...
CSS reference - CSS: Cascading Style Sheets
colorcolumn-rule-stylecolumn-rule-widthcolumn-spancolumn-widthcolumnsconic-gradient()containcontentcontrast()<counter>counter-incrementcounter-resetcounter-set@counter-stylecounters()cross-fade()cubic-bezier()::cue::cue-regioncursor<custom-ident>d:defaultdeg<dimension>:dirdirection:disableddisplay<display-box><display-inside><display-internal><display-legacy><display-listitem><display-outside>dpcm
dpidppxdrop-shadow()eelement()ellipse()em:emptyempty-cells:enabledenv()exffallback (@counter-style)filter<filter-function>:first:first-child::first-letter (:first-letter)::first-line (:first-line):first-of-typefit-content()<flex>flexflex-basisflex-directionflex-flowflex-growflex-shrinkflex-wrapfloat:focusfont@font-facefont-familyfont-family (@font-face)font-feature-settingsfont-feature-settings (@fon...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
for example: <link href="print.css" rel="stylesheet" media="print"> <link href="mobile.css" rel="stylesheet" media="all"> <link href="desktop.css" rel="stylesheet" media="screen and (min-width: 600px)"> <link href="highres.css" rel="stylesheet" media="screen and (min-resolution: 300
dpi)"> stylesheet load events you can determine when a style sheet has been loaded by watching for a load event to fire on it; similarly, you can detect if an error has occurred while processing a style sheet by watching for an error event: <script> var mystylesheet = document.queryselector('#my-stylesheet'); mystylesheet.onload = function() { // do something interesting; the sheet has been lo...
Web app manifests
this splashscreen is auto-generated from properties in the web app manifest, specifically: name background_color the icon in the icons array that is closest to 128
dpi for the device.
The building blocks of responsive design - Progressive web apps (PWAs)
you can also serve a larger graphic to a higher resolution device using a resolution media query, like so: button { background: url(images/low-res-header.jpg) 1rem center ; } @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and ( min-resolution: 192
dpi), only screen and ( min-resolution: 2dppx) { button { background: url(images/high-res-header.jpg) 1rem center ; } } this looks rather complicated, but really it's not — we are providing a number of media query options, as at this time different browsers support different resolution media query types and even units.
Positions - SVG: Scalable Vector Graphics
a quote from the svg 1.1 specification illustrates this: [...] suppose that the user agent can determine from its environment that "1px" corresponds to "0.2822222mm" (i.e., 90
dpi).