graphics

What is the header size of png, jpg/jpeg, bmp, gif and other common graphics format?

孤街醉人 提交于 2019-12-18 02:42:26
问题 I have search in google. I found something here, http://paulbourke.net/dataformats/bmp/ , but i can't understand the size of header. Reading some webpages i got confused. http://en.wikipedia.org/wiki/JPEG Can anyone give the correct information of header about all these format? 回答1: PNG file contains 8-bytes header. JPEG file (see specification) contains 2-bytes header (SOI) followed by series of markers, some markers can be followed by data array. Each type of marker has different header

Performant 2D OpenGL graphics in R for fast display of raster image using qtpaint (qt) or rdyncall (SDL/OpenGL) packages?

穿精又带淫゛_ 提交于 2019-12-18 02:04:08
问题 For a real-time interactive Mandelbrot viewer I was making in R & Rcpp+OpenMP & Shiny I am on the lookout for a performant way to display 1920x1080 matrices as raster images in the hope of being able to achieve ca. 5-10 fps (calculating the Mandelbrot images themselves now achieves ca. 20-30 fps at moderate zooms, and certainly scrolling around should go fast). Using image() with option useRaster=TRUE , plot.raster or even grid.raster() still doesn't quite cut it, so I am on the lookout for a

Algorithm for Text Wrapping Within a Shape

[亡魂溺海] 提交于 2019-12-17 22:46:50
问题 I am looking for an algorithm to wrap text within a non-rectangular shape, preferably based on the Knuth and Plass algorithm. The hardest part of this is that the lines may have different heights due to differing font sizes in the text. The image below is an example of what the algorithm should be able to generate. 回答1: Edit, Updated Try text / html gggggggggggggg gggggggggggggg gggggggggggggggggggg gggggggggggggggggg gggggggggggggggggggggggg gggggggggggggggggggggg ggggggggggggggggggggggggggg

how to use the LightingColorFilter to make the image form dark to light

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-17 22:37:03
问题 I want to add light of the image, I want to use LightingColorFilter LightingColorFilter lcf = new LightingColorFilter( mul, add); imageView.setColorFilter(lcf); but I don't know how to adjust mul, add , can you give some link or code or parameters to adjust the light of the image? Thank you 回答1: The integer values are colours (you may want to have a closer look here http://developer.android.com/reference/android/graphics/Color.html) 4 Bytes are used, one for alpha, one for red, one for green,

Draw a parallel line

情到浓时终转凉″ 提交于 2019-12-17 22:34:21
问题 I have x1,y1 and x2,y2 which forms a line segment. How can I get another line x3,y3 - x4,y4 which is parallel to the first line as in the picture. I can simply add n to x1 and x2 to get a parallel line but it is not what i wanted. I want the lines to be as parallel in the picture. 回答1: What you want to do is to offset the coordinates in the orthogonal direction. If you know vector math, multiply the vector created by the distance between the endpoints of the line by the following matrix: [ 0

Scale & rotate Bitmap using Matrix in Android

。_饼干妹妹 提交于 2019-12-17 22:30:15
问题 I'm trying to scale and rotate in single operation before creting the final bitmap but the preRotate, postConcat doesn't seem to work. Bitmap bmp = ... original image ... Matrix m = new Matrix() m.setScale(x, y); m.preRotate(degrees, (float) width / 2, (float) height / 2); Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), m, true); It only applies the scale and not rotation. 回答1: This is the code public class Bitmaptest extends Activity { @Override public void onCreate(Bundle

How to draw a graph in PHP? [closed]

偶尔善良 提交于 2019-12-17 22:19:42
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . Hey I want to draw a graph(Stdent mark distribution) in my site based on PHP. How can I do this? 回答1: pChart is another great PHP graphing library. 回答2: <? # ------- The graph values in the form of associative array $values=array( "Jan" => 110, "Feb" => 130, "Mar" => 215, "Apr" =>

Where can I get freely available audio, graphics, and other resources for games? [closed]

落花浮王杯 提交于 2019-12-17 22:04:48
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I've done a google search of this topic, but so far haven't found anything satisfactory. From your experience, what's the best place to get game resources, like sprites, backgrounds, sound effects, music, etc.? To be more specific, I'm looking for more of sound effects and music, which I'm currently lacking more

Java BasicStroke “Fuzzy”

被刻印的时光 ゝ 提交于 2019-12-17 22:01:35
问题 I'm trying to write a simple paint applet with Java, but I'm having trouble with BasicStroke . Initially, my plan was to try to somehow draw a line with a width, but the API apparently doesn't support that. I tried using BasicStroke , but the result is just a fuzzy mess. How can I fix this fuzz problem? private void mousedrag_hook(Point point) { if(start == null) start = point; end = point; Graphics2D g2d = (Graphics2D)applInstance.buffer_g; g2d.setStroke(new BasicStroke(7)); //g2d.fillOval

Android Graphics Internals

点点圈 提交于 2019-12-17 21:52:41
问题 I haven't found a clear explanation on how the Android graphics system works, specifically, does it use a display server, is it based on DirectFB or X11, etc. From what I've managed to piece together, Android depends on the Linux frame buffer. I haven't found much on what sort of display server or window manager Android uses to multiplex access to the framebuffer though, so any pointers would be much appreciated! Finally, from what I understand the ARM instruction set provides instructions to