From 62539278e10d106f52b9a05134ef3e8267b22a02 Mon Sep 17 00:00:00 2001 From: Rich Geldreich Date: Thu, 17 Dec 2020 13:57:57 -0500 Subject: [PATCH] Moving encoder-related files to the "encoder" directory --- apg_bmp.h | 123 ------------------ apg_bmp.c => encoder/apg_bmp.c | 0 .../basisu_astc_decomp.cpp | 0 .../basisu_astc_decomp.h | 0 .../basisu_backend.cpp | 0 basisu_backend.h => encoder/basisu_backend.h | 0 .../basisu_basis_file.cpp | 0 .../basisu_basis_file.h | 0 .../basisu_bc7enc.cpp | 0 basisu_bc7enc.h => encoder/basisu_bc7enc.h | 0 basisu_comp.cpp => encoder/basisu_comp.cpp | 0 basisu_comp.h => encoder/basisu_comp.h | 0 basisu_enc.cpp => encoder/basisu_enc.cpp | 0 basisu_enc.h => encoder/basisu_enc.h | 0 basisu_etc.cpp => encoder/basisu_etc.cpp | 0 basisu_etc.h => encoder/basisu_etc.h | 0 .../basisu_frontend.cpp | 0 .../basisu_frontend.h | 0 ...basisu_global_selector_palette_helpers.cpp | 0 .../basisu_global_selector_palette_helpers.h | 0 .../basisu_gpu_texture.cpp | 0 .../basisu_gpu_texture.h | 0 basisu_miniz.h => encoder/basisu_miniz.h | 0 .../basisu_pvrtc1_4.cpp | 0 .../basisu_pvrtc1_4.h | 0 .../basisu_resample_filters.cpp | 0 .../basisu_resampler.cpp | 0 .../basisu_resampler.h | 0 .../basisu_resampler_filters.h | 0 basisu_ssim.cpp => encoder/basisu_ssim.cpp | 0 basisu_ssim.h => encoder/basisu_ssim.h | 0 .../basisu_uastc_enc.cpp | 0 .../basisu_uastc_enc.h | 0 jpgd.cpp => encoder/jpgd.cpp | 0 jpgd.h => encoder/jpgd.h | 0 lodepng.cpp => encoder/lodepng.cpp | 0 lodepng.h => encoder/lodepng.h | 0 37 files changed, 123 deletions(-) delete mode 100644 apg_bmp.h rename apg_bmp.c => encoder/apg_bmp.c (100%) rename basisu_astc_decomp.cpp => encoder/basisu_astc_decomp.cpp (100%) rename basisu_astc_decomp.h => encoder/basisu_astc_decomp.h (100%) rename basisu_backend.cpp => encoder/basisu_backend.cpp (100%) rename basisu_backend.h => encoder/basisu_backend.h (100%) rename basisu_basis_file.cpp => encoder/basisu_basis_file.cpp (100%) rename basisu_basis_file.h => encoder/basisu_basis_file.h (100%) rename basisu_bc7enc.cpp => encoder/basisu_bc7enc.cpp (100%) rename basisu_bc7enc.h => encoder/basisu_bc7enc.h (100%) rename basisu_comp.cpp => encoder/basisu_comp.cpp (100%) rename basisu_comp.h => encoder/basisu_comp.h (100%) rename basisu_enc.cpp => encoder/basisu_enc.cpp (100%) rename basisu_enc.h => encoder/basisu_enc.h (100%) rename basisu_etc.cpp => encoder/basisu_etc.cpp (100%) rename basisu_etc.h => encoder/basisu_etc.h (100%) rename basisu_frontend.cpp => encoder/basisu_frontend.cpp (100%) rename basisu_frontend.h => encoder/basisu_frontend.h (100%) rename basisu_global_selector_palette_helpers.cpp => encoder/basisu_global_selector_palette_helpers.cpp (100%) rename basisu_global_selector_palette_helpers.h => encoder/basisu_global_selector_palette_helpers.h (100%) rename basisu_gpu_texture.cpp => encoder/basisu_gpu_texture.cpp (100%) rename basisu_gpu_texture.h => encoder/basisu_gpu_texture.h (100%) rename basisu_miniz.h => encoder/basisu_miniz.h (100%) rename basisu_pvrtc1_4.cpp => encoder/basisu_pvrtc1_4.cpp (100%) rename basisu_pvrtc1_4.h => encoder/basisu_pvrtc1_4.h (100%) rename basisu_resample_filters.cpp => encoder/basisu_resample_filters.cpp (100%) rename basisu_resampler.cpp => encoder/basisu_resampler.cpp (100%) rename basisu_resampler.h => encoder/basisu_resampler.h (100%) rename basisu_resampler_filters.h => encoder/basisu_resampler_filters.h (100%) rename basisu_ssim.cpp => encoder/basisu_ssim.cpp (100%) rename basisu_ssim.h => encoder/basisu_ssim.h (100%) rename basisu_uastc_enc.cpp => encoder/basisu_uastc_enc.cpp (100%) rename basisu_uastc_enc.h => encoder/basisu_uastc_enc.h (100%) rename jpgd.cpp => encoder/jpgd.cpp (100%) rename jpgd.h => encoder/jpgd.h (100%) rename lodepng.cpp => encoder/lodepng.cpp (100%) rename lodepng.h => encoder/lodepng.h (100%) diff --git a/apg_bmp.h b/apg_bmp.h deleted file mode 100644 index 8cd73b6..0000000 --- a/apg_bmp.h +++ /dev/null @@ -1,123 +0,0 @@ -/* -BMP File Reader/Writer Implementation -Anton Gerdelan -Version: 3.1 18 March 2020. -Licence: see bottom of file. -C89 ( Implementation is C99 ) - -Contributors: -- Anton Gerdelan - Initial code. -- Saija Sorsa - Fuzz testing. - -Instructions: -- Just drop this header, and the matching .c file into your project. -- To get debug printouts during parsing define APG_BMP_DEBUG_OUTPUT. - -Advantages: -- The implementation is fast, simple, and supports more formats than most BMP reader libraries. -- The reader function is fuzzed with AFL https://lcamtuf.coredump.cx/afl/. -- The reader is robust to large files and malformed files, and will return any valid partial data in an image. -- Reader supports 32bpp (with alpha channel), 24bpp, 8bpp, 4bpp, and 1bpp monochrome BMP images. -- Reader handles indexed BMP images using a colour palette. -- Writer supports 32bpp RGBA and 24bpp uncompressed RGB images. - -Current Limitations: -- 16-bit images not supported (don't have any samples to test on). -- No support for interleaved channel bit layouts eg RGB101010 RGB555 RGB565. -- No support for compressed BMP images, although in practice these are not used. -- Output images with alpha channel are written in BITMAPINFOHEADER format. - For better alpha support in other apps the 124-bit v5 header could be used instead, - at the cost of some backward compatibility and bloat. - -To Do: -- FUZZING - - create a unique fuzz test set for (8,4,1 BPP). -- (maybe) FEATURE Flipping the image based on negative width and height in header, and/or function arguments. -- (maybe) PERF ifdef intrinsics/asm for bitscan. Platform-specific code so won't include unless necessary. -- (maybe) FEATURE Add parameter for padding output memory to eg 4-byte alignment or n channels. -- (maybe) FEATURE Improved apps support in alpha channel writing (using v5 header). -*/ - -#ifndef APG_BMP_H_ -#define APG_BMP_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* CPP */ - -/* Reads a bitmap from a file, allocates memory for the raw image data, and returns it. -PARAMS - * w,h, - Retrieves the width and height of the BMP in pixels. - * n_chans - Retrieves the number of channels in the BMP. -RETURNS - * Tightly-packed pixel memory in RGBA order. The caller must call free() on the memory. - * NULL on any error. Any allocated memory is freed before returning NULL. */ -unsigned char* apg_bmp_read( const char* filename, int* w, int* h, unsigned int* n_chans ); - -/* Calls free() on memory created by apg_bmp_read */ -void apg_bmp_free( unsigned char* pixels_ptr ); - -/* Writes a bitmap to a file. -PARAMS - * filename - e.g."my_bitmap.bmp". Must not be NULL. - * pixels_ptr - Pointer to tightly-packed pixel memory in RGBA order. Must not be NULL. There must be abs(w)*abs(h)*n_chans bytes in the memory pointed to. - * w,h, - Width and height of the image in pixels. - * n_chans - The number of channels in the BMP. 3 or 4 supported for writing, which means RGB or RGBA memory, respectively. -RETURNS - * Zero on any error, non zero on success. */ -unsigned int apg_bmp_write( const char* filename, unsigned char* pixels_ptr, int w, int h, unsigned int n_chans ); - -#ifdef __cplusplus -} -#endif /* CPP */ - -#endif /*_APG_BMP_H_ */ - -/* -------------------------------------------------------------------------------------- -This software is available under two licences - you may use it under either licence. -------------------------------------------------------------------------------------- -FIRST LICENCE OPTION - -> Apache License -> Version 2.0, January 2004 -> http://www.apache.org/licenses/ -> Copyright 2019 Anton Gerdelan. -> Licensed under the Apache License, Version 2.0 (the "License"); -> you may not use this file except in compliance with the License. -> You may obtain a copy of the License at -> http://www.apache.org/licenses/LICENSE-2.0 -> Unless required by applicable law or agreed to in writing, software -> distributed under the License is distributed on an "AS IS" BASIS, -> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -> See the License for the specific language governing permissions and -> limitations under the License. -------------------------------------------------------------------------------------- -SECOND LICENCE OPTION - -> This is free and unencumbered software released into the public domain. -> -> Anyone is free to copy, modify, publish, use, compile, sell, or -> distribute this software, either in source code form or as a compiled -> binary, for any purpose, commercial or non-commercial, and by any -> means. -> -> In jurisdictions that recognize copyright laws, the author or authors -> of this software dedicate any and all copyright interest in the -> software to the public domain. We make this dedication for the benefit -> of the public at large and to the detriment of our heirs and -> successors. We intend this dedication to be an overt act of -> relinquishment in perpetuity of all present and future rights to this -> software under copyright law. -> -> 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 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. -> -> For more information, please refer to -------------------------------------------------------------------------------------- -*/ diff --git a/apg_bmp.c b/encoder/apg_bmp.c similarity index 100% rename from apg_bmp.c rename to encoder/apg_bmp.c diff --git a/basisu_astc_decomp.cpp b/encoder/basisu_astc_decomp.cpp similarity index 100% rename from basisu_astc_decomp.cpp rename to encoder/basisu_astc_decomp.cpp diff --git a/basisu_astc_decomp.h b/encoder/basisu_astc_decomp.h similarity index 100% rename from basisu_astc_decomp.h rename to encoder/basisu_astc_decomp.h diff --git a/basisu_backend.cpp b/encoder/basisu_backend.cpp similarity index 100% rename from basisu_backend.cpp rename to encoder/basisu_backend.cpp diff --git a/basisu_backend.h b/encoder/basisu_backend.h similarity index 100% rename from basisu_backend.h rename to encoder/basisu_backend.h diff --git a/basisu_basis_file.cpp b/encoder/basisu_basis_file.cpp similarity index 100% rename from basisu_basis_file.cpp rename to encoder/basisu_basis_file.cpp diff --git a/basisu_basis_file.h b/encoder/basisu_basis_file.h similarity index 100% rename from basisu_basis_file.h rename to encoder/basisu_basis_file.h diff --git a/basisu_bc7enc.cpp b/encoder/basisu_bc7enc.cpp similarity index 100% rename from basisu_bc7enc.cpp rename to encoder/basisu_bc7enc.cpp diff --git a/basisu_bc7enc.h b/encoder/basisu_bc7enc.h similarity index 100% rename from basisu_bc7enc.h rename to encoder/basisu_bc7enc.h diff --git a/basisu_comp.cpp b/encoder/basisu_comp.cpp similarity index 100% rename from basisu_comp.cpp rename to encoder/basisu_comp.cpp diff --git a/basisu_comp.h b/encoder/basisu_comp.h similarity index 100% rename from basisu_comp.h rename to encoder/basisu_comp.h diff --git a/basisu_enc.cpp b/encoder/basisu_enc.cpp similarity index 100% rename from basisu_enc.cpp rename to encoder/basisu_enc.cpp diff --git a/basisu_enc.h b/encoder/basisu_enc.h similarity index 100% rename from basisu_enc.h rename to encoder/basisu_enc.h diff --git a/basisu_etc.cpp b/encoder/basisu_etc.cpp similarity index 100% rename from basisu_etc.cpp rename to encoder/basisu_etc.cpp diff --git a/basisu_etc.h b/encoder/basisu_etc.h similarity index 100% rename from basisu_etc.h rename to encoder/basisu_etc.h diff --git a/basisu_frontend.cpp b/encoder/basisu_frontend.cpp similarity index 100% rename from basisu_frontend.cpp rename to encoder/basisu_frontend.cpp diff --git a/basisu_frontend.h b/encoder/basisu_frontend.h similarity index 100% rename from basisu_frontend.h rename to encoder/basisu_frontend.h diff --git a/basisu_global_selector_palette_helpers.cpp b/encoder/basisu_global_selector_palette_helpers.cpp similarity index 100% rename from basisu_global_selector_palette_helpers.cpp rename to encoder/basisu_global_selector_palette_helpers.cpp diff --git a/basisu_global_selector_palette_helpers.h b/encoder/basisu_global_selector_palette_helpers.h similarity index 100% rename from basisu_global_selector_palette_helpers.h rename to encoder/basisu_global_selector_palette_helpers.h diff --git a/basisu_gpu_texture.cpp b/encoder/basisu_gpu_texture.cpp similarity index 100% rename from basisu_gpu_texture.cpp rename to encoder/basisu_gpu_texture.cpp diff --git a/basisu_gpu_texture.h b/encoder/basisu_gpu_texture.h similarity index 100% rename from basisu_gpu_texture.h rename to encoder/basisu_gpu_texture.h diff --git a/basisu_miniz.h b/encoder/basisu_miniz.h similarity index 100% rename from basisu_miniz.h rename to encoder/basisu_miniz.h diff --git a/basisu_pvrtc1_4.cpp b/encoder/basisu_pvrtc1_4.cpp similarity index 100% rename from basisu_pvrtc1_4.cpp rename to encoder/basisu_pvrtc1_4.cpp diff --git a/basisu_pvrtc1_4.h b/encoder/basisu_pvrtc1_4.h similarity index 100% rename from basisu_pvrtc1_4.h rename to encoder/basisu_pvrtc1_4.h diff --git a/basisu_resample_filters.cpp b/encoder/basisu_resample_filters.cpp similarity index 100% rename from basisu_resample_filters.cpp rename to encoder/basisu_resample_filters.cpp diff --git a/basisu_resampler.cpp b/encoder/basisu_resampler.cpp similarity index 100% rename from basisu_resampler.cpp rename to encoder/basisu_resampler.cpp diff --git a/basisu_resampler.h b/encoder/basisu_resampler.h similarity index 100% rename from basisu_resampler.h rename to encoder/basisu_resampler.h diff --git a/basisu_resampler_filters.h b/encoder/basisu_resampler_filters.h similarity index 100% rename from basisu_resampler_filters.h rename to encoder/basisu_resampler_filters.h diff --git a/basisu_ssim.cpp b/encoder/basisu_ssim.cpp similarity index 100% rename from basisu_ssim.cpp rename to encoder/basisu_ssim.cpp diff --git a/basisu_ssim.h b/encoder/basisu_ssim.h similarity index 100% rename from basisu_ssim.h rename to encoder/basisu_ssim.h diff --git a/basisu_uastc_enc.cpp b/encoder/basisu_uastc_enc.cpp similarity index 100% rename from basisu_uastc_enc.cpp rename to encoder/basisu_uastc_enc.cpp diff --git a/basisu_uastc_enc.h b/encoder/basisu_uastc_enc.h similarity index 100% rename from basisu_uastc_enc.h rename to encoder/basisu_uastc_enc.h diff --git a/jpgd.cpp b/encoder/jpgd.cpp similarity index 100% rename from jpgd.cpp rename to encoder/jpgd.cpp diff --git a/jpgd.h b/encoder/jpgd.h similarity index 100% rename from jpgd.h rename to encoder/jpgd.h diff --git a/lodepng.cpp b/encoder/lodepng.cpp similarity index 100% rename from lodepng.cpp rename to encoder/lodepng.cpp diff --git a/lodepng.h b/encoder/lodepng.h similarity index 100% rename from lodepng.h rename to encoder/lodepng.h