pixel

Draw image from pixel array on canvas with putImageData

ぃ、小莉子 提交于 2019-12-03 13:15:43
I am working on a project that can encrypt an image and redraw the decrypted image on canvas. As I am still pretty new to coding and programming, I am currently having issues redrawing the decrypted image data, which is a pixel array in the form R,G,B,A. I thought this would be possible by simply putting the data into ctx.putImageData(imgd,0,0); But firebug tells me that the value does not implement the interface for imagedata. I have posted the entire array here . The image is 160px wide and 120px high. Is there any way to reformat the array so that it is drawable on the canvas? Assuming imgd

浅谈响应式Web设计与实现思路

社会主义新天地 提交于 2019-12-03 13:08:37
是否还在为你的应用程序适配PC端,移动端,平板而苦苦思索呢,是否在寻找如何一套代码适配多终端方式呢,是否希望快速上手实现你的跨终端应用程序呢,是的话,那就看过来吧,本文阐述响应式UI设计相关理论基础,包括:屏幕尺寸,物理,设备独立,CSS像素,dpr,视口等相关概念,还有响应式设计基础,常见设计模式,及响应式UI实现基本思路,希望能加深对响应式的理解和实践思路。 欢迎访问我的个人博客 响应式(Responsive) 响应式是什么呢?顾名思义,响应式,肯定会自动响应,响应什么?应用程序是在终端屏幕窗口中展示给用户,被用户访问的,那么就是响应屏幕的变化,不同终端屏幕尺寸大小不一致,需要针对不同尺寸屏幕进行不同的展示响应。 响应式(Responsive web design, RWD) ,是指一套应用程序用户界面(User Interface)能自动响应不同设备窗口或屏幕尺寸(screen size)并且内容,布局渲染表现良好。 自适应(Adaptive) 在响应式设计(RWD)之外,还有一种适配多设备屏幕的方式, 自适应设计(Adaptive web design, AWD) 。 自适应设计(AWD),是指一个应用程序使用多版本用户界面,针对不同设备屏幕,服务器端返回不同版本用户界面,供用户访问。 自适应vs响应式 自适应和响应式设计的不同主要概括如下: 自适应是多套用户界面

javascript ImageData typed array read whole pixel?

为君一笑 提交于 2019-12-03 12:36:51
So there is are a lot of examples on how to write an entire pixel from a Uint32Array view of the ImageData object. But is it possible to read an entire pixel without incrementing the counter 4 times? From hacks.mozilla.org , writing an rgba pixels looks like this . var imageData = ctx.getImageData(0, 0, canvasWidth, canvasHeight); var buf = new ArrayBuffer(imageData.data.length); var buf8 = new Uint8ClampedArray(buf); var data = new Uint32Array(buf); for (var y = 0; y < canvasHeight; ++y) { for (var x = 0; x < canvasWidth; ++x) { var value = x * y & 0xff; data[y * canvasWidth + x] = (255 << 24

swscaler warning : deprecated pixel format used

戏子无情 提交于 2019-12-03 11:51:02
问题 I want to perform a color space conversion of my video frame before converting it to an opengl texture with the following code: struct SwsContext * pSwsCtx = sws_getCachedContext(NULL,width, height, codec->pix_fmt, width, height, AV_PIX_FMT_RGBA, SWS_POINT, NULL, NULL, NULL); Each time the sws_getCachedContext() function is called I got the following warning: [swscaler @ 0x10506fa00] deprecated pixel format used, make sure you did set range correctly Here is my ffmpeg output for version

How can I measure pixels in Chrome without an extension?

旧城冷巷雨未停 提交于 2019-12-03 11:14:52
Due to security limitations at work, I am not allowed to install Chrome extensions. Chrome has a ruler built in to the developer tools, but I can't figure out how to define start and end points like a ruler would permit. Are there any tools or techniques for measuring pixels that don't require installing a Chrome extension? Matt Zeunert You could create your own ruler functionality and paste it into the console. Here's a basic example: var fromX, fromY; var svg = document.createElementNS ('http://www.w3.org/2000/svg',"svg"); svg.setAttribute("style", "position: absolute; top:0;left:0;height: "

高德地图和canvas画图结合应用(一)

僤鯓⒐⒋嵵緔 提交于 2019-12-03 11:09:21
现在重构web项目的时候发现,以前项目中是高德画基站的扇区的时候,通过计算点来画多边形,在站点的数量比较多的时候,会增加请求,同时计算扇区的时候有大量的计算,这样会极度浪费服务器的性能,所以对这块进行了改良,直接使用的高德地图的canvas层在画基站,效果如下图所示: 其代码为: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>ImageLayer</title> <meta id="viewport" name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0,maximum-scale=1.0"/> <link rel="stylesheet" href="http://cache.amap.com/lbs/static/main1119.css"/> <script src="http://webapi.amap.com/maps?v=1.4.2&key=您申请的key值"></script> --> </head> <body> <div id="container"></div>

高通8x25平台display模块总结

北战南征 提交于 2019-12-03 10:22:58
一、 概述 1.1 简介 本文档主要包括 LCD 模块的驱动流程分析、 Framebuffer 相关知识、 Gralloc 等相关内容,以及 LCD 调试的一些经验和相关 bug 的分析和讲解。 1.2 开发环境 Android:4.0 Kernel: Linux3.0 Ubuntu: 需要 10.04 以及之后的版本 Gcc: 4.4.3 toolchain 1.3 硬件平台 Msm8x25,pmic(pm8029) 1.4 操作系统 Android:4.0, Kernel: 3.0 1.5 开发工具 VIM,SourceInsight,JTAG,ADB 二、 LCD 驱动流程分析 2.1 帧缓冲 2.1.1 帧缓冲概念 帧缓冲( framebuffer )是 Linux 系 统为显示设备提供的一个接口,它将显示缓冲区抽象,屏蔽图像硬件的底层差异,允许上层应用程序在图形模式下直接对显示缓冲区进行读写操作。用户不必关系物 理显示缓冲区的具体位置及存放方式,这些都由帧缓冲设备驱动本身来完成。对于帧缓冲设备而言,只要在显示缓冲区中与显示点对应的区域写入颜色值,对应的颜 色会自动在屏幕上显示。帧缓冲为标准字符设备,主设备号为 29 ,对应于 /dev/fbn 。 2.1.2 fb_info 结构体 帧缓冲设备最关键的一个数据结构体是 fb_info 结构,为了便于记忆,简称 FBI

Find color name when have Hue in android

半世苍凉 提交于 2019-12-03 09:11:31
I only care about 12 colors: red: RGB: 255, 0, 0 pink: RGB: 255, 192, 203 violet: RGB: 36, 10, 64 blue: RGB: 0, 0, 255 green: RGB: 0, 255, 0 yellow: RGB: 255, 255, 0 orange: RGB: 255, 104, 31 white: RGB: 255, 255, 255 black: RGB: 0, 0, 0 gray: RGB: 128, 128, 128 tea: RGB: 193, 186, 176 cream: RGB: 255, 253, 208 When i read the pixel of bitmap, i can get the Hue value: int picw = mBitmap.getWidth(); int pich = mBitmap.getHeight(); int[] pix = new int[picw * pich]; float[] HSV = new float[3]; // get pixel array from source mBitmap.getPixels(pix, 0, picw, 0, 0, picw, pich); int index = 0; //

Read pixel from a big jp2 image without loading the whole image into memory

匿名 (未验证) 提交于 2019-12-03 08:59:04
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to read parts from a big image in java. My image size is more than 700 MB. I have used this code which normally reads pixels without loading the whole image into memory: Rectangle sourceRegion = new Rectangle(0, 0, 512, 512); // The region you want to extract ImageInputStream stream = ImageIO.createImageInputStream( new File("/home/dhoha/Downloads/BreastCancer.jp2")); // File or input stream final Iterator<ImageReader> readers = ImageIO.getImageReaders(stream); if (readers.hasNext()) { ImageReader reader = (ImageReader)readers

Move MKMapView point to pixel coordinates

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a quick question. I am using a custom view as a callout accessory for my map view. I am having some issues with getting the annotation to move to the right bottom corner of the said view. I am currently trying to get the CGPoint coords of the selected annotation, but beyond that I've drawn a blank Any help would be greatly appreciated. The current code I'm using (I know it is incorrect is:) CGPoint bottomLeftPoint = CGPointMake(xOffset,[self.internalAnnotationCallout view].frame.size.height); CLLocationCoordinate2D bottomLeftCoord =