Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package vsgXchange for openSUSE:Factory checked in at 2023-09-20 13:25:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/vsgXchange (Old) and /work/SRC/openSUSE:Factory/.vsgXchange.new.16627 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "vsgXchange" Wed Sep 20 13:25:38 2023 rev:3 rq:1111774 version:1.0.5 Changes: -------- --- /work/SRC/openSUSE:Factory/vsgXchange/vsgXchange.changes 2023-08-02 16:50:46.365618519 +0200 +++ /work/SRC/openSUSE:Factory/.vsgXchange.new.16627/vsgXchange.changes 2023-09-20 13:27:21.658714716 +0200 @@ -1,0 +2,7 @@ +Fri Sep 15 20:32:13 UTC 2023 - Ralf Habacker <ralf.habac...@freenet.de> + +- Update to version 1.0.5 + * See https://github.com/vsg-dev/vsgXchange/releases/tag/v1.0.5 for + release info + +------------------------------------------------------------------- Old: ---- vsgXchange-1.0.4.tar.xz New: ---- vsgXchange-1.0.5.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ vsgXchange.spec ++++++ --- /var/tmp/diff_new_pack.zRGPQm/_old 2023-09-20 13:27:22.858757708 +0200 +++ /var/tmp/diff_new_pack.zRGPQm/_new 2023-09-20 13:27:22.858757708 +0200 @@ -19,7 +19,7 @@ %define _vsg_so_nr 1 Name: vsgXchange -Version: 1.0.4 +Version: 1.0.5 Release: 0 Summary: 3D graphics toolkit License: MIT ++++++ _service ++++++ --- /var/tmp/diff_new_pack.zRGPQm/_old 2023-09-20 13:27:22.886758711 +0200 +++ /var/tmp/diff_new_pack.zRGPQm/_new 2023-09-20 13:27:22.886758711 +0200 @@ -2,7 +2,7 @@ <service name="tar_scm" mode="disabled"> <param name="scm">git</param> <param name="url">https://github.com/vsg-dev/vsgXchange</param> - <param name="revision">v1.0.4</param> + <param name="revision">v1.0.5</param> <param name="versionformat">@PARENT_TAG@</param> <param name="versionrewrite-pattern">v(.*)</param> </service> ++++++ vsgXchange-1.0.4.tar.xz -> vsgXchange-1.0.5.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vsgXchange-1.0.4/CMakeLists.txt new/vsgXchange-1.0.5/CMakeLists.txt --- old/vsgXchange-1.0.4/CMakeLists.txt 2023-07-26 18:49:37.000000000 +0200 +++ new/vsgXchange-1.0.5/CMakeLists.txt 2023-08-31 10:14:34.000000000 +0200 @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.7) project(vsgXchange - VERSION 1.0.4 + VERSION 1.0.5 DESCRIPTION "VulkanSceneGraph 3rd party data integration library" LANGUAGES CXX C ) @@ -20,7 +20,7 @@ set(ENV{VULKAN_SDK} ${VULKAN_SDK}) endif() -set(VSG_MIN_VERSION 1.0.8) +set(VSG_MIN_VERSION 1.0.9) find_package(vsg ${VSG_MIN_VERSION}) vsg_setup_dir_vars() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vsgXchange-1.0.4/README.md new/vsgXchange-1.0.5/README.md --- old/vsgXchange-1.0.4/README.md 2023-07-26 18:49:37.000000000 +0200 +++ new/vsgXchange-1.0.5/README.md 2023-08-31 10:14:34.000000000 +0200 @@ -14,8 +14,8 @@ cmake automatically finds which dependencies are available and builds the appropriate components: * [reading font formats](#font-file-formats-supported-by-optional-vsgxchangefreetype) TrueType etc. using [Freetype](https://www.freetype.org/) as vsg::Font. -* [reading image & DEM formats](#image-formats-supported-by-optional-vsgxchangegdal) .exr using by [OpenEXP](https://www.openexr.com/), and GeoTiff etc. using [GDAL](https://gdal.org/) as vsg::Data. -* [reading 3d model formats](#model-formats-supported-by-optional-vsgxchangeassimp) GLTF, OBJ, 3DS, LWO etc. use Assimp as vsg::Node. +* [reading image & DEM formats](#image-formats-supported-by-optional-vsgxchangegdal) .exr using [OpenEXR](https://www.openexr.com/), and GeoTiff etc. using [GDAL](https://gdal.org/) as vsg::Data. +* [reading 3d model formats](#model-formats-supported-by-optional-vsgxchangeassimp) GLTF, OBJ, 3DS, LWO etc. using Assimp as vsg::Node. * [reading data over the internet](#protocols-supported-by-optional-vsgxchangecurl) reading image and model files from http:// and https:// using [libcurl](https://curl.se/libcurl/) * [reading image and 3d model formats](#image-and-model-formats-supported-by-optional-vsgxchangeosg) OpenSceneGraph, OpenFlight etc. using [osg2vsg](https://github.com/vsg-dev/osg2vsg)/[OpenSceneGraph](http://www.openscenegraph.org/). @@ -47,7 +47,7 @@ ### Windows: -To be filled in by a kindly Window dev :-) +To be filled in by a kindly Windows dev :-) ## How to use vsgXchange in your own applications @@ -59,14 +59,14 @@ C++ additions: - #include <vsgXchange/ReaderWriter_all.h> + #include <vsgXchange/all.h> ... // assign a composite ReaderWriter that includes all supported formats - auto options = vsg::Options::create(vsgXchange::ReaderWriter_all::create()); + auto options = vsg::Options::create(vsgXchange::all::create()); - // pass in the options that provides the link to the ReaderWriter of interest. + // pass in the options that provide the link to the ReaderWriter of interest. auto object = vsg::read("myimage.dds", options); // read file and cast to vsg::Data if possible, returns vsg::ref_ptr<vsg::Data> @@ -86,12 +86,12 @@ vsgconv myshader.frag myshader.spv vsgconv myshader.comp myshader_comp.cpp -To convert 3rd part image formats to native VSG format or source file: +To convert 3rd party image formats to native VSG format or source file: vsgconv image.jpg image.vsgb vsgconv image.jpg image.cpp -To convert 3rd part model formats to native VSG format or source file: +To convert 3rd party model formats to native VSG format or source file: vsgconv mymodel.obj mymodel.vsgt # convert OBJ model to VSG ascii text format (requires Assimp) vsgconv mymodel.gltif mymodel.vsgt # convert GLTF model to VSG ascii text format (requires Assimp) @@ -99,7 +99,7 @@ vsgconv mymodel.flt mymodel.vsgb # convert OpenFlight format to VSG binary format (requires osg2vsg/OpenSceneGraph) vsgconv mymodel.vsgb mymodel.cpp # convert native VSG binary format to source file. -To convert a OpenSceneGraph Paged database (requires osg2vsg/OpenSceneGraph): +To convert an OpenSceneGraph Paged database (requires osg2vsg/OpenSceneGraph): vsgconv OsgDatabase/earth.osgb VsgDatabase/earth.vsgb -l 30 # convert up to level 30 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vsgXchange-1.0.4/applications/vsgconv/vsgconv.cpp new/vsgXchange-1.0.5/applications/vsgconv/vsgconv.cpp --- old/vsgXchange-1.0.4/applications/vsgconv/vsgconv.cpp 2023-07-26 18:49:37.000000000 +0200 +++ new/vsgXchange-1.0.5/applications/vsgconv/vsgconv.cpp 2023-08-31 10:14:34.000000000 +0200 @@ -117,7 +117,7 @@ log(" failed to read ", readRequest.src_filename); } - // we have finished this read operation so decrement the latch, which will release and threads waiting on it. + // we have finished this read operation so decrement the latch, which will release any threads waiting on it. latch->count_down(); } @@ -262,9 +262,22 @@ } // namespace vsgconv +void printHelp(std::ostream& out) +{ + out << "Usage:\n"; + out << " vsgconv input_filename output_filename\n"; + out << " vsgconv input_filename_1 input_filename_2 output_filename\n"; + out << "Options:\n"; + out << " --features # list all ReaderWriters and the formats supported\n"; + out << " --features rw_name # list formats supported by the specified ReaderWriter\n"; + out << " --nc --no-compile # do not compile shaders to SPIRV\n"; + out << " --rgb # leave RGB source data in its original form rather than converting to RGBA\n"; + out << " -v --version # report version\n"; +} + int main(int argc, char** argv) { - // use the vsg::Options object to pass the ReaderWriter_all to use when reading files. + // use the vsg::Options object to pass the vsgXchange::all ReaderWriter to use when reading files. auto options = vsg::Options::create(vsgXchange::all::create()); options->paths = vsg::getEnvPaths("VSG_FILE_PATH"); options->sharedObjects = vsg::SharedObjects::create(); @@ -272,25 +285,16 @@ // set up defaults and read command line arguments to override them vsg::CommandLine arguments(&argc, argv); - if (argc <= 1 || arguments.read({"-h", "--help"})) + if (arguments.read({"-h", "--help"})) { - std::cout << "Usage:\n"; - std::cout << " vsgconv input_filename output_filefilename\n"; - std::cout << " vsgconv input_filename_1 input_filefilename_2 output_filefilename\n"; - std::cout << "Options:\n"; - std::cout << " --features # list all ReaderWriters and the formats supported\n"; - std::cout << " --features rw_name # list formats sipportred \n"; - std::cout << " --nc --no-compile # do not compile shaders to SPIRV\n"; - std::cout << " --rgb # leave RGB source data in it's original form rather than converting to RGBA \n"; - std::cout << " -v --version # report version \n"; - return 1; + printHelp(std::cout); + return 0; } if (arguments.read("--rgb")) options->mapRGBtoRGBAHint = false; - // read any command line options that the ReaderWrite support + // read any command line options that the ReaderWriter supports arguments.read(options); - if (argc <= 1) return 0; if (arguments.read({"-v", "--version"})) { @@ -328,6 +332,14 @@ auto numThreads = arguments.value(16, "-t"); bool compileShaders = !arguments.read({"--no-compile", "--nc"}); + if (argc <= 2) + { + std::cout<<"Warning: vsgconv requires at last an input filenae and output filename.\n\n"; + + printHelp(std::cout); + return 1; + } + vsg::Path outputFilename = arguments[argc - 1]; using VsgObjects = std::vector<vsg::ref_ptr<vsg::Object>>; @@ -490,7 +502,7 @@ operationQueue->add(vsgconv::ReadOperation::create(obs_queue, latch, itr->second, 1, levels)); } - // wait until the latch goes zero i.e. all read operations have completed + // wait until the latch goes to zero i.e. all read operations have completed latch->wait(); // signal that we are finished and the thread should close diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vsgXchange-1.0.4/include/vsgXchange/all.h new/vsgXchange-1.0.5/include/vsgXchange/all.h --- old/vsgXchange-1.0.4/include/vsgXchange/all.h 2023-07-26 18:49:37.000000000 +0200 +++ new/vsgXchange-1.0.5/include/vsgXchange/all.h 2023-08-31 10:14:34.000000000 +0200 @@ -28,7 +28,7 @@ namespace vsgXchange { - /// initialize any statics, such as registering all the ReaderWriter's with vsg::ObjectFactory::instance(), + /// initialize any statics, such as registering all the ReaderWriters with vsg::ObjectFactory::instance(), /// so that any serialization that includes vsgXchange ReaderWriters will be able to load them. extern VSGXCHANGE_DECLSPEC void init(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vsgXchange-1.0.4/include/vsgXchange/curl.h new/vsgXchange-1.0.5/include/vsgXchange/curl.h --- old/vsgXchange-1.0.4/include/vsgXchange/curl.h 2023-07-26 18:49:37.000000000 +0200 +++ new/vsgXchange-1.0.5/include/vsgXchange/curl.h 2023-08-31 10:14:34.000000000 +0200 @@ -41,7 +41,7 @@ bool getFeatures(Features& features) const override; - // vsg::Options::setValue(str, value) suppoorted options: + // vsg::Options::setValue(str, value) supported options: static constexpr const char* SSL_OPTIONS = "CURLOPT_SSL_OPTIONS"; /// uint32_t /// specify whether libcurl should be initialized and cleaned up by vsgXchange::curl. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vsgXchange-1.0.4/include/vsgXchange/freetype.h new/vsgXchange-1.0.5/include/vsgXchange/freetype.h --- old/vsgXchange-1.0.4/include/vsgXchange/freetype.h 2023-07-26 18:49:37.000000000 +0200 +++ new/vsgXchange-1.0.5/include/vsgXchange/freetype.h 2023-08-31 10:14:34.000000000 +0200 @@ -39,7 +39,7 @@ bool getFeatures(Features& features) const override; - // vsg::Options::setValue(str, value) suppoorted options: + // vsg::Options::setValue(str, value) supported options: static constexpr const char* texel_margin_ratio = "texel_margin_ratio"; static constexpr const char* quad_margin_ratio = "quad_margin_ratio"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vsgXchange-1.0.4/include/vsgXchange/images.h new/vsgXchange-1.0.5/include/vsgXchange/images.h --- old/vsgXchange-1.0.4/include/vsgXchange/images.h 2023-07-26 18:49:37.000000000 +0200 +++ new/vsgXchange-1.0.5/include/vsgXchange/images.h 2023-08-31 10:14:34.000000000 +0200 @@ -31,7 +31,7 @@ namespace vsgXchange { - /// Composite ReaderWriter that holds the uses load 3rd party images formats. + /// Composite ReaderWriter that holds the used 3rd party image format loaders. /// By default utilizes the stbi, dds and ktx ReaderWriters so that users only need to create vsgXchange::images::create() to utilize them all. class VSGXCHANGE_DECLSPEC images : public vsg::Inherit<vsg::CompositeReaderWriter, images> { @@ -53,7 +53,7 @@ bool getFeatures(Features& features) const override; - // vsg::Options::setValue(str, value) suppoorted options: + // vsg::Options::setValue(str, value) supported options: static constexpr const char* jpeg_quality = "jpeg_quality"; bool readOptions(vsg::Options& options, vsg::CommandLine& arguments) const override; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vsgXchange-1.0.4/include/vsgXchange/models.h new/vsgXchange-1.0.5/include/vsgXchange/models.h --- old/vsgXchange-1.0.4/include/vsgXchange/models.h 2023-07-26 18:49:37.000000000 +0200 +++ new/vsgXchange-1.0.5/include/vsgXchange/models.h 2023-08-31 10:14:34.000000000 +0200 @@ -30,8 +30,7 @@ namespace vsgXchange { - /// Composite ReaderWriter that holds the uses load 3rd party images formats. - /// By default utilizes the stbi, dds and ktx ReaderWriters so that users only need to create vsgXchange::images::create() to utilize them all. + /// Composite ReaderWriter that holds the used 3rd party model format loaders. class VSGXCHANGE_DECLSPEC models : public vsg::Inherit<vsg::CompositeReaderWriter, models> { public: @@ -49,7 +48,7 @@ bool getFeatures(Features& features) const override; - // vsg::Options::setValue(str, value) suppoorted options: + // vsg::Options::setValue(str, value) supported options: static constexpr const char* generate_smooth_normals = "generate_smooth_normals"; static constexpr const char* generate_sharp_normals = "generate_sharp_normals"; static constexpr const char* crease_angle = "crease_angle"; /// float diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vsgXchange-1.0.4/src/CMakeLists.txt new/vsgXchange-1.0.5/src/CMakeLists.txt --- old/vsgXchange-1.0.4/src/CMakeLists.txt 2023-07-26 18:49:37.000000000 +0200 +++ new/vsgXchange-1.0.5/src/CMakeLists.txt 2023-08-31 10:14:34.000000000 +0200 @@ -1,5 +1,5 @@ -# vars used to enable subdirectories to extend the build of the vsgXchange library in a loose coupled way +# vars used to enable subdirectories to extend the build of the vsgXchange library in a loosely coupled way set(EXTRA_DEFINES) set(EXTRA_INCLUDES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vsgXchange-1.0.4/src/all/Version.h.in new/vsgXchange-1.0.5/src/all/Version.h.in --- old/vsgXchange-1.0.4/src/all/Version.h.in 2023-07-26 18:49:37.000000000 +0200 +++ new/vsgXchange-1.0.5/src/all/Version.h.in 2023-08-31 10:14:34.000000000 +0200 @@ -32,8 +32,8 @@ extern VSGXCHANGE_DECLSPEC const char* vsgXchangeGetVersionString(); extern VSGXCHANGE_DECLSPEC const char* vsgXchangeGetSOVersionString(); - /// return 0 if the linked vsgXchage was built as static library (default), 1 if the linked vsgXchange library was built as shared/dynamic library. - /// When building against a shared libraryTo ensure the correct selection of VSGXCHANGE_DECLSPEC (provided in vsgXchange/Export.h) one must compile with the define VSGXCHANGE_SHARED_LIBRARY + /// return 0 if the linked vsgXchange was built as static library (default), 1 if the linked vsgXchange library was built as shared/dynamic library. + /// When building against a shared library, to ensure the correct selection of VSGXCHANGE_DECLSPEC (provided in vsgXchange/Export.h) one must compile with the define VSGXCHANGE_SHARED_LIBRARY extern VSGXCHANGE_DECLSPEC int vsgXchangeBuiltAsSharedLibrary(); /// standard Features diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vsgXchange-1.0.4/src/all/all.cpp new/vsgXchange-1.0.5/src/all/all.cpp --- old/vsgXchange-1.0.4/src/all/all.cpp 2023-07-26 18:49:37.000000000 +0200 +++ new/vsgXchange-1.0.5/src/all/all.cpp 2023-08-31 10:14:34.000000000 +0200 @@ -57,7 +57,7 @@ all::all() { - // for convinience make sure the init() method is called + // for convenience make sure the init() method is called vsgXchange::init(); #ifdef vsgXchange_curl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vsgXchange-1.0.4/src/assimp/assimp.cpp new/vsgXchange-1.0.5/src/assimp/assimp.cpp --- old/vsgXchange-1.0.4/src/assimp/assimp.cpp 2023-07-26 18:49:37.000000000 +0200 +++ new/vsgXchange-1.0.5/src/assimp/assimp.cpp 2023-08-31 10:14:34.000000000 +0200 @@ -235,7 +235,7 @@ void convert(const aiMaterial* material, vsg::DescriptorConfigurator& convertedMaterial); - vsg::ref_ptr<vsg::Data> createIndices(const aiMesh* mesh, unsigned int numIndicesPerFace, uint32_t numIndidices); + vsg::ref_ptr<vsg::Data> createIndices(const aiMesh* mesh, unsigned int numIndicesPerFace, uint32_t numIndices); void convert(const aiMesh* mesh, vsg::ref_ptr<vsg::Node>& node); vsg::ref_ptr<vsg::Node> visit(const aiScene* in_scene, vsg::ref_ptr<const vsg::Options> in_options, const vsg::Path& ext); @@ -253,7 +253,7 @@ if (auto texture = scene->GetEmbeddedTexture(texPath.C_Str())) { - // check embedded texture has no width so must be invalid + // embedded texture has no width so must be invalid if (texture->mWidth == 0) return {}; if (texture->mHeight == 0) @@ -272,7 +272,7 @@ { vsg::debug("filename = ", filename, " : Embedded raw format texture->achFormatHint = ", texture->achFormatHint); - // Vulkan doesn't support this format we have to reorder it to RGBA + // Vulkan doesn't support this format, we have to reorder it to RGBA auto image = vsg::ubvec4Array2D::create(texture->mWidth, texture->mHeight, vsg::Data::Properties{VK_FORMAT_R8G8B8A8_UNORM}); auto src = texture->pcData; for(auto& dest_c : *image) @@ -472,7 +472,7 @@ if (samplerImage = convertTexture(*material, aiTextureType_SPECULAR); samplerImage.data.valid()) { - // TODO phong shader doesn't present have a specular texture maps + // TODO phong shader doesn't have a specular texture map at present convertedMaterial.assignTexture("specularMap", samplerImage.data, samplerImage.sampler); if (specularResult != AI_SUCCESS) @@ -495,11 +495,11 @@ } } -vsg::ref_ptr<vsg::Data> SceneConverter::createIndices(const aiMesh* mesh, unsigned int numIndicesPerFace, uint32_t numIndidices) +vsg::ref_ptr<vsg::Data> SceneConverter::createIndices(const aiMesh* mesh, unsigned int numIndicesPerFace, uint32_t numIndices) { if (mesh->mNumVertices > 16384) { - auto indices = vsg::uintArray::create(numIndidices); + auto indices = vsg::uintArray::create(numIndices); auto itr = indices->begin(); for (unsigned int j = 0; j < mesh->mNumFaces; ++j) { @@ -513,7 +513,7 @@ } else { - auto indices = vsg::ushortArray::create(numIndidices); + auto indices = vsg::ushortArray::create(numIndices); auto itr = indices->begin(); for (unsigned int j = 0; j < mesh->mNumFaces; ++j) { @@ -531,19 +531,19 @@ { if (convertedMaterials.size() <= mesh->mMaterialIndex) { - vsg::warn("Warning: mesh ", mesh, ") mesh->mMaterialIndex = ", mesh->mMaterialIndex, " exceedes available meterails.size()= ", convertedMaterials.size()); + vsg::warn("Warning: mesh (", mesh, ") mesh->mMaterialIndex = ", mesh->mMaterialIndex, " exceeds available materials.size()= ", convertedMaterials.size()); return; } if (mesh->mNumVertices == 0 || mesh->mVertices == nullptr) { - vsg::warn("Warning: mesh", mesh, ") no verticex data, mesh->mNumVertices = ", mesh->mNumVertices, " mesh->mVertices = ", mesh->mVertices); + vsg::warn("Warning: mesh (", mesh, ") no vertices data, mesh->mNumVertices = ", mesh->mNumVertices, " mesh->mVertices = ", mesh->mVertices); return; } if (mesh->mNumFaces == 0 || mesh->mFaces == nullptr) { - vsg::warn("Warning: mesh", mesh, ") no mesh data, mesh->mNumFaces = ", mesh->mNumFaces); + vsg::warn("Warning: mesh (", mesh, ") no mesh data, mesh->mNumFaces = ", mesh->mNumFaces); return; } @@ -569,12 +569,12 @@ } } - int numPrimtiveTypes = 0; - if (numTriangleIndices > 0) ++numPrimtiveTypes; - if (numLineIndices > 0) ++numPrimtiveTypes; - if (numPointIndices > 0) ++numPrimtiveTypes; + int numPrimitiveTypes = 0; + if (numTriangleIndices > 0) ++numPrimitiveTypes; + if (numLineIndices > 0) ++numPrimitiveTypes; + if (numPointIndices > 0) ++numPrimitiveTypes; - if (numPrimtiveTypes > 1) + if (numPrimitiveTypes > 1) { vsg::warn("Warning: more than one primitive type required, numTriangleIndices = ", numTriangleIndices, ", numLineIndices = ", numLineIndices, ", numPointIndices = ", numPointIndices); } @@ -609,7 +609,6 @@ auto config = vsg::GraphicsPipelineConfigurator::create(material->shaderSet); config->descriptorConfigurator = material; - config->inputAssemblyState->topology = topology; auto indices = createIndices(mesh, numIndicesPerFace, numIndices); vsg::DataList vertexArrays; @@ -665,25 +664,28 @@ vid->instanceCount = 1; if (!name.empty()) vid->setValue("name", name); - if (material->blending) + // set the GraphicsPipelineStates to the required values. + struct SetPipelineStates : public vsg::Visitor { - config->colorBlendState->attachments = vsg::ColorBlendState::ColorBlendAttachments{ - {true, VK_BLEND_FACTOR_SRC_ALPHA, VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, VK_BLEND_OP_ADD, VK_BLEND_FACTOR_SRC_ALPHA, VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, VK_BLEND_OP_SUBTRACT, VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT}}; - - if (sharedObjects) sharedObjects->share(config->colorBlendState); - } - - if (material->two_sided) - { - config->rasterizationState->cullMode = VK_CULL_MODE_NONE; - } + VkPrimitiveTopology topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; + bool blending = false; + bool two_sided = false; + + SetPipelineStates(VkPrimitiveTopology in_topology, bool in_blending, bool in_two_sided) : topology(in_topology), blending(in_blending), two_sided(in_two_sided) {} + + void apply(vsg::Object& object) { object.traverse(*this); } + void apply(vsg::RasterizationState& rs) { if (two_sided) rs.cullMode = VK_CULL_MODE_NONE; } + void apply(vsg::InputAssemblyState& ias) { ias.topology = topology; } + void apply(vsg::ColorBlendState& cbs) { cbs.configureAttachments(blending); } + } sps(topology, material->blending, material->two_sided); + config->accept(sps); if (sharedObjects) sharedObjects->share(config, [](auto gpc) { gpc->init(); }); else config->init(); - // create StateGroup as the root of the scene/command graph to hold the GraphicsProgram, and binding of Descriptors to decorate the whole graph + // create StateGroup as the root of the scene/command graph to hold the GraphicsPipeline, and binding of Descriptors to decorate the whole graph auto stateGroup = vsg::StateGroup::create(); config->copyTo(stateGroup, sharedObjects); @@ -724,7 +726,7 @@ processCameras(); processLights(); - // convet the materials + // convert the materials convertedMaterials.resize(scene->mNumMaterials); for (unsigned int i = 0; i < scene->mNumMaterials; ++i) { @@ -732,7 +734,7 @@ convert(scene->mMaterials[i], *convertedMaterials[i]); } - // convet the meshses + // convert the meshes convertedMeshes.resize(scene->mNumMeshes); for (unsigned int i = 0; i < scene->mNumMeshes; ++i) { @@ -782,7 +784,7 @@ std::string name = node->mName.C_Str(); - // assign any lights + // assign any cameras if (auto camera_itr = cameraMap.find(name); camera_itr != cameraMap.end()) { children.push_back(camera_itr->second); @@ -794,7 +796,7 @@ children.push_back(light_itr->second); } - // visit the meshes + // assign the meshes for (unsigned int i = 0; i < node->mNumMeshes; ++i) { auto mesh_index = node->mMeshes[i]; @@ -869,6 +871,21 @@ { if (scene->mNumLights > 0) { + auto setColorAndIntensity = [](const aiLight& light, vsg::Light& vsg_light) -> void + { + vsg_light.color = convert(light.mColorDiffuse); + float maxValue = std::max(std::max(vsg_light.color.r, vsg_light.color.g), vsg_light.color.b); + if (maxValue > 0.0) + { + vsg_light.color /= maxValue; + vsg_light.intensity = maxValue; + } + else + { + vsg_light.intensity = 0.0; + } + }; + for (unsigned int li = 0; li < scene->mNumLights; ++li) { auto* light = scene->mLights[li]; @@ -876,32 +893,32 @@ { case (aiLightSource_UNDEFINED): { auto vsg_light = vsg::Light::create(); + setColorAndIntensity(*light, *vsg_light); vsg_light->name = light->mName.C_Str(); - vsg_light->color = convert(light->mColorDiffuse); vsg_light->setValue("light_type", "UNDEFINED"); lightMap[vsg_light->name] = vsg_light; break; } case (aiLightSource_DIRECTIONAL): { auto vsg_light = vsg::DirectionalLight::create(); + setColorAndIntensity(*light, *vsg_light); vsg_light->name = light->mName.C_Str(); - vsg_light->color = convert(light->mColorDiffuse); vsg_light->direction = dconvert(light->mDirection); lightMap[vsg_light->name] = vsg_light; break; } case (aiLightSource_POINT): { auto vsg_light = vsg::PointLight::create(); + setColorAndIntensity(*light, *vsg_light); vsg_light->name = light->mName.C_Str(); - vsg_light->color = convert(light->mColorDiffuse); vsg_light->position = dconvert(light->mDirection); lightMap[vsg_light->name] = vsg_light; break; } case (aiLightSource_SPOT): { auto vsg_light = vsg::SpotLight::create(); + setColorAndIntensity(*light, *vsg_light); vsg_light->name = light->mName.C_Str(); - vsg_light->color = convert(light->mColorDiffuse); vsg_light->position = dconvert(light->mDirection); vsg_light->direction = dconvert(light->mDirection); vsg_light->innerAngle = light->mAngleInnerCone; @@ -911,15 +928,15 @@ } case (aiLightSource_AMBIENT): { auto vsg_light = vsg::AmbientLight::create(); + setColorAndIntensity(*light, *vsg_light); vsg_light->name = light->mName.C_Str(); - vsg_light->color = convert(light->mColorDiffuse); lightMap[vsg_light->name] = vsg_light; break; } case (aiLightSource_AREA): { auto vsg_light = vsg::Light::create(); + setColorAndIntensity(*light, *vsg_light); vsg_light->name = light->mName.C_Str(); - vsg_light->color = convert(light->mColorDiffuse); vsg_light->setValue("light_type", "AREA"); lightMap[vsg_light->name] = vsg_light; break; @@ -933,11 +950,11 @@ vsg::ref_ptr<vsg::MatrixTransform> SceneConverter::processCoordinateFrame(const vsg::Path& ext) { - vsg::CoordinateConvention source_coordianteConvention = vsg::CoordinateConvention::Y_UP; + vsg::CoordinateConvention source_coordinateConvention = vsg::CoordinateConvention::Y_UP; if (auto itr = options->formatCoordinateConventions.find(ext); itr != options->formatCoordinateConventions.end()) { - source_coordianteConvention = itr->second; + source_coordinateConvention = itr->second; } if (scene->mMetaData) @@ -946,20 +963,20 @@ if (scene->mMetaData->Get("UpAxis", upAxis) == AI_SUCCESS) { if (upAxis == 0) - source_coordianteConvention = vsg::CoordinateConvention::X_UP; + source_coordinateConvention = vsg::CoordinateConvention::X_UP; else if (upAxis == 1) - source_coordianteConvention = vsg::CoordinateConvention::Y_UP; + source_coordinateConvention = vsg::CoordinateConvention::Y_UP; else - source_coordianteConvention = vsg::CoordinateConvention::Z_UP; + source_coordinateConvention = vsg::CoordinateConvention::Z_UP; - // unclear on how to intepret the UpAxisSign so will leave it unused for now. + // unclear on how to interpret the UpAxisSign so will leave it unused for now. // int upAxisSign = 1; // scene->mMetaData->Get("UpAxisSign", upAxisSign); } } vsg::dmat4 matrix; - if (vsg::transform(source_coordianteConvention, options->sceneCoordinateConvention, matrix)) + if (vsg::transform(source_coordinateConvention, options->sceneCoordinateConvention, matrix)) { return vsg::MatrixTransform::create(matrix); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vsgXchange-1.0.4/src/dds/dds.cpp new/vsgXchange-1.0.5/src/dds/dds.cpp --- old/vsgXchange-1.0.4/src/dds/dds.cpp 2023-07-26 18:49:37.000000000 +0200 +++ new/vsgXchange-1.0.5/src/dds/dds.cpp 2023-08-31 10:14:34.000000000 +0200 @@ -214,7 +214,7 @@ vsg_data = vsg::ubvec4Array3D::create(width, height, depth, reinterpret_cast<vsg::ubvec4*>(raw), layout); break; case tinyddsloader::DDSFile::TextureDimension::Unknown: - std::cerr << "dds::readDds() Num of dimension (" << (uint32_t)dim << ") is supported." << std::endl; + std::cerr << "dds::readDds() Num of dimension (" << (uint32_t)dim << ") not supported." << std::endl; break; } @@ -311,7 +311,7 @@ std::cerr << "dds::read(uint_8_t*, size_t) Error loading file: Feature not supported" << std::endl; break; default: - std::cerr << "dds::readuint_8_t*, size_t) Error loading file: " << result << std::endl; + std::cerr << "dds::read(uint_8_t*, size_t) Error loading file: " << result << std::endl; break; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vsgXchange-1.0.4/src/freetype/freetype.cpp new/vsgXchange-1.0.5/src/freetype/freetype.cpp --- old/vsgXchange-1.0.4/src/freetype/freetype.cpp 2023-07-26 18:49:37.000000000 +0200 +++ new/vsgXchange-1.0.5/src/freetype/freetype.cpp 2023-08-31 10:14:34.000000000 +0200 @@ -66,7 +66,7 @@ using Contours = std::list<Contour>; - unsigned char nearerst_edge(const FT_Bitmap& glyph_bitmap, int c, int r, int delta) const; + unsigned char nearest_edge(const FT_Bitmap& glyph_bitmap, int c, int r, int delta) const; vsg::ref_ptr<vsg::Group> createOutlineGeometry(const Contours& contours) const; bool generateOutlines(FT_Outline& outline, Contours& contours) const; void checkForAndFixDegenerates(Contours& contours) const; @@ -157,13 +157,13 @@ { // std::cout<<"freetype::Implementation::init() failed."<<std::endl; return; - //throw vsg::Exception{"FreeType an error occurred during library initialization", error}; + //throw vsg::Exception{"FreeType error occurred during library initialization", error}; } // std::cout<<"freetype::Implementation() FT_Init_FreeType library = "<<_library<<std::endl; } -unsigned char freetype::Implementation::nearerst_edge(const FT_Bitmap& glyph_bitmap, int c, int r, int delta) const +unsigned char freetype::Implementation::nearest_edge(const FT_Bitmap& glyph_bitmap, int c, int r, int delta) const { unsigned char value = 0; if (c >= 0 && c < static_cast<int>(glyph_bitmap.width) && r >= 0 && r < static_cast<int>(glyph_bitmap.rows)) @@ -295,7 +295,7 @@ if (p0 == p1 && p1 == p2) { - // ignore degenate segment + // ignore degenerate segment //std::cout<<"conicTo error\n"; return 0; } @@ -329,7 +329,7 @@ if (p0 == p1 && p1 == p2 && p2 == p3) { - // ignore degenate segment + // ignore degenerate segment // std::cout<<"cubic Error\n"; return 0; } @@ -370,7 +370,7 @@ int error = FT_Outline_Decompose(&outline, &funcs, &in_contours); if (error != 0) { - std::cout << "Warning: could not decomposs outline." << error << std::endl; + std::cout << "Warning: could not decompose outline." << error << std::endl; return false; } @@ -418,7 +418,7 @@ if (clean_points.front() != clean_points.back()) { - // make sure the the contour is closed (last point equals first point.) + // make sure the contour is closed (last point equals first point.) clean_points.back() = clean_points.front(); } @@ -522,10 +522,10 @@ else if (between_or_equal(p0.x, v.x, p1.x)) { // segment wholly right of v - // need to intersection test + // need to do intersection test float r = (v.y - p0.y) / (p1.y - p0.y); - float x_itersection = p0.x + (p1.x - p0.x) * r; - if (x_itersection < v.x) ++numLeft; + float x_intersection = p0.x + (p1.x - p0.x) * r; + if (x_intersection < v.x) ++numLeft; } } } @@ -550,7 +550,7 @@ FT_Face face; FT_Long face_index = 0; - // Windows workaround for no wchar_t support in Freetype convert vsg::Path's std::wstring to UTF8 std::string + // Windows workaround for no wchar_t support in Freetype, convert vsg::Path's std::wstring to UTF8 std::string std::string filenameToUse_string = filenameToUse.string(); int error = FT_New_Face(_library, filenameToUse_string.c_str(), face_index, &face); if (error == FT_Err_Unknown_File_Format) @@ -717,9 +717,9 @@ double total_nearest_edge = 0.0; double total_outside_edge = 0.0; - auto glyphMetrics = vsg::GlyphMetricsArray::create(sortedGlyphQuads.size() + 1); + auto glyphMetrics = vsg::GlyphMetricsArray::create(static_cast<uint32_t>(sortedGlyphQuads.size() + 1)); auto charmap = vsg::uintArray::create(max_charcode + 1); - uint32_t destation_glyphindex = 0; + uint32_t destination_glyphindex = 0; // first entry of glyphMetrics should be a null entry vsg::GlyphMetrics null_metrics; @@ -732,7 +732,7 @@ null_metrics.vertBearingX = 0.0f; null_metrics.vertBearingY = 0.0f; null_metrics.vertAdvance = 0.0f; - glyphMetrics->set(destation_glyphindex++, null_metrics); + glyphMetrics->set(destination_glyphindex++, null_metrics); // initialize charmap to zeros. for (auto& c : *charmap) c = 0; @@ -770,7 +770,7 @@ } } - // fix any degernate segments + // fix any degenerate segments checkForAndFixDegenerates(contours); // font->setObject(vsg::make_string(glyphQuad.glyph_index), createOutlineGeometry(contours)); @@ -877,7 +877,7 @@ std::size_t index = atlas->index(xpos - delta, ypos + r); for (int c = -delta; c < static_cast<int>(bitmap.width + delta); ++c) { - atlas->at(index++) = nearerst_edge(bitmap, c, r, quad_margin); + atlas->at(index++) = nearest_edge(bitmap, c, r, quad_margin); } } } @@ -911,10 +911,10 @@ vsg_metrics.vertAdvance = (float(metrics.vertAdvance) * freetype_pixel_size_scale) / float(pixel_size); // assign the glyph metrics and charcode/glyph_index to the VSG glyphMetrics and charmap containers. - glyphMetrics->set(destation_glyphindex, vsg_metrics); - charmap->set(glyphQuad.charcode, destation_glyphindex); + glyphMetrics->set(destination_glyphindex, vsg_metrics); + charmap->set(glyphQuad.charcode, destination_glyphindex); - ++destation_glyphindex; + ++destination_glyphindex; unsigned int local_ytop = ypos + height + texel_margin; if (local_ytop > ytop) ytop = local_ytop; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vsgXchange-1.0.4/src/gdal/GDAL.cpp new/vsgXchange-1.0.5/src/gdal/GDAL.cpp --- old/vsgXchange-1.0.4/src/gdal/GDAL.cpp 2023-07-26 18:49:37.000000000 +0200 +++ new/vsgXchange-1.0.5/src/gdal/GDAL.cpp 2023-08-31 10:14:34.000000000 +0200 @@ -78,12 +78,12 @@ start_pos = extensions.find_first_not_of(" .", start_pos); if (start_pos == std::string::npos) break; - std::string::size_type deliminator_pos = extensions.find_first_of(" /", start_pos); - if (deliminator_pos != std::string::npos) + std::string::size_type delimiter_pos = extensions.find_first_of(" /", start_pos); + if (delimiter_pos != std::string::npos) { - ext = extensions.substr(start_pos, deliminator_pos - start_pos); + ext = extensions.substr(start_pos, delimiter_pos - start_pos); features.extensionFeatureMap[dotPrefix + ext] = rasterFeatureMask; - start_pos = deliminator_pos + 1; + start_pos = delimiter_pos + 1; if (start_pos == extensions.length()) break; } else @@ -170,7 +170,7 @@ bool mapRGBtoRGBAHint = !options || options->mapRGBtoRGBAHint; if (mapRGBtoRGBAHint && numComponents == 3) { - //std::cout<<"Reamppping RGB to RGBA "<<filename<<std::endl; + //std::cout<<"Remapping RGB to RGBA "<<filename<<std::endl; numComponents = 4; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vsgXchange-1.0.4/src/gdal/gdal_utils.cpp new/vsgXchange-1.0.5/src/gdal/gdal_utils.cpp --- old/vsgXchange-1.0.4/src/gdal/gdal_utils.cpp 2023-07-26 18:49:37.000000000 +0200 +++ new/vsgXchange-1.0.5/src/gdal/gdal_utils.cpp 2023-08-31 10:14:34.000000000 +0200 @@ -62,7 +62,7 @@ // if one of the pointers is NULL then they are incompatible if (!lhs_projectionRef || !rhs_projectionRef) return false; - // check in the OGRSpatialReference are the same + // check if the OGRSpatialReference are the same return (std::strcmp(lhs_projectionRef, rhs_projectionRef) == 0); } @@ -85,7 +85,7 @@ if (non_const_lhs.GetGeoTransform(lhs_GeoTransform) == CE_None) ++numberWithValidTransforms; if (non_const_rhs.GetGeoTransform(rhs_GeoTransform) == CE_None) ++numberWithValidTransforms; - // if neither have transform mark as compatible + // if neither have transforms mark as compatible if (numberWithValidTransforms == 0) return true; // only one has a transform so must be incompatible @@ -138,43 +138,43 @@ vsg::ref_ptr<vsg::Data> vsgXchange::createImage2D(int width, int height, int numComponents, GDALDataType dataType, vsg::dvec4 def) { - using TypeCompontents = std::pair<GDALDataType, int>; + using TypeComponents = std::pair<GDALDataType, int>; using CreateFunction = std::function<vsg::ref_ptr<vsg::Data>(uint32_t w, uint32_t h, vsg::dvec4 def)>; - std::map<TypeCompontents, CreateFunction> createMap; - createMap[TypeCompontents(GDT_Byte, 1)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::ubyteArray2D::create(w, h, default_value<uint8_t>(d[0]), vsg::Data::Properties{VK_FORMAT_R8_UNORM}); }; - createMap[TypeCompontents(GDT_UInt16, 1)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::ushortArray2D::create(w, h, default_value<uint16_t>(d[0]), vsg::Data::Properties{VK_FORMAT_R16_UNORM}); }; - createMap[TypeCompontents(GDT_Int16, 1)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::shortArray2D::create(w, h, default_value<int16_t>(d[0]), vsg::Data::Properties{VK_FORMAT_R16_SNORM}); }; - createMap[TypeCompontents(GDT_UInt32, 1)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::uintArray2D::create(w, h, default_value<uint32_t>(d[0]), vsg::Data::Properties{VK_FORMAT_R32_UINT}); }; - createMap[TypeCompontents(GDT_Int32, 1)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::intArray2D::create(w, h, default_value<int32_t>(d[0]), vsg::Data::Properties{VK_FORMAT_R32_SINT}); }; - createMap[TypeCompontents(GDT_Float32, 1)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::floatArray2D::create(w, h, default_value<float>(d[0]), vsg::Data::Properties{VK_FORMAT_R32_SFLOAT}); }; - createMap[TypeCompontents(GDT_Float64, 1)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::doubleArray2D::create(w, h, default_value<double>(d[0]), vsg::Data::Properties{VK_FORMAT_R64_SFLOAT}); }; - - createMap[TypeCompontents(GDT_Byte, 2)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::ubvec2Array2D::create(w, h, default_vec2<uint8_t>(d), vsg::Data::Properties{VK_FORMAT_R8G8_UNORM}); }; - createMap[TypeCompontents(GDT_UInt16, 2)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::usvec2Array2D::create(w, h, default_vec2<uint16_t>(d), vsg::Data::Properties{VK_FORMAT_R16G16_UNORM}); }; - createMap[TypeCompontents(GDT_Int16, 2)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::svec2Array2D::create(w, h, default_vec2<int16_t>(d), vsg::Data::Properties{VK_FORMAT_R16G16_SNORM}); }; - createMap[TypeCompontents(GDT_UInt32, 2)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::uivec2Array2D::create(w, h, default_vec2<uint32_t>(d), vsg::Data::Properties{VK_FORMAT_R32G32_UINT}); }; - createMap[TypeCompontents(GDT_Int32, 2)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::ivec2Array2D::create(w, h, default_vec2<int32_t>(d), vsg::Data::Properties{VK_FORMAT_R32G32_SINT}); }; - createMap[TypeCompontents(GDT_Float32, 2)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::vec2Array2D::create(w, h, default_vec2<float>(d), vsg::Data::Properties{VK_FORMAT_R32G32_SFLOAT}); }; - createMap[TypeCompontents(GDT_Float64, 2)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::dvec2Array2D::create(w, h, default_vec2<double>(d), vsg::Data::Properties{VK_FORMAT_R64G64_SFLOAT}); }; - - createMap[TypeCompontents(GDT_Byte, 3)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::ubvec3Array2D::create(w, h, default_vec3<uint8_t>(d), vsg::Data::Properties{VK_FORMAT_R8G8B8_UNORM}); }; - createMap[TypeCompontents(GDT_UInt16, 3)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::usvec3Array2D::create(w, h, default_vec3<uint16_t>(d), vsg::Data::Properties{VK_FORMAT_R16G16B16_UNORM}); }; - createMap[TypeCompontents(GDT_Int16, 3)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::svec3Array2D::create(w, h, default_vec3<int16_t>(d), vsg::Data::Properties{VK_FORMAT_R16G16B16_SNORM}); }; - createMap[TypeCompontents(GDT_UInt32, 3)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::uivec3Array2D::create(w, h, default_vec3<uint32_t>(d), vsg::Data::Properties{VK_FORMAT_R32G32B32_UINT}); }; - createMap[TypeCompontents(GDT_Int32, 3)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::ivec3Array2D::create(w, h, default_vec3<int32_t>(d), vsg::Data::Properties{VK_FORMAT_R32G32B32_SINT}); }; - createMap[TypeCompontents(GDT_Float32, 3)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::vec3Array2D::create(w, h, default_vec3<float>(d), vsg::Data::Properties{VK_FORMAT_R32G32B32_SFLOAT}); }; - createMap[TypeCompontents(GDT_Float64, 3)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::dvec3Array2D::create(w, h, default_vec3<double>(d), vsg::Data::Properties{VK_FORMAT_R64G64B64_SFLOAT}); }; - - createMap[TypeCompontents(GDT_Byte, 4)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::ubvec4Array2D::create(w, h, default_vec4<uint8_t>(d), vsg::Data::Properties{VK_FORMAT_R8G8B8A8_UNORM}); }; - createMap[TypeCompontents(GDT_UInt16, 4)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::usvec4Array2D::create(w, h, default_vec4<uint16_t>(d), vsg::Data::Properties{VK_FORMAT_R16G16B16A16_UNORM}); }; - createMap[TypeCompontents(GDT_Int16, 4)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::svec4Array2D::create(w, h, default_vec4<int16_t>(d), vsg::Data::Properties{VK_FORMAT_R16G16B16A16_SNORM}); }; - createMap[TypeCompontents(GDT_UInt32, 4)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::uivec4Array2D::create(w, h, default_vec4<uint32_t>(d), vsg::Data::Properties{VK_FORMAT_R32G32B32A32_UINT}); }; - createMap[TypeCompontents(GDT_Int32, 4)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::ivec4Array2D::create(w, h, default_vec4<int32_t>(d), vsg::Data::Properties{VK_FORMAT_R32G32B32A32_SINT}); }; - createMap[TypeCompontents(GDT_Float32, 4)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::vec4Array2D::create(w, h, default_vec4<float>(d), vsg::Data::Properties{VK_FORMAT_R32G32B32A32_SFLOAT}); }; - createMap[TypeCompontents(GDT_Float64, 4)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::dvec4Array2D::create(w, h, default_vec4<double>(d), vsg::Data::Properties{VK_FORMAT_R64G64B64A64_SFLOAT}); }; + std::map<TypeComponents, CreateFunction> createMap; + createMap[TypeComponents(GDT_Byte, 1)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::ubyteArray2D::create(w, h, default_value<uint8_t>(d[0]), vsg::Data::Properties{VK_FORMAT_R8_UNORM}); }; + createMap[TypeComponents(GDT_UInt16, 1)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::ushortArray2D::create(w, h, default_value<uint16_t>(d[0]), vsg::Data::Properties{VK_FORMAT_R16_UNORM}); }; + createMap[TypeComponents(GDT_Int16, 1)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::shortArray2D::create(w, h, default_value<int16_t>(d[0]), vsg::Data::Properties{VK_FORMAT_R16_SNORM}); }; + createMap[TypeComponents(GDT_UInt32, 1)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::uintArray2D::create(w, h, default_value<uint32_t>(d[0]), vsg::Data::Properties{VK_FORMAT_R32_UINT}); }; + createMap[TypeComponents(GDT_Int32, 1)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::intArray2D::create(w, h, default_value<int32_t>(d[0]), vsg::Data::Properties{VK_FORMAT_R32_SINT}); }; + createMap[TypeComponents(GDT_Float32, 1)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::floatArray2D::create(w, h, default_value<float>(d[0]), vsg::Data::Properties{VK_FORMAT_R32_SFLOAT}); }; + createMap[TypeComponents(GDT_Float64, 1)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::doubleArray2D::create(w, h, default_value<double>(d[0]), vsg::Data::Properties{VK_FORMAT_R64_SFLOAT}); }; + + createMap[TypeComponents(GDT_Byte, 2)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::ubvec2Array2D::create(w, h, default_vec2<uint8_t>(d), vsg::Data::Properties{VK_FORMAT_R8G8_UNORM}); }; + createMap[TypeComponents(GDT_UInt16, 2)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::usvec2Array2D::create(w, h, default_vec2<uint16_t>(d), vsg::Data::Properties{VK_FORMAT_R16G16_UNORM}); }; + createMap[TypeComponents(GDT_Int16, 2)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::svec2Array2D::create(w, h, default_vec2<int16_t>(d), vsg::Data::Properties{VK_FORMAT_R16G16_SNORM}); }; + createMap[TypeComponents(GDT_UInt32, 2)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::uivec2Array2D::create(w, h, default_vec2<uint32_t>(d), vsg::Data::Properties{VK_FORMAT_R32G32_UINT}); }; + createMap[TypeComponents(GDT_Int32, 2)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::ivec2Array2D::create(w, h, default_vec2<int32_t>(d), vsg::Data::Properties{VK_FORMAT_R32G32_SINT}); }; + createMap[TypeComponents(GDT_Float32, 2)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::vec2Array2D::create(w, h, default_vec2<float>(d), vsg::Data::Properties{VK_FORMAT_R32G32_SFLOAT}); }; + createMap[TypeComponents(GDT_Float64, 2)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::dvec2Array2D::create(w, h, default_vec2<double>(d), vsg::Data::Properties{VK_FORMAT_R64G64_SFLOAT}); }; + + createMap[TypeComponents(GDT_Byte, 3)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::ubvec3Array2D::create(w, h, default_vec3<uint8_t>(d), vsg::Data::Properties{VK_FORMAT_R8G8B8_UNORM}); }; + createMap[TypeComponents(GDT_UInt16, 3)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::usvec3Array2D::create(w, h, default_vec3<uint16_t>(d), vsg::Data::Properties{VK_FORMAT_R16G16B16_UNORM}); }; + createMap[TypeComponents(GDT_Int16, 3)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::svec3Array2D::create(w, h, default_vec3<int16_t>(d), vsg::Data::Properties{VK_FORMAT_R16G16B16_SNORM}); }; + createMap[TypeComponents(GDT_UInt32, 3)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::uivec3Array2D::create(w, h, default_vec3<uint32_t>(d), vsg::Data::Properties{VK_FORMAT_R32G32B32_UINT}); }; + createMap[TypeComponents(GDT_Int32, 3)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::ivec3Array2D::create(w, h, default_vec3<int32_t>(d), vsg::Data::Properties{VK_FORMAT_R32G32B32_SINT}); }; + createMap[TypeComponents(GDT_Float32, 3)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::vec3Array2D::create(w, h, default_vec3<float>(d), vsg::Data::Properties{VK_FORMAT_R32G32B32_SFLOAT}); }; + createMap[TypeComponents(GDT_Float64, 3)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::dvec3Array2D::create(w, h, default_vec3<double>(d), vsg::Data::Properties{VK_FORMAT_R64G64B64_SFLOAT}); }; + + createMap[TypeComponents(GDT_Byte, 4)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::ubvec4Array2D::create(w, h, default_vec4<uint8_t>(d), vsg::Data::Properties{VK_FORMAT_R8G8B8A8_UNORM}); }; + createMap[TypeComponents(GDT_UInt16, 4)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::usvec4Array2D::create(w, h, default_vec4<uint16_t>(d), vsg::Data::Properties{VK_FORMAT_R16G16B16A16_UNORM}); }; + createMap[TypeComponents(GDT_Int16, 4)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::svec4Array2D::create(w, h, default_vec4<int16_t>(d), vsg::Data::Properties{VK_FORMAT_R16G16B16A16_SNORM}); }; + createMap[TypeComponents(GDT_UInt32, 4)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::uivec4Array2D::create(w, h, default_vec4<uint32_t>(d), vsg::Data::Properties{VK_FORMAT_R32G32B32A32_UINT}); }; + createMap[TypeComponents(GDT_Int32, 4)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::ivec4Array2D::create(w, h, default_vec4<int32_t>(d), vsg::Data::Properties{VK_FORMAT_R32G32B32A32_SINT}); }; + createMap[TypeComponents(GDT_Float32, 4)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::vec4Array2D::create(w, h, default_vec4<float>(d), vsg::Data::Properties{VK_FORMAT_R32G32B32A32_SFLOAT}); }; + createMap[TypeComponents(GDT_Float64, 4)] = [](uint32_t w, uint32_t h, vsg::dvec4 d) { return vsg::dvec4Array2D::create(w, h, default_vec4<double>(d), vsg::Data::Properties{VK_FORMAT_R64G64B64A64_SFLOAT}); }; - auto itr = createMap.find(TypeCompontents(dataType, numComponents)); + auto itr = createMap.find(TypeComponents(dataType, numComponents)); if (itr == createMap.end()) { return {}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vsgXchange-1.0.4/src/gdal/meta_utils.cpp new/vsgXchange-1.0.5/src/gdal/meta_utils.cpp --- old/vsgXchange-1.0.4/src/gdal/meta_utils.cpp 2023-07-26 18:49:37.000000000 +0200 +++ new/vsgXchange-1.0.5/src/gdal/meta_utils.cpp 2023-08-31 10:14:34.000000000 +0200 @@ -90,7 +90,7 @@ str.clear(); str.str(value_str); str >> vsgXchange::dms_in_brackets(latitude); - vsg::info("vsgGA::getEXIF_.. EXIF_GPSLatitude = ", value_str, " degrees = ", latitude); + vsg::info("vsgXchange::getEXIF_.. EXIF_GPSLatitude = ", value_str, " degrees = ", latitude); success = true; } if (object.getValue("EXIF_GPSLongitude", value_str)) @@ -98,7 +98,7 @@ str.clear(); str.str(value_str); str >> vsgXchange::dms_in_brackets(longitude); - vsg::info("vsgGA::getEXIF_.. EXIF_GPSLongitude = ", value_str, " degrees = ", longitude); + vsg::info("vsgXchange::getEXIF_.. EXIF_GPSLongitude = ", value_str, " degrees = ", longitude); success = true; } if (object.getValue("EXIF_GPSAltitude", value_str)) @@ -106,7 +106,7 @@ str.clear(); str.str(value_str); str >> vsgXchange::in_brackets(altitude); - vsg::info("vsgGA::getEXIF_.. EXIF_GPSAltitude = ", value_str, " altitude = ", altitude); + vsg::info("vsgXchange::getEXIF_.. EXIF_GPSAltitude = ", value_str, " altitude = ", altitude); success = true; } return success; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vsgXchange-1.0.4/src/ktx/ktx.cpp new/vsgXchange-1.0.5/src/ktx/ktx.cpp --- old/vsgXchange-1.0.4/src/ktx/ktx.cpp 2023-07-26 18:49:37.000000000 +0200 +++ new/vsgXchange-1.0.5/src/ktx/ktx.cpp 2023-08-31 10:14:34.000000000 +0200 @@ -102,7 +102,7 @@ textureSize *= (texture->numLayers * texture->numFaces); } - // copy the data and repack into ordered assumed by VSG + // copy the data and repack into ordering assumed by VSG uint8_t* copiedData = static_cast<uint8_t*>(vsg::allocate(textureSize, vsg::ALLOCATOR_AFFINITY_DATA)); size_t offset = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vsgXchange-1.0.4/src/stbi/stbi.cpp new/vsgXchange-1.0.5/src/stbi/stbi.cpp --- old/vsgXchange-1.0.4/src/stbi/stbi.cpp 2023-07-26 18:49:37.000000000 +0200 +++ new/vsgXchange-1.0.5/src/stbi/stbi.cpp 2023-08-31 10:14:34.000000000 +0200 @@ -77,7 +77,7 @@ reinterpret_cast<std::ostream*>(context)->write(reinterpret_cast<const char*>(data), size); } -// if the data is in BGR or BGRA form create a copy that is reformated into RGB or RGBA redpectively +// if the data is in BGR or BGRA form create a copy that is reformated into RGB or RGBA respectively static std::pair<int, vsg::ref_ptr<const vsg::Data>> reformatForWriting(const vsg::Data* data, const vsg::Path& filename) { int num_components = 0; @@ -284,7 +284,7 @@ if (num_components==0) return false; if (local_data) data = local_data.get(); - // convert utf8 std::string; + // convert to utf8 std::string std::string filename_str = filename.string(); int result = 0; if (ext == ".png")