$search
00001 00002 /********************************************************************* 00003 * Software License Agreement (BSD License) 00004 * 00005 * Copyright (c) 2009, Willow Garage, Inc. 00006 * All rights reserved. 00007 * 00008 * Redistribution and use in source and binary forms, with or without 00009 * modification, are permitted provided that the following conditions 00010 * are met: 00011 * 00012 * * Redistributions of source code must retain the above copyright 00013 * notice, this list of conditions and the following disclaimer. 00014 * * Redistributions in binary form must reproduce the above 00015 * copyright notice, this list of conditions and the following 00016 * disclaimer in the documentation and/or other materials provided 00017 * with the distribution. 00018 * * Neither the name of the Willow Garage nor the names of its 00019 * contributors may be used to endorse or promote products derived 00020 * from this software without specific prior written permission. 00021 * 00022 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00023 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00024 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00025 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00026 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00027 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00028 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00029 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00030 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00031 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00032 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00033 * POSSIBILITY OF SUCH DAMAGE. 00034 *********************************************************************/ 00035 00036 #ifndef SENSOR_MSGS_IMAGE_ENCODINGS_H 00037 #define SENSOR_MSGS_IMAGE_ENCODINGS_H 00038 00039 #include <string> 00040 00041 namespace sensor_msgs 00042 { 00043 namespace image_encodings 00044 { 00045 extern const std::string RGB8; 00046 extern const std::string RGBA8; 00047 extern const std::string RGB16; 00048 extern const std::string RGBA16; 00049 extern const std::string BGR8; 00050 extern const std::string BGRA8; 00051 extern const std::string BGR16; 00052 extern const std::string BGRA16; 00053 extern const std::string MONO8; 00054 extern const std::string MONO16; 00055 00056 // OpenCV CvMat types 00057 extern const std::string TYPE_8UC1; 00058 extern const std::string TYPE_8UC2; 00059 extern const std::string TYPE_8UC3; 00060 extern const std::string TYPE_8UC4; 00061 extern const std::string TYPE_8SC1; 00062 extern const std::string TYPE_8SC2; 00063 extern const std::string TYPE_8SC3; 00064 extern const std::string TYPE_8SC4; 00065 extern const std::string TYPE_16UC1; 00066 extern const std::string TYPE_16UC2; 00067 extern const std::string TYPE_16UC3; 00068 extern const std::string TYPE_16UC4; 00069 extern const std::string TYPE_16SC1; 00070 extern const std::string TYPE_16SC2; 00071 extern const std::string TYPE_16SC3; 00072 extern const std::string TYPE_16SC4; 00073 extern const std::string TYPE_32SC1; 00074 extern const std::string TYPE_32SC2; 00075 extern const std::string TYPE_32SC3; 00076 extern const std::string TYPE_32SC4; 00077 extern const std::string TYPE_32FC1; 00078 extern const std::string TYPE_32FC2; 00079 extern const std::string TYPE_32FC3; 00080 extern const std::string TYPE_32FC4; 00081 extern const std::string TYPE_64FC1; 00082 extern const std::string TYPE_64FC2; 00083 extern const std::string TYPE_64FC3; 00084 extern const std::string TYPE_64FC4; 00085 00086 // Bayer encodings 00087 extern const std::string BAYER_RGGB8; 00088 extern const std::string BAYER_BGGR8; 00089 extern const std::string BAYER_GBRG8; 00090 extern const std::string BAYER_GRBG8; 00091 extern const std::string BAYER_RGGB16; 00092 extern const std::string BAYER_BGGR16; 00093 extern const std::string BAYER_GBRG16; 00094 extern const std::string BAYER_GRBG16; 00095 00096 // Miscellaneous 00097 extern const std::string YUV422; 00098 00099 // Utility functions for inspecting an encoding string 00100 bool isColor(const std::string& encoding); 00101 bool isMono(const std::string& encoding); 00102 bool isBayer(const std::string& encoding); 00103 bool hasAlpha(const std::string& encoding); 00104 int numChannels(const std::string& encoding); 00105 int bitDepth(const std::string& encoding); 00106 } 00107 } 00108 00109 #endif