/[projet1]/public/pc/tools/osdk/main/pictconv/sources/oric_converter.h
Defence Force logotype

Contents of /public/pc/tools/osdk/main/pictconv/sources/oric_converter.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 406 - (show annotations)
Mon Sep 20 18:59:17 2010 UTC (9 years, 1 month ago) by dbug
File MIME type: text/plain
File size: 2493 byte(s)
Updated the OSDK with the latest code of most of the tools.

1 #ifndef ORIC_CONVERTER_H
2 #define ORIC_CONVERTER_H
3
4 #include "hires.h"
5
6 enum ORIC_COLOR
7 { // BGR
8 ORIC_COLOR_BLACK, // 000
9 ORIC_COLOR_RED, // 001
10 ORIC_COLOR_GREEN, // 010
11 ORIC_COLOR_YELLOW, // 011
12 ORIC_COLOR_BLUE, // 100
13 ORIC_COLOR_MAGENTA, // 101
14 ORIC_COLOR_CYAN, // 110
15 ORIC_COLOR_WHITE, // 111
16 _ORIC_COLOR_LAST_
17 };
18
19 class OricPictureConverter : public PictureConverter
20 {
21 friend class PictureConverter;
22
23 public:
24 enum FORMAT
25 {
26 FORMAT_MONOCHROM,
27 FORMAT_COLORED,
28 FORMAT_RGB,
29 FORMAT_TWILIGHTE_MASK,
30 FORMAT_RB,
31 FORMAT_TRUETEXT,
32 _FORMAT_MAX_
33 };
34
35 public:
36 virtual int GetFormat() const { return (int)m_format; }
37 virtual bool SetFormat(int format) { m_format=(FORMAT)format;return m_format<_FORMAT_MAX_; }
38
39 virtual int GetPaletteMode() const { return 0; }
40 virtual bool SetPaletteMode(int paletteMode) { return paletteMode==0; }
41
42 virtual bool Convert(const ImageContainer& sourcePicture);
43 virtual bool TakeSnapShot(ImageContainer& sourcePicture);
44
45 virtual void SaveToFile(long handle,int output_format);
46
47 bool get_bit6() { return m_flag_setbit6; }
48 void set_bit6(bool flag_value) { m_flag_setbit6=flag_value; }
49
50 void clear_screen();
51
52 void convert_monochrom(const ImageContainer& sourcePicture);
53 void convert_colored(const ImageContainer& sourcePicture);
54 void convert_rgb(const ImageContainer& sourcePicture);
55 void convert_rb(const ImageContainer& sourcePicture);
56 void convert_twilighte_mask(const ImageContainer& sourcePicture);
57
58 ORIC_COLOR convert_pixel_monochrom(const ImageContainer& sourcePicture,unsigned int x,unsigned int y);
59 ORIC_COLOR convert_pixel_rgb(const ImageContainer& sourcePicture,unsigned int x,unsigned int y);
60 ORIC_COLOR convert_pixel_rb(const ImageContainer& sourcePicture,unsigned int x,unsigned int y);
61
62 void save_header(long handle,int adress_begin);
63
64 virtual unsigned char *GetBufferData() { return m_buffer; }
65 virtual unsigned int GetBufferSize() { return m_buffer_size; }
66
67 unsigned int get_buffer_width() { return m_buffer_width; }
68 unsigned int get_buffer_height() { return m_buffer_height; }
69
70 void set_buffer_size(int width,int height);
71
72 protected:
73 OricPictureConverter();
74 virtual ~OricPictureConverter();
75
76 private:
77 unsigned char *m_buffer;
78 FORMAT m_format;
79
80 bool m_flag_setbit6;
81
82 unsigned int m_buffer_size;
83 unsigned int m_buffer_width;
84 unsigned int m_buffer_height;
85 int m_buffer_cols;
86 };
87
88 #endif

  ViewVC Help
Powered by ViewVC 1.1.26