{"id":23429987,"url":"https://github.com/parkertomatoes/lttb-cpp","last_synced_at":"2025-06-13T11:09:14.447Z","repository":{"id":76133302,"uuid":"226151984","full_name":"parkertomatoes/lttb-cpp","owner":"parkertomatoes","description":"C++ implementation of the Largest Triangle Three Buckets (LTTB) downsampling algorithm","archived":false,"fork":false,"pushed_at":"2024-09-11T03:01:33.000Z","size":105,"stargazers_count":35,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-12T21:38:05.784Z","etag":null,"topics":["cpp","downsample","lttb"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parkertomatoes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-12-05T17:12:24.000Z","updated_at":"2025-02-10T18:26:10.000Z","dependencies_parsed_at":"2023-11-19T16:25:39.745Z","dependency_job_id":"6dab73dc-c0e1-424f-875d-a19660efaab1","html_url":"https://github.com/parkertomatoes/lttb-cpp","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/parkertomatoes/lttb-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parkertomatoes%2Flttb-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parkertomatoes%2Flttb-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parkertomatoes%2Flttb-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parkertomatoes%2Flttb-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parkertomatoes","download_url":"https://codeload.github.com/parkertomatoes/lttb-cpp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parkertomatoes%2Flttb-cpp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259634382,"owners_count":22887700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","downsample","lttb"],"created_at":"2024-12-23T08:13:58.198Z","updated_at":"2025-06-13T11:09:14.412Z","avatar_url":"https://github.com/parkertomatoes.png","language":"C++","readme":"# C++ Implementation of the Largest Triangle Three Buckets (LTTB) Downsampling Algorithm\n\nThis is a straightforward C++ port of the [reference implementation](https://github.com/sveinn-steinarsson/flot-downsample) of the Largest Triangle Three Buckets (LTTB) downsampling algorithm described in the paper [\"Downsampling time series for visual representation\" by Sveinn Steinarsson](http://hdl.handle.net/1946/15343). It is a single header, with a single class template that allows using different structures and data types.\n\n## How To Install\nSimply add the ```lttb.hpp``` header to your project. There are no binaries to install, and no dependencies outside the standard library.\n\n## How To Use\nCreate a typedef to specify your time series datapoint type\n```c++\n#include \"lttb.hpp\"\n\nstruct ExamplePoint {\n    float x;\n    float y;\n};\n\nusing PointLttb = LargestTriangleThreeBuckets\u003cExamplePoint, float, \u0026ExamplePoint::x, \u0026ExamplePoint::y\u003e\n```\n\nThen use the static method ```Downsample``` in the class. It can be used with iterators\n```c++\nstd::vector\u003cExamplePoint\u003e in = GetYourInputsFromSomewhere();\nstd::vector\u003cExamplePoint\u003e out;\nPointLttb::Downsample(in.begin(), in.size(), std::back_inserter(out), 50);\n```\n\n...or pointers:\n```c++\nExamplePoint in[500];\nGetYourInputsFromSomewhere(in);\nExamplePoint out[50];\nPointLttb::Downsample(in, 500, out, 50);\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparkertomatoes%2Flttb-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparkertomatoes%2Flttb-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparkertomatoes%2Flttb-cpp/lists"}