Many changes just look at the new documentation and such

This commit is contained in:
Andrew Haynes
2026-08-31 22:18:42 -04:00
parent 5367c71c34
commit 854f5c2ba6
7 changed files with 139 additions and 47 deletions
+5 -4
View File
@@ -65,7 +65,7 @@ ppm_load(const char* file, PPM* m_attr)
}
int
ppm_save(const unsigned int* buf, const PPM img)
ppm_save(const unsigned int* buf, const PPM img, char* name)
{
if (!buf)
{
@@ -82,12 +82,12 @@ ppm_save(const unsigned int* buf, const PPM img)
if (img.fmt == '3')
{
fptr = fopen(img.name, "w");
fptr = fopen(name, "w");
}
if (img.fmt == '6')
{
fptr = fopen(img.name, "wb");
fptr = fopen(name, "wb");
}
if (!fptr)
@@ -125,6 +125,7 @@ ppm_save(const unsigned int* buf, const PPM img)
fclose(fptr);
free(dst_buf);
printf("Encode Done!\n");
printf("Image: %s is saved.\n", name);
return 1;
}
@@ -209,7 +210,7 @@ transcode_to_ppm(JPEG* input, PPM* out)
out->width = input->width;
out->height = input->height;
out->len = out->width * out->height;
ppm_save(dst, *out);
ppm_save(dst, *out, out->name);
free(dst);
}