Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mcraiha/libktxsharp
Managed C# library for handling KTX File Format
https://github.com/mcraiha/libktxsharp
csharp ktx lib
Last synced: 4 days ago
JSON representation
Managed C# library for handling KTX File Format
- Host: GitHub
- URL: https://github.com/mcraiha/libktxsharp
- Owner: mcraiha
- License: unlicense
- Created: 2018-05-30T17:23:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-12-10T19:03:37.000Z (12 days ago)
- Last Synced: 2024-12-14T01:23:59.861Z (8 days ago)
- Topics: csharp, ktx, lib
- Language: C#
- Homepage:
- Size: 140 KB
- Stars: 9
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# libktxsharp
C# library for handling [KTX File Format](https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/). Only Version 1 is supported, so Version 2 is **NOT** supported.
## Build status
![](https://github.com/mcraiha/libktxsharp/workflows/CIBuild/badge.svg)
## Nuget
[https://www.nuget.org/packages/LibKTX/](https://www.nuget.org/packages/LibKTX/)
## Why
Because KTX specs are public and I need something like this for my upcoming projects
## How to use
1. Get nuget, build .dll or include [lib folder](lib) in your project
2. Use following code example
```csharp
using KtxSharp;byte[] ktxBytes = File.ReadAllBytes("myImage.ktx");
KtxStructure ktxStructure = null;
using (MemoryStream ms = new MemoryStream(ktxBytes))
{
ktxStructure = KtxLoader.LoadInput(ms);
}Console.WriteLine(ktxStructure.header.pixelWidth);
```## How do I build this
### Requirements
Dotnet core 2.0 (or newer) environment
### Build .dll
Move to lib folder and run
```bash
dotnet build
```### Build nuget
Move to lib folder and run
```bash
dotnet pack -o out --configuration Release --include-source --include-symbols
```## Testing
### Requirements
* nunit
* NUnit3TestAdapter
* Microsoft.NET.Test.SdkAll requirements are restored when you run
```bash
dotnet restore
```### Run tests
Just call
```bash
dotnet test
```## What is in
* Basic KTX read functionality
* Some test cases## What is partially in
* KTX write support
## What is missing
* More files for testing
* Benchmarks## License
All code is released under *"Do whatever you want"* license aka [Unlicense](LICENSE)