![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|
#include <GL/glew.h>#include <GL/glut.h>#include <stdio.h>#include <stdlib.h>#include <assert.h>#include <sys/time.h>

Go to the source code of this file.
Macros | |
| #define | DXT_COMPRESS_STANDALONE |
| #define | DXT_IMAGE_GL_FORMAT GL_RGBA |
| #define | DXT_IMAGE_GL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV |
| #define | DXT_IMAGE_TYPE unsigned char |
| #define | TIMER_DURATION() |
| #define | TIMER_INIT() |
| #define | TIMER_START() |
| #define | TIMER_STOP() |
| #define | TIMER_STOP_PRINT(text) |
Enumerations | |
| enum | dxt_format { DXT_FORMAT_RGB , DXT_FORMAT_RGBA , DXT_FORMAT_YUV , DXT_FORMAT_YUV422 } |
| enum | dxt_type { DXT_TYPE_DXT1 , DXT_TYPE_DXT1_YUV , DXT_TYPE_DXT5_YCOCG } |
Functions | |
| int | dxt_image_compressed_destroy (unsigned char *image_compressed) |
| int | dxt_image_compressed_load_from_file (const char *filename, unsigned char **data, int *data_size) |
| int | dxt_image_compressed_save_to_file (const char *filename, unsigned char *image, int image_size) |
| int | dxt_image_destroy (DXT_IMAGE_TYPE *image) |
| int | dxt_image_load_from_file (const char *filename, int width, int height, DXT_IMAGE_TYPE **image) |
| int | dxt_image_save_to_file (const char *filename, DXT_IMAGE_TYPE *image, int width, int height) |
| int | dxt_init () |
| #define DXT_COMPRESS_STANDALONE |
Copyright (c) 2011, Martin Srom All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition at line 35 of file dxt_common.h.
| #define DXT_IMAGE_GL_FORMAT GL_RGBA |
Definition at line 73 of file dxt_common.h.
Referenced by dxt_decoder_create(), dxt_display_image(), and dxt_display_image_comparison().
| #define DXT_IMAGE_GL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV |
Definition at line 72 of file dxt_common.h.
Referenced by dxt_decoder_create(), dxt_decoder_decompress(), dxt_display_image(), dxt_display_image_comparison(), and dxt_encoder_compress().
| #define DXT_IMAGE_TYPE unsigned char |
Image type
Definition at line 71 of file dxt_common.h.
Referenced by dxt_decoder_buffer_allocate(), dxt_image_load_from_file(), main(), perform_comparison(), perform_decode(), perform_display(), and perform_encode().
| #define TIMER_DURATION | ( | ) |
Definition at line 63 of file dxt_common.h.
Referenced by perform_decode(), and perform_encode().
| #define TIMER_INIT | ( | ) |
Timer
Definition at line 52 of file dxt_common.h.
Referenced by dxt_decoder_decompress(), dxt_encoder_compress(), perform_decode(), and perform_encode().
| #define TIMER_START | ( | ) |
Definition at line 56 of file dxt_common.h.
Referenced by dxt_decoder_decompress(), dxt_encoder_compress(), dxt_encoder_compress_texture(), perform_decode(), and perform_encode().
| #define TIMER_STOP | ( | ) |
Definition at line 58 of file dxt_common.h.
Referenced by perform_decode(), and perform_encode().
| #define TIMER_STOP_PRINT | ( | text | ) |
Definition at line 64 of file dxt_common.h.
Referenced by dxt_decoder_decompress(), dxt_encoder_compress(), and dxt_encoder_compress_texture().
| enum dxt_format |
DXT format
| Enumerator | |
|---|---|
| DXT_FORMAT_RGB | |
| DXT_FORMAT_RGBA | |
| DXT_FORMAT_YUV | |
| DXT_FORMAT_YUV422 | |
Definition at line 78 of file dxt_common.h.
| enum dxt_type |
DXT type
| Enumerator | |
|---|---|
| DXT_TYPE_DXT1 | |
| DXT_TYPE_DXT1_YUV | |
| DXT_TYPE_DXT5_YCOCG | |
Definition at line 88 of file dxt_common.h.
| int dxt_image_compressed_destroy | ( | unsigned char * | image_compressed | ) |
Destroy DXT compressed image
| image_compressed | Compressed image data buffer |
Documented at declaration
Definition at line 206 of file dxt_common.c.
Referenced by perform_comparison(), perform_decode(), and perform_display().
| int dxt_image_compressed_load_from_file | ( | const char * | filename, |
| unsigned char ** | data, | ||
| int * | data_size ) |
Load compressed image from file
| filaname | Image filename |
| width | Image width in pixels |
| height | Image height in pixels |
Documented at declaration
Definition at line 145 of file dxt_common.c.
Referenced by perform_comparison(), perform_decode(), and perform_display().
| int dxt_image_compressed_save_to_file | ( | const char * | filename, |
| unsigned char * | image, | ||
| int | image_size ) |
Save compressed image to file
| filename | Image filename |
| image | Image data |
| image_size | Image data size |
Documented at declaration
Definition at line 173 of file dxt_common.c.
Referenced by main(), and perform_encode().
| int dxt_image_destroy | ( | DXT_IMAGE_TYPE * | image | ) |
Destroy DXT image
| image | Image data buffer |
Documented at declaration
Definition at line 197 of file dxt_common.c.
Referenced by main(), perform_comparison(), perform_display(), and perform_encode().
| int dxt_image_load_from_file | ( | const char * | filename, |
| int | width, | ||
| int | height, | ||
| DXT_IMAGE_TYPE ** | image ) |
Load RGB image from file
| filaname | Image filename |
| width | Image width in pixels |
| height | Image height in pixels |
Documented at declaration
Definition at line 67 of file dxt_common.c.
References DXT_IMAGE_TYPE.
Referenced by main(), perform_comparison(), perform_display(), and perform_encode().
| int dxt_image_save_to_file | ( | const char * | filename, |
| DXT_IMAGE_TYPE * | image, | ||
| int | width, | ||
| int | height ) |
Load RGB image from file
| filaname | Image filename |
| width | Image width in pixels |
| height | Image height in pixels |
Documented at declaration
Definition at line 107 of file dxt_common.c.
Referenced by perform_decode().
| int dxt_init | ( | ) |
Initialize DXT
Copyright (c) 2011, Martin Srom All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Documented at declaration
Definition at line 32 of file dxt_common.c.
References CHECK_EXTENSION.
Referenced by main().