00001 /************************************************************************************************** 00002 Software License Agreement (BSD License) 00003 00004 Copyright (c) 2011-2013, LAR toolkit developers - University of Aveiro - http://lars.mec.ua.pt 00005 All rights reserved. 00006 00007 Redistribution and use in source and binary forms, with or without modification, are permitted 00008 provided that the following conditions are met: 00009 00010 *Redistributions of source code must retain the above copyright notice, this list of 00011 conditions and the following disclaimer. 00012 *Redistributions in binary form must reproduce the above copyright notice, this list of 00013 conditions and the following disclaimer in the documentation and/or other materials provided 00014 with the distribution. 00015 *Neither the name of the University of Aveiro nor the names of its contributors may be used to 00016 endorse or promote products derived from this software without specific prior written permission. 00017 00018 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 00019 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 00020 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 00021 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00022 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00023 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 00024 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00025 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00026 ***************************************************************************************************/ 00032 //============================================================================= 00033 // Copyright © 2004 Point Grey Research, Inc. All Rights Reserved. 00034 // 00035 // This software is the confidential and proprietary information of Point 00036 // Grey Research, Inc. ("Confidential Information"). You shall not 00037 // disclose such Confidential Information and shall use it only in 00038 // accordance with the terms of the license agreement you entered into 00039 // with Point Grey Research, Inc. (PGR). 00040 // 00041 // PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE 00042 // SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 00043 // IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 00044 // PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES 00045 // SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING 00046 // THIS SOFTWARE OR ITS DERIVATIVES. 00047 // 00048 //============================================================================= 00049 //============================================================================= 00050 // $Id: triclopsbuffer.h,v 2.3 2007/11/30 00:43:03 soowei Exp $ 00051 //============================================================================= 00052 #ifndef TRICLOPSBUFFER_H 00053 #define TRICLOPSBUFFER_H 00054 00055 //============================================================================= 00056 // 00057 // This file defines the the API for Buffer management calls in the 00058 // Triclops Stereo Vision SDK. 00059 // 00060 //============================================================================= 00061 00062 00063 //============================================================================= 00064 // Defines 00065 //============================================================================= 00066 00067 //============================================================================= 00068 // System Includes 00069 //============================================================================= 00070 00071 #include <triclops.h> 00072 00073 #ifdef __cplusplus 00074 extern "C" 00075 { 00076 #endif 00077 00078 //============================================================================= 00079 // Macros 00080 //============================================================================= 00081 00082 //============================================================================= 00083 // Enumerations 00084 //============================================================================= 00085 00086 //============================================================================= 00087 // Types 00088 //============================================================================= 00089 00090 //============================================================================= 00091 // Function Prototypes 00092 //============================================================================= 00093 00094 //============================================================================= 00095 // Image Buffer Operations 00096 //============================================================================= 00097 // 00098 // Group = Image Buffer Operations 00099 00100 // 00101 // Name: triclopsSetImageBuffer 00102 // 00103 // Synopsis: 00104 // Sets the internal image buffer for the specified camera and image type 00105 // to be the buffer supplied by the user. 00106 // 00107 // Input: 00108 // context - The context. 00109 // buffer - A user allocated buffer of sufficient size. 00110 // imageType - The image type. 00111 // camera - The camera. 00112 // 00113 // Returns: 00114 // TriclopsErrorOk - The operation succeeded. 00115 // InvalidContext - The input context was invalid. 00116 // InvalidCamera - The input camera is invalid for this camera configuration, 00117 // or is not associated with the requested image type. 00118 // InvalidRequest - The image is not set to be generated by the stereo kernel. 00119 // 00120 // Description: 00121 // This function allows the user to specify directly what memory he/she 00122 // wishes the output images to be deposited into. This memory will be used 00123 // by the stereo kernel as working space. This has the advantage of saving 00124 // a copy for tasks such as displaying to the screen. The user may simply 00125 // set the output image buffer to his/her display buffer. However, since 00126 // this memory will be used by the stereo kernel as working space, the 00127 // contents of the buffer may change with each call of triclopsPreprocess() 00128 // or triclopsStereo(). If the results are to be saved, it is the user's 00129 // responsibility to do so. In addition, the user is responsible to allocate 00130 // sufficient memory for the buffer, and to de-allocate the buffer after 00131 // it is no longer needed. Before de-allocating the buffer, the user should 00132 // call triclopsUnsetImageBuffer(). If the user requests an invalid image, 00133 // such as the disparity image, when the context stereo flag is set to false, 00134 // or the edge image when edge correlation is set to false, an error of 00135 // invalid request will be returned. Disparity images are always associated 00136 // with the reference camera. 00137 // 00138 // See Also: 00139 // triclopsGetImage(), triclopsUnsetImageBuffer() 00140 // 00141 TriclopsError 00142 triclopsSetImageBuffer( TriclopsContext context, 00143 unsigned char* buffer, 00144 TriclopsImageType imageType, 00145 TriclopsCamera camera ); 00146 00147 // 00148 // Name: triclopsUnsetImageBuffer 00149 // 00150 // Synopsis: 00151 // This releases the user specified internal image buffer for the specified 00152 // camera and image type. The next time this buffer is required by the 00153 // system, it will allocate a new one for internal use. 00154 // 00155 // Input: 00156 // context - The context. 00157 // imageType - The image type. 00158 // camera - The camera. 00159 // 00160 // Returns: 00161 // TriclopsErrorOk - The operation succeeded. 00162 // InvalidContext - The input context was invalid. 00163 // InvalidCamera - The input camera is invalid for this camera configuration, 00164 // or is not associated with the requested image type. 00165 // 00166 // Description: 00167 // If the user has already called triclopsSetImageBuffer for a particular 00168 // camera and image type, the stereo kernel will be using that buffer for 00169 // internal processing. If the user no longer wants to have the supplied 00170 // buffer used by the stereo kernel, he/she may use this function to inform 00171 // the stereo kernel that it is no longer available. A new buffer will be 00172 // created the next time it is required by the stereo kernel. 00173 // 00174 // See Also: 00175 // TriclopsGetImage(), triclopsSetImageBuffer() 00176 // 00177 TriclopsError 00178 triclopsUnsetImageBuffer( TriclopsContext context, 00179 TriclopsImageType imageType, 00180 TriclopsCamera camera ); 00181 00182 00183 // 00184 // Name: triclopsSetImage16Buffer 00185 // 00186 // Description: 00187 // This function allows the user to set the location to which 16bit 00188 // (generally subpixel) depth images are written to once they are processed. 00189 // 00190 // Input: 00191 // context - The TriclopsContext to set the buffer in. 00192 // buffer - A pointer to the buffer. 00193 // imageType - The type of image to be written to the buffer. 00194 // camera - The camera to write from. 00195 // 00196 // Returns: 00197 // TriclopsErrorOk - Upon the successful completion of the operation. 00198 // 00199 TriclopsError 00200 triclopsSetImage16Buffer( TriclopsContext context, 00201 unsigned short* buffer, 00202 TriclopsImage16Type imageType, 00203 TriclopsCamera camera ); 00204 00205 // 00206 // Name: triclopsUnsetImage16Buffer 00207 // 00208 // Synopsis: 00209 // This releases the user specified internal image buffer for the specified 00210 // camera and image type. The next time this buffer is required by the 00211 // system, it will allocate a new one for internal use. 00212 // 00213 // Input: 00214 // context - The context. 00215 // imageType - The image type. 00216 // camera - The camera. 00217 // 00218 // Returns: 00219 // TriclopsErrorOk - The operation succeeded. 00220 // InvalidContext - The input context was invalid. 00221 // InvalidCamera - The input camera is invalid for this camera configuration, 00222 // or is not associated with the requested image type. 00223 // 00224 // Description: 00225 // If the user has already called triclopsSetImage16Buffer for a particular 00226 // camera and image type, the stereo kernel will be using that buffer for 00227 // internal processing. If the user no longer wants to have the supplied 00228 // buffer used by the stereo kernel, he/she may use this function to inform 00229 // the stereo kernel that it is no longer available. A new buffer will be 00230 // created the next time it is required by the stereo kernel. 00231 // 00232 // See Also: 00233 // triclopsGetImage(), triclopsSetImage16Buffer() 00234 // 00235 TriclopsError 00236 triclopsUnsetImage16Buffer( TriclopsContext context, 00237 TriclopsImage16Type imageType, 00238 TriclopsCamera camera ); 00239 00240 // 00241 // Name: triclopsSetColorImageBuffer 00242 // 00243 // Synopsis: 00244 // Allows the user to set separate buffers to which individual bands of the 00245 // processed color image are written to. In this case, the "processed" image 00246 // means the rectified image that is rectified when triclopsRectifyColorImage() 00247 // is called. 00248 // 00249 // Input: 00250 // context - The TriclopsContext to set the buffer for. 00251 // nCamera - The camera buffer to set. 00252 // red - A pointer to the red buffer. 00253 // green - A pointer to the green buffer. 00254 // blue - A pointer to the blue buffer. 00255 // 00256 // Returns: 00257 // TriclopsErrorOk - Upon the successful completion of the operation. 00258 // 00259 // See Also: 00260 // triclopsRectifyColorImage() 00261 // 00262 TriclopsError 00263 triclopsSetColorImageBuffer( TriclopsContext context, 00264 TriclopsCamera nCamera, 00265 unsigned char* red, 00266 unsigned char* green, 00267 unsigned char* blue ); 00268 00269 // 00270 // Name: triclopsUnsetColorImageBuffer 00271 // 00272 // Synopsis: 00273 // This releases the user specified internal color image buffer for the 00274 // specified camera. The next time this buffer is required by the 00275 // system, it will allocate a new one for internal use. 00276 // 00277 // Input: 00278 // context - The context. 00279 // camera - The camera. 00280 // 00281 // Returns: 00282 // TriclopsErrorOk - The operation succeeded. 00283 // InvalidContext - The input context was invalid. 00284 // InvalidCamera - The input camera is invalid for this camera configuration, 00285 // or is not associated with the requested image type. 00286 // 00287 // Description: 00288 // If the user has already called triclopsSetColorImageBuffer for a particular 00289 // camera, the stereo kernel will be using that buffer when rectifying a 00290 // color image. If the user no longer wants to have the supplied 00291 // buffer used by the stereo kernel, he/she may use this function to inform 00292 // the stereo kernel that it is no longer available. A new buffer will be 00293 // created the next time it is required by the stereo kernel. 00294 // 00295 // See Also: 00296 // triclopsRectifyColorImage(), triclopsSetColorImageBuffer() 00297 // 00298 TriclopsError 00299 triclopsUnsetColorImageBuffer( TriclopsContext context, 00300 TriclopsCamera camera ); 00301 00302 // 00303 // Name: triclopsSetPackedColorImageBuffer 00304 // 00305 // Synopsis: 00306 // Allows the user to set the buffer to which the processed color image 00307 // is written to. 00308 // 00309 // Input: 00310 // context - The TriclopsContext to set the buffer for. 00311 // nCamera - The camera buffer to set. 00312 // buffer - A pointer to a buffer of TriclopsPackedColorPixels. 00313 // 00314 // Returns: 00315 // TriclopsErrorOk - Upon the successful completion of the operation. 00316 // 00317 TriclopsError 00318 triclopsSetPackedColorImageBuffer( TriclopsContext context, 00319 TriclopsCamera nCamera, 00320 TriclopsPackedColorPixel* buffer ); 00321 00322 // 00323 // Name: triclopsUnsetPackedColorImageBuffer 00324 // 00325 // Synopsis: 00326 // This releases the user specified internal color image buffer for the 00327 // specified camera. The next time this buffer is required by the 00328 // system, it will allocate a new one for internal use. 00329 // 00330 // Input: 00331 // context - The context. 00332 // camera - The camera. 00333 // 00334 // Returns: 00335 // TriclopsErrorOk - The operation succeeded. 00336 // InvalidContext - The input context was invalid. 00337 // InvalidCamera - The input camera is invalid for this camera configuration, 00338 // or is not associated with the requested image type. 00339 // 00340 // Description: 00341 // If the user has already called triclopsSetPackedColorImageBuffer for a 00342 // particular camera, the stereo kernel will be using that buffer when rectifying a 00343 // color image. If the user no longer wants to have the supplied 00344 // buffer used by the stereo kernel, he/she may use this function to inform 00345 // the stereo kernel that it is no longer available. A new buffer will be 00346 // created the next time it is required by the stereo kernel. 00347 // 00348 // See Also: 00349 // triclopsSetPackedColorImageBuffer(), triclopsRectifyPackedColorImage() 00350 // 00351 TriclopsError 00352 triclopsUnsetPackedColorImageBuffer( TriclopsContext context, 00353 TriclopsCamera camera ); 00354 00355 #ifdef __cplusplus 00356 } 00357 #endif 00358 00359 #endif // #ifndef TRICLOPSBUFFER_H