Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Reduced warnings. | 865f2c52ed60c37c050a1033905bb2df278032a0 | Jackalope | 2020-05-27 15:03:07 |
Make "find_package(jlib 0.2.0 REQUIRED)" optional | 58bfc04890fab24adf5fc84963cb1a3bca7a8706 | Jackalope | 2020-05-24 16:39:14 |
changed notice about native compilation | 0ed7e9e5e72a2d13e8add619f7999a51634f8e9c | Jackalope | 2020-05-24 16:37:54 |
Version 0.2.1 | 02d30aa69e9026a3f96d8549a297fccfbefbda47 | Jackalope | 2020-05-24 14:31:31 |
Why there is Doxyfile? | 16cf9fe9e64353a2a717668cc4083465e2f8dff5 | Jackalope | 2020-05-24 14:25:20 |
Add license notice to CMakeLists.txt | db2e7f018714cd2643c7928a8cce966d3da25059 | Jackalope | 2020-05-24 14:23:39 |
Make zip functionality optional | 8e4409ba503637e5981f98c4df39ff4d649351de | Jackalope | 2020-05-24 14:23:18 |
remove LTO option | 9b39746de0abc22a2ae8d2ce8c2db253dd9ad71a | Jackalope | 2020-05-24 13:41:20 |
more lost changes | c52ad1ddc9fe753cb2ec6f388e4a88f9dfb0fadf | Jackalope | 2020-05-24 13:30:51 |
added lost changes | 1e60b3d0d8ecda7995f3a102257d8f3c0ca4b15e | Jackalope | 2020-05-24 13:27:42 |
CMake installation target | 57ba69a5bc17124a96b401c20e68f1602345c4f7 | Jackalope | 2020-05-24 13:22:15 |
Moved read,write functions to read.h,write.h, merged vertices,indices and mesh files to mesh.h | 365bcb01b01e95448e223de82e9f9e96b51fa789 | Jackalope | 2020-05-24 13:21:23 |
Update for new JLIB target | a1152ffa6340863fbbd216a4d38806e2d31d3dd5 | Jackalope | 2020-05-23 23:27:05 |
added CMake project PARENT_SCOPE variables JRF_* | 5ac8009d6709f681fbe0d59dba8cdd646a3cdc47 | Jackalope | 2020-05-20 19:06:51 |
added version number definitions, changed magic number (because incompatible) | 46ccce5359274d660b327c667903b9534dc3bfe0 | Jackalope | 2020-05-19 17:39:57 |
Changed image formats, BGR->RGB convertion while reading from TARGA | 297dd913b6084e890e5bd3d53f88d06a8f14657a | Jackalope | 2020-05-19 17:17:53 |
Changed cmake library interface | 9c704c515769a03e5b1f82dcb1fd947884f1bd1e | Jackalope | 2020-05-12 06:58:47 |
added copyright notice to convert.cpp and convert.h | a778f4f4a4783656fefac85440e135ddcda3788c | Jackalope | 2020-05-12 05:18:35 |
fixes after prev commit changes | fc46b4bacf1c69f6eae0c679b26e3b88d1796217 | Jackalope | 2020-05-11 08:14:50 |
convert image from tga and add alpha channel functions | 4541972149b6b19afda05c608d4abe88a72098bb | Jackalope | 2020-05-11 07:49:43 |
File | Lines added | Lines deleted |
---|---|---|
include/jrf/image.h | 10 | 6 |
include/jrf/zip.h | 4 | 2 |
File include/jrf/image.h changed (mode: 100644) (index f334468..2bf48f8) | |||
... | ... | struct jrf::Image | |
33 | 33 | }; | }; |
34 | 34 | constexpr static const uint16_t DEPTH_LIMIT = uint16_t(~0u); | constexpr static const uint16_t DEPTH_LIMIT = uint16_t(~0u); |
35 | 35 | struct Extent { | struct Extent { |
36 | [[nodiscard]] uint64_t pixel_count() { | ||
36 | [[nodiscard]] uint64_t | ||
37 | pixel_count() { | ||
37 | 38 | return width * height * depth; | return width * height * depth; |
38 | 39 | } | } |
39 | [[nodiscard]] uint64_t size() { | ||
40 | [[nodiscard]] uint64_t | ||
41 | size() { | ||
40 | 42 | return pixel_count() * pixelSize; | return pixel_count() * pixelSize; |
41 | 43 | } | } |
42 | 44 | uint16_t width; | uint16_t width; |
... | ... | struct jrf::Image | |
44 | 46 | uint16_t depth; | uint16_t depth; |
45 | 47 | uint16_t pixelSize; | uint16_t pixelSize; |
46 | 48 | }; | }; |
47 | [[nodiscard]] bool init(Extent extent, Format format) { | ||
48 | this->extent = extent; | ||
49 | [[nodiscard]] bool | ||
50 | init(Extent extent_in, Format format_in) { | ||
51 | this->extent = extent_in; | ||
49 | 52 | this->size = extent.size(); | this->size = extent.size(); |
50 | this->format = format; | ||
53 | this->format = format_in; | ||
51 | 54 | return jl::allocate_bytes(&p_pixels, size); | return jl::allocate_bytes(&p_pixels, size); |
52 | 55 | } | } |
53 | void destroy() { | ||
56 | void | ||
57 | destroy() { | ||
54 | 58 | jl::deallocate(&p_pixels); | jl::deallocate(&p_pixels); |
55 | 59 | } | } |
56 | 60 | uint8_t *p_pixels; | uint8_t *p_pixels; |
File include/jrf/zip.h changed (mode: 100644) (index 527a311..63e9171) | |||
... | ... | struct ZipArchive { | |
312 | 312 | [[nodiscard]] ZipResult open(const char *path, OpenMask flags) { | [[nodiscard]] ZipResult open(const char *path, OpenMask flags) { |
313 | 313 | ZipResult res; | ZipResult res; |
314 | 314 | p = zip_open(path, flags, zip_result_ptr(&res)); | p = zip_open(path, flags, zip_result_ptr(&res)); |
315 | if (p != nullptr) | ||
316 | res = ZipResult::SUCCESS, p_error_info = zip_get_error(p); | ||
315 | if (p != nullptr) { | ||
316 | res = ZipResult::SUCCESS; | ||
317 | p_error_info = zip_get_error(p); | ||
318 | } | ||
317 | 319 | return res; | return res; |
318 | 320 | } | } |
319 | 321 | [[nodiscard]] ZipResult open(const char *path) { | [[nodiscard]] ZipResult open(const char *path) { |