aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderJPG.h
diff options
context:
space:
mode:
authorDavid Walter Seikel2013-01-13 18:54:10 +1000
committerDavid Walter Seikel2013-01-13 18:54:10 +1000
commit959831f4ef5a3e797f576c3de08cd65032c997ad (patch)
treee7351908be5995f0b325b2ebeaa02d5a34b82583 /libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderJPG.h
parentAdd info about changes to Irrlicht. (diff)
downloadSledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.zip
SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.gz
SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.bz2
SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.xz
Remove damned ancient DOS line endings from Irrlicht. Hopefully I did not go overboard.
Diffstat (limited to 'libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderJPG.h')
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderJPG.h232
1 files changed, 116 insertions, 116 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderJPG.h b/libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderJPG.h
index d3d0633..c76c086 100644
--- a/libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderJPG.h
+++ b/libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderJPG.h
@@ -1,116 +1,116 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt 1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine". 2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h 3// For conditions of distribution and use, see copyright notice in irrlicht.h
4 4
5#ifndef __C_IMAGE_LOADER_JPG_H_INCLUDED__ 5#ifndef __C_IMAGE_LOADER_JPG_H_INCLUDED__
6#define __C_IMAGE_LOADER_JPG_H_INCLUDED__ 6#define __C_IMAGE_LOADER_JPG_H_INCLUDED__
7 7
8#include "IrrCompileConfig.h" 8#include "IrrCompileConfig.h"
9 9
10#ifdef _IRR_COMPILE_WITH_JPG_LOADER_ 10#ifdef _IRR_COMPILE_WITH_JPG_LOADER_
11 11
12#include "IImageLoader.h" 12#include "IImageLoader.h"
13 13
14#include <stdio.h> // required for jpeglib.h 14#include <stdio.h> // required for jpeglib.h
15#ifdef _IRR_COMPILE_WITH_LIBJPEG_ 15#ifdef _IRR_COMPILE_WITH_LIBJPEG_
16extern "C" { 16extern "C" {
17 #ifndef _IRR_USE_NON_SYSTEM_JPEG_LIB_ 17 #ifndef _IRR_USE_NON_SYSTEM_JPEG_LIB_
18 #include <jpeglib.h> // use system lib 18 #include <jpeglib.h> // use system lib
19 #else 19 #else
20 #include "jpeglib/jpeglib.h" // use irrlicht jpeglib 20 #include "jpeglib/jpeglib.h" // use irrlicht jpeglib
21 #endif 21 #endif
22 #include <setjmp.h> 22 #include <setjmp.h>
23} 23}
24#endif // _IRR_COMPILE_WITH_LIBJPEG_ 24#endif // _IRR_COMPILE_WITH_LIBJPEG_
25 25
26 26
27namespace irr 27namespace irr
28{ 28{
29namespace video 29namespace video
30{ 30{
31 31
32 32
33//! Surface Loader for JPG images 33//! Surface Loader for JPG images
34class CImageLoaderJPG : public IImageLoader 34class CImageLoaderJPG : public IImageLoader
35{ 35{
36public: 36public:
37 37
38 //! constructor 38 //! constructor
39 CImageLoaderJPG(); 39 CImageLoaderJPG();
40 40
41 //! destructor 41 //! destructor
42 virtual ~CImageLoaderJPG(); 42 virtual ~CImageLoaderJPG();
43 43
44 //! returns true if the file maybe is able to be loaded by this class 44 //! returns true if the file maybe is able to be loaded by this class
45 //! based on the file extension (e.g. ".tga") 45 //! based on the file extension (e.g. ".tga")
46 virtual bool isALoadableFileExtension(const io::path& filename) const; 46 virtual bool isALoadableFileExtension(const io::path& filename) const;
47 47
48 //! returns true if the file maybe is able to be loaded by this class 48 //! returns true if the file maybe is able to be loaded by this class
49 virtual bool isALoadableFileFormat(io::IReadFile* file) const; 49 virtual bool isALoadableFileFormat(io::IReadFile* file) const;
50 50
51 //! creates a surface from the file 51 //! creates a surface from the file
52 virtual IImage* loadImage(io::IReadFile* file) const; 52 virtual IImage* loadImage(io::IReadFile* file) const;
53 53
54private: 54private:
55 55
56 #ifdef _IRR_COMPILE_WITH_LIBJPEG_ 56 #ifdef _IRR_COMPILE_WITH_LIBJPEG_
57 // several methods used via function pointers by jpeglib 57 // several methods used via function pointers by jpeglib
58 58
59 /* Receives control for a fatal error. Information sufficient to 59 /* Receives control for a fatal error. Information sufficient to
60 generate the error message has been stored in cinfo->err; call 60 generate the error message has been stored in cinfo->err; call
61 output_message to display it. Control must NOT return to the caller; 61 output_message to display it. Control must NOT return to the caller;
62 generally this routine will exit() or longjmp() somewhere. 62 generally this routine will exit() or longjmp() somewhere.
63 Typically you would override this routine to get rid of the exit() 63 Typically you would override this routine to get rid of the exit()
64 default behavior. Note that if you continue processing, you should 64 default behavior. Note that if you continue processing, you should
65 clean up the JPEG object with jpeg_abort() or jpeg_destroy(). 65 clean up the JPEG object with jpeg_abort() or jpeg_destroy().
66 */ 66 */
67 static void error_exit (j_common_ptr cinfo); 67 static void error_exit (j_common_ptr cinfo);
68 68
69 /* output error messages via Irrlicht logger. */ 69 /* output error messages via Irrlicht logger. */
70 static void output_message(j_common_ptr cinfo); 70 static void output_message(j_common_ptr cinfo);
71 71
72 /* Initialize source. This is called by jpeg_read_header() before any 72 /* Initialize source. This is called by jpeg_read_header() before any
73 data is actually read. Unlike init_destination(), it may leave 73 data is actually read. Unlike init_destination(), it may leave
74 bytes_in_buffer set to 0 (in which case a fill_input_buffer() call 74 bytes_in_buffer set to 0 (in which case a fill_input_buffer() call
75 will occur immediately). */ 75 will occur immediately). */
76 static void init_source (j_decompress_ptr cinfo); 76 static void init_source (j_decompress_ptr cinfo);
77 77
78 /* This is called whenever bytes_in_buffer has reached zero and more 78 /* This is called whenever bytes_in_buffer has reached zero and more
79 data is wanted. In typical applications, it should read fresh data 79 data is wanted. In typical applications, it should read fresh data
80 into the buffer (ignoring the current state of next_input_byte and 80 into the buffer (ignoring the current state of next_input_byte and
81 bytes_in_buffer), reset the pointer & count to the start of the 81 bytes_in_buffer), reset the pointer & count to the start of the
82 buffer, and return TRUE indicating that the buffer has been reloaded. 82 buffer, and return TRUE indicating that the buffer has been reloaded.
83 It is not necessary to fill the buffer entirely, only to obtain at 83 It is not necessary to fill the buffer entirely, only to obtain at
84 least one more byte. bytes_in_buffer MUST be set to a positive value 84 least one more byte. bytes_in_buffer MUST be set to a positive value
85 if TRUE is returned. A FALSE return should only be used when I/O 85 if TRUE is returned. A FALSE return should only be used when I/O
86 suspension is desired (this mode is discussed in the next section). */ 86 suspension is desired (this mode is discussed in the next section). */
87 static boolean fill_input_buffer (j_decompress_ptr cinfo); 87 static boolean fill_input_buffer (j_decompress_ptr cinfo);
88 88
89 /* Skip num_bytes worth of data. The buffer pointer and count should 89 /* Skip num_bytes worth of data. The buffer pointer and count should
90 be advanced over num_bytes input bytes, refilling the buffer as 90 be advanced over num_bytes input bytes, refilling the buffer as
91 needed. This is used to skip over a potentially large amount of 91 needed. This is used to skip over a potentially large amount of
92 uninteresting data (such as an APPn marker). In some applications 92 uninteresting data (such as an APPn marker). In some applications
93 it may be possible to optimize away the reading of the skipped data, 93 it may be possible to optimize away the reading of the skipped data,
94 but it's not clear that being smart is worth much trouble; large 94 but it's not clear that being smart is worth much trouble; large
95 skips are uncommon. bytes_in_buffer may be zero on return. 95 skips are uncommon. bytes_in_buffer may be zero on return.
96 A zero or negative skip count should be treated as a no-op. */ 96 A zero or negative skip count should be treated as a no-op. */
97 static void skip_input_data (j_decompress_ptr cinfo, long num_bytes); 97 static void skip_input_data (j_decompress_ptr cinfo, long num_bytes);
98 98
99 /* Terminate source --- called by jpeg_finish_decompress() after all 99 /* Terminate source --- called by jpeg_finish_decompress() after all
100 data has been read. Often a no-op. */ 100 data has been read. Often a no-op. */
101 static void term_source (j_decompress_ptr cinfo); 101 static void term_source (j_decompress_ptr cinfo);
102 102
103 // Copy filename to have it around for error-messages 103 // Copy filename to have it around for error-messages
104 static io::path Filename; 104 static io::path Filename;
105 105
106 #endif // _IRR_COMPILE_WITH_LIBJPEG_ 106 #endif // _IRR_COMPILE_WITH_LIBJPEG_
107}; 107};
108 108
109 109
110} // end namespace video 110} // end namespace video
111} // end namespace irr 111} // end namespace irr
112 112
113 113
114#endif 114#endif
115#endif 115#endif
116 116