uberlambda / libktx-rs Goto Github PK
View Code? Open in Web Editor NEWReading, writing, transcoding Khronos Textures in Rust. Bindings to KhronosGroup/KTX-Software.
License: Apache License 2.0
Reading, writing, transcoding Khronos Textures in Rust. Bindings to KhronosGroup/KTX-Software.
License: Apache License 2.0
Thanks for making these crates, super useful stuff!
While building the library by recursively cloning the repo as said in the README works fine, I'm getting the following build script error when adding libktx-rs = "*"
to my Cargo.toml dependency list:
--- stderr
CMake Warning at cmake/version.cmake:151 (message):
Error retrieving version from GIT tag. Falling back to 0.0.0-noversion
Call Stack (most recent call first):
CMakeLists.txt:10 (include)
CMake Error at CMakeLists.txt:200 (add_library):
Cannot find source file:
lib/internalexport.def
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
.hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc
CMake Error at CMakeLists.txt:200 (add_library):
No SOURCES given to target: ktx_read
CMake Error at CMakeLists.txt:195 (add_library):
No SOURCES given to target: ktx
CMake Generate step failed. Build files cannot be regenerated correctly.
thread 'main' panicked at '
command did not execute successfully, got: exit code: 1
I think it would be nice to have methods on Texture
like is_array
, base_width
etc. for the fields in the underlying ktxTexture.
Is it possible to access specific layers of a (2d) texture array?
The method iterate_levels
iterates over mip levels and cube map faces, but not over array layers. I guess the data for all layers is included in pixel_data
?
I'm trying to parse this ktx file using this code:
unsafe fn libktx_rs() {
let data = std::fs::read("uffizi_rgba16f_cube.ktx").unwrap();
let mut result = zeroed();
dbg!(ktxTexture2_CreateFromMemory(
data.as_ptr(),
data.len(),
ktxTextureCreateFlagBits_KTX_TEXTURE_CREATE_NO_FLAGS,
&mut result
));
let result = &*result;
dbg!(result.numFaces);
dbg!(result.numLayers);
dbg!(result.numLevels);
}
But the call to createfrommemory returns error code 15. C++ code that uses libktx directly works fine:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.