¡Esta es una revisión vieja del documento!
libmagick++ y, al compilar con g++, agregaremos los siguientes parámetros: -I/usr/include/ImageMagick/ -lMagick++#include <Magick++.h> #include <iostream> using namespace std; using namespace Magick; int main(int argc,char **argv) { Image image; image.read( "girl.gif" ); image.crop( Geometry(100,100, 100, 100) ); image.write( "x.gif" ); image.display(); return 0; }
Image image(Geometry(f->s.width, f->s.height), "black"); ... for (x, y) if (f->blobs[y][x] == nBlob) image.pixelColor(x, y, "white"); ... image.write("test.png");
Se utilizan los objetos Drawable.
Image image( Geometry(300,200), Color("white") ); image.strokeColor("red"); // Outline color image.fillColor("green"); // Fill color image.strokeWidth(5); image.draw( DrawableCircle(100,100, 50,100) ); image.draw( DrawableRectangle(200,200, 270,170) ); image.display( );
img->strokeColor("blue"); img->strokeWidth(3); img->fillColor(rgb); list<Coordinate> coords; for (int j=0; j<p.nvertices; j++) coords.push_back(Coordinate(p.vertices[j].x, p.vertices[j].y)); img->draw(DrawablePolygon(coords));
char rgb[20]; sprintf(rgb,"rgb(%d,%d,%d)",colors[orient][0], colors[orient][1], colors[orient][2]); img->fillColor(rgb);
Image img; img.read("mario.jpg"); img.write(&blob, "RGBA", 8); glGenTextures (1, &texture); glBindTexture (GL_TEXTURE_2D, texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); gluBuild2DMipmaps(GL_TEXTURE_2D, 4, img.columns(), img.rows(), GL_RGBA, GL_UNSIGNED_BYTE, blob.data());