// -*- C++ -*- // // This file is part of the Coriolis Software. // Copyright (c) UPMC/LIP6 2008-2012, All Rights Reserved // // +-----------------------------------------------------------------+ // | H U R R I C A N E | // | V L S I B a c k e n d D a t a - B a s e | // | | // | Author : Jean-Paul CHAPUT | // | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | =============================================================== | // | C++ Module : "./ScreenUtilisties.cpp" | // +-----------------------------------------------------------------+ #include #include #include "hurricane/BasicLayer.h" #include "hurricane/viewer/ScreenUtilities.h" namespace { inline bool charToBits ( uchar& b, char c, bool isMSB=true ) { bool isValid = true; uchar value = 0xF; if ( (c >= '0') && (c <= '9') ) value = (uchar)( c - '0' ); else { if ( (c >= 'a') && (c <= 'f') ) value = (uchar)( c - 'a' + 10 ); else { if ( (c >= 'A') && (c <= 'F') ) value = (uchar)( c - 'A' + 10 ); else isValid = false; } } b &= (isMSB) ? 0x0F : 0xF0; b |= (isMSB) ? (value<<4) : value; return isValid; } bool isSolidFill ( const std::string& pattern ) { for( size_t i=0 ; i