Changeset 7e38970d in mainline for uspace/lib/gfximage/src/tga_gz.c
- Timestamp:
- 2020-12-07T00:08:37Z (3 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 25f26600
- Parents:
- 7a873f0 (diff), 8596474 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gfximage/src/tga_gz.c
r7a873f0 r7e38970d 37 37 #include <gzip.h> 38 38 #include <stdlib.h> 39 #include <draw/codec.h> 39 #include <gfximage/tga.h> 40 #include <gfximage/tga_gz.h> 40 41 41 42 /** Decode gzipped Truevision TGA format 42 43 * 43 * Decode gzipped Truevision TGA format and create a surface44 * Decode gzipped Truevision TGA format and create a bitmap 44 45 * from it. The supported variants of TGA are limited those 45 46 * supported by decode_tga(). 46 47 * 47 * @param[in] data Memory representation of gzipped TGA. 48 * @param[in] size Size of the representation (in bytes). 49 * @param[in] flags Surface creation flags. 48 * @param gc Graphic context 49 * @param data Memory representation of gzipped TGA. 50 * @param size Size of the representation (in bytes). 51 * @param rbitmap Place to store pointer to new bitmap 52 * @param rrect Place to store bitmap rectangle 50 53 * 51 * @return Newly allocated surface with the decoded content. 52 * @return NULL on error or unsupported format. 53 * 54 * @return EOK un success or an error code 54 55 */ 55 surface_t *decode_tga_gz(void *data, size_t size, surface_flags_t flags) 56 errno_t decode_tga_gz(gfx_context_t *gc, void *data, size_t size, 57 gfx_bitmap_t **rbitmap, gfx_rect_t *rrect) 56 58 { 57 59 void *data_expanded; 58 60 size_t size_expanded; 61 errno_t rc; 59 62 60 errno_t ret= gzip_expand(data, size, &data_expanded, &size_expanded);61 if (r et!= EOK)62 return NULL;63 rc = gzip_expand(data, size, &data_expanded, &size_expanded); 64 if (rc != EOK) 65 return rc; 63 66 64 surface_t *surface = decode_tga(data_expanded, size_expanded, flags); 65 67 rc = decode_tga(gc, data_expanded, size_expanded, rbitmap, rrect); 66 68 free(data_expanded); 67 return surface; 68 } 69 70 /** Encode gzipped Truevision TGA format 71 * 72 * Encode gzipped Truevision TGA format into an array. 73 * 74 * @param[in] surface Surface to be encoded into gzipped TGA. 75 * @param[out] pdata Pointer to the resulting array. 76 * @param[out] psize Pointer to the size of the resulting array. 77 * 78 * @return True on succesful encoding. 79 * @return False on failure. 80 * 81 */ 82 bool encode_tga_gz(surface_t *surface, void **pdata, size_t *psize) 83 { 84 // TODO 85 return false; 69 return rc; 86 70 } 87 71
Note:
See TracChangeset
for help on using the changeset viewer.