DOCS: Corrected comments to match new parameters. CHORE: Moved some variable definition to top of function call.
71 lines
1.8 KiB
C
71 lines
1.8 KiB
C
#ifndef IMGIO_H
|
|
#define IMGIO_H
|
|
|
|
#include "utils.h"
|
|
|
|
/**
|
|
* @brief Open and Fill buffer from .ppm file
|
|
* @param [in] filename Location of the image to be modified
|
|
* @param [in,out] metadata PPM pointer to store image information
|
|
*/
|
|
unsigned int*
|
|
read_ppm(const char* filename, PPM* metadata);
|
|
|
|
/**
|
|
* @brief Open and write buffer to file
|
|
* @param [in] buffer Information of pixels
|
|
* @param [in] metadata PPM pointer to store image information
|
|
* @param [in] filename Name/Location for file
|
|
*/
|
|
int
|
|
write_ppm(const unsigned int* buffer, const PPM metadata, const char* filename);
|
|
|
|
/**
|
|
* @brief Open and Fill buffer from .jpg file
|
|
* @details Opens a .jpg file, creates a new buffer and extracts the pixels into
|
|
* said buffer as integers.
|
|
* @param [in,out] metadata JPEG pointer to store image information
|
|
*/
|
|
unsigned int*
|
|
read_jpeg(JPEG* metadata);
|
|
|
|
/**
|
|
* @brief Open and write buffer to file
|
|
* @param [in] buf Information of pixels
|
|
* @param [in] metadata JPEG pointer to store image information
|
|
* @param [in] filename Name/Location for file
|
|
*/
|
|
int
|
|
write_jpeg(const unsigned int* buf, const JPEG* metadata, const char* filename);
|
|
|
|
/**
|
|
* @brief Converts PPM to JPEG
|
|
* @param [in] location points to file to use
|
|
*/
|
|
void
|
|
transcode_to_jpeg(const char* location);
|
|
|
|
/**
|
|
* @brief Converts JPEG to PPM
|
|
* @param [in] location Pointer to JPEG container
|
|
*/
|
|
void
|
|
transcode_to_ppm(const char* location);
|
|
|
|
/**
|
|
* @brief Inherits the attributes from JPEG container
|
|
* @param [in] metadata Pointer to JPEG container
|
|
* @param [in] fmt Character for type of PPM image, binary or raw
|
|
*/
|
|
PPM
|
|
inherit_from_jpeg(const JPEG* metadata, const char fmt);
|
|
|
|
/**
|
|
* @brief Inherits the attributes from PPM container
|
|
* @param [in] metadata Pointer to PPM container
|
|
*/
|
|
JPEG
|
|
inherit_from_ppm(const PPM* metadata);
|
|
|
|
#endif
|