I am aiming to implement an editable spline or bezier curve for a GUI component in Cocoa OS X 10.6. The functionality could be along the line of the ichart RapahelJS demo http://raphaeljs.com/ichart.html or a typical "illustrator-type" handle on the curve points. Exact specification of the curve is somewhat malleable and can conform to what is available/simpler to implement.
So I am hoping to find a library or component that provides a solid basis, with the standard Cocoa patterns applied. I've looked at Core Plot, which seems great to actually plot data, but apparently does not offer interactive methods to modify a data array.
Am I missing something or must such a thing (including hit tests) be implemented from scratch in an NSView? Thanks.
You might like to check out DrawKit by Graham Cox. It's an extremely sophisticated framework and the sample app is amazing.
There is no Bezier path editor provided "free" as part of AppKit. Dave DeLong and I have been working on a bezier curve editor app called BezierBuilder which is available at GitHub. You may be able to pull out the BezierView class and some of its dependencies.
I wouldn't say the app's done by any stretch of the imagination; there are certainly things you'll want to change if you're integrating it into your own app. But it's a start, anyway.
Related
I need to take a streaming image from a USB / UVC compliant web camera and digitally magnify it. The application is for people with low vision to be able to read.
The application must run on a MAC / OS X.
I am trying figure which framework to use. I did find that I can use the CALayer and apply an affine transformation, however the image is grainy as you would expect. I need to smooth it out with some method such as anti-aliasing, or some other method..
I know this is a very general question, but I need to know how to focus my efforts. At the moment I am chasing my tail reading docs, etc.
Anybody have a suggestion on what OS X Frameworks, also what algorithms or methods to smooth out grainy magnified images?
Thanks!
You're basically talking about interpolation--resizing images with some intelligent filling in of information rather than just chopping the pixels. There are various methods you could look into, such as "bilinear", "bicubic", etc. In the Apple API you might want to look at CGContextSetInterpolationQuality, which could help with some of the noise you're seeing. OpenCV is a very extensive image processing library which is readily available on OSX and has a C++ API.
Keep in mind, though, that you will ultimately be limited by the quality of the web cam, and the environment (especially lighting). There are "super resolution" techniques to stitch multiple images together, but they may not be applicable if this is a live-video application.
I can't overemphasize the importance of good lighting for applications like this. If you think about doing an iOS version of this, look at what apps like Turboscan do using the flash and a "best-of-three" technique. It's amazing what high-quality images you can get of printed text that way.
I've created a relatively simple tower defense game using c++ and SFML. I'm very interested in creating a nice gui overlay for it, ie hud, menus, etc. I know there are a lot of gui libraries out there, but I would like to make my own (for learning purposes.
I'm very familiar with working with graphics, but I'm not as familiar with GUI systems (I just render my frames, and don't worry about widgets, title bars, etc.).
Are there any good articles out there, or perhaps suggestions anyone has regarding how to layout such an interface?
There are a couple ways I know of (at least for Java) to get a nice HUD in your game. One method is to have a separate 3D world with the UI elements placed directly in front of the camera, then overlay that camera's view over the main view. This can be buggy at times, especially when you don't have a good color filter, or when you have a high number of objects being displayed. Another method is to look at a GUI library designed for this purpose (such as NiftyGUI for Java).
A quick Google search lead me to a listing on Wikipedia of many open-source GUI libraries you could use. There are many others out there, so you should probably do the Google search yourself, or look around on GitHub and SourceForge.
I'm looking for a raster image drawing software with an "infinite" zoom capability like the image viewer SeaDragon(YouTube-link). Or, alternatively, a library (in any language) with which one could build such a drawing software.
I want to draw images without having to think about resolution, being able to add ("infinite") detail wherever I feel like it.
I think you might be looking for DeepZoom Composer. There are a number of projects starting up at OpenZoom as well. Although this is relatively new, so the quality is still rather rough.
Take a look at the piccolo project: http://www.piccolo2d.org/ There is a demo app for drawing which might do what you want, but it's quite easy to make your own. Java + C# versions were pretty good last I checked (last used the Java version about 3 years ago).
I'm going to program a fancy (animated) about-box for an app I'm working on. Since this is where programmers are often allowed to shine and play with code, I'm eager to find out what kind of cool algorithms the community has implemented.
The algorithms can be animated fractals, sine blobs, flames, smoke, particle systems etc.
However, a few natural constraints come to mind: It should be possible to implement the algorithm in virtually any language. Thus advanced directx code or XNA code that utilizes libraries that aren't accessible in most languages should not be posted. 3D is most welcome, but it shouldn't rely on lots of extra installs.
If you could post an image along with your code effect, it would be awesome.
Here's an example of a cool about box with an animated 3D figure and some animated sine blobs on the titlebar:
And here's an image of the about box used in Winamp, complete with 3D animations:
I tested and ran the code on this page. It produces an old-school 2D flame effect. Even when I ran it on an N270 in HD fullscreen it seemed to work fine with no lag. The code and all source is posted on the given webpage.
Metaballs is another possibly interesting approach. They define an energy field around a blob and will melt two shapes together when they are close enough. A link to an article can be found here.
Something called a Wolfram Worm seems so be an awesome project to attempt. It would be easy to calculate random smooth movement by using movement along two connected bezier curves. Loads of awesome demos can be found on this page:
http://levitated.net/daily/index.html
(source: levitated.net)
I like a lot the Julia 4D quaternion fractal.
(source: macromedia.com)
Video: Julia 4D animation in F#
I'm messing around with image manipulation, mostly using Python. I'm not too worried about performance right now, as I'm just doing this for fun. Thus far, I can load bitmaps, merge them (according to some function), and do some REALLY crude analysis (find the brightest/darkest points, that kind of thing).
I'd like to be able to take an image, generate a set of control points (which I can more or less do now), and then smudge the image, starting at a control point and moving in a particular direction. What I'm not sure of is the process of smudging itself. What's a good algorithm for this?
This question is pretty old but I've recently gotten interested in this very subject so maybe this might be helpful to someone. I implemented a 'smudge' brush using Imagick for PHP which is roughly based on the smudging technique described in this paper. If you want to inspect the code feel free to have a look at the project: Magickpaint
Try PythonMagick (ImageMagick library bindings for Python). If you can't find it on your distribution's repositories, get it here: http://www.imagemagick.org/download/python/
It has more effect functions than you can shake a stick at.
One method would be to apply a Gaussian blur (or some other type of blur) to each point in the region defined by your control points.
One method would be to create a grid that your control points moves and then use texture mapping techniques to map the image back onto the distorted grid.
I can vouch for a Gaussian Blur mentioned above, it is quite simple to implement and provides a fairly decent blur result.
James