CImg 라이브러리는 사용하기 쉽습니다.
CImg<unsigned char> img("lena.png"); // Read in the image lena.png
const unsigned char valR = img(10,10,0,0); // Read the red component at coordinates (10,10)
const unsigned char valG = img(10,10,0,1); // Read the green component at coordinates (10,10)
const unsigned char valB = img(10,10,2); // Read the blue component at coordinates (10,10) (Z-coordinate omitted here).
const unsigned char avg = (valR + valG + valB)/3; // Compute average pixel value.
img(10,10,0) = img(10,10,1) = img(10,10,2) = avg; // Replace the pixel (10,10) by the average grey value.
CImgDisplay main_disp(img, "Modified Lena"); // Display the modified image on the screen
img.save("lena_mod.png"); // Save the modified image to lena_mod.png
강력한 이미지 처리 라이브러리로 사용할 수도 있습니다. 예제 here을 참조하십시오.
혼자서 표시하는 것은 많은 코드 일 것이고 또한 시스템 의존적 일 것입니다. 이미 일부 GUI 라이브러리를 사용하고 있습니까? 어떤 플랫폼을 사용하고 있습니까? –
Martin : 아직 소스 코드가 없습니다. (실제로 존재하지만, 처음부터 다시 시작하는 것을 망설이지는 않을 정도로 작습니다.) – Benno
영원한 C++ 질문입니다. 이미 5 장의 upvote로 백업. 20 년 이상의 그래픽 사용자 인터페이스가 주류가 된 후에도 이미지를 보여주는 핵심적인 문제는 여전히 언어 실무자들의 조잡함을 돋보이게합니다. 안좋다. –