Archive

Archive for the ‘C++ Classes’ Category

Converting CMYK to RGB

September 7th, 2009
Representation of CMYK (Values discussed here are in the range [0, 1]) In CMYK, black (K) is a minimum amount of black ink for all three CMY. The CMY components are then scaled inside the remaining range: 123C' = (1-K)*C; M' = (1-K)*M; Y' = (1-K)*Y; Black Cyan Magenta Yellow Ink Contribution (CMKY) Cyan-Black Contribution […] Read more...
Categories: ITL Tags:

Loading Images using QuickTime

August 1st, 2009
QuickTime can be used to open a variety of image files on Mac OS and Windows. I have put together a simple C++ class that will open image and read image files. By default, QuickTime will read jpeg, tiff, png, gif, bmp, targa, sgi, pdf (first page) and others such as JPEG 2000 (depending on […] Read more...
Categories: C++ Classes, Programming Tags:

Loading Images under Windows (an OLE Image Loader)

August 1st, 2009
OLE can be used to open a few of image file formats (JPEG, BMP, GIF but no PNG) on Windows. I have put together a simple C++ class that will open image and read image files. Basically, here is how you can proceed to open an image with OLE (this is actually inspired from this […] Read more...
Categories: C++ Classes, Programming Tags:

Fast Fourier Transform in C++

August 1st, 2009
To download: 1bzr branch http://bazaar.enseed.com/lib/Generic/ look under Math/Fourier.h This class is a work in progress. It works fine as it is, for most transforms I do are real->complex, and only half of the transform needs to be computed in such a case. So I plan on modifying this code eventually to deal with this case […] Read more...
Categories: C++ Classes, Programming Tags:

LU Matrix Decomposition in C++

August 1st, 2009
To download: 1bzr branch http://bazaar.enseed.com/lib/Generic/ look under Geometry/LUDecomposition.h A LU decomposition decomposes a matrix M into a Lower and Upper matrix pair such that L×U=M. This representation is useful in many ways - for example, it's easy to solve (L×U)x = b. (for more info, see LU Decomposition on Wikipedia or LU Decomposition on MathWorld. […] Read more...
Categories: C++ Classes, Programming Tags:

Quaternion Class

August 1st, 2009
To download: 1bzr branch http://bazaar.enseed.com/lib/Generic/ look under Geometry/Quaternion.h I used quaternions mainly for rotations around an axis (for example, to implement a trackball that doesn't suffer from the gimbal lock like matrix-based trackballs do). Rotation of Points Around an Axis Rotation around an axis is done in three steps. First you create a quaternion q […] Read more...
Categories: C++ Classes, Programming Tags:

TrackBall Class (with no Gimbal Lock)

August 1st, 2009
To download: 1bzr branch http://bazaar.enseed.com/lib/Generic/ look under Geometry/TrackBall.h A trackball is useful when you display 3D objects and want to let the user change the position of the camera around an object by click-and-dragging the mouse. A trackball simulates a 3D ball in the scene, and rotates as though the user was dragging a point […] Read more...
Categories: C++ Classes, Programming Tags:

Point Class

August 1st, 2009
To download: 1bzr branch http://bazaar.enseed.com/demo/point/ This is a C++ point class (or vector if you prefer). Features were added as I needed them. I use it regularly so it's got pretty much everything one needs. There is a general point class (see Point.h) and four specialized classes (Point1, Point2, Point3 and Point4). Once you have […] Read more...
Categories: C++ Classes, Programming Tags:

Matrix Class

August 1st, 2009
To download (lightweight, no support for matrix inverse or determinant): 1bzr branch http://bazaar.enseed.com/demo/matrix/ To download (full version with matrix inverse and determinant): 1bzr branch http://bazaar.enseed.com/demo/matrix-with-inverse/ This is a c++ matrix class designed to minimize errors at runtime and allow the compiler to optimize as much as possible. The class uses three template arguments: The data type […] Read more...
Categories: C++ Classes, Programming Tags:

Smart Makefile for C/C++/ObjC

August 1st, 2009
To download: 1bzr branch http://bazaar.enseed.com/demo/c-makefile/ This is a smart Makefile that I have written and used over the years. It will look in your current directory and compile any .c or .cpp that it finds. It also builds dependencies from your c and cpp files (headers used) and will recompile your source file if one […] Read more...
Categories: C++ Classes, Programming Tags: