Now you can download a copy of these docs so you can use them offline! Download now
ImageBase.cpp
00001 /*----------------------------------------------------------------------------*/ 00002 /* Copyright (c) FIRST 2008. All Rights Reserved. */ 00003 /* Open Source Software - may be modified and shared by FRC teams. The code */ 00004 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ 00005 /*----------------------------------------------------------------------------*/ 00006 00007 #include "ImageBase.h" 00008 #include "nivision.h" 00009 00011 IMAQ_FUNC int Priv_SetWriteFileAllowed(UINT32 enable); 00012 00019 ImageBase::ImageBase(ImageType type) 00020 { 00021 m_imaqImage = imaqCreateImage(type, DEFAULT_BORDER_SIZE); 00022 } 00023 00028 ImageBase::~ImageBase() 00029 { 00030 if(m_imaqImage) 00031 imaqDispose(m_imaqImage); 00032 } 00033 00039 void ImageBase::Write(const char *fileName) 00040 { 00041 Priv_SetWriteFileAllowed(1); 00042 int success = imaqWriteFile(m_imaqImage, fileName, NULL); 00043 wpi_setImaqErrorWithContext(success, "Imaq Image writeFile error"); 00044 } 00045 00050 int ImageBase::GetHeight() 00051 { 00052 int height; 00053 imaqGetImageSize(m_imaqImage, NULL, &height); 00054 return height; 00055 } 00056 00061 int ImageBase::GetWidth() 00062 { 00063 int width; 00064 imaqGetImageSize(m_imaqImage, &width, NULL); 00065 return width; 00066 } 00067 00073 Image *ImageBase::GetImaqImage() 00074 { 00075 return m_imaqImage; 00076 } 00077
Generated on Thu Jan 12 2012 22:35:20 for WPILibC++ by
1.7.1