Home » Source Code » » highgui.h

highgui.h ( File view )

From:
  • By 2010-07-20
  • View(s):8
  • Download(s):0
  • Point(s): 1
			/*M///////////////////////////////////////////////////////////////////////////////////////
//
//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
//  By downloading, copying, installing or using the software you agree to this license.
//  If you do not agree to this license, do not download, install,
//  copy or use the software.
//
//
//                        Intel License Agreement
//                For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
//   * Redistribution's of source code must retain the above copyright notice,
//     this list of conditions and the following disclaimer.
//
//   * Redistribution's in binary form must reproduce the above copyright notice,
//     this list of conditions and the following disclaimer in the documentation
//     and/or other materials provided with the distribution.
//
//   * The name of Intel Corporation may not be used to endorse or promote products
//     derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/

#ifndef _HIGH_GUI_
#define _HIGH_GUI_

#include "cv.h"
#ifdef WIN32
#include <windows.h>
#endif

#if defined(_CH_)
#include <cvch.h>
CV_CH_LOAD_CODE(highgui,Highgui)
#endif

#ifdef __cplusplus
#define HIGHGUI_EXTERN_C extern "C"
extern "C" {

#else
#define HIGHGUI_EXTERN_C
#endif /* __cplusplus */

#if defined HIGHGUI_EXPORTS && defined WIN32
    #define HIGHGUI_DLL_ENTRY __declspec(dllexport)
#else
    #define HIGHGUI_DLL_ENTRY
#endif

#ifdef HIGHGUI_EXPORTS
#define HIGHGUI_API HIGHGUI_EXTERN_C HIGHGUI_DLL_ENTRY
#else
#define HIGHGUI_API
#endif /* HIGHGUI_DLLEXPORT */


/****************************************************************************************\
*                                Basic HighGUI functionality                             *
\****************************************************************************************/

/* this function is used to set some external parameters in case of X Window */
HIGHGUI_API int cvInitSystem( int argc, char** argv );

#define CV_WINDOW_AUTOSIZE  1
/* create window */
HIGHGUI_API int cvNamedWindow( const char* name, int flags );

/* display image within window (highgui windows remember their content) */
HIGHGUI_API void cvShowImage( const char* name, const CvArr* image );

/* resize/move window */
HIGHGUI_API void cvResizeWindow( const char* name, int width, int height );

/* destroy window and all the trackers associated with it */
HIGHGUI_API void cvDestroyWindow( const char* name );

HIGHGUI_API void cvDestroyAllWindows(void);

/* get native window handle (HWND in case of Win32 and Widget in case of X Window) */
HIGHGUI_API void* cvGetWindowHandle( const char* name );

/* get name of highgui window given its native handle */
HIGHGUI_API const char* cvGetWindowName( void* window_handle );

CV_EXTERN_C_FUNCPTR( void (*CvTrackbarCallback)(int pos) );

/* create trackbar and display it on top of given window, set callback */
HIGHGUI_API int cvCreateTrackbar( const char* trackbar_name, const char* window_name,
                                  int* value, int count, CvTrackbarCallback on_change );

/* retrieve or set trackbar position */
HIGHGUI_API int cvGetTrackbarPos( const char* trackbar_name, const char* window_name );
HIGHGUI_API void cvSetTrackbarPos( const char* trackbar_name, const char* window_name, int pos );

#define CV_EVENT_MOUSEMOVE      0
#define CV_EVENT_LBUTTONDOWN    1
#define CV_EVENT_RBUTTONDOWN    2
#define CV_EVENT_MBUTTONDOWN    3
#define CV_EVENT_LBUTTONUP      4
#define CV_EVENT_RBUTTONUP      5
#define CV_EVENT_MBUTTONUP      6
#define CV_EVENT_LBUTTONDBLCLK  7
#define CV_EVENT_RBUTTONDBLCLK  8
#define CV_EVENT_MBUTTONDBLCLK  9

#define CV_EVENT_FLAG_LBUTTON   1
#define CV_EVENT_FLAG_RBUTTON   2
#define CV_EVENT_FLAG_MBUTTON   4
#define CV_EVENT_FLAG_CTRLKEY   8
#define CV_EVENT_FLAG_SHIFTKEY  16
#define CV_EVENT_FLAG_ALTKEY    32

CV_EXTERN_C_FUNCPTR( void (*CvMouseCallback )(int event, int x, int y, int flags) );
/* assign callback for mouse events */
HIGHGUI_API void cvSetMouseCallback( const char* window_name, CvMouseCallback on_mouse );

/*load image from file 
  iscolor: >0 - output image is always color,
            0 - output image is always grayscale,
           <0 - output image is color or grayscale dependending on the file */
HIGHGUI_API IplImage* cvLoadImage( const char* filename, int iscolor CV_DEFAULT(1));

/* save image to file */
HIGHGUI_API int cvSaveImage( const char* filename, const CvArr* image );

/* add folder to the image search path (used by cvLoadImage) */
HIGHGUI_API void cvAddSearchPath( const char* path );

/* utility function: convert one image to another with optional vertical flip */
HIGHGUI_API void cvConvertImage( const CvArr* src, CvArr* dst, int flip CV_DEFAULT(0));

/* wait for key event infinitely (delay<=0) or for "delay" milliseconds */
HIGHGUI_API int cvWaitKey(int delay CV_DEFAULT(0));


/****************************************************************************************\
*                             Working with AVIs and Cameras                              *
\****************************************************************************************/

/* "black box" capture structure */
typedef struct CvCapture CvCapture;

/* start capturing frames from AVI */
HIGHGUI_API CvCapture* cvCaptureFromAVI( const char* filename );

/* start capturing frames from camera */
HIGHGUI_API CvCapture* cvCaptureFromCAM( int index );

/*just grab frame, return 1 if success, 0 if fail 
  this function is thought to be fast               */  
HIGHGUI_API int cvGrabFrame( CvCapture* capture );

/*get frame grabbed with cvGrabFrame(..) 
  This function may apply some frame processing like 
  frame decompression, flipping etc.
  !!!DO NOT RELEASE or MODIFY the retrieved frame!!! */
HIGHGUI_API IplImage* cvRetrieveFrame( CvCapture* capture );

/* Just successive call of cvGrabFrame and cvRetrieveFrame
   !!!DO NOT RELEASE or MODIFY the retrieved frame!!!      */
HIGHGUI_API IplImage* cvQueryFrame( CvCapture* capture );

/* stop capturing/reading and free resources */
HIGHGUI_API void cvReleaseCapture( CvCapture** capture );

#define CV_CAP_PROP_POS_MSEC       0
#define CV_CAP_PROP_POS_FRAMES     1
#define CV_CAP_PROP_POS_AVI_RATIO  2
#define CV_CAP_PROP_FRAME_WIDTH    3
#define CV_CAP_PROP_FRAME_HEIGHT   4
#define CV_CAP_PROP_FPS            5
#define CV_CAP_PROP_FOURCC         6

/* retrieve or set capture properties */
HIGHGUI_API double cvGetCaptureProperty( CvCapture* capture, int property_id );
HIGHGUI_API int    cvSetCaptureProperty( CvCapture* capture, int property_id, double value );

/* "black box" AVI writer structure */
typedef struct CvAVIWriter CvAVIWriter;

#define CV_FOURCC(c1,c2,c3,c4)  \
    (((c1)&255) + (((c2)&255)<<8) + (((c3)&255)<<16) + (((c4)&255)<<24))

/* initialize AVI writer */
HIGHGUI_API CvAVIWriter* cvCreateAVIWriter( const char* filename, int fourcc,
                                            double fps, CvSize frameSize );

/* write frame to AVI */
HIGHGUI_API int cvWriteToAVI( CvAVIWriter* writer, const IplImage* image );

/* close AVI writer */
HIGHGUI_API void cvReleaseAVIWriter( CvAVIWriter** writer );

/****************************************************************************************\
*                              Obsolete functions/synonyms                               *
\****************************************************************************************/

#ifndef HIGHGUI_NO_BACKWARD_COMPATIBILITY
    #define HIGHGUI_BACKWARD_COMPATIBILITY
#endif

#ifdef HIGHGUI_BACKWARD_COMPATIBILITY

#define cvvInitSystem cvInitSystem
#define cvvNamedWindow cvNamedWindow
#define cvvShowImage cvShowImage
#define cvvResizeWindow cvResizeWindow
#define cvvDestroyWindow cvDestroyWindow
#define cvvCreateTrackbar cvCreateTrackbar
#define cvvLoadImage(name) cvLoadImage((name),1)
#define cvvSaveImage cvSaveImage
#define cvvAddSearchPath cvAddSearchPath
#define cvvWaitKey(name) cvWaitKey(0)
#define cvvWaitKeyEx(name,delay) cvWaitKey(delay)
#define cvvConvertImage cvConvertImage
#define HG_AUTOSIZE CV_WINDOW_AUTOSIZE

#ifdef WIN32

CV_EXTERN_C_FUNCPTR( int (CV_CDECL * CvWin32WindowCallback)
                     (HWND, UINT, WPARAM, LPARAM, int*));
HIGHGUI_API void set_preprocess_func( CvWin32WindowCallback on_preprocess );
HIGHGUI_API void set_postprocess_func( CvWin32WindowCallback on_postprocess );

CV_INLINE int iplWidth( const IplImage* img );
CV_INLINE int iplWidth( const IplImage* img )
{

    return !img ? 0 : !img->roi ? img->width : img->roi->width;

}

CV_INLINE int iplHeight( const IplImage* img );
CV_INLINE int iplHeight( const IplImage* img )
{

    return !img ? 0 : !img->roi ? img->height : img->roi->height;

}

#endif

#endif /* obsolete functions */

/* For use with Win32 */
#ifdef WIN32

CV_INLINE RECT NormalizeRect( RECT r );
CV_INLINE RECT NormalizeRect( RECT r )
{

    int t;

    if( r.left >
...
...
(Not finished, please download and read the complete file)
			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 1

Download
0 lines left, continue to read
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
源码文件 <HMMDemo><HMMDemo>0.00 B20-08-04 14:48
code file untitled_baseCFG.txtuntitled_baseCFG.txt272.00 B23-08-04 10:32
code file ContEHMM.hContEHMM.h3.00 kB26-03-01 12:21
code file FaceBase.hFaceBase.h7.99 kB05-11-01 22:08
code file HMMDemo.hHMMDemo.h3.78 kB26-03-01 12:21
code file HMMDemoDoc.hHMMDemoDoc.h3.71 kB05-11-01 22:08
code file HMMDemoView.hHMMDemoView.h4.22 kB05-11-01 22:08
code file HMMParams.hHMMParams.h1.31 kB26-03-01 12:21
code file ImageBaseView.hImageBaseView.h4.49 kB05-11-01 22:08
code file InfoDialogs.hInfoDialogs.h4.47 kB26-03-01 12:21
code file MainFrm.hMainFrm.h5.33 kB05-11-01 22:08
code file MiscParams.hMiscParams.h1.30 kB26-03-01 12:21
code file multiprocdiv.hmultiprocdiv.h24.71 kB02-11-01 22:45
code file resource.hresource.h3.16 kB26-03-01 12:21
code file SamplingParams.hSamplingParams.h1.43 kB26-03-01 12:21
code file StdAfx.hStdAfx.h3.19 kB05-11-01 22:08
code file Threads.hThreads.h735.00 B15-08-01 16:05
code file ContEHMM.cppContEHMM.cpp9.69 kB26-03-01 12:21
code file FaceBase.cppFaceBase.cpp49.22 kB18-11-02 19:32
code file HMMDemo.cppHMMDemo.cpp18.88 kB05-11-01 22:08
code file HMMDemoDoc.cppHMMDemoDoc.cpp9.18 kB05-11-01 22:08
code file HMMDemoView.cppHMMDemoView.cpp6.56 kB26-11-02 16:45
code file HMMParams.cppHMMParams.cpp3.08 kB26-03-01 12:21
code file ImageBaseView.cppImageBaseView.cpp10.66 kB05-11-01 22:08
code file InfoDialogs.cppInfoDialogs.cpp5.29 kB26-03-01 12:21
code file MainFrm.cppMainFrm.cpp17.08 kB05-11-01 22:08
code file MiscParams.cppMiscParams.cpp1.32 kB26-03-01 12:21
code file SamplingParams.cppSamplingParams.cpp1.71 kB26-03-01 12:21
code file StdAfx.cppStdAfx.cpp2.28 kB26-03-01 12:21
源码文件 ~VCC.tmp~VCC.tmp80.00 kB20-04-05 09:31
源码文件 <res><res>0.00 B10-11-03 12:46
源码文件 Toolbar.bmpToolbar.bmp3.24 kB26-03-01 12:21
源码文件 HMMDemo.icoHMMDemo.ico1.05 kB26-03-01 12:21
源码文件 HMMDemoDoc.icoHMMDemoDoc.ico1.05 kB26-03-01 12:21
源码文件 HMMDemo.rc2HMMDemo.rc2399.00 B26-03-01 12:21
源码文件 Thumbs.dbThumbs.db5.00 kB20-03-05 14:16
源码文件 HMMDemo.dspHMMDemo.dsp6.21 kB22-03-05 15:45
源码文件 HMMDemo.plgHMMDemo.plg2.18 kB16-04-05 15:56
code file HMMDemo.rcHMMDemo.rc18.42 kB26-03-01 12:21
code file highgui.hhighgui.h13.33 kB22-03-05 15:31
code file cv.hcv.h129.19 kB22-03-05 15:35
源码文件 RCa01240RCa0124034.94 kB20-03-05 14:17
源码文件 HMMDemo.optHMMDemo.opt90.00 kB20-04-05 13:00
源码文件 HMMDemo.apsHMMDemo.aps39.01 kB16-04-05 15:06
code file cvt.txtcvt.txt46.93 kB22-03-05 15:38
code file cvtypes.hcvtypes.h46.93 kB22-03-05 15:40
code file cverror.hcverror.h9.88 kB22-03-05 15:42
code file cvcompat.hcvcompat.h29.95 kB22-03-05 15:44
源码文件 ~VC20.tmp~VC20.tmp48.00 kB12-04-05 10:48
源码文件 FaceBase.ncbFaceBase.ncb49.00 kB19-04-05 21:28
源码文件 FaceBase.plgFaceBase.plg3.90 kB20-04-05 12:55
源码文件 ~VCC6.tmp~VCC6.tmp80.00 kB19-04-05 22:44
源码文件 HMMDemoDoc.optHMMDemoDoc.opt52.50 kB22-03-05 15:57
源码文件 MainFrm.optMainFrm.opt52.50 kB19-04-05 22:44
源码文件 FaceBase.optFaceBase.opt52.50 kB19-04-05 21:28
code file Camera.cppCamera.cpp8.47 kB12-04-05 10:54
code file Threads.cppThreads.cpp21.72 kB19-04-05 22:48
code file Camera.hCamera.h3.29 kB12-04-05 10:54
源码文件 Threads.optThreads.opt52.50 kB19-04-05 22:45
源码文件 StdAfx.optStdAfx.opt52.50 kB19-04-05 22:44
源码文件 HMMDemo.dswHMMDemo.dsw1.09 kB19-04-05 22:42
源码文件 HMMDemo.ncbHMMDemo.ncb273.00 kB20-04-05 13:00
源码文件 HMMDemoDoc.dspHMMDemoDoc.dsp3.37 kB21-03-05 16:24
源码文件 HMMDemoDoc.ncbHMMDemoDoc.ncb49.00 kB22-03-05 15:57
源码文件 HMMDemoDoc.plgHMMDemoDoc.plg690.00 B21-03-05 16:24
源码文件 HMMDemoDoc.dswHMMDemoDoc.dsw729.00 B21-03-05 16:26
源码文件 StdAfx.dspStdAfx.dsp3.32 kB21-03-05 21:56
源码文件 StdAfx.ncbStdAfx.ncb41.00 kB19-04-05 22:44
源码文件 StdAfx.plgStdAfx.plg1.26 kB21-03-05 21:56
源码文件 StdAfx.dswStdAfx.dsw537.00 B21-03-05 21:57
源码文件 MainFrm.dspMainFrm.dsp3.33 kB21-03-05 21:57
源码文件 MainFrm.ncbMainFrm.ncb49.00 kB19-04-05 22:44
源码文件 MainFrm.plgMainFrm.plg1.27 kB21-03-05 21:57
源码文件 MainFrm.dswMainFrm.dsw539.00 B21-03-05 21:57
源码文件 FaceBase.dspFaceBase.dsp3.34 kB21-03-05 21:58
源码文件 FaceBase.dswFaceBase.dsw541.00 B21-03-05 21:58
源码文件 Threads.dspThreads.dsp3.33 kB21-03-05 22:04
源码文件 Threads.ncbThreads.ncb49.00 kB19-04-05 22:45
源码文件 Threads.plgThreads.plg1.26 kB20-04-05 12:55
源码文件 Threads.dswThreads.dsw539.00 B21-03-05 22:05
...
Sponsored links
×

highgui.h (253.31 kB)

Need 1 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point

×

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com
×

切换到中文版?

CodeForge Chinese Version
CodeForge English Version
×

Where are you going?

×

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK
×

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D