Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed Utils/mac/nvcompress
Binary file not shown.
2 changes: 1 addition & 1 deletion install_mac.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Install dependencies
brew install python gdal spatialindex p7zip proj python-tk
brew install python gdal spatialindex p7zip proj python-tk imagemagick

# Install pyproj
pip3 install pyproj
Expand Down
69 changes: 51 additions & 18 deletions src/O4_Imagery_Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@
}

if "dar" in sys.platform:
dds_convert_cmd = "magick"
dds_convert_cmd = os.path.join(
UI.Ortho4XP_dir, "Utils", "mac", "nvcompress"
UI.Ortho4XP_dir, "Utils", "mac", "DDSTool"
)
gdal_transl_cmd = "gdal_translate"
gdalwarp_cmd = "gdalwarp"
Expand Down Expand Up @@ -2062,7 +2063,7 @@ def cut_quad_into_grid(quad, steps):
y += y_step

inv_proj = GEO.transformer(t_epsg, s_epsg)

for quad in cut_quad_into_grid(t_quad, 8):
s_quad = []
for (t_pixx, t_pixy) in [
Expand Down Expand Up @@ -2434,23 +2435,55 @@ def convert_texture(
# eventually the dds conversion
if type == "dds":
if not dxt5:
conv_cmd = [
dds_convert_cmd,
"-bc1",
"-fast",
file_to_convert,
os.path.join(tile.build_dir, "textures", out_file_name),
devnull_rdir,
]
if "dar" in sys.platform:
# conv_cmd = [
# dds_convert_cmd,
# "-define",
# "dds:compression=dxt3",
# file_to_convert,
# os.path.join(tile.build_dir, "textures", out_file_name)
# ]
conv_cmd = [
dds_convert_cmd,
"--png2dxt1",
file_to_convert,
os.path.join(tile.build_dir, "textures", out_file_name)
]
print(conv_cmd)
else:
conv_cmd = [
dds_convert_cmd,
"-bc1",
"-fast",
file_to_convert,
os.path.join(tile.build_dir, "textures", out_file_name),
devnull_rdir,
]
else:
conv_cmd = [
dds_convert_cmd,
"-bc3",
"-fast",
file_to_convert,
os.path.join(tile.build_dir, "textures", out_file_name),
devnull_rdir,
]
if "dar" in sys.platform:
# conv_cmd = [
# dds_convert_cmd,
# "-define",
# "dds:compression=dxt5",
# file_to_convert,
# os.path.join(tile.build_dir, "textures", out_file_name),
# ]
conv_cmd = [
dds_convert_cmd,
"--png2dxt5",
file_to_convert,
os.path.join(tile.build_dir, "textures", out_file_name)
]
print(conv_cmd)
else:
conv_cmd = [
dds_convert_cmd,
"-bc3",
"-fast",
file_to_convert,
os.path.join(tile.build_dir, "textures", out_file_name),
devnull_rdir,
]
else:
(latmax, lonmin) = GEO.gtile_to_wgs84(til_x_left, til_y_top, zoomlevel)
(latmin, lonmax) = GEO.gtile_to_wgs84(
Expand Down