23 #include "wxgis/carto/renderer.h"
25 #include "wxgis/carto/stretch.h"
30 enum wxGISEnumRasterRendererType
32 enumGISRasterRenderTypeNone = 0,
33 enumGISRasterRenderTypeGreyScale,
34 enumGISRasterRenderTypeRGBA,
35 enumGISRasterRenderTypeIndexed,
36 enumGISRasterRenderTypePackedRGBA
46 int nPixelDataWidth, nPixelDataHeight;
47 double dPixelDataWidth, dPixelDataHeight;
48 double dPixelDeltaX, dPixelDeltaY;
49 int nOutputWidth, nOutputHeight;
50 OGREnvelope stWorldBounds;
55 inline double BiCubicKernel(
double x)
65 a = ( xp2 <= 0.0 ) ? 0.0 : xp2 * xp2 * xp2;
66 b = ( xp1 <= 0.0 ) ? 0.0 : xp1 * xp1 * xp1;
67 c = ( x <= 0.0 ) ? 0.0 : x * x * x;
68 d = ( xm1 <= 0.0 ) ? 0.0 : xm1 * xm1 * xm1;
70 return ( 0.16666666666666666667 * ( a - ( 4.0 * b ) + ( 6.0 * c ) - ( 4.0 * d ) ) );
73 static void NearestNeighbourInterpolation(
void *pInputData,
int nInputXSize,
double dInputXSize,
double dInputYSize,
double dDeltaX,
double dDeltaY, GDALDataType eSrcType,
unsigned char *pOutputData,
int nOutXSize,
int nOutYSize,
int nBegY,
int nEndY,
int nBandCount,
wxGISRasterRenderer*
const pRasterRenderer,
ITrackCancel*
const pTrackCancel = NULL);
75 static void BilinearInterpolation(
void *pInputData,
int nInputXSize,
int nInputYSize,
double dInputXSize,
double dInputYSize,
double dDeltaX,
double dDeltaY, GDALDataType eSrcType,
unsigned char *pOutputData,
int nOutXSize,
int nOutYSize,
int nBegY,
int nEndY,
int nBandCount,
wxGISRasterRenderer*
const pRasterRenderer,
ITrackCancel*
const pTrackCancel = NULL);
77 static void BicubicInterpolation(
void *pInputData,
int nInputXSize,
int nInputYSize,
double dInputXSize,
double dInputYSize,
double dDeltaX,
double dDeltaY, GDALDataType eSrcType,
unsigned char *pOutputData,
int nOutXSize,
int nOutYSize,
int nBegY,
int nEndY,
int nBandCount,
wxGISRasterRenderer*
const pRasterRenderer,
ITrackCancel*
const pTrackCancel = NULL);
91 wxRasterDrawThread(
RAWPIXELDATA &stPixelData, GDALDataType eSrcType,
int nBandCount,
unsigned char *pTransformData, wxGISEnumDrawQuality eQuality,
int nOutXSize,
int nOutYSize,
int nBegY,
int nEndY,
wxGISRasterRenderer *pRasterRenderer,
ITrackCancel *
const pTrackCancel = NULL);
92 virtual void *Entry();
93 virtual void OnExit();
98 GDALDataType m_eSrcType;
99 unsigned char *m_pTransformData;
100 wxGISEnumDrawQuality m_eQuality;
119 virtual bool CanRender(
wxGISLayer*
const pwxGISLayer)
const;
120 virtual int *GetBandsCombination(
int *pnBandCount) = 0;
121 virtual bool Draw(wxGISEnumDrawPhase DrawPhase,
wxGISDisplay*
const pDisplay,
ITrackCancel*
const pTrackCancel = NULL);
122 virtual bool Apply(
ITrackCancel*
const pTrackCancel = NULL);
123 virtual wxGISColorTable GetColorTable(
void)
const {
return m_mColorTable;};
124 virtual wxGISEnumRasterRendererType GetRasterRenderType(
void)
const {
return enumGISRasterRenderTypeNone;};
125 virtual wxGISEnumRendererType GetType(
void)
const {
return enumGISRenderTypeRaster;};
126 virtual void FillPixel(
unsigned char* pOutputData,
const double *pSrcValR,
const double *pSrcValG,
const double *pSrcValB,
const double *pSrcValA) = 0;
129 virtual short GetBandCount()
const = 0;
131 wxColour m_oNoDataColor;
134 wxGISEnumDrawQuality m_eQuality;
135 wxGISColorTable m_mColorTable;
136 unsigned short m_nTileSizeX, m_nTileSizeY;
151 virtual bool CanRender(
wxGISLayer*
const pwxGISLayer)
const;
152 virtual int *GetBandsCombination(
int *pnBandCount);
153 virtual void FillPixel(
unsigned char* pOutputData,
const double *pSrcValR,
const double *pSrcValG,
const double *pSrcValB,
const double *pSrcValA);
154 virtual wxGISEnumRasterRendererType GetRasterRenderType(
void)
const {
return enumGISRasterRenderTypeRGBA;};
156 virtual void OnFillStats(
void);
157 virtual short GetBandCount()
const;
159 int m_nRedBand, m_nGreenBand, m_nBlueBand, m_nAlphaBand;
163 bool m_bNodataNewBehaviour;
178 virtual bool CanRender(
wxGISLayer*
const pwxGISLayer)
const;
179 virtual int *GetBandsCombination(
int *pnBandCount);
180 virtual void FillPixel(
unsigned char* pOutputData,
const double *pSrcValR,
const double *pSrcValG,
const double *pSrcValB,
const double *pSrcValA);
181 virtual wxGISEnumRasterRendererType GetRasterRenderType(
void)
const {
return enumGISRasterRenderTypeIndexed;};
184 virtual void OnFillColorTable(
void);
185 virtual short GetBandCount()
const;
186 wxColor HSVtoRGB(
const short &h,
const short &s,
const short &v,
const short &alpha );
187 wxColor CMYKtoRGB(
const short &c,
const short &m,
const short &y,
const short &k );
191 short m_nNoDataIndex;
205 virtual int *GetBandsCombination(
int *pnBandCount);
206 virtual void FillPixel(
unsigned char* pOutputData,
const double *pSrcValR,
const double *pSrcValG,
const double *pSrcValB,
const double *pSrcValA);
207 virtual wxGISEnumRasterRendererType GetRasterRenderType(
void)
const {
return enumGISRasterRenderTypeGreyScale;};
209 virtual void OnFillStats(
void);
210 virtual short GetBandCount()
const;
228 virtual void FillPixel(
unsigned char* pOutputData,
const double *pSrcValR,
const double *pSrcValG,
const double *pSrcValB,
const double *pSrcValA);
229 virtual wxGISEnumRasterRendererType GetRasterRenderType(
void)
const{
return enumGISRasterRenderTypePackedRGBA;};
231 bool m_bNodataNewBehaviour;
Definition: rasterdataset.h:32
The base class for renderers.
Definition: rasterrenderer.h:112
The raster layer renderer for RGB data and Alpha channel.
Definition: rasterrenderer.h:143
The raster layer renderer for packed RGB data and Alpha channel.
Definition: rasterrenderer.h:220
The raster layer renderer for Palette Index data.
Definition: rasterrenderer.h:170
The base class for stretch from pixel field to display field.
Definition: stretch.h:52
Definition: gisdisplay.h:43
A TrackCancel interface class.
Definition: core.h:144
The raster layer draw thread.
Definition: rasterrenderer.h:87
The raster layer renderer for grey scale data.
Definition: rasterrenderer.h:198
The base class for renderers.
Definition: renderer.h:31
Definition: rasterrenderer.h:43