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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1260 - (show annotations)
Sat Feb 14 20:26:49 2015 UTC (4 years, 7 months ago) by dbug
File MIME type: text/plain
File size: 2744 byte(s)
PictConv 0.21
- Added support for 32bit picture, to handle things like masking/opacity in the picture formats
- The -a1 mode will generate bytes with null value for blocks of 6 pixels with transparent alpha values (only active in monochrome or AIC conversion modes)
- Added the -f7 conversion mode for Oric pictures using the AIC coloring method.

1 #ifndef ATARI_CONVERTER_H
2 #define ATARI_CONVERTER_H
3
4 #include "hires.h"
5
6 #include "FreeImage.h"
7
8 class RgbColor;
9 class ShifterColor;
10
11
12 class AtariClut
13 {
14 public:
15 int convert_pixel_shifter(const RgbColor& rgb);
16 int convert_pixel_shifter(const ShifterColor& color);
17
18 void SetColor(const RgbColor& rgb,int index);
19 void SetColor(const ShifterColor& color,int index);
20
21 void SaveClut(long handle) const;
22 void SaveClutAsText(std::string& text) const;
23
24 void Reorder(AtariClut& baseClut);
25
26 void GetColors(std::vector<RGBQUAD>& colors) const;
27
28 public:
29 std::map<ShifterColor,int> m_clut_color_to_index;
30 std::map<int,ShifterColor> m_clut_index_to_color;
31 };
32
33 class AtariPictureConverter : public PictureConverter
34 {
35 friend class PictureConverter;
36
37 public:
38 enum FORMAT
39 {
40 FORMAT_SINGLE_PALETTE,
41 FORMAT_MULTIPLE_PALETTE,
42 _FORMAT_MAX_
43 };
44
45 enum PALETTE_MODE
46 {
47 PALETTE_AUTOMATIC,
48 PALETTE_FROM_LAST_LINE,
49 PALETTE_FROM_LAST_PIXELS,
50 _PALETTE_MAX_
51 };
52
53 protected:
54 AtariPictureConverter();
55 virtual ~AtariPictureConverter();
56
57 virtual int GetFormat() const { return (int)m_format; }
58 virtual bool SetFormat(int format) { m_format=(FORMAT)format;return m_format<_FORMAT_MAX_; }
59
60 virtual int GetPaletteMode() const { return m_palette_mode; }
61 virtual bool SetPaletteMode(int paletteMode) { m_palette_mode=(PALETTE_MODE)paletteMode;return m_palette_mode<_PALETTE_MAX_; }
62
63 virtual int GetTransparencyMode() const { return m_transparency; }
64 virtual bool SetTransparencyMode(int transparencyMode) { m_transparency=(TRANSPARENCY)transparencyMode;return m_transparency<_TRANSPARENCY_MAX_; }
65
66 virtual bool Convert(const ImageContainer& sourcePicture);
67 virtual bool TakeSnapShot(ImageContainer& sourcePicture);
68
69 virtual void SaveToFile(long handle,int output_format);
70
71 private:
72 //int convert_pixel_shifter(const RgbColor& rgb);
73 void convert_shifter(const ImageContainer& sourcePicture);
74
75 void clear_screen();
76
77 unsigned char* GetBufferData() { return m_buffer; }
78 unsigned int GetBufferSize() { return m_buffer_size; }
79
80 unsigned int get_buffer_width() { return m_buffer_width; }
81 unsigned int get_buffer_height() { return m_buffer_height; }
82
83 void set_buffer_size(int width,int height);
84
85 AtariClut& GetClut(unsigned int scanline);
86
87 private:
88 FORMAT m_format;
89 PALETTE_MODE m_palette_mode;
90 unsigned char* m_buffer;
91 unsigned int m_buffer_size;
92 unsigned int m_buffer_width;
93 unsigned int m_buffer_height;
94 int m_buffer_cols;
95 bool m_flagPalettePerScanline;
96
97 std::map<int,AtariClut> m_cluts; // Scanline/associated clut
98 };
99
100
101 #endif

  ViewVC Help
Powered by ViewVC 1.1.26