Warning: The magic method Slickr_Flickr_Plugin::__wakeup() must have public visibility in /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php on line 152

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":28322,"date":"2015-11-25T22:39:20","date_gmt":"2015-11-26T04:39:20","guid":{"rendered":"http:\/\/myfreakingcrazythoughts.wordpress.com\/?p=386"},"modified":"2015-11-25T22:39:20","modified_gmt":"2015-11-26T04:39:20","slug":"final-project-10","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2015\/2015\/final-project-10\/","title":{"rendered":"Final Project!"},"content":{"rendered":"

We did it!<\/p>\n

My buddy and I finally acomplish our project for our TC101 class.<\/p>\n

Well, basically, our program had to do the following:<\/p>\n

“You will create a command-line program that uses two-dimensional arrays or matrices to process images. You cannot simply call graphics libraries to manipulate the images directly but must implement the functions with your own algorithms. The input to each operation is an image (you choose to support any of JPEG, PNG) and the output is the modified image. The idea is to have a final project which shows your mastery of the topics in this course”.<\/p>\n

I was really hard to acomplish but Eduardo and I worked together and we made it!<\/p>\n

The user is able to type in the name of the file (a picture) and the program will process the image outputting a different file than the first one.<\/p>\n

There is a huge code!<\/p>\n

It looks like this:<\/p>\n

\n
#include <Magick++.h><\/span>\n#include <iostream><\/span>\n#include <cmath><\/span>\nusing<\/span> namespace<\/span> std;<\/span>\nusing<\/span> namespace<\/span> Magick;<\/span>\n\nvoid<\/span> grayscale<\/span> (string<\/span> in,<\/span> string<\/span> out){<\/span>\n  Image<\/span> image;<\/span>\n  image.read(<\/span> in<\/span> );<\/span>\n  int<\/span> x<\/span> =<\/span> image.rows();<\/span>\n  int<\/span> y<\/span> =<\/span> image.columns();<\/span>\n  Color<\/span> image_array<\/span> [x]<\/span> [y];<\/span>\n  Color<\/span> original;<\/span>\n  Color<\/span> graysc;<\/span>\n  int<\/span> col;<\/span>\n\n\n  for<\/span> (<\/span>int<\/span> i=<\/span>0<\/span>;<\/span> i<\/span> <<\/span> x;<\/span> i++){<\/span>                    \n    for<\/span> (<\/span>int<\/span> u<\/span> =<\/span> 0<\/span>;<\/span> u<\/span> <<\/span> y;<\/span> u++){<\/span>               \n      original<\/span> =<\/span> image.pixelColor(u,i);<\/span> \n      image_array<\/span> [i][u]<\/span> =<\/span> original;<\/span>\n      col<\/span> =<\/span> (original.redQuantum()<\/span> +<\/span> original.greenQuantum()<\/span> +<\/span> original.blueQuantum())<\/span> \/<\/span> 3<\/span>;<\/span>\n      graysc.redQuantum(col);<\/span>\n      graysc.greenQuantum(col);<\/span>\n      graysc.blueQuantum(col);<\/span>\n      image_array<\/span> [i]<\/span> [u]<\/span> =<\/span> graysc;<\/span>\n      image.pixelColor(u,<\/span> i,<\/span> graysc);<\/span>\n    }<\/span>\n  }<\/span>\n  image.write(<\/span> out<\/span> );<\/span>\n}<\/span>\n\nvoid<\/span> scale<\/span>(string<\/span> in,<\/span> string<\/span> out){<\/span>\n  Image<\/span> image;<\/span>\n  image.read(<\/span> in<\/span> );<\/span>\n\n  int<\/span> x<\/span> =<\/span> image.rows();<\/span>\n  int<\/span> y<\/span> =<\/span> image.columns();<\/span>\n  int<\/span> xf<\/span> =<\/span> x\/<\/span>2<\/span>;<\/span>\n  int<\/span> yf<\/span> =<\/span> y\/<\/span>2<\/span>;<\/span>\n  Image<\/span> image2(<\/span> Geometry(yf,<\/span> xf),<\/span> Color(MaxRGB,<\/span> MaxRGB,<\/span> MaxRGB,<\/span> 0<\/span>));<\/span>\n  Color<\/span> image_array<\/span> [x]<\/span> [y];<\/span>\n  Color<\/span> image_array2<\/span> [xf]<\/span> [yf];<\/span>\n  Color<\/span> pixel1,<\/span> pixel2,<\/span> pixel3,<\/span> pixel4,<\/span> pixel5;<\/span>\n  int<\/span> red,blue,green;<\/span>\n  Color<\/span> newRGB,<\/span> newRGB2;<\/span>\n\n  for<\/span> (<\/span>int<\/span> i=<\/span>0<\/span>;<\/span> i<\/span> <<\/span> x;<\/span> i++){<\/span>\n        for<\/span> (<\/span>int<\/span> u<\/span> =<\/span> 0<\/span>;<\/span> u<\/span> <<\/span> y;<\/span> u++){<\/span>\n              pixel1<\/span> =<\/span> image.pixelColor(u,i);<\/span>\n              image_array<\/span> [i][u]<\/span> =<\/span> pixel1;<\/span>\n        }<\/span>\n  }<\/span>\n\n  for<\/span> (<\/span>int<\/span> i=<\/span>0<\/span>;<\/span> i<\/span> <<\/span> x;<\/span> i<\/span> =<\/span> i+<\/span>2<\/span>){<\/span>\n       for<\/span> (<\/span>int<\/span> u<\/span> =<\/span> 0<\/span>;<\/span> u<\/span> <<\/span> y;<\/span> u<\/span> =<\/span> u+<\/span>2<\/span>){<\/span>\n       \t     int<\/span> x2<\/span> =<\/span> i\/<\/span>2<\/span>;<\/span>\n       \t     int<\/span> y2<\/span> =<\/span> u\/<\/span>2<\/span>;<\/span>\n             pixel2<\/span> =<\/span> image_array<\/span> [i]<\/span> [u];<\/span>\n             pixel3<\/span> =<\/span> image_array<\/span> [i+<\/span>1<\/span>]<\/span> [u];<\/span>\n             pixel4<\/span> =<\/span> image_array<\/span> [i]<\/span> [u+<\/span>1<\/span>];<\/span>\n             pixel5<\/span> =<\/span> image_array<\/span> [i+<\/span>1<\/span>]<\/span> [u+<\/span>1<\/span>];<\/span>\n             red<\/span> =<\/span> (pixel2.redQuantum()<\/span> +<\/span> pixel3.redQuantum()<\/span> +<\/span> pixel4.redQuantum()<\/span> +<\/span> pixel5.redQuantum())\/<\/span>4<\/span>;<\/span>\n             blue<\/span> =<\/span> (pixel2.blueQuantum()<\/span> +<\/span> pixel3.blueQuantum()<\/span> +<\/span> pixel4.blueQuantum()<\/span> +<\/span> pixel5.blueQuantum())\/<\/span>4<\/span>;<\/span>\n             green<\/span> =<\/span> (pixel2.greenQuantum()<\/span> +<\/span> pixel3.greenQuantum()<\/span> +<\/span> pixel4.greenQuantum()<\/span> +<\/span> pixel5.greenQuantum())\/<\/span>4<\/span>;<\/span>\n             newRGB.redQuantum(red);<\/span>\n             newRGB.greenQuantum(green);<\/span>\n             newRGB.blueQuantum(blue);<\/span>\n             image_array2<\/span> [x2]<\/span> [y2]<\/span> =<\/span> newRGB;<\/span>\n       }<\/span>\n  }<\/span>\n\n  for<\/span> (<\/span>int<\/span> i=<\/span>0<\/span>;<\/span> i<\/span> <<\/span> xf;<\/span> i++){<\/span>\n       for<\/span> (<\/span>int<\/span> u<\/span> =<\/span> 0<\/span>;<\/span> u<\/span> <<\/span> yf;<\/span> u++){<\/span>\n             newRGB2<\/span> =image_array2<\/span> [i]<\/span> [u];<\/span>\n             image2.pixelColor(u,<\/span> i,<\/span> newRGB2);<\/span>\n       }<\/span>\n  }<\/span>\n\n image2.write(<\/span> out<\/span> );<\/span>\n}<\/span>\n\nint<\/span> main<\/span>(<\/span>int<\/span> argc,<\/span>char<\/span> **argv)<\/span>\n{<\/span>\n  InitializeMagick(*argv);<\/span>\n\n  try<\/span> {<\/span>\n string<\/span> im;<\/span>\n string<\/span> out;<\/span>\n int<\/span> ans;<\/span>\n cout<\/span> <<<\/span> \"Write your file name: \"<\/span>;<\/span>\n cin<\/span> >><\/span> im;<\/span>\n cout<<<\/span> \"Write the name of your output file: \"<\/span>;<\/span>\n cin>>out;<\/span>\n cout<<<\/span>\"What do you wanna do?\"<\/span><<endl<<<\/span>\"1. Grayscale.\"<\/span><<endl<<<\/span>\"2. Scale (1\/2).\"<\/span><<endl;<\/span>\n cin>>ans;<\/span>\n\nwhile<\/span> (ans<\/span> !=<\/span> 1<\/span> &&<\/span> ans<\/span> !=<\/span> 2<\/span>){<\/span>\n  cout<<<\/span>\"Try again please: \"<\/span>;<\/span>\n  cin>>ans;}<\/span>\nif<\/span>(ans<\/span> ==<\/span> 1<\/span>){<\/span>\n grayscale(im,<\/span> out);}<\/span>\n if<\/span> (ans<\/span> ==<\/span> 2<\/span>){<\/span>\n scale(im,<\/span> out);<\/span>\n}<\/span>\n}<\/span>\n  catch<\/span>(<\/span> Exception<\/span> &error_<\/span> )<\/span>\n    {<\/span>\n      cout<\/span> <<<\/span> \"Caught exception: \"<\/span> <<<\/span> error_.what()<\/span> <<<\/span> endl;<\/span>\n      return<\/span> 1<\/span>;<\/span>\n    }<\/span>\n  return<\/span> 0<\/span>;<\/span>\n\/\/\/\/ c++ -O2 -o prog prog.cpp `Magick++-config --cppflags --cxxflags --ldflags --libs`<\/span>\n}<\/span>\n<\/pre>\n<\/div>\n

 <\/p>\n

There is also a Repository made it in Github and that’s were our teacher is going to check it out.<\/p>\n

Any question feel completely free to ask.<\/p>\n

Thank you guys for everything.<\/p>\n

-The Admin.<\/p>\n

 <\/p>\n

 <\/p>\n

\"\"<\/a> \"\"<\/p>\n","protected":false},"excerpt":{"rendered":"

We did it! My buddy and I finally acomplish our project for our TC101 class. Well, basically, our program had to do the following: “You will create a command-line program that uses two-dimensional arrays or matrices to process images. You… Continue Reading →<\/a>\"\"<\/p>\n","protected":false},"author":259,"featured_media":28321,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[582,206,619,809,152,617,614,615],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28322"}],"collection":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/users\/259"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/comments?post=28322"}],"version-history":[{"count":1,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28322\/revisions"}],"predecessor-version":[{"id":28323,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28322\/revisions\/28323"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/media\/28321"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/media?parent=28322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/categories?post=28322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/tags?post=28322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}