-
Notifications
You must be signed in to change notification settings - Fork 16
/
Output.H
97 lines (78 loc) · 3.07 KB
/
Output.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// ---------------------------------------------------------------
// Output.H
// ---------------------------------------------------------------
#ifndef _OUTPUT_H_
#define _OUTPUT_H_
#include <X11/Xlib.h>
#undef index
#include <AMReX_REAL.H>
#include <AMReX_Vector.H>
#include <Palette.H>
#include <AMReX_AmrData.H>
#include <AmrPicture.H>
#include <string>
using std::string;
using amrex::Real;
// the following is support for writing rgb files.
#define IMAGIC 0732
#define TYPEMASK 0xff00
#define BPPMASK 0x00ff
#define ITYPE_VERBATIM 0x0000
#define ITYPE_RLE 0x0100
#define ISRLE(type) (((type) & 0xff00) == ITYPE_RLE)
#define ISVERBATIM(type) (((type) & 0xff00) == ITYPE_VERBATIM)
#define BPP(type) ((type) & BPPMASK)
#define RLE(bpp) (ITYPE_RLE | (bpp))
#define VERBATIM(bpp) (ITYPE_VERBATIM | (bpp))
#define IBUFSIZE(pixels) ((pixels+(pixels>>6))<<2)
typedef struct {
unsigned short imagic; // data saved on disk
unsigned short type;
unsigned short dim;
unsigned short xsize;
unsigned short ysize;
unsigned short zsize;
unsigned long min;
unsigned long max;
unsigned long wastebytes;
char name[80];
unsigned long colormap;
long file; // data used in core only
unsigned short flags;
short dorev;
short x;
short y;
short z;
short cnt;
unsigned short *ptr;
unsigned short *base;
unsigned short *tmpbuf;
unsigned long offset;
unsigned long rleend; // for rle images
unsigned long *rowstart; // for rle images
long *rowsize; // for rle images
} IMAGE;
void WritePSFile(const char *filename, XImage *image,
int imagesizehoriz, int imagesizevert,
const Palette& palette);
void WriteNewPSFile(const char *filename, XImage *image,
int imagesizehoriz, int imagesizevert,
const Palette &palette, const amrex::AmrData &amrdata,
const int minlev, const int maxlev,
amrex::Vector< amrex::Vector<GridBoxes> > &gridBoxes);
void WritePSPaletteFile(const char *filename, XImage *image,
int imagesizehoriz, int imagesizevert,
const amrex::Vector<Real> &palValuesList,
const string &palNumFormat, const Palette& palette);
void WriteRGBFile(const char *filename, XImage *image,
int imagesizehoriz, int imagesizevert,
const Palette& palette);
void WritePPMFile(const char *filename, XImage *image,
int imagesizehoriz, int imagesizevert,
const Palette& palette);
void WritePPMFileAnnotated(const char *filename, XImage *image,
int imagesizehoriz, int imagesizevert,
const Palette& palette, int frame,
Real time, GraphicsAttributes *gaPtr,
const string &pltFilename, const string &derived);
#endif