33 #include <Base/Image/ImageConvert.hh>
35 #include <Base/Common/BIASpragma.hh>
43 template int GuiBase::ConvertToUC_<float>(
Image<float>& image, float, float);
44 #ifdef BUILD_IMAGE_CHAR
45 template int GuiBase::ConvertToUC_<char>(
Image<char>& image, float, float);
48 #ifdef BUILD_IMAGE_DOUBLE
49 template int GuiBase::ConvertToUC_<double>(
Image<double>& image, float, float);
52 #ifdef BUILD_IMAGE_UINT
57 #ifdef BUILD_IMAGE_INT
58 template int GuiBase::ConvertToUC_<int>(
Image<int>& image, float, float);
61 #ifdef BUILD_IMAGE_SHORT
66 #ifdef BUILD_IMAGE_USHORT
165 #ifdef BUILD_IMAGE_USHORT
175 #ifdef BUILD_IMAGE_CHAR
185 #ifdef BUILD_IMAGE_SHORT
195 #ifdef BUILD_IMAGE_INT
205 #ifdef BUILD_IMAGE_UINT
216 #ifdef BUILD_IMAGE_DOUBLE
236 template <
class PixelType>
254 im.
Init(pim[0]->GetWidth(), pim[0]->GetHeight() , pim[0]->GetChannelCount(),
256 for (
unsigned p=0; p<pim.
size(); p++){
257 tmp[p]->ScaleShiftBetween(0, 255);
260 BIASERR(
"error converting image");
279 BIASERR(
"GuiBase::ShowConvertedImage_() must be overloaded!!");
285 BIASERR(
"GuiBase::DestroyWindow() must be overloaded!!");
291 BIASERR(
"GuiBase::SetTitle() must be overloaded!!");
297 int& Button,
int& Xpos,
int& Ypos)
312 int& Button,
int& Xpos,
int& Ypos)
332 int& Xpos,
int& Ypos)
354 BIASDOUT(D_GUI_KEY,
"WaitForKeyEvent()");
365 BIASDOUT(D_GUI_KEY,
"WaitForKeyEvent() : key pressed : "<<Key);
370 int& Xpos,
int& Ypos)
399 int& Xpos,
int& Ypos)
419 BIASCDOUT(D_GUI_MOUSE_BUTTON,
"pressed at ("<<Xpos<<
", "<<Ypos<<
")"<<endl);
427 BIASCDOUT(D_GUI_MOUSE_BUTTON,
"released at ("<<Xpos<<
", "<<Ypos<<
")"<<endl);
virtual void SetTitle(std::string const &Title)
virtual char WaitForKeyEvent()
waits until a key is pressed and returns it tested
unsigned int Pyramid0Width_
(16bit) unsigned integer image storage type
static pthread_mutex_t MouseButtonMutex_
virtual void GetFactorOffset(int &xoffset, int &yoffset, int &factor)
gets offset and factor for mouse position mouse position in (e.g.
virtual char CheckForKeyEvent()
checks if any key is pressed and returns it returns -1 if no key is pressed
unsigned size() const
deprecated interface
virtual bool CheckForMouseButtonEvent(bool &Pressed, int &Button, int &Xpos, int &Ypos)
return true if mouse button is pressed or released, false else see WaitForMouseButtonEvent for detail...
Gui is a simple windowing environment...
(8bit) signed char image storage type
int ScaleShiftBetween(double Min, double Max)
scales and shifts image so afterwards every pixel has a value between Min and Max ...
void GetSingleImage(Image< StorageType > &im) const
returns a single image containing all pyramid images
double image storage type
GuiBase(bool ShowMousePos=true)
virtual void SetFactorOffset(int xoffset, int yoffset, int factor)
sets offset and factor for mouse position mouse position in (e.g.
unsigned int Pyramid0Height_
(16bit) signed integer image storage type
ImageBase OrigPicture_
This is the original representation of the picture.
static bool BaseInitialized_
int StealImage(ImageBase &source)
steals the image data array from source, after releasing the actual image data and sets source image ...
static int ConvertST(const BIAS::ImageBase &source, BIAS::ImageBase &dest, ImageBase::EStorageType targetST)
Function to convert the storage type of images e.g.
color values, 3 channels, order: red,green,blue
void Init(const Image< StorageType > &image, const unsigned py_size=0)
copy image into level 0 and create other levels according to parameters set so far (pyramidsize...
virtual bool CheckForEvent(bool &KeyEvent, char &key, bool &Pressed, int &Button, int &Xpos, int &Ypos)
as above but does return immediate with true if event occured
virtual void WaitForMouseButtonEvent(bool &Pressed, int &Button, int &Xpos, int &Ypos)
waits until any mouse button is pressed or released
int ConvertToUC_(Image< PixelType > &image, float min, float max)
(32bit) signed integer image storage type
static int Convert(BIAS::ImageBase &source, BIAS::ImageBase &dest, enum BIAS::ImageBase::EColorModel targetColorModel, bool bPlanar=false)
main general conversion function, calls desired specialized functions, always initializes the destIma...
enum EStorageType GetStorageType() const
(8bit) unsigned char image storage type
virtual void Init_(bool ShowMousePos)
Set up thread and stuff.
virtual int DestroyWindow()
stops the main loop and closes the window
unsigned int Width_
if the following 3 variables are set , Buffer_ is already allocated
unsigned int PyramidLevels_
This is the base class for images in BIAS.
virtual int ShowConvertedImage_(Image< unsigned char > &image)
Does the real update of the image shown in window. Must be overloaded.
virtual int ShowImage(ImageBase &image, float min=0.0, float max=255.0)
shows/updates the image shown in window.
virtual void WaitForEvent(bool &KeyEvent, char &key, bool &Pressed, int &Button, int &Xpos, int &Ypos)
waits for either KeyEvent or MouseButtonEvent, KeyEvent is set to true if key is pressed, the other variables are set as in WaitForKeyEvent and WaitForMouseButtonEvent
(32bit) unsigned integer image storage type