image magick++

Download Image magick++

Post on 12-Aug-2015

69 views

Category:

Technology

4 download

Embed Size (px)

TRANSCRIPT

  1. 1. ImageMagick++ ( purewell@purewell.biz ) 2012.01.13
  2. 2. ImageMagick ImageMagick++
  3. 3. RedHat... $ yum install ImageMagick-devel Ubuntu... $ apt-get install libmagick++-dev Installation
  4. 4. Compiling $ c++ -o exam exam.cpp `Magick++-config -- cppflags --cxxflags --ldflags --libs`
  5. 5. CMake CMakeLists.txt 1/2 find_package(ImageMagick) find_package(ImageMagick COMPONENTS Magick++ convert) include_directories(${ImageMagick_INCLUDE_ DIRS}) set(LIBS ${ImageMagick_LIBRARIES})
  6. 6. CMake CMakeLists.txt 2/2 add_executable(exam exam.cpp) target_link_libraries(exam ${LIBS})
  7. 7. #include #include using namespace Magick; using namespace std; int main(int argc, char* argv[] ) { InitializeMagick(*argv); // for Windows only. }
  8. 8. Image class Single Frame Manipulation Ref: http://imagemagick.org/Magick++/Image.html Image
  9. 9. try { Image img1("local.gif"); Image img2(Geometry("100x100"), 32, "GIF"); Image img3; img3.read("local.jpg"); } catch (Exception& e) { cerr