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

Contents of /public/pc/tools/osdk/main/pictconv/sources/image.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: 1651 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 IMAGE_CONTAINER_H
2 #define IMAGE_CONTAINER_H
3
4 // Crappy FreeImage wrapper
5 #include <string>
6 #include <vector>
7 #include <map>
8
9 struct FIBITMAP;
10 class RgbColor;
11 class AtariClut;
12
13 class ImageContainer
14 {
15 public:
16 ImageContainer();
17 ImageContainer(const ImageContainer& otherImage);
18 virtual ~ImageContainer();
19
20 void Clear();
21 bool Allocate(unsigned int width,unsigned int height,unsigned int bpp);
22
23 FIBITMAP* GetBitmap()
24 {
25 return m_pBitmap;
26 }
27
28 unsigned int GetWidth() const;
29 unsigned int GetHeight() const;
30 unsigned int GetDpp() const;
31 unsigned int GetPaletteSize() const;
32
33 bool LoadPicture(const std::string& fileName);
34 bool SavePicture(const std::string& fileName) const;
35
36 void WriteColor(const RgbColor& rgb,int x,int y);
37 RgbColor ReadColor(int x,int y) const;
38
39 // Painting functions
40 void FillRectangle(const RgbColor& rgb,unsigned int x0,unsigned int y0,unsigned int width,unsigned int heigth);
41
42 // Utility functions
43 bool ConvertToGrayScale(); // Pure grey scale conversion
44 bool ReduceColorDepth(const AtariClut* pClut=0);
45 bool ReduceColorDepthPerScanline(const std::map<int,AtariClut>* pCluts=0);
46
47 int FindBlocks(std::string& block_data) const;
48
49 // Block copy functions
50 bool CreateFromImage(const ImageContainer& otherImage,unsigned int x,unsigned int y,unsigned int width,unsigned int height); // Accepts itself as a valid source, can use that to crop a picture
51
52 private:
53 FIBITMAP* m_pBitmap;
54 };
55
56
57 // Utility function missing from the FreeImage library
58 unsigned char* FreeImage_GetBitsRowCol(FIBITMAP *dib,int x,int y);
59
60
61 #endif

  ViewVC Help
Powered by ViewVC 1.1.26