Created
          March 25, 2011 18:22 
        
      - 
      
 - 
        
Save dennis/887323 to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // denne klasse skal vise progress.. | |
| class monitor { | |
| void progress(int) = 0; | |
| }; | |
| // | |
| class libasciify { | |
| public: | |
| libasciify(std::string, monitor); | |
| std::string getAscii(); | |
| protected: | |
| void updateProgress(int, int, int, int); | |
| std::vector<std::string> grayscale_chars; | |
| std::vector<int> grayscale_bounds; | |
| std::string ascii_str; | |
| int current_progress; // percentage | |
| }; | |
| i getAscii() kalder du saa monitor->guimonitor(current_progress); | |
| /// i gui | |
| class guimonitor : monitor { | |
| void progress(int current_progress) { | |
| // Qmagic der opdaterer progress baren, | |
| } | |
| } | |
| et sted i din gui har du noget i stil med | |
| libasciify asciifier(text, new guimonitor()); | |
| asciifier.getAscii(); | |
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment