graphics

R: function to scale ggplot2, lattice or base R graph proportionally

风流意气都作罢 提交于 2019-12-20 20:30:55
问题 In R I always find it annoying that base R, lattice and ggplot2 plots all work with absolute point sizes for the size of text and plot symbols. This means that if you increase say the size of your plot window to get a page-filling graph from windows(width=5,height=5);qplot(Sepal.Length, Petal.Length, data = iris, color = Species, size = Petal.Width, alpha = I(0.7)) to windows(width=10,height=10);qplot(Sepal.Length, Petal.Length, data = iris, color = Species, size = Petal.Width, alpha = I(0.7)

WPF charting/visualization of realtime data

不羁岁月 提交于 2019-12-20 19:42:03
问题 I've been trying to figure out what is the appropriate way to render real-time data as a line graph in WPF. And by real-time I actually mean, data that is being collected from a USB device that generates data at a rate of approximately 40Hz. There are multiple (up to 7) streams of data that I'm reading at 40Hz in an asynchronous fashion. I've tried using two off-the shelf solutions (WPF Toolkit charting and Swordfish charts) and almost looked into the Dynamic Data Visualization component but

glGenTextures - is there a limit to the number of textures?

可紊 提交于 2019-12-20 19:31:22
问题 Is there a limit to the number of textures that can be created in OpenGL - that is, with glGenTextures? I know that there are some limits imposed by GL, eg. the number of textures that can be used in a fragment shader. However, I haven't been able to find any sort of documentation concerning the total number of integer "texture names" that are available to use. 回答1: The only limit of glGenTextures is given by the bit width of the texture name ( GLint ), which is 32 bit; indeed the number of

Shader optimization: Is a ternary operator equivalent to branching?

心已入冬 提交于 2019-12-20 16:27:32
问题 I'm working on a vertex shader in which I want to conditionally drop some vertices: float visible = texture(VisibleTexture, index).x; if (visible > threshold) gl_Vertex.z = 9999; // send out of frustum I know that branches kill performance when there's little commonality between neighboring data. In this case, every other vertex may get a different 'visible' value, which would be bad for the performance of the local shader core cluster (from my understanding). To my question: Is a ternary

Graphics Library for C++

谁都会走 提交于 2019-12-20 14:56:43
问题 I am working on a simulation project in C++ and I need to output some information graphically. I searched about it and found some libraries, but most of them just do plotting or something. There are also libraries like EasyBMP, which can be used to create bitmap images or similar image formats. There are also some libraries like OpenGL, DirectX and SDL which allow hardware-accelerated real time graphics. My problem is that I need a library for real time, hardware accelerated graphics. As a

Create a circle avatar image in .net

会有一股神秘感。 提交于 2019-12-20 14:37:32
问题 I want to create a default avatar image which is a circle with initials in it. I want to do this on the server side as a png. Is this possible using the .net graphics library? 回答1: I ended up doing this. Thanks for pointing me in the right direction TaW public ActionResult Avatar() { using (var bitmap = new Bitmap(50, 50)) { using (Graphics g = Graphics.FromImage(bitmap)) { g.Clear(Color.White); using (Brush b = new SolidBrush(ColorTranslator.FromHtml("#eeeeee"))) { g.FillEllipse(b, 0, 0, 49,

Create a circle avatar image in .net

对着背影说爱祢 提交于 2019-12-20 14:37:08
问题 I want to create a default avatar image which is a circle with initials in it. I want to do this on the server side as a png. Is this possible using the .net graphics library? 回答1: I ended up doing this. Thanks for pointing me in the right direction TaW public ActionResult Avatar() { using (var bitmap = new Bitmap(50, 50)) { using (Graphics g = Graphics.FromImage(bitmap)) { g.Clear(Color.White); using (Brush b = new SolidBrush(ColorTranslator.FromHtml("#eeeeee"))) { g.FillEllipse(b, 0, 0, 49,

wpf 2d high performance graphics

痞子三分冷 提交于 2019-12-20 14:14:37
问题 Basically, I want GDI-type functionality in WPF, where I can write pixels to a bitmap and update and display that bitmap through WPF. Note, I need to be able to animate the bitmap on the fly by updating pixels in response to mouse movements. I've read that InteropBitmap is perfect for this, as you can write to pixels in memory and copy the memory location to the bitmap--but I don't have any good examples to go by. Does anyone know of any good resources, tutorials, or blogs for using the

How Scanline based 2d rendering engines works?

馋奶兔 提交于 2019-12-20 12:52:43
问题 Will you please provide me a reference to help me understand how scanline based rendering engines works? I want to implement a 2D rendering engine which can support region-based clipping, basic shape drawing and filling with anti aliasing, and basic transformations (Perspective, Rotation, Scaling). I need algorithms which give priority to performance rather than quality because I want to implement it for embedded systems with no fpu. 回答1: I'm probably showing my age, but I still love my copy

How Scanline based 2d rendering engines works?

此生再无相见时 提交于 2019-12-20 12:51:22
问题 Will you please provide me a reference to help me understand how scanline based rendering engines works? I want to implement a 2D rendering engine which can support region-based clipping, basic shape drawing and filling with anti aliasing, and basic transformations (Perspective, Rotation, Scaling). I need algorithms which give priority to performance rather than quality because I want to implement it for embedded systems with no fpu. 回答1: I'm probably showing my age, but I still love my copy