00001 /* 00002 * Copyright (C) 2007,2008 Alex Shulgin 00003 * 00004 * This file is part of png++ the C++ wrapper for libpng. PNG++ is free 00005 * software; the exact copying conditions are as follows: 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions are met: 00009 * 00010 * 1. Redistributions of source code must retain the above copyright notice, 00011 * this list of conditions and the following disclaimer. 00012 * 00013 * 2. Redistributions in binary form must reproduce the above copyright 00014 * notice, this list of conditions and the following disclaimer in the 00015 * documentation and/or other materials provided with the distribution. 00016 * 00017 * 3. The name of the author may not be used to endorse or promote products 00018 * derived from this software without specific prior written permission. 00019 * 00020 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 00021 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00022 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 00023 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00024 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 00025 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00026 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00027 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00028 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00029 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00030 */ 00031 #ifndef PNGPP_RGB_PIXEL_HPP_INCLUDED 00032 #define PNGPP_RGB_PIXEL_HPP_INCLUDED 00033 00034 #include "types.hpp" 00035 #include "pixel_traits.hpp" 00036 00037 namespace png 00038 { 00039 00043 template< typename T > 00044 struct basic_rgb_pixel 00045 { 00050 basic_rgb_pixel() 00051 : red(0), green(0), blue(0) 00052 { 00053 } 00054 00059 basic_rgb_pixel(T red, T green, T blue) 00060 : red(red), green(green), blue(blue) 00061 { 00062 } 00063 00064 T red; 00065 T green; 00066 T blue; 00067 }; 00068 00072 typedef basic_rgb_pixel< byte > rgb_pixel; 00073 00077 typedef basic_rgb_pixel< uint_16 > rgb_pixel_16; 00078 00082 template< typename T > 00083 struct pixel_traits< basic_rgb_pixel< T > > 00084 : basic_pixel_traits< basic_rgb_pixel< T >, T, color_type_rgb > 00085 { 00086 }; 00087 00088 } // namespace png 00089 00090 #endif // PNGPP_RGB_PIXEL_HPP_INCLUDED