WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Image.h
1#ifndef _WINC_IMAGE
2#define _WINC_IMAGE
3
4#include <WXP/Date.h>
5#include <WXP/DateVal.h>
6#include <WXP/Domain.h>
7#include <WXP/DomainVal.h>
8#include <WXP/EarthPoint.h>
9#include <WXP/FloatArray.h>
10#include <WXP/GeomBox.h>
11#include <WXP/GridPoint.h>
12#include <WXP/ImageColor.h>
13#include <WXP/Point.h>
14#include <WXP/Rect.h>
15#include <WXP/RGB.h>
16#include <WXP/String.h>
17
18namespace WXP {
19 class Image {
20 int source; /* Source of image */
21 int type; /* Type of image */
22 int version; /* Version of image */
23 char datim[50]; /* Date and time information */
24 Date date;
25 char info[80]; /* Label for image information */
26 int width; /* Image type used in image */
27 int height; /* Image type used in image */
28 int depth; /* Image type used in image */
29 float xres,yres; /* Image resolution */
30 float xoff,yoff; /* Image offset */
31 int bits_pixel; /* Bits per pixel */
32 int bytes_line; /* Number of bytes per scan line */
33 int byte_order; /* Bytes order in data */
34 int color_type; /* Color type used in image */
35 unsigned int red_mask; /* Red mask for true color */
36 unsigned int grn_mask; /* Green mask for true color */
37 unsigned int blu_mask; /* Blue mask for true color */
38 int num_colors; /* Image type used in image */
39 ImageColor *colors; /* Color array */
40 int trans_color; /* Transparent color index */
41 Domain domain; /* The image domain */
42 int index;
43 bool pix_ave;
44 int cutoff[7];
45 int cutbase;
46 int numcut;
47 int num_values;
48 float *values; /* A pointer an array of pixel values*/
49 unsigned char *data; /* A pointer to the image */
50
51 public:
52 int initClass();
53 int init();
54 Image( );
55 Image( const Image &image );
56 ~Image( );
57 int copy( Image &image );
58 int copyInfo( Image &image );
59 int copyData( Image &image );
60 Image operator=(const Image &image);
61 int set( int rwidth, int rheight, int rdepth );
62 int set( Domain &rdomain, int rdepth );
63 int set( DomainVal &rdv, int rdepth );
64 int allocData();
65 int clearData();
66 bool validData();
67 int allocColors( int num );
69 inline int hasColors(){ return colors != NULL; };
70 int setSource( int val );
71 int setType( int val );
72 int setDate( int secs );
73 int setDate( DateVal &dv );
74 int setDate( Date &d );
75 int getDate( Date &rdate );
76 Date getDate();
77 int setDatim( const char *str );
78 int setDatim( String &str );
79 char *getDatim();
80 int setInfo( const char *str );
81 int setInfo( String &str );
82 char *getInfo();
83 int setDomain( DomainVal &val );
84 int setDomain( Domain &dom );
85 int getDomainProj();
86 Domain getDomain();
87 int getDomain( Domain &dom );
88 DomainVal getDomainVal();
89 inline float getPLat(){ return domain.getPLat(); };
90 inline float getPLon(){ return domain.getPLon(); };
91 inline int getWidth(){ return width; };
92 inline int getHeight(){ return height; };
93 inline int getDepth(){ return depth; };
94 inline int getBytes(){ return bytes_line*height; };
95 inline int getBytesLine(){ return bytes_line; };
96 inline int getColorType(){ return color_type; };
97 inline int getNumColors(){ return num_colors; };
98 float getRed( int ind );
99 float getGrn( int ind );
100 float getBlu( int ind );
101 int setWidth( int val );
102 int setHeight( int val );
103 int setDepth( int val );
104 int setBitsPixel( int val );
105 int setBytesLine( int val );
106 int setBytesLine();
107 int setColorType( int val );
108 int setByteOrder( int val );
109 int setRedMask( unsigned long );
110 inline unsigned int getRedMask(){ return red_mask; };
111 int setGrnMask( unsigned long );
112 inline unsigned int getGrnMask(){ return grn_mask; };
113 int setBluMask( unsigned long );
114 inline unsigned int getBluMask(){ return blu_mask; };
115 int setRed( int ind, float val );
116 int setGrn( int ind, float val );
117 int setBlu( int ind, float val );
118 int setColor( int ind, float r, float g, float b );
119 int setColor( int ind, RGB &rgb );
120 int setRGB( int ind, RGB &rgb );
121 int getRGB( int ind, RGB &rgb );
122 int setTransColor( int clr );
123 inline bool hasTransColor(){ return trans_color != -1; };
124 inline int getTransColor(){ return trans_color; };
125 int setColorVal( int ind, int val );
126 int getColorVal( int ind );
127 int setPixAve( bool val );
128 inline int setCutBase( int val ){ cutbase = val; return 1; };
129 int setCutoff( int ind, int val );
130 int setCutoff( char *str );
131 inline bool hasCutoff(){ return cutoff[0] != Const::MISS; };
132 inline int getCutBase(){ return cutbase; };
133 inline int getCutoff(int i){ return cutoff[i+1]; };
134 inline int getNumCut(){ return numcut; };
135 int print();
136 int printInt();
137 int printValues();
138 int printColors();
139 int printHist();
140 int printData( EarthPoint &ept );
141 int getPixel( int x, int y );
142 int getVal( int x, int y );
143 bool isPixelTrans( int x, int y );
144 int getRGB( int x, int y, RGB &rgb );
145 int getRow( int row, unsigned char *odata );
146 inline const unsigned char *getData(){ return data; };
147 int getPixel( float x, float y );
148 int getPixel( GridPoint gpt );
149 int getPixel( EarthPoint ept );
150 int getPixel( Point pt );
151 int allocValues();
152 inline bool hasValues(){ return values != NULL; };
153 int setValue( int ind, float val );
154 int setValues( FloatArray &array );
155 float getValue( int ind );
156 int getIndex( float val );
157 float getValue( int x, int y );
158 float getValue( float x, float y );
159 float getValue( Point &pt );
160 float getValue( GridPoint &gpt );
161 float getValue( EarthPoint &ept );
162 int getVal( EarthPoint &ept );
163 int setPixel( int x, int y, int val );
164 int setPixel( int val );
165 int setPixel( GridPoint gpt, int val );
166 int setValue( int x, int y, float val );
167 Rect getLimits();
168 inline int getProj(){ return domain.getProj(); };
169 int tran( EarthPoint ept, Point &pt );
170 int tran( Point pt, EarthPoint &ept );
171 int tran( GridPoint gpt, Point &pt );
172 int tran( Point pt, GridPoint &gpt );
173 int tran( EarthPoint ept, GridPoint &gpt );
174 int tran( GridPoint gpt, EarthPoint &ept );
175 float getDx();
176
177 static int copyInfo( Image &image1, const Image &image2 );
178 static int copyData( Image &image1, const Image &image2 );
179 static int copy( Image &image1, const Image &image2 );
180
181 friend class ImageMath;
182 /*
183 Image data requests
184 */
185 enum Query { ALL, INQ };
186 enum Type { UNK, IMG, GINI, AREA };
187 enum ByteOrder { LSB, MSB };
188 enum ColorType { TRUECOL, INDEX, VALUE };
189 };
190}
191#endif
static const int MISS
Definition Const.h:7
This class stores date and time information.
Definition Date.h:8
This class stores and manipulates domain data.
Definition Domain.h:19
float getPLon()
Definition Domain.h:64
int getProj()
Definition Domain.h:60
float getPLat()
Definition Domain.h:62
This class defines an image.
Definition Image.h:19
~Image()
Definition Image.cc:113
int getRow(int row, unsigned char *odata)
Definition Image.cc:734
int setGrn(int ind, float val)
Definition Image.cc:492
int set(int rwidth, int rheight, int rdepth)
Definition Image.cc:219
int setBlu(int ind, float val)
Definition Image.cc:503
float getDx()
Definition Image.cc:1102
int hasColors()
Definition Image.h:69
int allocColors(int num)
Definition Image.cc:293
int setRed(int ind, float val)
Definition Image.cc:481
int getVal(int x, int y)
Definition Image.cc:641
Image()
Definition Image.cc:84
Rect getLimits()
Definition Image.cc:1040
int allocData()
Definition Image.cc:260
int tran(EarthPoint ept, Point &pt)
Definition Image.cc:1049
int setColorVal(int ind, int val)
Definition Image.cc:530
bool validData()
Definition Image.cc:274
int setPixAve(bool val)
Definition Image.cc:550
int print()
Definition Image.cc:1109
int setPixel(int x, int y, int val)
Definition Image.cc:966
int getPixel(int x, int y)
Definition Image.cc:586
Image operator=(const Image &image)
Definition Image.cc:104
int init()
Definition Image.cc:28
int clearData()
Definition Image.cc:281
This is a variable length string class.
Definition String.h:5
All WXP classes fall under the WXP namespace.
Definition Angle.h:4
This struct defines basic date values.
Definition DateVal.h:5
This struct defines basic domain parameters.
Definition DomainVal.h:5
This struct sets up color values for an image.
Definition ImageColor.h:5