22 #ifndef ZVISION_RENDER_TABLE_H 23 #define ZVISION_RENDER_TABLE_H 25 #include "common/rect.h" 26 #include "graphics/surface.h" 27 #include "zvision/zvision.h" 39 float _fX, _fY, _fTL, _fTR, _fBL, _fBR;
42 FilterPixel(
float x,
float y,
bool highQuality =
false) {
43 _src.
left = int16(floor(x));
44 _src.
right = int16(ceil(x));
45 _src.top = int16(floor(y));
46 _src.bottom = int16(ceil(y));
48 _fX = x - (float)_src.
left;
49 _fY = y - (
float)_src.top;
50 _fTL = (1 - _fX) * (1 - _fY);
51 _fTR = _fX * (1 - _fY);
52 _fBL = (1 - _fX) * _fY;
56 _xDir = (x - _src.
left) > 0.5f;
57 _yDir = (y - _src.top) > 0.5f;
67 _src.bottom = -_src.bottom;
87 uint16 _numRows, _numColumns, _halfRows, _halfColumns;
88 float _halfWidth, _halfHeight;
90 RenderState _renderState;
91 bool _highQuality =
false;
94 inline void splitColor(uint16 &color, uint32 &r, uint32 &g, uint32 &b)
const {
100 inline uint16 mergeColor(
const uint32 &r,
const uint32 &g,
const uint32 &b)
const {
102 return r | (g & 0x03e0) | (b & 0x7c00);
121 RenderState getRenderState() {
124 void setRenderState(RenderState newState);
130 template <
typename I>
131 Common::String pixelToBinary(
const I &pixel,
bool splitColors =
true)
const {
132 uint8 bits =
sizeof(pixel) << 3;
135 for (uint8 i = 0; i < 3; i++)
136 spaceMask = (spaceMask << 5) + 0x10;
137 for (I mask = 0x01 << (bits - 1); mask; mask >>= 1) {
138 if (splitColors && (spaceMask & mask))
140 str += mask & pixel ?
"1" :
"0";
144 void generateRenderTable();
146 void setPanoramaFoV(
float fov);
147 void setPanoramaScale(
float scale);
148 void setPanoramaReverse(
bool reverse);
149 void setPanoramaZeroPoint(uint16 point);
150 uint16 getPanoramaZeroPoint();
151 bool getPanoramaReverse();
153 void setTiltFoV(
float fov);
154 void setTiltScale(
float scale);
155 void setTiltReverse(
bool reverse);
162 void generateLookupTable(
bool tilt =
false);
163 void generatePanoramaLookupTable();
164 void generateTiltLookupTable();
T left
Definition: rect.h:170
Definition: render_table.h:71
Definition: focus_list.h:27
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
T right
Definition: rect.h:171
Definition: render_table.h:32