1
//========================================================================
5
//========================================================================
7
//========================================================================
9
// Modified under the Poppler project - http://poppler.freedesktop.org
11
// All changes made under the Poppler project to this file are licensed
12
// under GPL version 2 or later
14
// Copyright (C) 2007 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
15
// Copyright (C) 2009 Shen Liang <shenzhuxi@gmail.com>
16
// Copyright (C) 2009 Albert Astals Cid <aacid@kde.org>
17
// Copyright (C) 2009 Stefan Thomas <thomas@eload24.com>
18
// Copyright (C) 2010 Adrian Johnson <ajohnson@redneon.com>
19
// Copyright (C) 2010 Harry Roberts <harry.roberts@midnight-labs.org>
20
// Copyright (C) 2010 Christian Feuers�nger <cfeuersaenger@googlemail.com>
22
// To see a description of the changes please see the Changelog file that
23
// came with your tarball or type make ChangeLog if you are building from git
25
//========================================================================
27
#ifndef SPLASHBITMAP_H
28
#define SPLASHBITMAP_H
30
#ifdef USE_GCC_PRAGMAS
34
#include "SplashTypes.h"
39
//------------------------------------------------------------------------
41
//------------------------------------------------------------------------
46
// Create a new bitmap. It will have <widthA> x <heightA> pixels in
47
// color mode <modeA>. Rows will be padded out to a multiple of
48
// <rowPad> bytes. If <topDown> is false, the bitmap will be stored
49
// upside-down, i.e., with the last row first in memory.
50
SplashBitmap(int widthA, int heightA, int rowPad,
51
SplashColorMode modeA, GBool alphaA,
52
GBool topDown = gTrue);
56
int getWidth() { return width; }
57
int getHeight() { return height; }
58
int getRowSize() { return rowSize; }
59
int getAlphaRowSize() { return width; }
60
int getRowPad() { return rowPad; }
61
SplashColorMode getMode() { return mode; }
62
SplashColorPtr getDataPtr() { return data; }
63
Guchar *getAlphaPtr() { return alpha; }
65
SplashError writePNMFile(char *fileName);
66
SplashError writePNMFile(FILE *f);
68
SplashError writeImgFile(SplashImageFileFormat format, char *fileName, int hDPI, int vDPI);
69
SplashError writeImgFile(SplashImageFileFormat format, FILE *f, int hDPI, int vDPI);
70
SplashError writeImgFile(ImgWriter *writer, FILE *f, int hDPI, int vDPI);
72
void getPixel(int x, int y, SplashColorPtr pixel);
73
Guchar getAlpha(int x, int y);
77
int width, height; // size of bitmap
79
int rowSize; // size of one row of data, in bytes
80
// - negative for bottom-up bitmaps
81
SplashColorMode mode; // color mode
82
SplashColorPtr data; // pointer to row zero of the color data
83
Guchar *alpha; // pointer to row zero of the alpha data