+++ /dev/null
-/*M///////////////////////////////////////////////////////////////////////////////////////\r
-//\r
-// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\r
-//\r
-// By downloading, copying, installing or using the software you agree to this license.\r
-// If you do not agree to this license, do not download, install,\r
-// copy or use the software.\r
-//\r
-//\r
-// Intel License Agreement\r
-// For Open Source Computer Vision Library\r
-//\r
-// Copyright (C) 2000, Intel Corporation, all rights reserved.\r
-// Third party copyrights are property of their respective owners.\r
-//\r
-// Redistribution and use in source and binary forms, with or without modification,\r
-// are permitted provided that the following conditions are met:\r
-//\r
-// * Redistribution's of source code must retain the above copyright notice,\r
-// this list of conditions and the following disclaimer.\r
-//\r
-// * Redistribution's in binary form must reproduce the above copyright notice,\r
-// this list of conditions and the following disclaimer in the documentation\r
-// and/or other materials provided with the distribution.\r
-//\r
-// * The name of Intel Corporation may not be used to endorse or promote products\r
-// derived from this software without specific prior written permission.\r
-//\r
-// This software is provided by the copyright holders and contributors "as is" and\r
-// any express or implied warranties, including, but not limited to, the implied\r
-// warranties of merchantability and fitness for a particular purpose are disclaimed.\r
-// In no event shall the Intel Corporation or contributors be liable for any direct,\r
-// indirect, incidental, special, exemplary, or consequential damages\r
-// (including, but not limited to, procurement of substitute goods or services;\r
-// loss of use, data, or profits; or business interruption) however caused\r
-// and on any theory of liability, whether in contract, strict liability,\r
-// or tort (including negligence or otherwise) arising in any way out of\r
-// the use of this software, even if advised of the possibility of such damage.\r
-//\r
-//M*/// Image.h: interface for the CImage class.\r
-//\r
-//////////////////////////////////////////////////////////////////////\r
-\r
-#if !defined(AFX_IMAGE_H__B0C6A376_E412_4ADD_B1EA_7488350A7F5B__INCLUDED_)\r
-#define AFX_IMAGE_H__B0C6A376_E412_4ADD_B1EA_7488350A7F5B__INCLUDED_\r
-\r
-#if _MSC_VER > 1000\r
-#pragma once\r
-#endif // _MSC_VER > 1000\r
-\r
-#include "ipl.h"\r
-\r
-inline int iplWidth( IplImage* img )\r
-{\r
- return !img ? 0 : !(img->roi) ? img->width : img->roi->width;\r
-}\r
-\r
-inline int iplHeight( IplImage* img )\r
-{\r
- return !img ? 0 : !(img->roi) ? img->height : img->roi->height;\r
-}\r
-\r
-inline IplROI RectToROI( RECT rect )\r
-{\r
- IplROI roi;\r
- roi.coi = 0;\r
- roi.xOffset = rect.left;\r
- roi.yOffset = rect.top;\r
- roi.width = rect.right - rect.left;\r
- roi.height = rect.bottom - rect.top;\r
- return roi;\r
-}\r
-\r
-inline RECT NormalizeRect( RECT r )\r
-{\r
- if( r.left > r.right )\r
- {\r
- int t = r.left;\r
- r.left = r.right;\r
- r.right = t;\r
- }\r
-\r
- if( r.top > r.bottom )\r
- {\r
- int t = r.top;\r
- r.top = r.bottom;\r
- r.bottom = t;\r
- }\r
-\r
- return r;\r
-}\r
-\r
-class CImage \r
-{\r
-public:\r
- CImage();\r
- ~CImage();\r
- \r
- /* Create image (BGR or grayscale) */\r
- bool Create( int w, int h, int bpp );\r
- \r
- /* Load image from specified file */\r
- bool Load( const char* filename, int desired_color );\r
-\r
- /* Load rectangle from the file */\r
- bool LoadRect( const char* filename,\r
- int desired_color, RECT r );\r
- \r
- /* Save entire image to specified file. */\r
- bool Save( const char* filename );\r
- \r
- /* Get copy of input image ROI */\r
- void CopyOf( CImage& image, int desired_color = -1 );\r
- void CopyOf( IplImage* img, int desired_color = -1 );\r
-\r
- IplImage* GetImage();\r
- HDC GetDC();\r
- void Destroy(void);\r
- \r
- /* width and height of ROI */\r
- int Width() { return iplWidth( &m_img ); };\r
- int Height() { return iplHeight( &m_img ); };\r
-\r
- /* put part of bitmap to specified destination rectangle */\r
- void Show( HDC dc, int x, int y, int w, int h, int from_x, int from_y );\r
- /* draw all bitmap to specified rectangl of DC */\r
- void DrawToHDC( HDC hDCDst, RECT* pDstRect );\r
-\r
- void Fill( COLORREF color );\r
-\r
-protected:\r
-\r
- void Clear(void);\r
- \r
- HDC m_memDC;\r
- HGDIOBJ m_old;\r
- IplImage m_img;\r
-};\r
-\r
-bool LoadGrFmtLib();\r
-void FillBitmapInfo( BITMAPINFO* bmi, int width, int height, int bpp );\r
-\r
-#endif // !defined(AFX_IMAGE_H__B0C6A376_E412_4ADD_B1EA_7488350A7F5B__INCLUDED_)\r