Skip to content

Commit

Permalink
Auto mode, start swapping everything...
Browse files Browse the repository at this point in the history
  • Loading branch information
Aang23 committed Feb 26, 2024
1 parent e842b8c commit 3bc6584
Show file tree
Hide file tree
Showing 19 changed files with 676 additions and 548 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/all_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ jobs:
run: sudo apt update

- name: Install dependencies
run: sudo apt install -y libglfw3-dev libfftw3-dev libvolk2-dev build-essential cmake pkgconf libjpeg-dev libpng-dev libairspy-dev libairspyhf-dev libhackrf-dev librtlsdr-dev libomp-dev libnng-dev libiio-dev libzstd-dev libad9361-dev libbladerf-dev libuhd-dev liblimesuite-dev ocl-icd-opencl-dev libjemalloc-dev
run: sudo apt install -y libglfw3-dev libfftw3-dev libvolk2-dev build-essential cmake pkgconf libjpeg-dev libpng-dev libtiff-dev libairspy-dev libairspyhf-dev libhackrf-dev librtlsdr-dev libomp-dev libnng-dev libiio-dev libzstd-dev libad9361-dev libbladerf-dev libuhd-dev liblimesuite-dev ocl-icd-opencl-dev libjemalloc-dev

- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
run: sudo apt update

- name: Install dependencies
run: sudo apt install -y libglfw3-dev libfftw3-dev libvolk2-dev build-essential cmake pkgconf libjpeg-dev libpng-dev libairspy-dev libairspyhf-dev libhackrf-dev librtlsdr-dev libomp-dev libnng-dev libiio-dev libzstd-dev libad9361-dev libbladerf-dev libuhd-dev liblimesuite-dev ocl-icd-opencl-dev libjemalloc-dev
run: sudo apt install -y libglfw3-dev libfftw3-dev libvolk2-dev build-essential cmake pkgconf libjpeg-dev libpng-dev libtiff-dev libairspy-dev libairspyhf-dev libhackrf-dev librtlsdr-dev libomp-dev libnng-dev libiio-dev libzstd-dev libad9361-dev libbladerf-dev libuhd-dev liblimesuite-dev ocl-icd-opencl-dev libjemalloc-dev

- name: Delete build dir
run: rm -rf ${{runner.workspace}}/build
Expand Down Expand Up @@ -280,7 +280,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install dependencies
run: brew install cmake volk jpeg libpng glfw airspy rtl-sdr hackrf mbedtls pkg-config libomp dylibbundler portaudio jemalloc
run: brew install cmake volk jpeg libpng libtiff glfw airspy rtl-sdr hackrf mbedtls pkg-config libomp dylibbundler portaudio jemalloc

- name: Build airspyhf
run: git clone https://github.com/airspy/airspyhf.git && cd airspyhf && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j8 && sudo make install
Expand Down Expand Up @@ -334,7 +334,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install dependencies
run: brew install cmake volk jpeg libpng glfw airspy rtl-sdr hackrf mbedtls pkg-config libomp dylibbundler portaudio jemalloc
run: brew install cmake volk jpeg libpng libtiff glfw airspy rtl-sdr hackrf mbedtls pkg-config libomp dylibbundler portaudio jemalloc

- name: Build airspyhf
run: git clone https://github.com/airspy/airspyhf.git && cd airspyhf && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j8 && sudo make install
Expand Down Expand Up @@ -383,7 +383,13 @@ jobs:

# Yes, since I was asked to do like SDR++ for this I did look at how Ryzerth has done it :-)
update_nightly_release:
needs: ["build_windows", "build_linux", "build_macos_intel", "build_macos_silicon", "build_linux_arm64"] #, "build_android"]
needs: [
"build_windows",
"build_linux",
"build_macos_intel",
"build_macos_silicon",
"build_linux_arm64",
] #, "build_android"]
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}

Expand Down
40 changes: 38 additions & 2 deletions satdump_cfg.json
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,18 @@
"type": "equirectangular"
}
}
/*"project_channels": {
"channels": "all",
"width": 2048,
"height": 1024,
//"individual_equalize": true,
//"draw_map_overlay": true,
"config": {
"type": "equirec",
"auto": true,
"geotiff": true
}
}*/
},
"virr": {
"handler": "image_handler",
Expand Down Expand Up @@ -1293,7 +1305,19 @@
"white_balance": true,
"apply_lut": true
}
}
} /*,
"project_channels": {
"channels": "all",
"width": 2048,
"height": 1024,
//"individual_equalize": true,
//"draw_map_overlay": true,
"config": {
"type": "equirec",
"auto": true,
"geotiff": true
}
}*/
},
"viirs_dnb": {
"handler": "image_handler",
Expand All @@ -1306,7 +1330,19 @@
"DNB Night": {
"equation": "chdnb * 50 - 0.5"
}
}
} /*,
"project_channels": {
"channels": "all",
"width": 2048,
"height": 1024,
//"individual_equalize": true,
//"draw_map_overlay": true,
"config": {
"type": "equirec",
"auto": true,
"geotiff": true
}
}*/
},
"modis": {
"handler": "image_handler",
Expand Down
23 changes: 23 additions & 0 deletions src-core/common/image/image_meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,27 @@ namespace image
else
return nlohmann::json();
}

template <typename T>
bool has_metadata_proj_cfg(Image<T> &img)
{
return img.metadata_obj != nullptr && get_metadata(img).contains("proj_cfg");
}

template <typename T>
void set_metadata_proj_cfg(Image<T> &img, nlohmann::json proj_cfg)
{
if (img.metadata_obj == nullptr)
img.metadata_obj = (nlohmann::json *)new nlohmann::json();
(*((nlohmann::json *)img.metadata_obj))["proj_cfg"] = proj_cfg;
}

template <typename T>
nlohmann::json get_metadata_proj_cfg(const Image<T> &img)
{
if (img.metadata_obj != nullptr && get_metadata(img).contains("proj_cfg"))
return (*((nlohmann::json *)img.metadata_obj))["proj_cfg"];
else
return nlohmann::json();
}
}
2 changes: 1 addition & 1 deletion src-core/common/projection/geotiff/geotiff_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace geotiff
if (pixelscale_c >= 2)
{
proj->proj_scalar_x = pixelscale[0];
proj->proj_scalar_y = pixelscale[1];
proj->proj_scalar_y = -pixelscale[1];
has_pixelscale = true;
}

Expand Down
2 changes: 1 addition & 1 deletion src-core/common/projection/geotiff/geotiff_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace geotiff
TIFFSetField(tif, GEOTIFFTAG_ModelTiepointTag, 6, &tiepoints);

// Then write pixel scales
double pixelscales[3] = {proj->proj_scalar_x, proj->proj_scalar_y, 0.0};
double pixelscales[3] = {proj->proj_scalar_x, -proj->proj_scalar_y, 0.0};
TIFFSetField(tif, GEOTIFFTAG_ModelPixelScaleTag, 3, &pixelscales);

// Finally, the GeoKeys
Expand Down
4 changes: 2 additions & 2 deletions src-core/common/projection/projs2/proj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ namespace proj
*y += proj->y0;

*x = (*x - proj->proj_offset_x) / proj->proj_scalar_x;
*y = (*y - proj->proj_offset_y) / -proj->proj_scalar_y; // Top corner, need to swap
*y = (*y - proj->proj_offset_y) / proj->proj_scalar_y;

return false;
}
Expand All @@ -100,7 +100,7 @@ namespace proj
{
/* Apply scalars & offsets */
x = x * proj->proj_scalar_x + proj->proj_offset_x;
y = y * -proj->proj_scalar_y + proj->proj_offset_y; // Top corner, need to swap
y = y * proj->proj_scalar_y + proj->proj_offset_y;

x -= proj->x0;
y -= proj->y0;
Expand Down
Loading

0 comments on commit 3bc6584

Please sign in to comment.