Canola
0.8.D001
|
00001 // 00002 // canola - canon canola 1614p emulator 00003 // Copyright (C) 2011 Peter Miller 00004 // 00005 // This program is free software; you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License, version 3, as 00007 // published by the Free Software Foundation. 00008 // 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 // General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License along 00015 // with this program. If not, see <http://www.gnu.org/licenses/>. 00016 // 00017 00018 #include <lib/image/monochrome.h> 00019 00020 00021 image_monochrome::~image_monochrome() 00022 { 00023 } 00024 00025 00026 image_monochrome::image_monochrome(const pointer &a_deeper) : 00027 deeper(a_deeper) 00028 { 00029 } 00030 00031 00032 image::pointer 00033 image_monochrome::create(const pointer &a_deeper) 00034 { 00035 return pointer(new image_monochrome(a_deeper)); 00036 } 00037 00038 00039 const char * 00040 image_monochrome::type_name() 00041 const 00042 { 00043 return "monochrome"; 00044 } 00045 00046 void 00047 image_monochrome::get_pixel(int x, int y, icon_pixel &value) 00048 const 00049 { 00050 icon_pixel p; 00051 deeper->get_pixel(x, y, p); 00052 value = p.monochrome(); 00053 } 00054 00055 00056 void 00057 image_monochrome::set_pixel(int x, int y, const icon_pixel &value) 00058 { 00059 deeper->set_pixel(x, y, value.monochrome()); 00060 } 00061 00062 unsigned 00063 image_monochrome::get_width() 00064 const 00065 { 00066 return deeper->get_width(); 00067 } 00068 00069 unsigned 00070 image_monochrome::get_height() 00071 const 00072 { 00073 return deeper->get_height(); 00074 } 00075 00076 00077 void 00078 image_monochrome::save_to_file(const std::string &filename) 00079 const 00080 { 00081 deeper->save_to_file(filename); 00082 }