Path Tracer
Functions
spb Namespace Reference

Functions

bool check_file_identifier (char headerInfo[HEADER_SIZE])
 
void get_header (std::ifstream &file, char headerInfo[HEADER_SIZE])
 
void get_sub (unsigned int &start, char arr[4], char headerInfo[HEADER_SIZE])
 
void get_sub_ui (unsigned int &start, uint32_t &val, char headerInfo[HEADER_SIZE])
 
void get_sub_f (unsigned int &start, float &val, char headerInfo[HEADER_SIZE])
 
void parseFileHeader (char headerInfo[HEADER_SIZE], uint32_t &width, uint32_t &height, uint32_t &nb_channels, float &first_wavelength, float &wavelength_resolution, float &last_wavelength)
 
void getImageData (std::ifstream &file, float *data, const uint32_t &width, const uint32_t &height, const uint32_t &nb_channels)
 
void read_header (const char *fpath, uint32_t &width, uint32_t &height, uint32_t &nb_channels, float &first_wavelength, float &wavelength_resolution, float &last_wavelength)
 
void read_file (const char *fpath, const uint32_t &width, const uint32_t &height, const uint32_t &nb_channels, float *data)
 
void put_header (char hinfo[HEADER_SIZE], uint32_t &start_pos, const char *put_arr, uint32_t size)
 
bool isLittleEndian ()
 
void convert_uint_to_bytes_little (uint32_t t, char bytes[4])
 
void convert_uint_to_bytes_big (uint32_t t, char bytes[4])
 
void convert_float_to_bytes_little (float t, char bytes[4])
 
void convert_float_to_bytes_big (float t, char bytes[4])
 
void write_header (char headerInfo[HEADER_SIZE], uint32_t width, uint32_t height, uint32_t nb_channels, float first_wavelength, float wavelength_resolution, float last_wavelength)
 
void write_data (char *spb_data, uint32_t imsize, float *data)
 
void write_file (const char *path, uint32_t width, uint32_t height, uint32_t nb_channels, float first_wavelength, float wavelength_resolution, float last_wavelength, float *data)
 

Detailed Description

MIT License

Copyright (c) 2020 D.Kaan Eraslan & Qm Auber

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Function Documentation

◆ check_file_identifier()

bool spb::check_file_identifier ( char  headerInfo[HEADER_SIZE])

Check if file header is "SPB"