mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-02-03 09:44:26 -05:00
MSVC and TDMGCC fixes
This commit is contained in:
parent
c1774ee96a
commit
3fbb1def49
5
external/cubicvr2/math/cubic_types.h
vendored
5
external/cubicvr2/math/cubic_types.h
vendored
@ -38,4 +38,9 @@ namespace CubicVR {
|
||||
|
||||
}
|
||||
|
||||
#include <cmath>
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
11
external/cubicvr2/math/frustum.h
vendored
11
external/cubicvr2/math/frustum.h
vendored
@ -10,6 +10,7 @@
|
||||
#define CubicVR2_frustum_h
|
||||
|
||||
#include <vector>
|
||||
#include "cubic_types.h"
|
||||
#include "mat4.h"
|
||||
#include "vec3.h"
|
||||
#include "vec4.h"
|
||||
@ -75,14 +76,14 @@ namespace CubicVR {
|
||||
|
||||
//Sphere
|
||||
__float fov = 1 / pMatrix[5];
|
||||
__float near = -planes[PLANE_NEAR][3];
|
||||
__float far = planes[PLANE_FAR][3];
|
||||
__float view_length = far - near;
|
||||
__float znear = -planes[PLANE_NEAR][3];
|
||||
__float zfar = planes[PLANE_FAR][3];
|
||||
__float view_length = zfar - znear;
|
||||
__float height = view_length * fov;
|
||||
__float width = height;
|
||||
|
||||
vec3 P(0, 0, near + view_length * 0.5f);
|
||||
vec3 Q(width, height, near + view_length);
|
||||
vec3 P(0, 0, znear + view_length * 0.5f);
|
||||
vec3 Q(width, height, znear + view_length);
|
||||
vec3 diff = vec3::subtract(P, Q);
|
||||
__float diff_mag = vec3::length(diff);
|
||||
|
||||
|
1
external/cubicvr2/math/mat3.h
vendored
1
external/cubicvr2/math/mat3.h
vendored
@ -11,6 +11,7 @@
|
||||
|
||||
#include <iostream>
|
||||
#include "vec3.h"
|
||||
#include <cstring>
|
||||
|
||||
namespace CubicVR {
|
||||
|
||||
|
8
external/cubicvr2/math/mat4.h
vendored
8
external/cubicvr2/math/mat4.h
vendored
@ -72,15 +72,15 @@ namespace CubicVR {
|
||||
return mOut;
|
||||
}
|
||||
|
||||
static mat4 perspective(__float fovy, __float aspect, __float near, __float far) {
|
||||
static mat4 perspective(__float fovy, __float aspect, __float znear, __float zfar) {
|
||||
__float yFac = tan(fovy * (float)M_PI / 360.0f);
|
||||
__float xFac = yFac * aspect;
|
||||
|
||||
return mat4(
|
||||
1.0f / xFac, 0, 0, 0, 0, 1.0f / yFac, 0, 0, 0, 0, -(far + near) / (far - near), -1, 0, 0, -(2.0f * far * near) / (far - near), 0);
|
||||
1.0f / xFac, 0, 0, 0, 0, 1.0f / yFac, 0, 0, 0, 0, -(zfar + znear) / (zfar - znear), -1, 0, 0, -(2.0f * zfar * znear) / (zfar - znear), 0);
|
||||
};
|
||||
static mat4 ortho(__float left,__float right,__float bottom,__float top,__float near,__float far) {
|
||||
return mat4(2.0f / (right - left), 0, 0, 0, 0, 2.0f / (top - bottom), 0, 0, 0, 0, -2.0f / (far - near), 0, -(left + right) / (right - left), -(top + bottom) / (top - bottom), -(far + near) / (far - near), 1);
|
||||
static mat4 ortho(__float left,__float right,__float bottom,__float top,__float znear,__float zfar) {
|
||||
return mat4(2.0f / (right - left), 0, 0, 0, 0, 2.0f / (top - bottom), 0, 0, 0, 0, -2.0f / (zfar - znear), 0, -(left + right) / (right - left), -(top + bottom) / (top - bottom), -(zfar + znear) / (zfar - znear), 1);
|
||||
};
|
||||
static __float determinant(mat4 m) {
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "CubicSDRDefs.h"
|
||||
#include "ThreadQueue.h"
|
||||
#include "IOThread.h"
|
||||
#include <algorithm>
|
||||
|
||||
typedef ThreadQueue<ReferenceCounter *> VisualDataQueue;
|
||||
|
||||
|
@ -9,9 +9,9 @@ GLPanel::GLPanel() : fillType(GLPANEL_FILL_SOLID), contentsVisible(true), transf
|
||||
pos[1] = 0.0f;
|
||||
size[0] = 1.0f;
|
||||
size[1] = 1.0f;
|
||||
fill[0] = RGB(0.5,0.5,0.5);
|
||||
fill[1] = RGB(0.1,0.1,0.1);
|
||||
borderColor = RGB(0.8, 0.8, 0.8);
|
||||
fill[0] = RGB3f(0.5,0.5,0.5);
|
||||
fill[1] = RGB3f(0.1,0.1,0.1);
|
||||
borderColor = RGB3f(0.8, 0.8, 0.8);
|
||||
setCoordinateSystem(GLPANEL_Y_UP);
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ void GLPanel::genArrays() {
|
||||
max, min
|
||||
};
|
||||
|
||||
RGB c[4];
|
||||
RGB3f c[4];
|
||||
|
||||
if (fillType == GLPANEL_FILL_SOLID) {
|
||||
c[0] = c[1] = c[2] = c[3] = fill[0];
|
||||
@ -58,7 +58,7 @@ void GLPanel::genArrays() {
|
||||
glColors.reserve(3 * 8);
|
||||
glColors.resize(3 * 8);
|
||||
|
||||
RGB c[8];
|
||||
RGB3f c[8];
|
||||
|
||||
if (fillType == GLPANEL_FILL_GRAD_BAR_X) {
|
||||
float pts[2 * 8] = {
|
||||
@ -173,12 +173,12 @@ void GLPanel::setFill(GLPanelFillType fill_mode) {
|
||||
genArrays();
|
||||
}
|
||||
|
||||
void GLPanel::setFillColor(RGB color1) {
|
||||
void GLPanel::setFillColor(RGB3f color1) {
|
||||
fill[0] = color1;
|
||||
genArrays();
|
||||
}
|
||||
|
||||
void GLPanel::setFillColor(RGB color1, RGB color2) {
|
||||
void GLPanel::setFillColor(RGB3f color1, RGB3f color2) {
|
||||
fill[0] = color1;
|
||||
fill[1] = color2;
|
||||
genArrays();
|
||||
@ -189,7 +189,7 @@ void GLPanel::setMarginPx(float marg) {
|
||||
}
|
||||
|
||||
|
||||
void GLPanel::setBorderColor(RGB clr) {
|
||||
void GLPanel::setBorderColor(RGB3f clr) {
|
||||
borderColor = clr;
|
||||
}
|
||||
|
||||
|
@ -42,8 +42,8 @@ public:
|
||||
GLPanelCoordinateSystem coord;
|
||||
float marginPx;
|
||||
GLPanelEdges borderPx;
|
||||
RGB fill[2];
|
||||
RGB borderColor;
|
||||
RGB3f fill[2];
|
||||
RGB3f borderColor;
|
||||
bool contentsVisible;
|
||||
CubicVR::mat4 transform;
|
||||
CubicVR::mat4 localTransform;
|
||||
@ -68,11 +68,11 @@ public:
|
||||
void setCoordinateSystem(GLPanelCoordinateSystem coord);
|
||||
|
||||
void setFill(GLPanelFillType fill_mode);
|
||||
void setFillColor(RGB color1);
|
||||
void setFillColor(RGB color1, RGB color2);
|
||||
void setFillColor(RGB3f color1);
|
||||
void setFillColor(RGB3f color1, RGB3f color2);
|
||||
void setMarginPx(float marg);
|
||||
|
||||
void setBorderColor(RGB clr);
|
||||
void setBorderColor(RGB3f clr);
|
||||
void setBorderPx(float bord);
|
||||
void setBorderPx(float bordl, float bordr, float bordt, float bordb);
|
||||
|
||||
|
@ -9,30 +9,30 @@ PrimaryGLContext(canvas, sharedContext) {
|
||||
testPanel.setSize(1.0, 1.0);
|
||||
testPanel.setMarginPx(10);
|
||||
testPanel.setFill(GLPanel::GLPANEL_FILL_GRAD_BAR_Y);
|
||||
testPanel.setFillColor(RGB(0.0,0.0,1.0), RGB(0.0,1.0,0.0));
|
||||
testPanel.setFillColor(RGB3f(0.0,0.0,1.0), RGB3f(0.0,1.0,0.0));
|
||||
|
||||
testChildPanel.setPosition(0.0, 0.0);
|
||||
testChildPanel.setMarginPx(5);
|
||||
testChildPanel.setSize(1.0, 0.33);
|
||||
testChildPanel.setCoordinateSystem(GLPanel::GLPANEL_Y_DOWN_ZERO_ONE);
|
||||
testChildPanel.setFill(GLPanel::GLPANEL_FILL_GRAD_BAR_X);
|
||||
testChildPanel.setFillColor(RGB(0.0,0.0,1.0), RGB(0.0,1.0,0.0));
|
||||
testChildPanel.setFillColor(RGB3f(0.0,0.0,1.0), RGB3f(0.0,1.0,0.0));
|
||||
testChildPanel.setBorderPx(1);
|
||||
|
||||
testChildPanel2.setPosition(0.0, -0.66);
|
||||
testChildPanel2.setSize(1.0, 0.33);
|
||||
testChildPanel2.setMarginPx(5);
|
||||
testChildPanel2.setFill(GLPanel::GLPANEL_FILL_GRAD_X);
|
||||
testChildPanel2.setFillColor(RGB(0.0,0.0,1.0), RGB(0.0,1.0,0.0));
|
||||
testChildPanel2.setBorderColor(RGB(1.0,0.0,0.0));
|
||||
testChildPanel2.setFillColor(RGB3f(0.0,0.0,1.0), RGB3f(0.0,1.0,0.0));
|
||||
testChildPanel2.setBorderColor(RGB3f(1.0,0.0,0.0));
|
||||
testChildPanel2.setBorderPx(1);
|
||||
|
||||
testChildPanel3.setPosition(0.0, 0.66);
|
||||
testChildPanel3.setSize(1.0, 0.33);
|
||||
testChildPanel3.setMarginPx(5);
|
||||
testChildPanel3.setFill(GLPanel::GLPANEL_FILL_GRAD_X);
|
||||
testChildPanel3.setFillColor(RGB(0.0,0.0,1.0), RGB(0.0,1.0,0.0));
|
||||
testChildPanel3.setBorderColor(RGB(1.0,0.0,0.0));
|
||||
testChildPanel3.setFillColor(RGB3f(0.0,0.0,1.0), RGB3f(0.0,1.0,0.0));
|
||||
testChildPanel3.setBorderColor(RGB3f(1.0,0.0,0.0));
|
||||
testChildPanel3.setBorderPx(1);
|
||||
|
||||
testText1.setText("Testing 123..");
|
||||
|
@ -41,27 +41,27 @@ DefaultColorTheme::DefaultColorTheme() {
|
||||
waterfallGradient.addColor(GradientColor(1.0, 1.0, 0));
|
||||
waterfallGradient.addColor(GradientColor(1.0, 0.2, 0.0));
|
||||
waterfallGradient.generate(256);
|
||||
waterfallHighlight = RGB(1, 1, 1);
|
||||
waterfallNew = RGB(0, 1, 0);
|
||||
waterfallHover = RGB(1, 1, 0);
|
||||
waterfallDestroy = RGB(1, 0, 0);
|
||||
fftLine = RGB(0.9, 0.9, 0.9);
|
||||
fftHighlight = RGB(1, 1, 1);
|
||||
scopeLine = RGB(0.9, 0.9, 0.9);
|
||||
tuningBarLight = RGB(0.2, 0.2, 0.9);
|
||||
tuningBarDark = RGB(0.0, 0.0, 0.35);
|
||||
tuningBarUp = RGB(1.0, 139.0/255.0, 96.0/255.0);
|
||||
tuningBarDown = RGB(148.0/255.0, 148.0/255.0, 1.0);
|
||||
meterLevel = RGB(0.1, 0.75, 0.1);
|
||||
meterValue = RGB(0.75, 0.1, 0.1);
|
||||
text = RGB(1, 1, 1);
|
||||
freqLine = RGB(1, 1, 1);
|
||||
button = RGB(0.65, 0.65, 0.65);
|
||||
buttonHighlight = RGB(1, 1, 0);
|
||||
waterfallHighlight = RGB3f(1, 1, 1);
|
||||
waterfallNew = RGB3f(0, 1, 0);
|
||||
waterfallHover = RGB3f(1, 1, 0);
|
||||
waterfallDestroy = RGB3f(1, 0, 0);
|
||||
fftLine = RGB3f(0.9, 0.9, 0.9);
|
||||
fftHighlight = RGB3f(1, 1, 1);
|
||||
scopeLine = RGB3f(0.9, 0.9, 0.9);
|
||||
tuningBarLight = RGB3f(0.2, 0.2, 0.9);
|
||||
tuningBarDark = RGB3f(0.0, 0.0, 0.35);
|
||||
tuningBarUp = RGB3f(1.0, 139.0/255.0, 96.0/255.0);
|
||||
tuningBarDown = RGB3f(148.0/255.0, 148.0/255.0, 1.0);
|
||||
meterLevel = RGB3f(0.1, 0.75, 0.1);
|
||||
meterValue = RGB3f(0.75, 0.1, 0.1);
|
||||
text = RGB3f(1, 1, 1);
|
||||
freqLine = RGB3f(1, 1, 1);
|
||||
button = RGB3f(0.65, 0.65, 0.65);
|
||||
buttonHighlight = RGB3f(1, 1, 0);
|
||||
|
||||
scopeBackground = RGB(0.1, 0.1, 0.1);
|
||||
fftBackground = RGB(0.1, 0.1, 0.1);
|
||||
generalBackground = RGB(0.1, 0.1, 0.1);
|
||||
scopeBackground = RGB3f(0.1, 0.1, 0.1);
|
||||
fftBackground = RGB3f(0.1, 0.1, 0.1);
|
||||
generalBackground = RGB3f(0.1, 0.1, 0.1);
|
||||
}
|
||||
|
||||
|
||||
@ -72,27 +72,27 @@ RadarColorTheme::RadarColorTheme() {
|
||||
waterfallGradient.addColor(GradientColor(40.0 / 255.0, 240.0 / 255.0, 60.0 / 255.0));
|
||||
waterfallGradient.addColor(GradientColor(250.0 / 255.0, 250.0 / 255.0, 250.0 / 255.0));
|
||||
waterfallGradient.generate(256);
|
||||
waterfallHighlight = RGB(1, 1, 1);
|
||||
waterfallNew = RGB(0, 1, 0);
|
||||
waterfallHover = RGB(1, 1, 0);
|
||||
waterfallDestroy = RGB(1, 0, 0);
|
||||
fftLine = RGB(0.8, 1.0, 0.8);
|
||||
fftHighlight = RGB(1, 1, 1);
|
||||
scopeLine = RGB(0.8, 1.0, 0.8);
|
||||
tuningBarLight = RGB(0.0, 0.45, 0.0);
|
||||
tuningBarDark = RGB(0.0, 0.1, 0.0);
|
||||
tuningBarUp = RGB(1.0, 139.0/255.0, 96.0/255.0);
|
||||
tuningBarDown = RGB(148.0/255.0, 0.0, 0.0);
|
||||
meterLevel = RGB(0, 0.5, 0);
|
||||
meterValue = RGB(0, 0.5, 0);
|
||||
text = RGB(0.8, 1.0, 0.8);
|
||||
freqLine = RGB(1, 1, 1);
|
||||
button = RGB(0.65, 0.75, 0.65);
|
||||
buttonHighlight = RGB(0.65, 1.0, 0.65);
|
||||
waterfallHighlight = RGB3f(1, 1, 1);
|
||||
waterfallNew = RGB3f(0, 1, 0);
|
||||
waterfallHover = RGB3f(1, 1, 0);
|
||||
waterfallDestroy = RGB3f(1, 0, 0);
|
||||
fftLine = RGB3f(0.8, 1.0, 0.8);
|
||||
fftHighlight = RGB3f(1, 1, 1);
|
||||
scopeLine = RGB3f(0.8, 1.0, 0.8);
|
||||
tuningBarLight = RGB3f(0.0, 0.45, 0.0);
|
||||
tuningBarDark = RGB3f(0.0, 0.1, 0.0);
|
||||
tuningBarUp = RGB3f(1.0, 139.0/255.0, 96.0/255.0);
|
||||
tuningBarDown = RGB3f(148.0/255.0, 0.0, 0.0);
|
||||
meterLevel = RGB3f(0, 0.5, 0);
|
||||
meterValue = RGB3f(0, 0.5, 0);
|
||||
text = RGB3f(0.8, 1.0, 0.8);
|
||||
freqLine = RGB3f(1, 1, 1);
|
||||
button = RGB3f(0.65, 0.75, 0.65);
|
||||
buttonHighlight = RGB3f(0.65, 1.0, 0.65);
|
||||
|
||||
scopeBackground = RGB(0.05, 0.1, 0.05);
|
||||
fftBackground = RGB(0.05, 0.1, 0.05);
|
||||
generalBackground = RGB(0.05, 0.1, 0.05);
|
||||
scopeBackground = RGB3f(0.05, 0.1, 0.05);
|
||||
fftBackground = RGB3f(0.05, 0.1, 0.05);
|
||||
generalBackground = RGB3f(0.05, 0.1, 0.05);
|
||||
}
|
||||
|
||||
BlackAndWhiteColorTheme::BlackAndWhiteColorTheme() {
|
||||
@ -101,27 +101,27 @@ BlackAndWhiteColorTheme::BlackAndWhiteColorTheme() {
|
||||
waterfallGradient.addColor(GradientColor(0.75, 0.75, 0.75));
|
||||
waterfallGradient.addColor(GradientColor(1.0, 1.0, 1.0));
|
||||
waterfallGradient.generate(256);
|
||||
waterfallHighlight = RGB(1, 1, 0.9);
|
||||
waterfallNew = RGB(0, 1, 0);
|
||||
waterfallHover = RGB(1, 1, 0);
|
||||
waterfallDestroy = RGB(1, 0, 0);
|
||||
fftLine = RGB(0.9, 0.9, 0.9);
|
||||
fftHighlight = RGB(1, 1, 0.9);
|
||||
scopeLine = RGB(0.9, 0.9, 0.9);
|
||||
tuningBarLight = RGB(0.4, 0.4, 0.4);
|
||||
tuningBarDark = RGB(0.1, 0.1, 0.1);
|
||||
tuningBarUp = RGB(0.8, 0.8, 0.8);
|
||||
tuningBarDown = RGB(0.4, 0.4, 0.4);
|
||||
meterLevel = RGB(0.5, 0.5, 0.5);
|
||||
meterValue = RGB(0.5, 0.5, 0.5);
|
||||
text = RGB(1, 1, 1);
|
||||
freqLine = RGB(1, 1, 1);
|
||||
button = RGB(0.65, 0.65, 0.65);
|
||||
buttonHighlight = RGB(1, 1, 1);
|
||||
waterfallHighlight = RGB3f(1, 1, 0.9);
|
||||
waterfallNew = RGB3f(0, 1, 0);
|
||||
waterfallHover = RGB3f(1, 1, 0);
|
||||
waterfallDestroy = RGB3f(1, 0, 0);
|
||||
fftLine = RGB3f(0.9, 0.9, 0.9);
|
||||
fftHighlight = RGB3f(1, 1, 0.9);
|
||||
scopeLine = RGB3f(0.9, 0.9, 0.9);
|
||||
tuningBarLight = RGB3f(0.4, 0.4, 0.4);
|
||||
tuningBarDark = RGB3f(0.1, 0.1, 0.1);
|
||||
tuningBarUp = RGB3f(0.8, 0.8, 0.8);
|
||||
tuningBarDown = RGB3f(0.4, 0.4, 0.4);
|
||||
meterLevel = RGB3f(0.5, 0.5, 0.5);
|
||||
meterValue = RGB3f(0.5, 0.5, 0.5);
|
||||
text = RGB3f(1, 1, 1);
|
||||
freqLine = RGB3f(1, 1, 1);
|
||||
button = RGB3f(0.65, 0.65, 0.65);
|
||||
buttonHighlight = RGB3f(1, 1, 1);
|
||||
|
||||
scopeBackground = RGB(0.1, 0.1, 0.1);
|
||||
fftBackground = RGB(0.1, 0.1, 0.1);
|
||||
generalBackground = RGB(0.1, 0.1, 0.1);
|
||||
scopeBackground = RGB3f(0.1, 0.1, 0.1);
|
||||
fftBackground = RGB3f(0.1, 0.1, 0.1);
|
||||
generalBackground = RGB3f(0.1, 0.1, 0.1);
|
||||
|
||||
}
|
||||
|
||||
@ -139,27 +139,27 @@ SharpColorTheme::SharpColorTheme() {
|
||||
waterfallGradient.addColor(GradientColor(1.0, 0.25, 0.0));
|
||||
waterfallGradient.addColor(GradientColor(0.5, 0.1, 0.0));
|
||||
waterfallGradient.generate(256);
|
||||
waterfallHighlight = RGB(0.9, 0.9, 1.0);
|
||||
waterfallNew = RGB(0, 1, 0);
|
||||
waterfallHover = RGB(1, 1, 0);
|
||||
waterfallDestroy = RGB(1, 0, 0);
|
||||
fftLine = RGB(0.9, 0.9, 1.0);
|
||||
fftHighlight = RGB(0.9, 0.9, 1.0);
|
||||
scopeLine = RGB(0.85, 0.85, 1.0);
|
||||
tuningBarLight = RGB(28.0 / 255.0, 106.0 / 255.0, 179.0 / 255.0);
|
||||
tuningBarDark = RGB(14.0 / 255.0, 53.0 / 255.0, 89.5 / 255.0);
|
||||
tuningBarUp = RGB(0.7, 0.7, 0.7);
|
||||
tuningBarDown = RGB(1.0, 0.0, 0.0);
|
||||
meterLevel = RGB(28.0 / 255.0, 106.0 / 255.0, 179.0 / 255.0);
|
||||
meterValue = RGB(190.0 / 255.0, 190.0 / 255.0, 60.0 / 255.0);
|
||||
text = RGB(0.9, 0.9, 1);
|
||||
freqLine = RGB(0.85, 0.85, 1.0);
|
||||
button = RGB(217.0 / 255.0, 218.0 / 255.0, 228.0 / 255.0);
|
||||
buttonHighlight = RGB(208.0 / 255.0, 249.0 / 255.0, 255.0 / 255.0);
|
||||
waterfallHighlight = RGB3f(0.9, 0.9, 1.0);
|
||||
waterfallNew = RGB3f(0, 1, 0);
|
||||
waterfallHover = RGB3f(1, 1, 0);
|
||||
waterfallDestroy = RGB3f(1, 0, 0);
|
||||
fftLine = RGB3f(0.9, 0.9, 1.0);
|
||||
fftHighlight = RGB3f(0.9, 0.9, 1.0);
|
||||
scopeLine = RGB3f(0.85, 0.85, 1.0);
|
||||
tuningBarLight = RGB3f(28.0 / 255.0, 106.0 / 255.0, 179.0 / 255.0);
|
||||
tuningBarDark = RGB3f(14.0 / 255.0, 53.0 / 255.0, 89.5 / 255.0);
|
||||
tuningBarUp = RGB3f(0.7, 0.7, 0.7);
|
||||
tuningBarDown = RGB3f(1.0, 0.0, 0.0);
|
||||
meterLevel = RGB3f(28.0 / 255.0, 106.0 / 255.0, 179.0 / 255.0);
|
||||
meterValue = RGB3f(190.0 / 255.0, 190.0 / 255.0, 60.0 / 255.0);
|
||||
text = RGB3f(0.9, 0.9, 1);
|
||||
freqLine = RGB3f(0.85, 0.85, 1.0);
|
||||
button = RGB3f(217.0 / 255.0, 218.0 / 255.0, 228.0 / 255.0);
|
||||
buttonHighlight = RGB3f(208.0 / 255.0, 249.0 / 255.0, 255.0 / 255.0);
|
||||
|
||||
scopeBackground = RGB(0.05, 0.05, 0.15);
|
||||
fftBackground = RGB(0.05, 0.05, 0.15);
|
||||
generalBackground = RGB(0.05, 0.05, 0.15);
|
||||
scopeBackground = RGB3f(0.05, 0.05, 0.15);
|
||||
fftBackground = RGB3f(0.05, 0.05, 0.15);
|
||||
generalBackground = RGB3f(0.05, 0.05, 0.15);
|
||||
}
|
||||
|
||||
RadColorTheme::RadColorTheme() {
|
||||
@ -170,27 +170,27 @@ RadColorTheme::RadColorTheme() {
|
||||
waterfallGradient.addColor(GradientColor(1.0, 40.0 / 255.0, 40.0 / 255.0));
|
||||
waterfallGradient.addColor(GradientColor(1.0, 1.0, 1.0));
|
||||
waterfallGradient.generate(256);
|
||||
waterfallHighlight = RGB(1, 1, 1);
|
||||
waterfallNew = RGB(0, 1, 0);
|
||||
waterfallHover = RGB(1, 1, 0);
|
||||
waterfallDestroy = RGB(1, 0, 0);
|
||||
fftLine = RGB(1.0, 0.9, 0.9);
|
||||
fftHighlight = RGB(1, 1, 1);
|
||||
scopeLine = RGB(1.0, 0.9, 0.9);
|
||||
tuningBarLight = RGB(0.0, 0.45, 0.0);
|
||||
tuningBarDark = RGB(0.0, 0.1, 0.0);
|
||||
tuningBarUp = RGB(1.0, 0.0, 0.0);
|
||||
tuningBarDown = RGB(0.0, 0.5, 1.0);
|
||||
meterLevel = RGB(0, 0.5, 0);
|
||||
meterValue = RGB(0.5, 0, 0);
|
||||
text = RGB(1, 1, 1);
|
||||
freqLine = RGB(1, 1, 1);
|
||||
button = RGB(0.65, 0.65, 0.65);
|
||||
buttonHighlight = RGB(0.76, 0.65, 0);
|
||||
waterfallHighlight = RGB3f(1, 1, 1);
|
||||
waterfallNew = RGB3f(0, 1, 0);
|
||||
waterfallHover = RGB3f(1, 1, 0);
|
||||
waterfallDestroy = RGB3f(1, 0, 0);
|
||||
fftLine = RGB3f(1.0, 0.9, 0.9);
|
||||
fftHighlight = RGB3f(1, 1, 1);
|
||||
scopeLine = RGB3f(1.0, 0.9, 0.9);
|
||||
tuningBarLight = RGB3f(0.0, 0.45, 0.0);
|
||||
tuningBarDark = RGB3f(0.0, 0.1, 0.0);
|
||||
tuningBarUp = RGB3f(1.0, 0.0, 0.0);
|
||||
tuningBarDown = RGB3f(0.0, 0.5, 1.0);
|
||||
meterLevel = RGB3f(0, 0.5, 0);
|
||||
meterValue = RGB3f(0.5, 0, 0);
|
||||
text = RGB3f(1, 1, 1);
|
||||
freqLine = RGB3f(1, 1, 1);
|
||||
button = RGB3f(0.65, 0.65, 0.65);
|
||||
buttonHighlight = RGB3f(0.76, 0.65, 0);
|
||||
|
||||
scopeBackground = RGB(13.0 / 255.0, 47.0 / 255.0, 9.0 / 255.0);
|
||||
fftBackground = RGB(0, 0, 50.0 / 255.0);
|
||||
generalBackground = RGB(13.0 / 255.0, 47.0 / 255.0, 9.0 / 255.0);
|
||||
scopeBackground = RGB3f(13.0 / 255.0, 47.0 / 255.0, 9.0 / 255.0);
|
||||
fftBackground = RGB3f(0, 0, 50.0 / 255.0);
|
||||
generalBackground = RGB3f(13.0 / 255.0, 47.0 / 255.0, 9.0 / 255.0);
|
||||
}
|
||||
|
||||
TouchColorTheme::TouchColorTheme() {
|
||||
@ -204,27 +204,27 @@ TouchColorTheme::TouchColorTheme() {
|
||||
waterfallGradient.addColor(GradientColor(255.0 / 255.0, 0.0 / 255.0, 0.0 / 255.0));
|
||||
waterfallGradient.addColor(GradientColor(255.0 / 255.0, 255.0 / 255.0, 255.0 / 255.0));
|
||||
waterfallGradient.generate(256);
|
||||
waterfallHighlight = RGB(1, 1, 1);
|
||||
waterfallNew = RGB(0, 1, 0);
|
||||
waterfallHover = RGB(1, 1, 0);
|
||||
waterfallDestroy = RGB(1, 0, 0);
|
||||
fftLine = RGB(234.0 / 255.0, 232.0 / 255.0, 247.0 / 255.0);
|
||||
fftHighlight = RGB(1.0, 1.0, 1.0);
|
||||
scopeLine = RGB(234.0 / 255.0, 232.0 / 255.0, 247.0 / 255.0);
|
||||
tuningBarLight = RGB(0.2, 0.2, 0.7);
|
||||
tuningBarDark = RGB(0.1, 0.1, 0.45);
|
||||
tuningBarUp = RGB(0.5, 139.0/255.0, 96.0/255.0);
|
||||
tuningBarDown = RGB(0.6, 108.0/255.0, 1.0);
|
||||
meterLevel = RGB(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0);
|
||||
meterValue = RGB(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0);
|
||||
text = RGB(1, 1, 1);
|
||||
freqLine = RGB(1, 1, 1);
|
||||
button = RGB(1.0, 1.0, 1.0);
|
||||
buttonHighlight = RGB(208.0 / 255.0, 202.0 / 255.0, 247.0 / 255.0);
|
||||
waterfallHighlight = RGB3f(1, 1, 1);
|
||||
waterfallNew = RGB3f(0, 1, 0);
|
||||
waterfallHover = RGB3f(1, 1, 0);
|
||||
waterfallDestroy = RGB3f(1, 0, 0);
|
||||
fftLine = RGB3f(234.0 / 255.0, 232.0 / 255.0, 247.0 / 255.0);
|
||||
fftHighlight = RGB3f(1.0, 1.0, 1.0);
|
||||
scopeLine = RGB3f(234.0 / 255.0, 232.0 / 255.0, 247.0 / 255.0);
|
||||
tuningBarLight = RGB3f(0.2, 0.2, 0.7);
|
||||
tuningBarDark = RGB3f(0.1, 0.1, 0.45);
|
||||
tuningBarUp = RGB3f(0.5, 139.0/255.0, 96.0/255.0);
|
||||
tuningBarDown = RGB3f(0.6, 108.0/255.0, 1.0);
|
||||
meterLevel = RGB3f(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0);
|
||||
meterValue = RGB3f(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0);
|
||||
text = RGB3f(1, 1, 1);
|
||||
freqLine = RGB3f(1, 1, 1);
|
||||
button = RGB3f(1.0, 1.0, 1.0);
|
||||
buttonHighlight = RGB3f(208.0 / 255.0, 202.0 / 255.0, 247.0 / 255.0);
|
||||
|
||||
scopeBackground = RGB(39.0 / 255.0, 36.0 / 255.0, 56.0 / 255.0);
|
||||
fftBackground = RGB(39.0 / 255.0, 36.0 / 255.0, 56.0 / 255.0);
|
||||
generalBackground = RGB(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0);
|
||||
scopeBackground = RGB3f(39.0 / 255.0, 36.0 / 255.0, 56.0 / 255.0);
|
||||
fftBackground = RGB3f(39.0 / 255.0, 36.0 / 255.0, 56.0 / 255.0);
|
||||
generalBackground = RGB3f(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0);
|
||||
|
||||
}
|
||||
|
||||
@ -239,27 +239,27 @@ HDColorTheme::HDColorTheme() {
|
||||
waterfallGradient.addColor(GradientColor(255.0 / 255.0, 235.0 / 255.0, 100.0 / 255.0));
|
||||
waterfallGradient.addColor(GradientColor(250.0 / 255.0, 250.0 / 255.0, 250.0 / 255.0));
|
||||
waterfallGradient.generate(256);
|
||||
waterfallHighlight = RGB(1, 1, 1);
|
||||
waterfallNew = RGB(0, 1, 0);
|
||||
waterfallHover = RGB(1, 1, 0);
|
||||
waterfallDestroy = RGB(1, 0, 0);
|
||||
fftLine = RGB(0.9, 0.9, 0.9);
|
||||
fftHighlight = RGB(1, 1, 1);
|
||||
scopeLine = RGB(0.9, 0.9, 0.9);
|
||||
tuningBarLight = RGB(0.4, 0.4, 1.0);
|
||||
tuningBarDark = RGB(0.1, 0.1, 0.45);
|
||||
tuningBarUp = RGB(1.0, 139.0/255.0, 96.0/255.0);
|
||||
tuningBarDown = RGB(148.0/255.0, 148.0/255.0, 1.0);
|
||||
meterLevel = RGB(0, 0.5, 0);
|
||||
meterValue = RGB(0.0, 0.0, 1.0);
|
||||
text = RGB(1, 1, 1);
|
||||
freqLine = RGB(1, 1, 1);
|
||||
button = RGB(0, 0.7, 0.7);
|
||||
buttonHighlight = RGB(1, 1, 1);
|
||||
waterfallHighlight = RGB3f(1, 1, 1);
|
||||
waterfallNew = RGB3f(0, 1, 0);
|
||||
waterfallHover = RGB3f(1, 1, 0);
|
||||
waterfallDestroy = RGB3f(1, 0, 0);
|
||||
fftLine = RGB3f(0.9, 0.9, 0.9);
|
||||
fftHighlight = RGB3f(1, 1, 1);
|
||||
scopeLine = RGB3f(0.9, 0.9, 0.9);
|
||||
tuningBarLight = RGB3f(0.4, 0.4, 1.0);
|
||||
tuningBarDark = RGB3f(0.1, 0.1, 0.45);
|
||||
tuningBarUp = RGB3f(1.0, 139.0/255.0, 96.0/255.0);
|
||||
tuningBarDown = RGB3f(148.0/255.0, 148.0/255.0, 1.0);
|
||||
meterLevel = RGB3f(0, 0.5, 0);
|
||||
meterValue = RGB3f(0.0, 0.0, 1.0);
|
||||
text = RGB3f(1, 1, 1);
|
||||
freqLine = RGB3f(1, 1, 1);
|
||||
button = RGB3f(0, 0.7, 0.7);
|
||||
buttonHighlight = RGB3f(1, 1, 1);
|
||||
|
||||
scopeBackground = RGB(0.0, 0.0, 48.0 / 255.0);
|
||||
fftBackground = RGB(0.0, 0.0, 48.0 / 255.0);
|
||||
generalBackground = RGB(0.0, 0.0, 0.0);
|
||||
scopeBackground = RGB3f(0.0, 0.0, 48.0 / 255.0);
|
||||
fftBackground = RGB3f(0.0, 0.0, 48.0 / 255.0);
|
||||
generalBackground = RGB3f(0.0, 0.0, 0.0);
|
||||
|
||||
}
|
||||
|
||||
|
@ -15,21 +15,21 @@
|
||||
#define COLOR_THEME_RADAR 6
|
||||
#define COLOR_THEME_MAX 7
|
||||
|
||||
class RGB {
|
||||
class RGB3f {
|
||||
public:
|
||||
float r, g, b;
|
||||
RGB(float r, float g, float b) :
|
||||
RGB3f(float r, float g, float b) :
|
||||
r(r), g(g), b(b) {
|
||||
}
|
||||
|
||||
RGB() :
|
||||
RGB(0, 0, 0) {
|
||||
RGB3f() :
|
||||
RGB3f(0, 0, 0) {
|
||||
}
|
||||
|
||||
~RGB() {
|
||||
~RGB3f() {
|
||||
}
|
||||
|
||||
RGB & operator=(const RGB &other) {
|
||||
RGB3f & operator=(const RGB3f &other) {
|
||||
r = other.r;
|
||||
g = other.g;
|
||||
b = other.b;
|
||||
@ -39,28 +39,28 @@ public:
|
||||
|
||||
class ColorTheme {
|
||||
public:
|
||||
RGB waterfallHighlight;
|
||||
RGB waterfallNew;
|
||||
RGB wfHighlight;
|
||||
RGB waterfallHover;
|
||||
RGB waterfallDestroy;
|
||||
RGB fftLine;
|
||||
RGB fftHighlight;
|
||||
RGB scopeLine;
|
||||
RGB tuningBarLight;
|
||||
RGB tuningBarDark;
|
||||
RGB tuningBarUp;
|
||||
RGB tuningBarDown;
|
||||
RGB meterLevel;
|
||||
RGB meterValue;
|
||||
RGB text;
|
||||
RGB freqLine;
|
||||
RGB button;
|
||||
RGB buttonHighlight;
|
||||
RGB3f waterfallHighlight;
|
||||
RGB3f waterfallNew;
|
||||
RGB3f wfHighlight;
|
||||
RGB3f waterfallHover;
|
||||
RGB3f waterfallDestroy;
|
||||
RGB3f fftLine;
|
||||
RGB3f fftHighlight;
|
||||
RGB3f scopeLine;
|
||||
RGB3f tuningBarLight;
|
||||
RGB3f tuningBarDark;
|
||||
RGB3f tuningBarUp;
|
||||
RGB3f tuningBarDown;
|
||||
RGB3f meterLevel;
|
||||
RGB3f meterValue;
|
||||
RGB3f text;
|
||||
RGB3f freqLine;
|
||||
RGB3f button;
|
||||
RGB3f buttonHighlight;
|
||||
|
||||
RGB scopeBackground;
|
||||
RGB fftBackground;
|
||||
RGB generalBackground;
|
||||
RGB3f scopeBackground;
|
||||
RGB3f fftBackground;
|
||||
RGB3f generalBackground;
|
||||
|
||||
Gradient waterfallGradient;
|
||||
|
||||
|
@ -59,7 +59,7 @@ PrimaryGLContext::PrimaryGLContext(wxGLCanvas *canvas, wxGLContext *sharedContex
|
||||
//#endif
|
||||
}
|
||||
|
||||
void PrimaryGLContext::DrawDemodInfo(DemodulatorInstance *demod, RGB color, long long center_freq, long long srate) {
|
||||
void PrimaryGLContext::DrawDemodInfo(DemodulatorInstance *demod, RGB3f color, long long center_freq, long long srate) {
|
||||
if (!demod) {
|
||||
return;
|
||||
}
|
||||
@ -140,7 +140,7 @@ void PrimaryGLContext::DrawDemodInfo(DemodulatorInstance *demod, RGB color, long
|
||||
|
||||
}
|
||||
|
||||
void PrimaryGLContext::DrawDemod(DemodulatorInstance *demod, RGB color, long long center_freq, long long srate) {
|
||||
void PrimaryGLContext::DrawDemod(DemodulatorInstance *demod, RGB3f color, long long center_freq, long long srate) {
|
||||
if (!demod) {
|
||||
return;
|
||||
}
|
||||
@ -237,7 +237,7 @@ void PrimaryGLContext::DrawDemod(DemodulatorInstance *demod, RGB color, long lon
|
||||
|
||||
}
|
||||
|
||||
void PrimaryGLContext::DrawFreqSelector(float uxPos, RGB color, float w, long long center_freq, long long srate) {
|
||||
void PrimaryGLContext::DrawFreqSelector(float uxPos, RGB3f color, float w, long long center_freq, long long srate) {
|
||||
DemodulatorInstance *demod = wxGetApp().getDemodMgr().getLastActiveDemodulator();
|
||||
|
||||
long long bw = 0;
|
||||
@ -288,7 +288,7 @@ void PrimaryGLContext::DrawFreqSelector(float uxPos, RGB color, float w, long lo
|
||||
|
||||
}
|
||||
|
||||
void PrimaryGLContext::DrawRangeSelector(float uxPos1, float uxPos2, RGB color) {
|
||||
void PrimaryGLContext::DrawRangeSelector(float uxPos1, float uxPos2, RGB3f color) {
|
||||
if (uxPos2 < uxPos1) {
|
||||
float temp = uxPos2;
|
||||
uxPos2=uxPos1;
|
||||
|
@ -21,10 +21,10 @@ public:
|
||||
void BeginDraw(float r, float g, float b);
|
||||
void EndDraw();
|
||||
|
||||
void DrawFreqSelector(float uxPos, RGB color, float w = 0, long long center_freq = -1, long long srate = 0);
|
||||
void DrawRangeSelector(float uxPos1, float uxPos2, RGB color);
|
||||
void DrawDemod(DemodulatorInstance *demod, RGB color, long long center_freq = -1, long long srate = 0);
|
||||
void DrawDemodInfo(DemodulatorInstance *demod, RGB color, long long center_freq = -1, long long srate = 0);
|
||||
void DrawFreqSelector(float uxPos, RGB3f color, float w = 0, long long center_freq = -1, long long srate = 0);
|
||||
void DrawRangeSelector(float uxPos1, float uxPos2, RGB3f color);
|
||||
void DrawDemod(DemodulatorInstance *demod, RGB3f color, long long center_freq = -1, long long srate = 0);
|
||||
void DrawDemodInfo(DemodulatorInstance *demod, RGB3f color, long long center_freq = -1, long long srate = 0);
|
||||
|
||||
void setHoverAlpha(float hoverAlpha);
|
||||
|
||||
|
@ -84,10 +84,10 @@ void TuningCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
0.75, mouseTracker.getOriginMouseX(), mouseTracker.getMouseX());
|
||||
}
|
||||
|
||||
RGB clr = top ? ThemeMgr::mgr.currentTheme->tuningBarUp : ThemeMgr::mgr.currentTheme->tuningBarDown;
|
||||
RGB3f clr = top ? ThemeMgr::mgr.currentTheme->tuningBarUp : ThemeMgr::mgr.currentTheme->tuningBarDown;
|
||||
|
||||
RGB clrDark = ThemeMgr::mgr.currentTheme->tuningBarDark;
|
||||
RGB clrMid = ThemeMgr::mgr.currentTheme->tuningBarLight;
|
||||
RGB3f clrDark = ThemeMgr::mgr.currentTheme->tuningBarDark;
|
||||
RGB3f clrMid = ThemeMgr::mgr.currentTheme->tuningBarLight;
|
||||
|
||||
glContext->DrawTunerBarIndexed(1, 3, 11, freqDP, freqW, clrMid, 0.25, true, true); // freq
|
||||
glContext->DrawTunerBarIndexed(4, 6, 11, freqDP, freqW, clrDark, 0.25, true, true);
|
||||
@ -129,7 +129,7 @@ void TuningCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
glContext->DrawTuner(freq, 11, freqDP, freqW);
|
||||
int snap = wxGetApp().getFrequencySnap();
|
||||
if (snap != 1) {
|
||||
glContext->DrawTunerDigitBox((int)log10(snap), 11, freqDP, freqW, RGB(1.0,0.0,0.0));
|
||||
glContext->DrawTunerDigitBox((int)log10(snap), 11, freqDP, freqW, RGB3f(1.0,0.0,0.0));
|
||||
}
|
||||
}
|
||||
glContext->DrawTuner(bw, 7, bwDP, bwW);
|
||||
|
@ -112,7 +112,7 @@ void TuningContext::DrawTuner(long long freq, int count, float displayPos, float
|
||||
}
|
||||
|
||||
|
||||
void TuningContext::DrawTunerDigitBox(int index, int count, float displayPos, float displayWidth, RGB c) {
|
||||
void TuningContext::DrawTunerDigitBox(int index, int count, float displayPos, float displayWidth, RGB3f c) {
|
||||
GLint vp[4];
|
||||
glGetIntegerv( GL_VIEWPORT, vp);
|
||||
|
||||
@ -152,7 +152,7 @@ int TuningContext::GetTunerDigitIndex(float mPos, int count, float displayPos, f
|
||||
return count - index;
|
||||
}
|
||||
|
||||
void TuningContext::DrawTunerBarIndexed(int start, int end, int count, float displayPos, float displayWidth, RGB color, float alpha, bool top,
|
||||
void TuningContext::DrawTunerBarIndexed(int start, int end, int count, float displayPos, float displayWidth, RGB3f color, float alpha, bool top,
|
||||
bool bottom) {
|
||||
float ofs = (displayWidth / (float) count);
|
||||
float p2 = displayPos + ofs * (float) (count - start + 1);
|
||||
|
@ -14,9 +14,9 @@ public:
|
||||
void DrawBegin();
|
||||
void Draw(float r, float g, float b, float a, float p1, float p2);
|
||||
void DrawTuner(long long freq, int count, float displayPos, float displayWidth);
|
||||
void DrawTunerDigitBox(int index, int count, float displayPos, float displayWidth, RGB c);
|
||||
void DrawTunerDigitBox(int index, int count, float displayPos, float displayWidth, RGB3f c);
|
||||
int GetTunerDigitIndex(float mPos, int count, float displayPos, float displayWidth);
|
||||
void DrawTunerBarIndexed(int start, int end, int count, float displayPos, float displayWidth, RGB color, float alpha, bool top, bool bottom);
|
||||
void DrawTunerBarIndexed(int start, int end, int count, float displayPos, float displayWidth, RGB3f color, float alpha, bool top, bool bottom);
|
||||
|
||||
void DrawDemodFreqBw(long long freq, unsigned int bw, long long center);
|
||||
void DrawEnd();
|
||||
|
Loading…
Reference in New Issue
Block a user