Print attributes for ppm
This commit is contained in:
+10
@@ -1,4 +1,5 @@
|
||||
#include "image/utils.h"
|
||||
#include <stdio.h>
|
||||
|
||||
unsigned long
|
||||
u32to_u64(const unsigned int clr)
|
||||
@@ -21,3 +22,12 @@ u64to_u32(const unsigned long clr, const unsigned long u64_div)
|
||||
return ENCODE_ARGB((a / u64_div), (r / u64_div), (g / u64_div),
|
||||
(b / u64_div));
|
||||
}
|
||||
|
||||
// Utilizing new knowledge below
|
||||
|
||||
void
|
||||
__attribute__((overloadable))
|
||||
print_attr(const PPM *src) {
|
||||
printf("Name: %s\nFMT: %c\nWidth: %i, Height: %i\nLength: %i",
|
||||
src->name, src->fmt, src->width, src->height, src->len);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user