Tag Info

Hot answers tagged

71

I guess people often claim that C is faster than C++ because it's easier to reason about performance in C. C++ is not inherently slower or faster, but certain C++ code might obscure hidden performance penalties. For example, there can be copies and implicit conversions which are not immediately visible when looking at some piece of C++ code. Let's take the ...


30

Code written in C++ can be faster than in C, for certain types of tasks. If you prefer C++, use C++. Any performance issues are going to be insignificant compared to algorithmic decisions of your software.


28

Deconvolution (also see here and here) can partially deblur a photo. There is plenty of software out there that implements it, and this was even a fairly basic excersise in an image processing class I took in College. It's not possible to completely reverse the blurring, since it is lossy, but a lot of information can be restored (also see here (PDF)). A ...


27

This answer comes a bit too late, but I hope to shine light to others (particularly now that C++ standard committee wants to incorporate Cairo into std): The reason nobody really cares about "accelerated vector graphics" is because of how GPUs work. GPUs work using massive parallelization and SIMD capabilities to colour each pixel. AMD typically works in ...


25

I personally do not think you have to be good artistically to create pleasing user interfaces. What makes a good UI is not up to creativity, but is more related to a couple of well-established guidelines. If you follow these guidelines and practice some you can create great interfaces yourself. I would suggest doing the following... Read about what ...


22

One of the design principles of C++ is that you don't pay for features you don't use. So, if you write code in C++ and avoid features that don't exist in C, then the resulting compiled code should be equivalent in performance (though you would have to measure this). There is negligible cost to using classes, for example, compared to structs and a bunch of ...


15

In my company, there are a few people specialized in this job. They are designers. And they know HTML. They can be a bridge between the designers and the front-end engineers; which they usually are. This way, we just have to integrate their HTML. This is a hard job. There's a reason sites like "PSD to HTML in 24h" work well. The solution in our company is ...


14

2D / 1D - mapping is pretty simple. Given x and y, and 2D array sizes width and height, you can calculate the according index i in 1D space (zero-based) by i = x + width*y; and the reverse operation is x = i % width; // % is the "modulo operator", the remainder of i / width; y = i / width; // where "/" is an integer division You can extend this ...


13

They have a custom graphics engine written directly against the APIs of the OS's they code for. That's one of the things that sets them apart from the rest of the graphics tools out there is that they aren't just using the stock junk that comes built into the APIs. As for the core -- it's people. Brilliant, hard-working, well-paid people.


13

I don't think it is really true that nobody really cares about "accelerated vector graphics" as written in this answer. Nvidia seems to care a fair bit. Besides Kilgard who is the lead technical guy on NV_path_rendering (henceforth NVpr to save my fingers), the Khronos president, Neil Trevett, who is also a VP at Nvidia, has promoted NVpr as much as he ...


12

My art ability is about 5th grade on a good day:). I employ a graphic designer, either professionally when at work, or my wife, who has excellent art skills and loves using them. Note that in my mind Graphics design is not UI/UX design. I either do a majority of UX, or employ a UX expert to retain control of UX, who then works with the GD to make it look ...


12

One reason that higher level languages are sometimes slower is that they can hide behind the scenes a lot more memory management than lower level languages. Any language (or library, API, etc) that abstracts away low level detail can potentially be hiding costly operations. For example, in some languages simply trimming trailing whitespace from a string ...


11

The quick and dirty approach is to just do it. Make a website. You see websites everyday. What elements do you like from the sites you visit? What element's don't you like? You will get better the more sites you do. Now, if you want to put some real effort into it, there are a few books you can pick up that will help you with UI design and layout: Don't ...


10

Back in the graphics.h days each compiler had it's own limited graphics library. Now you program to either DirectX (Microsoft) or OpenGL (everywhere). After a few years of being sidelined to high-end Unix cad OpenGL/OpenGLEs is making a big splash on mobile devices For a list of books see http://stackoverflow.com/questions/5926357/c-opengl-books One ...


9

I always liked defining a rectangle as a point + width and height, where the point is the upper-left corner of the rectangle. class Rect { float x, y; float width, height; } And then add whatever methods you need to fetch the other metrics. Like the Java version


9

If you’re looking for graphical assets there are a few websites which collect high-quality graphics for free use: Bootstrap for arguably the best (but definitely the hottest right now) UI web framework Glyphicons for an icon set that complements Twitter’s Bootstrap UI framework Subtle Patterns for, well, subtle background patterns FamFamFam’s Silk icons ...


8

Being a good artist is just as much a talent as being a good engineer. Some have it, some don't. Some can do both (fairly hard to come by). Having said that, there are logical elements of design that you can learn to help you become fairly proficient at it. I mean, chances are that you won't find yourself getting a webby award for your designs, but you can ...


8

read Don't Make Me Think, by Steve Krug - this will provide functional help so your user-interfaces work well, and teach you about usability testing so you can design for the users and not just for yourself (a common developer problem) hire a pro to make stuff pretty - for when it matters, a good graphic artist can make the difference between "It's okay" ...


8

It's easy to do that. Using an Octtree you simply divide the world into progressively smaller pieces until you reach the level of detail needed. This might be the size of a grain of sand for example. Think Minecraft taken to an extreme. What do you render then? If the detail is small enough you may consider rendering blocks - the leaf nodes of the octtree. ...


8

X is practically the most low-level graphics API a Linux application will likely use on a modern Linux Desktop. Most applications won't even bother going that deep and will instead use a GUI toolkit implementation like GTK or Qt. Below that there's only the hardware drivers and probably some X-internal APIs for the drivers. But those are not meant or ...


8

You can hire specialists for this sort of thing, but you don't need innate artistic ability to learn some basic techniques. My undergrad degree actually required a semester of "art for engineers." Taking a class or two at your local community college could be very beneficial. You still won't be as good as people specially trained in the field, but you can ...


7

To learn GUI, all you have do is to put one idea in your mind, only one, which is: event-driven. That's it, the pattern appears in all GUI/gaming stuff. Then, what is event driven? Before we goes into details, let's see the common sequence console program first ask user for some parameters read file calculate some values write to the file close the file ...


7

Have you considered that it is less error prone? If you use (Point1, Point2) it is then very clear what you are specifying. If you provide 2 points, then the only possible error is that the user has mixed up their x and y when constructing the points as the order of the points doesn't matter. If you supply 4 integers, then if someone isn't paying ...


7

Since it is open source have you considered using a free, existing site like Github rather than building a new website? As for a logo, you could try: Farming the job out and perhaps offering $25, someone in the world might well be willing to do it for that price. As part of your Githup homepage ask for help designing a logo. Run a contest and announce it ...


7

The opencv image processing library does it by saving the image and comparing it to a reference image - it has a bunch of c++ test functions and macros to handle approximate image matching etc.


6

Actually, a rectagle isn't defined by 2 points. A rectangle can only be defined by two points if it is parallel to the axes. There are several ways to represent rectangles that are parallel to the axes: Two diagonally opposite points One corner point, height and width Centre point, half height and width (uncommon, but sometimes useful). As two X ...


6

Most opensource libs allow you to publish them together with your own code. You can bundle your class with all the code required to run it. If you just cut out and modify pieces you can run into serious issues if the user wants to include the lib in the future. Please keep in mind that in object oriented programming every class should have a clearly ...


6

Well p1: Point and p2: Point are each going to have two int coordinates in them anyway, so doesn't your class amount to the same thing? And if you store those two points as first-class Point objects, don't you get a little more utility from them? In most graphical coordinate systems that I know of, points are subclassed in this way to create a hierarchy of ...


6

Reversing image manipulation depends on how something has been manipulated. Since the image is a representation of the object and we only have the visual data in that image, we can't "unblur" it, since we don't have the data. Imagine a blurred image (like a pixelated faced) is similar to an email without all of the characters, we wouldn't be able to take ...



Only top voted, non community-wiki answers of a minimum length are eligible