├── README.md ├── converter ├── DDS.cpp ├── Utility.h ├── WinGdi.cpp ├── glew.c ├── glew.h ├── hdrloader.cpp ├── hdrloader.h ├── logo.png ├── pez.c ├── pez.h ├── readme.html ├── shaders.glsl ├── tinylib │ ├── liblzma │ │ ├── Alloc.c │ │ ├── Alloc.h │ │ ├── LzFind.c │ │ ├── LzFind.h │ │ ├── LzHash.h │ │ ├── LzmaDec.c │ │ ├── LzmaDec.h │ │ ├── LzmaEnc.c │ │ ├── LzmaEnc.h │ │ ├── LzmaLib.c │ │ ├── LzmaLib.h │ │ ├── NameMangle.h │ │ ├── Types.h │ │ └── readme.txt │ ├── libpng │ │ ├── png.c │ │ ├── png.h │ │ ├── pngconf.h │ │ ├── pngdebug.h │ │ ├── pngerror.c │ │ ├── pngget.c │ │ ├── pnginfo.h │ │ ├── pnglibconf.h │ │ ├── pngmem.c │ │ ├── pngpread.c │ │ ├── pngpriv.h │ │ ├── pngread.c │ │ ├── pngrio.c │ │ ├── pngrtran.c │ │ ├── pngrutil.c │ │ ├── pngset.c │ │ ├── pngstruct.h │ │ ├── pngtrans.c │ │ ├── pngwio.c │ │ ├── pngwrite.c │ │ ├── pngwtran.c │ │ └── pngwutil.c │ ├── openctm │ │ ├── LICENSE.txt │ │ ├── README.txt │ │ ├── compressMG1.c │ │ ├── compressMG2.c │ │ ├── compressRAW.c │ │ ├── internal.h │ │ ├── openctm.c │ │ ├── openctm.h │ │ ├── openctmpp.h │ │ └── stream.c │ ├── openexr │ │ ├── Half │ │ │ ├── eLut.cpp │ │ │ ├── half.cpp │ │ │ ├── half.h │ │ │ ├── halfFunction.h │ │ │ ├── halfLimits.h │ │ │ └── toFloat.cpp │ │ ├── Iex │ │ │ ├── Iex.h │ │ │ ├── IexBaseExc.cpp │ │ │ ├── IexBaseExc.h │ │ │ ├── IexErrnoExc.h │ │ │ ├── IexMacros.h │ │ │ ├── IexMathExc.h │ │ │ ├── IexThrowErrnoExc.cpp │ │ │ └── IexThrowErrnoExc.h │ │ ├── IlmImf │ │ │ ├── ImfAcesFile.cpp │ │ │ ├── ImfAcesFile.h │ │ │ ├── ImfArray.h │ │ │ ├── ImfAttribute.cpp │ │ │ ├── ImfAttribute.h │ │ │ ├── ImfAutoArray.h │ │ │ ├── ImfB44Compressor.cpp │ │ │ ├── ImfB44Compressor.h │ │ │ ├── ImfBoxAttribute.cpp │ │ │ ├── ImfBoxAttribute.h │ │ │ ├── ImfCRgbaFile.cpp │ │ │ ├── ImfCRgbaFile.h │ │ │ ├── ImfChannelList.cpp │ │ │ ├── ImfChannelList.h │ │ │ ├── ImfChannelListAttribute.cpp │ │ │ ├── ImfChannelListAttribute.h │ │ │ ├── ImfCheckedArithmetic.h │ │ │ ├── ImfChromaticities.cpp │ │ │ ├── ImfChromaticities.h │ │ │ ├── ImfChromaticitiesAttribute.cpp │ │ │ ├── ImfChromaticitiesAttribute.h │ │ │ ├── ImfCompression.h │ │ │ ├── ImfCompressionAttribute.cpp │ │ │ ├── ImfCompressionAttribute.h │ │ │ ├── ImfCompressor.cpp │ │ │ ├── ImfCompressor.h │ │ │ ├── ImfConvert.cpp │ │ │ ├── ImfConvert.h │ │ │ ├── ImfDoubleAttribute.cpp │ │ │ ├── ImfDoubleAttribute.h │ │ │ ├── ImfEnvmap.cpp │ │ │ ├── ImfEnvmap.h │ │ │ ├── ImfEnvmapAttribute.cpp │ │ │ ├── ImfEnvmapAttribute.h │ │ │ ├── ImfFloatAttribute.cpp │ │ │ ├── ImfFloatAttribute.h │ │ │ ├── ImfFrameBuffer.cpp │ │ │ ├── ImfFrameBuffer.h │ │ │ ├── ImfFramesPerSecond.cpp │ │ │ ├── ImfFramesPerSecond.h │ │ │ ├── ImfHeader.cpp │ │ │ ├── ImfHeader.h │ │ │ ├── ImfHuf.cpp │ │ │ ├── ImfHuf.h │ │ │ ├── ImfIO.cpp │ │ │ ├── ImfIO.h │ │ │ ├── ImfInputFile.cpp │ │ │ ├── ImfInputFile.h │ │ │ ├── ImfInt64.h │ │ │ ├── ImfIntAttribute.cpp │ │ │ ├── ImfIntAttribute.h │ │ │ ├── ImfKeyCode.cpp │ │ │ ├── ImfKeyCode.h │ │ │ ├── ImfKeyCodeAttribute.cpp │ │ │ ├── ImfKeyCodeAttribute.h │ │ │ ├── ImfLineOrder.h │ │ │ ├── ImfLineOrderAttribute.cpp │ │ │ ├── ImfLineOrderAttribute.h │ │ │ ├── ImfLut.cpp │ │ │ ├── ImfLut.h │ │ │ ├── ImfMatrixAttribute.cpp │ │ │ ├── ImfMatrixAttribute.h │ │ │ ├── ImfMisc.cpp │ │ │ ├── ImfMisc.h │ │ │ ├── ImfMultiView.cpp │ │ │ ├── ImfMultiView.h │ │ │ ├── ImfName.h │ │ │ ├── ImfOpaqueAttribute.cpp │ │ │ ├── ImfOpaqueAttribute.h │ │ │ ├── ImfOutputFile.cpp │ │ │ ├── ImfOutputFile.h │ │ │ ├── ImfPixelType.h │ │ │ ├── ImfPizCompressor.cpp │ │ │ ├── ImfPizCompressor.h │ │ │ ├── ImfPreviewImage.cpp │ │ │ ├── ImfPreviewImage.h │ │ │ ├── ImfPreviewImageAttribute.cpp │ │ │ ├── ImfPreviewImageAttribute.h │ │ │ ├── ImfPxr24Compressor.cpp │ │ │ ├── ImfPxr24Compressor.h │ │ │ ├── ImfRational.cpp │ │ │ ├── ImfRational.h │ │ │ ├── ImfRationalAttribute.cpp │ │ │ ├── ImfRationalAttribute.h │ │ │ ├── ImfRgba.h │ │ │ ├── ImfRgbaFile.cpp │ │ │ ├── ImfRgbaFile.h │ │ │ ├── ImfRgbaYca.cpp │ │ │ ├── ImfRgbaYca.h │ │ │ ├── ImfRleCompressor.cpp │ │ │ ├── ImfRleCompressor.h │ │ │ ├── ImfScanLineInputFile.cpp │ │ │ ├── ImfScanLineInputFile.h │ │ │ ├── ImfStandardAttributes.cpp │ │ │ ├── ImfStandardAttributes.h │ │ │ ├── ImfStdIO.cpp │ │ │ ├── ImfStdIO.h │ │ │ ├── ImfStringAttribute.cpp │ │ │ ├── ImfStringAttribute.h │ │ │ ├── ImfStringVectorAttribute.cpp │ │ │ ├── ImfStringVectorAttribute.h │ │ │ ├── ImfTestFile.cpp │ │ │ ├── ImfTestFile.h │ │ │ ├── ImfThreading.cpp │ │ │ ├── ImfThreading.h │ │ │ ├── ImfTileDescription.h │ │ │ ├── ImfTileDescriptionAttribute.cpp │ │ │ ├── ImfTileDescriptionAttribute.h │ │ │ ├── ImfTileOffsets.cpp │ │ │ ├── ImfTileOffsets.h │ │ │ ├── ImfTiledInputFile.cpp │ │ │ ├── ImfTiledInputFile.h │ │ │ ├── ImfTiledMisc.cpp │ │ │ ├── ImfTiledMisc.h │ │ │ ├── ImfTiledOutputFile.cpp │ │ │ ├── ImfTiledOutputFile.h │ │ │ ├── ImfTiledRgbaFile.cpp │ │ │ ├── ImfTiledRgbaFile.h │ │ │ ├── ImfTimeCode.cpp │ │ │ ├── ImfTimeCode.h │ │ │ ├── ImfTimeCodeAttribute.cpp │ │ │ ├── ImfTimeCodeAttribute.h │ │ │ ├── ImfVecAttribute.cpp │ │ │ ├── ImfVecAttribute.h │ │ │ ├── ImfVersion.cpp │ │ │ ├── ImfVersion.h │ │ │ ├── ImfWav.cpp │ │ │ ├── ImfWav.h │ │ │ ├── ImfXdr.h │ │ │ ├── ImfZipCompressor.cpp │ │ │ ├── ImfZipCompressor.h │ │ │ ├── b44ExpLogTable.cpp │ │ │ └── b44ExpLogTable.h │ │ ├── IlmThread │ │ │ ├── IlmThread.cpp │ │ │ ├── IlmThread.h │ │ │ ├── IlmThreadMutex.cpp │ │ │ ├── IlmThreadMutex.h │ │ │ ├── IlmThreadMutexPosix.cpp │ │ │ ├── IlmThreadMutexWin32.cpp │ │ │ ├── IlmThreadPool.cpp │ │ │ ├── IlmThreadPool.h │ │ │ ├── IlmThreadPosix.cpp │ │ │ ├── IlmThreadSemaphore.cpp │ │ │ ├── IlmThreadSemaphore.h │ │ │ ├── IlmThreadSemaphorePosix.cpp │ │ │ ├── IlmThreadSemaphorePosixCompat.cpp │ │ │ ├── IlmThreadSemaphoreWin32.cpp │ │ │ └── IlmThreadWin32.cpp │ │ ├── Imath │ │ │ ├── ImathBox.cpp │ │ │ ├── ImathBox.h │ │ │ ├── ImathBoxAlgo.h │ │ │ ├── ImathColor.h │ │ │ ├── ImathColorAlgo.cpp │ │ │ ├── ImathColorAlgo.h │ │ │ ├── ImathEuler.h │ │ │ ├── ImathExc.h │ │ │ ├── ImathFrame.h │ │ │ ├── ImathFrustum.h │ │ │ ├── ImathFun.cpp │ │ │ ├── ImathFun.h │ │ │ ├── ImathGL.h │ │ │ ├── ImathGLU.h │ │ │ ├── ImathHalfLimits.h │ │ │ ├── ImathInt64.h │ │ │ ├── ImathInterval.h │ │ │ ├── ImathLimits.h │ │ │ ├── ImathLine.h │ │ │ ├── ImathLineAlgo.h │ │ │ ├── ImathMath.h │ │ │ ├── ImathMatrix.h │ │ │ ├── ImathMatrixAlgo.cpp │ │ │ ├── ImathMatrixAlgo.h │ │ │ ├── ImathPlane.h │ │ │ ├── ImathPlatform.h │ │ │ ├── ImathQuat.h │ │ │ ├── ImathRandom.cpp │ │ │ ├── ImathRandom.h │ │ │ ├── ImathRoots.h │ │ │ ├── ImathShear.cpp │ │ │ ├── ImathShear.h │ │ │ ├── ImathSphere.h │ │ │ ├── ImathVec.cpp │ │ │ ├── ImathVec.h │ │ │ └── ImathVecAlgo.h │ │ ├── OpenEXRConfig.h │ │ ├── config.win │ │ │ └── IlmBaseConfig.h │ │ └── config.x11 │ │ │ ├── IlmBaseConfig.h │ │ │ ├── IlmBaseConfig.h.in │ │ │ ├── Makefile.am │ │ │ └── Makefile.in │ ├── wscript │ └── zlib │ │ ├── adler32.c │ │ ├── compress.c │ │ ├── crc32.c │ │ ├── crc32.h │ │ ├── deflate.c │ │ ├── deflate.h │ │ ├── gzclose.c │ │ ├── gzguts.h │ │ ├── gzlib.c │ │ ├── gzread.c │ │ ├── gzwrite.c │ │ ├── infback.c │ │ ├── inffast.c │ │ ├── inffast.h │ │ ├── inffixed.h │ │ ├── inflate.c │ │ ├── inflate.h │ │ ├── inftrees.c │ │ ├── inftrees.h │ │ ├── minigzip.c │ │ ├── trees.c │ │ ├── trees.h │ │ ├── uncompr.c │ │ ├── zconf.h │ │ ├── zlib.h │ │ ├── zutil.c │ │ └── zutil.h ├── viewer.cpp ├── vmath.h └── wscript ├── generator ├── bstrlib-license.txt ├── bstrlib.c ├── bstrlib.h ├── generate.py ├── glbo.c ├── glbo.h ├── glew-license.txt ├── glew.c ├── glew.h ├── glsw.c ├── glsw.h ├── glxew.h ├── lzfx-license.txt ├── lzfx.c ├── lzfx.h ├── platform.h ├── platform.win.c ├── platform.x11.c └── wglew.h ├── pez.c └── pez.h /README.md: -------------------------------------------------------------------------------- 1 | ![Image test](http://github.com/prideout/pez/raw/master/converter/logo.png) 2 | 3 | Pez lets you create a simple, fixed-size window and render to it with OpenGL. It's composed of a single header file and single C99 source file. 4 | 5 | It's intended for creating small demos on Linux. If you're building a real application, you should probably use a real library like [SDL](http://libsdl.org/) or [GLFW](http://www.glfw.org/). 6 | 7 | Your OpenGL demo needs to implement a few functions: 8 | 9 | PezConfig PezInitialize() // One-time setup, return a small struct with window size & title 10 | void PezRender() // Do your drawing here! 11 | void PezUpdate(float elapsedSeconds) // Perform animation and physics 12 | 13 | You can also optionally implement the following handler functions, depending on which `#define` statements you've got enabled in the header file: 14 | 15 | void PezHandleMouse(int x, int y, int action) // Respond to a mouse click or move event 16 | void PezReceiveDrop(const char* filename) // Respond to a file being drag-n-dropped to your window 17 | 18 | Pez provides some utility functions to help make assertions with printf-style error messages: 19 | 20 | void pezFatal(const char* pStr, ...) 21 | void pezCheck(int condition, ...) 22 | void pezPrintString(const char* pStr, ...) 23 | 24 | Note that your job is to implement functions that are prefixed with a capital `Pez`, whereas functions that prefixed with a lowercase `pez` are already implemented for you. 25 | 26 | Pez provides some OS-specific functions for you: 27 | 28 | const char* pezOpenFileDialog() 29 | const char* pezGetDesktopFolder() 30 | int pezIsPressing(char key) 31 | 32 | Pez never makes any OpenGL calls (that's up to you), but it provides a few helper functions to make it easy to load GLSL strings: 33 | 34 | const char* pezGetShader(const char* effectKey) 35 | int pezAddDirective(const char* token, const char* directive) 36 | 37 | Take a look at [glsw](http://prideout.net/blog/?p=11) to see how the above functions work. pez also makes it easy to create vertex buffer objects from blobs of data: 38 | 39 | PezVerts pezLoadVerts(const char* filename) 40 | PezVerts pezGenQuad(float left, float top, float right, float bottom) 41 | void pezFreeVerts(PezVerts verts) 42 | void pezSaveVerts(PezVerts verts, const char* filename) 43 | 44 | Likewise, here are some functions to help with textures or pixel buffer objects: 45 | 46 | PezPixels pezLoadPixels(const char* filename) 47 | void pezFreePixels(PezPixels pixels) 48 | void pezSavePixels(PezPixels pixels, const char* filename) 49 | void pezRenderText(PezPixels pixels, const char* message) 50 | PezPixels pezGenNoise(PezPixels desc, float alpha, float beta, int n) 51 | 52 | License 53 | ------- 54 | 55 | [Creative Commons Attribution](http://creativecommons.org/licenses/by/3.0/) 56 | -------------------------------------------------------------------------------- /converter/Utility.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pez.h" 3 | 4 | struct TexturePod { 5 | GLuint Handle; 6 | GLsizei Width; 7 | GLsizei Height; 8 | }; 9 | 10 | TexturePod OverlayText(const char* message); 11 | void ExportScreenshot(const char* filename); 12 | -------------------------------------------------------------------------------- /converter/hdrloader.h: -------------------------------------------------------------------------------- 1 | 2 | /*********************************************************************************** 3 | Created: 17:9:2002 4 | FileName: hdrloader.h 5 | Author: Igor Kravtchenko 6 | 7 | Info: Load HDR image and convert to a set of float32 RGB triplet. 8 | ************************************************************************************/ 9 | 10 | class HDRLoaderResult { 11 | public: 12 | int width, height; 13 | // each pixel takes 3 float32, each component can be of any value... 14 | float *cols; 15 | }; 16 | 17 | class HDRLoader { 18 | public: 19 | static bool load(const char *fileName, HDRLoaderResult &res); 20 | }; 21 | 22 | -------------------------------------------------------------------------------- /converter/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prideout/pez/a3c6f4afcc3983df0743bf472d1c0c18661399cb/converter/logo.png -------------------------------------------------------------------------------- /converter/pez.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #define PEZ_MAINLOOP 1 8 | 9 | #define PEZ_MOUSE_HANDLER 1 10 | 11 | #define PEZ_DROP_HANDLER 1 12 | 13 | #include "glew.h" 14 | 15 | #define PEZ_FORWARD_COMPATIBLE_GL 1 16 | 17 | typedef struct PezConfigRec 18 | { 19 | const char* Title; 20 | int Width; 21 | int Height; 22 | int Multisampling; 23 | int VerticalSync; 24 | } PezConfig; 25 | 26 | #ifdef PEZ_MAINLOOP 27 | PezConfig PezGetConfig(); 28 | void PezInitialize(); 29 | void PezRender(); 30 | void PezUpdate(float seconds); 31 | 32 | #ifdef PEZ_MOUSE_HANDLER 33 | void PezHandleMouse(int x, int y, int action); 34 | #endif 35 | 36 | #ifdef PEZ_DROP_HANDLER 37 | void PezReceiveDrop(const char* filename); 38 | #endif 39 | 40 | #else 41 | void pezSwapBuffers(); 42 | #endif 43 | 44 | enum {PEZ_DOWN, PEZ_UP, PEZ_MOVE, PEZ_DOUBLECLICK}; 45 | #define TwoPi (6.28318531f) 46 | #define Pi (3.14159265f) 47 | #define countof(A) (sizeof(A) / sizeof(A[0])) 48 | 49 | void pezPrintString(const char* pStr, ...); 50 | void pezFatal(const char* pStr, ...); 51 | void pezCheck(int condition, ...); 52 | int pezIsPressing(char key); 53 | const char* pezResourcePath(); 54 | const char* pezOpenFileDialog(); 55 | const char* pezGetDesktopFolder(); 56 | 57 | int pezInit(); 58 | int pezShutdown(); 59 | int pezAddPath(const char* pathPrefix, const char* pathSuffix); 60 | const char* pezGetShader(const char* effectKey); 61 | const char* pezGetError(); 62 | int pezAddDirective(const char* token, const char* directive); 63 | 64 | 65 | typedef struct PezAttribRec { 66 | const GLchar* Name; 67 | GLint Size; 68 | GLenum Type; 69 | GLsizei Stride; 70 | int FrameCount; 71 | GLvoid* Frames; 72 | } PezAttrib; 73 | 74 | typedef struct PezVertsRec { 75 | int AttribCount; 76 | int IndexCount; 77 | int VertexCount; 78 | GLenum IndexType; 79 | GLsizeiptr IndexBufferSize; 80 | PezAttrib* Attribs; 81 | GLvoid* Indices; 82 | void* RawHeader; 83 | } PezVerts; 84 | 85 | typedef struct PezPixelsRec { 86 | int FrameCount; 87 | GLsizei Width; 88 | GLsizei Height; 89 | GLsizei Depth; 90 | GLint MipLevels; 91 | GLenum Format; 92 | GLenum InternalFormat; 93 | GLenum Type; 94 | GLsizeiptr BytesPerFrame; 95 | GLvoid* Frames; 96 | void* RawHeader; 97 | } PezPixels; 98 | 99 | PezVerts pezLoadVerts(const char* filename); 100 | PezVerts pezGenQuad(float left, float top, float right, float bottom); 101 | void pezFreeVerts(PezVerts verts); 102 | void pezSaveVerts(PezVerts verts, const char* filename); 103 | 104 | PezPixels pezLoadPixels(const char* filename); 105 | void pezFreePixels(PezPixels pixels); 106 | void pezSavePixels(PezPixels pixels, const char* filename); 107 | void pezRenderText(PezPixels pixels, const char* message); 108 | PezPixels pezGenNoise(PezPixels desc, float alpha, float beta, int n); 109 | #ifdef __cplusplus 110 | } 111 | #endif 112 | -------------------------------------------------------------------------------- /converter/readme.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | OpenGL Demo 7 | 16 | 17 | 18 | 19 | 20 |

How To Build

21 | 22 |

23 | If you're using Windows, simply open the vcxproj file in this folder. 24 |

25 | 26 | For Linux/X11, you'll need to use the supplied WAF script. If you don't have WAF, you can download it from Google Code. Or, you can type this into a python script: 27 | 28 |
29 | import urllib
30 | import os
31 | import stat
32 | urllib.urlretrieve("http://waf.googlecode.com/files/waf-1.6.2", "waf")
33 | os.chmod('waf', stat.S_IEXEC)
34 | 
35 | 36 | Next, type this: 37 | 38 |
39 | $ ./waf configure build run
40 | 
41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /converter/shaders.glsl: -------------------------------------------------------------------------------- 1 | -- Quad.VS 2 | 3 | in vec2 Position; 4 | in vec2 TexCoord; 5 | out vec2 vTexCoord; 6 | 7 | void main() 8 | { 9 | vTexCoord = TexCoord; 10 | gl_Position = vec4(Position, 0, 1); 11 | } 12 | 13 | -- Quad.FS 14 | 15 | in vec2 vTexCoord; 16 | out vec4 FragColor; 17 | uniform sampler2D Sampler; 18 | 19 | void main() 20 | { 21 | FragColor = texture(Sampler, vTexCoord); 22 | } 23 | 24 | -- Mesh.VS 25 | 26 | in vec4 Position; 27 | in vec3 Normal; 28 | 29 | uniform mat4 Projection; 30 | uniform mat4 Modelview; 31 | uniform mat3 NormalMatrix; 32 | uniform vec3 DiffuseMaterial = vec3(0.75, 0.75, 0.5); 33 | 34 | out vec3 EyespaceNormal; 35 | out vec3 Diffuse; 36 | 37 | void main() 38 | { 39 | EyespaceNormal = NormalMatrix * Normal; 40 | gl_Position = Projection * Modelview * Position; 41 | Diffuse = DiffuseMaterial; 42 | } 43 | 44 | -- Mesh.FS 45 | 46 | in vec3 EyespaceNormal; 47 | in vec3 Diffuse; 48 | out vec4 FragColor; 49 | 50 | uniform vec3 LightPosition = vec3(0.25, 0.25, 1.0); 51 | uniform vec3 AmbientMaterial = vec3(0.04, 0.04, 0.04); 52 | uniform vec3 SpecularMaterial = vec3(0.5, 0.5, 0.5); 53 | uniform float Shininess = 50; 54 | 55 | void main() 56 | { 57 | vec3 N = normalize(EyespaceNormal); 58 | vec3 L = normalize(LightPosition); 59 | vec3 Eye = vec3(0, 0, 1); 60 | vec3 H = normalize(L + Eye); 61 | 62 | float df = max(0.0, dot(N, L)); 63 | float sf = max(0.0, dot(N, H)); 64 | sf = pow(sf, Shininess); 65 | 66 | vec3 color = AmbientMaterial + df * Diffuse + sf * SpecularMaterial; 67 | FragColor = vec4(color, 1.0); 68 | } 69 | -------------------------------------------------------------------------------- /converter/tinylib/liblzma/Alloc.c: -------------------------------------------------------------------------------- 1 | /* Alloc.c -- Memory allocation functions 2 | 2008-09-24 3 | Igor Pavlov 4 | Public domain */ 5 | 6 | #ifdef _WIN32 7 | #include 8 | #endif 9 | #include 10 | 11 | #include "Alloc.h" 12 | 13 | /* #define _SZ_ALLOC_DEBUG */ 14 | 15 | /* use _SZ_ALLOC_DEBUG to debug alloc/free operations */ 16 | #ifdef _SZ_ALLOC_DEBUG 17 | #include 18 | int g_allocCount = 0; 19 | int g_allocCountMid = 0; 20 | int g_allocCountBig = 0; 21 | #endif 22 | 23 | void *MyAlloc(size_t size) 24 | { 25 | if (size == 0) 26 | return 0; 27 | #ifdef _SZ_ALLOC_DEBUG 28 | { 29 | void *p = malloc(size); 30 | fprintf(stderr, "\nAlloc %10d bytes, count = %10d, addr = %8X", size, g_allocCount++, (unsigned)p); 31 | return p; 32 | } 33 | #else 34 | return malloc(size); 35 | #endif 36 | } 37 | 38 | void MyFree(void *address) 39 | { 40 | #ifdef _SZ_ALLOC_DEBUG 41 | if (address != 0) 42 | fprintf(stderr, "\nFree; count = %10d, addr = %8X", --g_allocCount, (unsigned)address); 43 | #endif 44 | free(address); 45 | } 46 | 47 | #ifdef _WIN32 48 | 49 | void *MidAlloc(size_t size) 50 | { 51 | if (size == 0) 52 | return 0; 53 | #ifdef _SZ_ALLOC_DEBUG 54 | fprintf(stderr, "\nAlloc_Mid %10d bytes; count = %10d", size, g_allocCountMid++); 55 | #endif 56 | return VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE); 57 | } 58 | 59 | void MidFree(void *address) 60 | { 61 | #ifdef _SZ_ALLOC_DEBUG 62 | if (address != 0) 63 | fprintf(stderr, "\nFree_Mid; count = %10d", --g_allocCountMid); 64 | #endif 65 | if (address == 0) 66 | return; 67 | VirtualFree(address, 0, MEM_RELEASE); 68 | } 69 | 70 | #ifndef MEM_LARGE_PAGES 71 | #undef _7ZIP_LARGE_PAGES 72 | #endif 73 | 74 | #ifdef _7ZIP_LARGE_PAGES 75 | SIZE_T g_LargePageSize = 0; 76 | typedef SIZE_T (WINAPI *GetLargePageMinimumP)(); 77 | #endif 78 | 79 | void SetLargePageSize() 80 | { 81 | #ifdef _7ZIP_LARGE_PAGES 82 | SIZE_T size = 0; 83 | GetLargePageMinimumP largePageMinimum = (GetLargePageMinimumP) 84 | GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetLargePageMinimum"); 85 | if (largePageMinimum == 0) 86 | return; 87 | size = largePageMinimum(); 88 | if (size == 0 || (size & (size - 1)) != 0) 89 | return; 90 | g_LargePageSize = size; 91 | #endif 92 | } 93 | 94 | 95 | void *BigAlloc(size_t size) 96 | { 97 | if (size == 0) 98 | return 0; 99 | #ifdef _SZ_ALLOC_DEBUG 100 | fprintf(stderr, "\nAlloc_Big %10d bytes; count = %10d", size, g_allocCountBig++); 101 | #endif 102 | 103 | #ifdef _7ZIP_LARGE_PAGES 104 | if (g_LargePageSize != 0 && g_LargePageSize <= (1 << 30) && size >= (1 << 18)) 105 | { 106 | void *res = VirtualAlloc(0, (size + g_LargePageSize - 1) & (~(g_LargePageSize - 1)), 107 | MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE); 108 | if (res != 0) 109 | return res; 110 | } 111 | #endif 112 | return VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE); 113 | } 114 | 115 | void BigFree(void *address) 116 | { 117 | #ifdef _SZ_ALLOC_DEBUG 118 | if (address != 0) 119 | fprintf(stderr, "\nFree_Big; count = %10d", --g_allocCountBig); 120 | #endif 121 | 122 | if (address == 0) 123 | return; 124 | VirtualFree(address, 0, MEM_RELEASE); 125 | } 126 | 127 | #endif 128 | -------------------------------------------------------------------------------- /converter/tinylib/liblzma/Alloc.h: -------------------------------------------------------------------------------- 1 | /* Alloc.h -- Memory allocation functions 2 | 2008-03-13 3 | Igor Pavlov 4 | Public domain */ 5 | 6 | #ifndef __COMMON_ALLOC_H 7 | #define __COMMON_ALLOC_H 8 | 9 | #include 10 | 11 | #include "NameMangle.h" 12 | 13 | void *MyAlloc(size_t size); 14 | void MyFree(void *address); 15 | 16 | #ifdef _WIN32 17 | 18 | void SetLargePageSize(); 19 | 20 | void *MidAlloc(size_t size); 21 | void MidFree(void *address); 22 | void *BigAlloc(size_t size); 23 | void BigFree(void *address); 24 | 25 | #else 26 | 27 | #define MidAlloc(size) MyAlloc(size) 28 | #define MidFree(address) MyFree(address) 29 | #define BigAlloc(size) MyAlloc(size) 30 | #define BigFree(address) MyFree(address) 31 | 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /converter/tinylib/liblzma/LzHash.h: -------------------------------------------------------------------------------- 1 | /* LzHash.h -- HASH functions for LZ algorithms 2 | 2008-10-04 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __LZHASH_H 5 | #define __LZHASH_H 6 | 7 | #define kHash2Size (1 << 10) 8 | #define kHash3Size (1 << 16) 9 | #define kHash4Size (1 << 20) 10 | 11 | #define kFix3HashSize (kHash2Size) 12 | #define kFix4HashSize (kHash2Size + kHash3Size) 13 | #define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size) 14 | 15 | #define HASH2_CALC hashValue = cur[0] | ((UInt32)cur[1] << 8); 16 | 17 | #define HASH3_CALC { \ 18 | UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ 19 | hash2Value = temp & (kHash2Size - 1); \ 20 | hashValue = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; } 21 | 22 | #define HASH4_CALC { \ 23 | UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ 24 | hash2Value = temp & (kHash2Size - 1); \ 25 | hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ 26 | hashValue = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & p->hashMask; } 27 | 28 | #define HASH5_CALC { \ 29 | UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ 30 | hash2Value = temp & (kHash2Size - 1); \ 31 | hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ 32 | hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)); \ 33 | hashValue = (hash4Value ^ (p->crc[cur[4]] << 3)) & p->hashMask; \ 34 | hash4Value &= (kHash4Size - 1); } 35 | 36 | /* #define HASH_ZIP_CALC hashValue = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */ 37 | #define HASH_ZIP_CALC hashValue = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF; 38 | 39 | 40 | #define MT_HASH2_CALC \ 41 | hash2Value = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1); 42 | 43 | #define MT_HASH3_CALC { \ 44 | UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ 45 | hash2Value = temp & (kHash2Size - 1); \ 46 | hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); } 47 | 48 | #define MT_HASH4_CALC { \ 49 | UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ 50 | hash2Value = temp & (kHash2Size - 1); \ 51 | hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ 52 | hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /converter/tinylib/liblzma/LzmaEnc.h: -------------------------------------------------------------------------------- 1 | /* LzmaEnc.h -- LZMA Encoder 2 | 2008-10-04 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __LZMAENC_H 5 | #define __LZMAENC_H 6 | 7 | #include "Types.h" 8 | 9 | #define LZMA_PROPS_SIZE 5 10 | 11 | typedef struct _CLzmaEncProps 12 | { 13 | int level; /* 0 <= level <= 9 */ 14 | UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version 15 | (1 << 12) <= dictSize <= (1 << 30) for 64-bit version 16 | default = (1 << 24) */ 17 | int lc; /* 0 <= lc <= 8, default = 3 */ 18 | int lp; /* 0 <= lp <= 4, default = 0 */ 19 | int pb; /* 0 <= pb <= 4, default = 2 */ 20 | int algo; /* 0 - fast, 1 - normal, default = 1 */ 21 | int fb; /* 5 <= fb <= 273, default = 32 */ 22 | int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */ 23 | int numHashBytes; /* 2, 3 or 4, default = 4 */ 24 | UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */ 25 | unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */ 26 | int numThreads; /* 1 or 2, default = 2 */ 27 | } CLzmaEncProps; 28 | 29 | void LzmaEncProps_Init(CLzmaEncProps *p); 30 | void LzmaEncProps_Normalize(CLzmaEncProps *p); 31 | UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2); 32 | 33 | 34 | /* ---------- CLzmaEncHandle Interface ---------- */ 35 | 36 | /* LzmaEnc_* functions can return the following exit codes: 37 | Returns: 38 | SZ_OK - OK 39 | SZ_ERROR_MEM - Memory allocation error 40 | SZ_ERROR_PARAM - Incorrect paramater in props 41 | SZ_ERROR_WRITE - Write callback error. 42 | SZ_ERROR_PROGRESS - some break from progress callback 43 | SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) 44 | */ 45 | 46 | typedef void * CLzmaEncHandle; 47 | 48 | CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc); 49 | void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig); 50 | SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props); 51 | SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size); 52 | SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream, 53 | ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); 54 | SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, 55 | int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); 56 | 57 | /* ---------- One Call Interface ---------- */ 58 | 59 | /* LzmaEncode 60 | Return code: 61 | SZ_OK - OK 62 | SZ_ERROR_MEM - Memory allocation error 63 | SZ_ERROR_PARAM - Incorrect paramater 64 | SZ_ERROR_OUTPUT_EOF - output buffer overflow 65 | SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) 66 | */ 67 | 68 | SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, 69 | const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, 70 | ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /converter/tinylib/liblzma/LzmaLib.c: -------------------------------------------------------------------------------- 1 | /* LzmaLib.c -- LZMA library wrapper 2 | 2008-08-05 3 | Igor Pavlov 4 | Public domain */ 5 | 6 | #include "LzmaEnc.h" 7 | #include "LzmaDec.h" 8 | #include "Alloc.h" 9 | #include "LzmaLib.h" 10 | 11 | static void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); } 12 | static void SzFree(void *p, void *address) { p = p; MyFree(address); } 13 | static ISzAlloc g_Alloc = { SzAlloc, SzFree }; 14 | 15 | MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen, 16 | unsigned char *outProps, size_t *outPropsSize, 17 | int level, /* 0 <= level <= 9, default = 5 */ 18 | unsigned dictSize, /* use (1 << N) or (3 << N). 4 KB < dictSize <= 128 MB */ 19 | int lc, /* 0 <= lc <= 8, default = 3 */ 20 | int lp, /* 0 <= lp <= 4, default = 0 */ 21 | int pb, /* 0 <= pb <= 4, default = 2 */ 22 | int fb, /* 5 <= fb <= 273, default = 32 */ 23 | int numThreads, /* 1 or 2, default = 2 */ 24 | int algo /* 0 = fast, 1 = normal */ 25 | ) 26 | { 27 | CLzmaEncProps props; 28 | LzmaEncProps_Init(&props); 29 | props.level = level; 30 | props.dictSize = dictSize; 31 | props.lc = lc; 32 | props.lp = lp; 33 | props.pb = pb; 34 | props.fb = fb; 35 | props.numThreads = numThreads; 36 | props.algo = algo; 37 | 38 | return LzmaEncode(dest, destLen, src, srcLen, &props, outProps, outPropsSize, 0, 39 | NULL, &g_Alloc, &g_Alloc); 40 | } 41 | 42 | 43 | MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t *srcLen, 44 | const unsigned char *props, size_t propsSize) 45 | { 46 | ELzmaStatus status; 47 | return LzmaDecode(dest, destLen, src, srcLen, props, (unsigned)propsSize, LZMA_FINISH_ANY, &status, &g_Alloc); 48 | } 49 | -------------------------------------------------------------------------------- /converter/tinylib/liblzma/readme.txt: -------------------------------------------------------------------------------- 1 | This is the C library implementation of LZMA compression/decompression by Igor Pavlov. 2 | 3 | Author: Igor Pavlov 4 | License: Public domain 5 | Version: 4.65 (2009-02-03) 6 | 7 | Some administrative adaptations for integration in OpenCTM were made by Marcus Geelnard. 8 | -------------------------------------------------------------------------------- /converter/tinylib/libpng/pnglibconf.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prideout/pez/a3c6f4afcc3983df0743bf472d1c0c18661399cb/converter/tinylib/libpng/pnglibconf.h -------------------------------------------------------------------------------- /converter/tinylib/openctm/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2010 Marcus Geelnard 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 16 | 2. Altered source versions must be plainly marked as such, and must not 17 | be misrepresented as being the original software. 18 | 19 | 3. This notice may not be removed or altered from any source 20 | distribution. 21 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/Half/half.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prideout/pez/a3c6f4afcc3983df0743bf472d1c0c18661399cb/converter/tinylib/openexr/Half/half.cpp -------------------------------------------------------------------------------- /converter/tinylib/openexr/Iex/Iex.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IEX_H 38 | #define INCLUDED_IEX_H 39 | 40 | 41 | //-------------------------------- 42 | // 43 | // Exception handling 44 | // 45 | //-------------------------------- 46 | 47 | 48 | #include "IexMacros.h" 49 | #include "IexBaseExc.h" 50 | #include "IexMathExc.h" 51 | #include "IexThrowErrnoExc.h" 52 | 53 | // Note that we do not include file IexErrnoExc.h here. That file 54 | // defines over 150 classes and significantly slows down compilation. 55 | // If you throw ErrnoExc exceptions using the throwErrnoExc() function, 56 | // you don't need IexErrnoExc.h. You have to include IexErrnoExc.h 57 | // only if you want to catch specific subclasses of ErrnoExc. 58 | 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/Iex/IexMathExc.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IEXMATHEXC_H 38 | #define INCLUDED_IEXMATHEXC_H 39 | 40 | #include "IexBaseExc.h" 41 | 42 | namespace Iex { 43 | 44 | //--------------------------------------------------------- 45 | // Exception classess which correspond to specific floating 46 | // point exceptions. 47 | //--------------------------------------------------------- 48 | 49 | DEFINE_EXC (OverflowExc, MathExc) // Overflow 50 | DEFINE_EXC (UnderflowExc, MathExc) // Underflow 51 | DEFINE_EXC (DivzeroExc, MathExc) // Division by zero 52 | DEFINE_EXC (InexactExc, MathExc) // Inexact result 53 | DEFINE_EXC (InvalidFpOpExc, MathExc) // Invalid operation 54 | 55 | 56 | } // namespace Iex 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfAutoArray.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IMF_AUTO_ARRAY_H 38 | #define INCLUDED_IMF_AUTO_ARRAY_H 39 | 40 | //----------------------------------------------------------------------------- 41 | // 42 | // class AutoArray -- a workaround for systems with 43 | // insufficient stack space for large auto arrays. 44 | // 45 | //----------------------------------------------------------------------------- 46 | 47 | #include "OpenEXRConfig.h" 48 | 49 | namespace Imf { 50 | 51 | 52 | #if !defined (HAVE_LARGE_STACK) 53 | 54 | 55 | template 56 | class AutoArray 57 | { 58 | public: 59 | 60 | AutoArray (): _data (new T [size]) {} 61 | ~AutoArray () {delete [] _data;} 62 | 63 | operator T * () {return _data;} 64 | operator const T * () const {return _data;} 65 | 66 | private: 67 | 68 | T *_data; 69 | }; 70 | 71 | 72 | #else 73 | 74 | 75 | template 76 | class AutoArray 77 | { 78 | public: 79 | 80 | operator T * () {return _data;} 81 | operator const T * () const {return _data;} 82 | 83 | private: 84 | 85 | T _data[size]; 86 | }; 87 | 88 | 89 | #endif 90 | 91 | } // namespace Imf 92 | 93 | #endif 94 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfBoxAttribute.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IMF_BOX_ATTRIBUTE_H 38 | #define INCLUDED_IMF_BOX_ATTRIBUTE_H 39 | 40 | //----------------------------------------------------------------------------- 41 | // 42 | // class Box2iAttribute 43 | // class Box2fAttribute 44 | // 45 | //----------------------------------------------------------------------------- 46 | 47 | #include 48 | #include "ImathBox.h" 49 | 50 | 51 | namespace Imf { 52 | 53 | 54 | typedef TypedAttribute Box2iAttribute; 55 | template <> const char *Box2iAttribute::staticTypeName (); 56 | template <> void Box2iAttribute::writeValueTo (OStream &, int) const; 57 | template <> void Box2iAttribute::readValueFrom (IStream &, int, int); 58 | 59 | 60 | typedef TypedAttribute Box2fAttribute; 61 | template <> const char *Box2fAttribute::staticTypeName (); 62 | template <> void Box2fAttribute::writeValueTo (OStream &, int) const; 63 | template <> void Box2fAttribute::readValueFrom (IStream &, int, int); 64 | 65 | 66 | } // namespace Imf 67 | 68 | // Metrowerks compiler wants the .cpp file inlined, too 69 | #ifdef __MWERKS__ 70 | #include 71 | #endif 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfChannelListAttribute.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IMF_CHANNEL_LIST_ATTRIBUTE_H 38 | #define INCLUDED_IMF_CHANNEL_LIST_ATTRIBUTE_H 39 | 40 | //----------------------------------------------------------------------------- 41 | // 42 | // class ChannelListAttribute 43 | // 44 | //----------------------------------------------------------------------------- 45 | 46 | #include 47 | #include 48 | 49 | 50 | namespace Imf { 51 | 52 | 53 | typedef TypedAttribute ChannelListAttribute; 54 | template <> const char *ChannelListAttribute::staticTypeName (); 55 | template <> void ChannelListAttribute::writeValueTo (OStream &, int) const; 56 | template <> void ChannelListAttribute::readValueFrom (IStream &, int, int); 57 | 58 | 59 | } // namespace Imf 60 | 61 | // Metrowerks compiler wants the .cpp file inlined, too 62 | #ifdef __MWERKS__ 63 | #include 64 | #endif 65 | 66 | #endif 67 | 68 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfChromaticitiesAttribute.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2003, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | //----------------------------------------------------------------------------- 37 | // 38 | // class ChromaticitiesAttribute 39 | // 40 | //----------------------------------------------------------------------------- 41 | 42 | #include 43 | 44 | 45 | namespace Imf { 46 | 47 | 48 | template <> 49 | const char * 50 | ChromaticitiesAttribute::staticTypeName () 51 | { 52 | return "chromaticities"; 53 | } 54 | 55 | 56 | template <> 57 | void 58 | ChromaticitiesAttribute::writeValueTo (OStream &os, int version) const 59 | { 60 | Xdr::write (os, _value.red.x); 61 | Xdr::write (os, _value.red.y); 62 | Xdr::write (os, _value.green.x); 63 | Xdr::write (os, _value.green.y); 64 | Xdr::write (os, _value.blue.x); 65 | Xdr::write (os, _value.blue.y); 66 | Xdr::write (os, _value.white.x); 67 | Xdr::write (os, _value.white.y); 68 | } 69 | 70 | 71 | template <> 72 | void 73 | ChromaticitiesAttribute::readValueFrom (IStream &is, int size, int version) 74 | { 75 | Xdr::read (is, _value.red.x); 76 | Xdr::read (is, _value.red.y); 77 | Xdr::read (is, _value.green.x); 78 | Xdr::read (is, _value.green.y); 79 | Xdr::read (is, _value.blue.x); 80 | Xdr::read (is, _value.blue.y); 81 | Xdr::read (is, _value.white.x); 82 | Xdr::read (is, _value.white.y); 83 | } 84 | 85 | 86 | } // namespace Imf 87 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfChromaticitiesAttribute.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2003, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | #ifndef INCLUDED_IMF_CHROMATICITIES_ATTRIBUTE_H 37 | #define INCLUDED_IMF_CHROMATICITIES_ATTRIBUTE_H 38 | 39 | 40 | //----------------------------------------------------------------------------- 41 | // 42 | // class ChromaticitiesAttribute 43 | // 44 | //----------------------------------------------------------------------------- 45 | 46 | #include 47 | #include 48 | 49 | 50 | namespace Imf { 51 | 52 | 53 | typedef TypedAttribute ChromaticitiesAttribute; 54 | 55 | template <> 56 | const char *ChromaticitiesAttribute::staticTypeName (); 57 | 58 | template <> 59 | void ChromaticitiesAttribute::writeValueTo (OStream &, int) const; 60 | 61 | template <> 62 | void ChromaticitiesAttribute::readValueFrom (IStream &, int, int); 63 | 64 | 65 | } // namespace Imf 66 | 67 | // Metrowerks compiler wants the .cpp file inlined, too 68 | #ifdef __MWERKS__ 69 | #include 70 | #endif 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfCompression.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IMF_COMPRESSION_H 38 | #define INCLUDED_IMF_COMPRESSION_H 39 | 40 | //----------------------------------------------------------------------------- 41 | // 42 | // enum Compression 43 | // 44 | //----------------------------------------------------------------------------- 45 | 46 | namespace Imf { 47 | 48 | 49 | enum Compression 50 | { 51 | NO_COMPRESSION = 0, // no compression 52 | 53 | RLE_COMPRESSION = 1, // run length encoding 54 | 55 | ZIPS_COMPRESSION = 2, // zlib compression, one scan line at a time 56 | 57 | ZIP_COMPRESSION = 3, // zlib compression, in blocks of 16 scan lines 58 | 59 | PIZ_COMPRESSION = 4, // piz-based wavelet compression 60 | 61 | PXR24_COMPRESSION = 5, // lossy 24-bit float compression 62 | 63 | B44_COMPRESSION = 6, // lossy 4-by-4 pixel block compression, 64 | // fixed compression rate 65 | 66 | B44A_COMPRESSION = 7, // lossy 4-by-4 pixel block compression, 67 | // flat fields are compressed more 68 | 69 | NUM_COMPRESSION_METHODS // number of different compression methods 70 | }; 71 | 72 | 73 | } // namespace Imf 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfCompressionAttribute.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | //----------------------------------------------------------------------------- 38 | // 39 | // class CompressionAttribute 40 | // 41 | //----------------------------------------------------------------------------- 42 | 43 | #include 44 | 45 | 46 | namespace Imf { 47 | 48 | 49 | template <> 50 | const char * 51 | CompressionAttribute::staticTypeName () 52 | { 53 | return "compression"; 54 | } 55 | 56 | 57 | template <> 58 | void 59 | CompressionAttribute::writeValueTo (OStream &os, int version) const 60 | { 61 | unsigned char tmp = _value; 62 | Xdr::write (os, tmp); 63 | } 64 | 65 | 66 | template <> 67 | void 68 | CompressionAttribute::readValueFrom (IStream &is, int size, int version) 69 | { 70 | unsigned char tmp; 71 | Xdr::read (is, tmp); 72 | _value = Compression (tmp); 73 | } 74 | 75 | 76 | } // namespace Imf 77 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfCompressionAttribute.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IMF_COMPRESSION_ATTRIBUTE_H 38 | #define INCLUDED_IMF_COMPRESSION_ATTRIBUTE_H 39 | 40 | //----------------------------------------------------------------------------- 41 | // 42 | // class CompressionAttribute 43 | // 44 | //----------------------------------------------------------------------------- 45 | 46 | #include 47 | #include 48 | 49 | 50 | namespace Imf { 51 | 52 | 53 | typedef TypedAttribute CompressionAttribute; 54 | template <> const char *CompressionAttribute::staticTypeName (); 55 | template <> void CompressionAttribute::writeValueTo (OStream &, int) const; 56 | template <> void CompressionAttribute::readValueFrom (IStream &, int, int); 57 | 58 | 59 | } // namespace Imf 60 | 61 | // Metrowerks compiler wants the .cpp file inlined, too 62 | #ifdef __MWERKS__ 63 | #include 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfDoubleAttribute.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | //----------------------------------------------------------------------------- 38 | // 39 | // class DoubleAttribute 40 | // 41 | //----------------------------------------------------------------------------- 42 | 43 | #include 44 | 45 | 46 | namespace Imf { 47 | 48 | 49 | template <> 50 | const char * 51 | DoubleAttribute::staticTypeName () 52 | { 53 | return "double"; 54 | } 55 | 56 | 57 | } // namespace Imf 58 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfDoubleAttribute.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IMF_DOUBLE_ATTRIBUTE_H 38 | #define INCLUDED_IMF_DOUBLE_ATTRIBUTE_H 39 | 40 | //----------------------------------------------------------------------------- 41 | // 42 | // class DoubleAttribute 43 | // 44 | //----------------------------------------------------------------------------- 45 | 46 | #include 47 | 48 | 49 | namespace Imf { 50 | 51 | 52 | typedef TypedAttribute DoubleAttribute; 53 | template <> const char *DoubleAttribute::staticTypeName (); 54 | 55 | 56 | } // namespace Imf 57 | 58 | // Metrowerks compiler wants the .cpp file inlined, too 59 | #ifdef __MWERKS__ 60 | #include 61 | #endif 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfEnvmapAttribute.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | //----------------------------------------------------------------------------- 37 | // 38 | // class EnvmapAttribute 39 | // 40 | //----------------------------------------------------------------------------- 41 | 42 | #include 43 | 44 | 45 | namespace Imf { 46 | 47 | 48 | template <> 49 | const char * 50 | EnvmapAttribute::staticTypeName () 51 | { 52 | return "envmap"; 53 | } 54 | 55 | 56 | template <> 57 | void 58 | EnvmapAttribute::writeValueTo (OStream &os, int version) const 59 | { 60 | unsigned char tmp = _value; 61 | Xdr::write (os, tmp); 62 | } 63 | 64 | 65 | template <> 66 | void 67 | EnvmapAttribute::readValueFrom (IStream &is, int size, int version) 68 | { 69 | unsigned char tmp; 70 | Xdr::read (is, tmp); 71 | _value = Envmap (tmp); 72 | } 73 | 74 | 75 | } // namespace Imf 76 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfEnvmapAttribute.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | #ifndef INCLUDED_IMF_ENVMAP_ATTRIBUTE_H 36 | #define INCLUDED_IMF_ENVMAP_ATTRIBUTE_H 37 | 38 | 39 | //----------------------------------------------------------------------------- 40 | // 41 | // class EnvmapAttribute 42 | // 43 | //----------------------------------------------------------------------------- 44 | 45 | #include 46 | #include 47 | 48 | 49 | namespace Imf { 50 | 51 | 52 | typedef TypedAttribute EnvmapAttribute; 53 | template <> const char *EnvmapAttribute::staticTypeName (); 54 | template <> void EnvmapAttribute::writeValueTo (OStream &, int) const; 55 | template <> void EnvmapAttribute::readValueFrom (IStream &, int, int); 56 | 57 | 58 | } // namespace Imf 59 | 60 | // Metrowerks compiler wants the .cpp file inlined, too 61 | #ifdef __MWERKS__ 62 | #include 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfFloatAttribute.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | //----------------------------------------------------------------------------- 38 | // 39 | // class FloatAttribute 40 | // 41 | //----------------------------------------------------------------------------- 42 | 43 | #include 44 | 45 | 46 | namespace Imf { 47 | 48 | 49 | template <> 50 | const char * 51 | FloatAttribute::staticTypeName () 52 | { 53 | return "float"; 54 | } 55 | 56 | 57 | } // namespace Imf 58 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfFloatAttribute.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IMF_FLOAT_ATTRIBUTE_H 38 | #define INCLUDED_IMF_FLOAT_ATTRIBUTE_H 39 | 40 | //----------------------------------------------------------------------------- 41 | // 42 | // class FloatAttribute 43 | // 44 | //----------------------------------------------------------------------------- 45 | 46 | #include 47 | 48 | 49 | namespace Imf { 50 | 51 | 52 | typedef TypedAttribute FloatAttribute; 53 | template <> const char *FloatAttribute::staticTypeName (); 54 | 55 | 56 | } // namespace Imf 57 | 58 | // Metrowerks compiler wants the .cpp file inlined, too 59 | #ifdef __MWERKS__ 60 | #include 61 | #endif 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfFramesPerSecond.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2006, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | //----------------------------------------------------------------------------- 36 | // 37 | // Convenience functions related to the framesPerSecond attribute 38 | // 39 | //----------------------------------------------------------------------------- 40 | 41 | #include 42 | #include "ImathFun.h" 43 | 44 | using namespace Imath; 45 | 46 | namespace Imf { 47 | 48 | Rational 49 | guessExactFps (double fps) 50 | { 51 | return guessExactFps (Rational (fps)); 52 | } 53 | 54 | 55 | Rational 56 | guessExactFps (const Rational &fps) 57 | { 58 | const double e = 0.002; 59 | 60 | if (abs (double (fps) - double (fps_23_976())) < e) 61 | return fps_23_976(); 62 | 63 | if (abs (double (fps) - double (fps_29_97())) < e) 64 | return fps_29_97(); 65 | 66 | if (abs (double (fps) - double (fps_47_952())) < e) 67 | return fps_47_952(); 68 | 69 | if (abs (double (fps) - double (fps_59_94())) < e) 70 | return fps_59_94(); 71 | 72 | return fps; 73 | } 74 | 75 | } // namespace Imf 76 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfHuf.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IMF_HUF_H 38 | #define INCLUDED_IMF_HUF_H 39 | 40 | 41 | //----------------------------------------------------------------------------- 42 | // 43 | // 16-bit Huffman compression and decompression: 44 | // 45 | // hufCompress (r, nr, c) 46 | // 47 | // Compresses the contents of array r (of length nr), 48 | // stores the compressed data in array c, and returns 49 | // the size of the compressed data (in bytes). 50 | // 51 | // To avoid buffer overflows, the size of array c should 52 | // be at least 2 * nr + 65536. 53 | // 54 | // hufUncompress (c, nc, r, nr) 55 | // 56 | // Uncompresses the data in array c (with length nc), 57 | // and stores the results in array r (with length nr). 58 | // 59 | //----------------------------------------------------------------------------- 60 | 61 | namespace Imf { 62 | 63 | 64 | int 65 | hufCompress (const unsigned short raw[/*nRaw*/], 66 | int nRaw, 67 | char compressed[/*2 * nRaw + 65536*/]); 68 | 69 | 70 | void 71 | hufUncompress (const char compressed[/*nCompressed*/], 72 | int nCompressed, 73 | unsigned short raw[/*nRaw*/], 74 | int nRaw); 75 | 76 | 77 | } // namespace Imf 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfIO.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | //----------------------------------------------------------------------------- 37 | // 38 | // Low-level file input and output for OpenEXR. 39 | // 40 | //----------------------------------------------------------------------------- 41 | 42 | #include 43 | #include "Iex.h" 44 | 45 | namespace Imf { 46 | 47 | 48 | IStream::IStream (const char fileName[]): _fileName (fileName) 49 | { 50 | // empty 51 | } 52 | 53 | 54 | IStream::~IStream () 55 | { 56 | // empty 57 | } 58 | 59 | 60 | bool 61 | IStream::isMemoryMapped () const 62 | { 63 | return false; 64 | } 65 | 66 | 67 | char * 68 | IStream::readMemoryMapped (int n) 69 | { 70 | throw Iex::InputExc ("Attempt to perform a memory-mapped read " 71 | "on a file that is not memory mapped."); 72 | return 0; 73 | } 74 | 75 | 76 | void 77 | IStream::clear () 78 | { 79 | // empty 80 | } 81 | 82 | 83 | const char * 84 | IStream::fileName () const 85 | { 86 | return _fileName.c_str(); 87 | } 88 | 89 | 90 | OStream::OStream (const char fileName[]): _fileName (fileName) 91 | { 92 | // empty 93 | } 94 | 95 | 96 | OStream::~OStream () 97 | { 98 | // empty 99 | } 100 | 101 | 102 | const char * 103 | OStream::fileName () const 104 | { 105 | return _fileName.c_str(); 106 | } 107 | 108 | 109 | } // namespace Imf 110 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfInt64.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2006, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | #ifndef INCLUDED_IMF_INT64_H 36 | #define INCLUDED_IMF_INT64_H 37 | 38 | //---------------------------------------------------------------------------- 39 | // 40 | // Int64 -- unsigned 64-bit integers, imported from namespace Imath 41 | // 42 | //---------------------------------------------------------------------------- 43 | 44 | #include "ImathInt64.h" 45 | 46 | namespace Imf { 47 | 48 | using Imath::Int64; 49 | 50 | } // namespace Imf 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfIntAttribute.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | //----------------------------------------------------------------------------- 38 | // 39 | // class IntAttribute 40 | // 41 | //----------------------------------------------------------------------------- 42 | 43 | #include 44 | 45 | 46 | namespace Imf { 47 | 48 | 49 | template <> 50 | const char * 51 | IntAttribute::staticTypeName () 52 | { 53 | return "int"; 54 | } 55 | 56 | 57 | } // namespace Imf 58 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfIntAttribute.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IMF_INT_ATTRIBUTE_H 38 | #define INCLUDED_IMF_INT_ATTRIBUTE_H 39 | 40 | //----------------------------------------------------------------------------- 41 | // 42 | // class IntAttribute 43 | // 44 | //----------------------------------------------------------------------------- 45 | 46 | #include 47 | 48 | 49 | namespace Imf { 50 | 51 | 52 | typedef TypedAttribute IntAttribute; 53 | template <> const char *IntAttribute::staticTypeName (); 54 | 55 | 56 | } // namespace Imf 57 | 58 | // Metrowerks compiler wants the .cpp file inlined, too 59 | #ifdef __MWERKS__ 60 | #include 61 | #endif 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfKeyCodeAttribute.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | //----------------------------------------------------------------------------- 37 | // 38 | // class KeyCodeAttribute 39 | // 40 | //----------------------------------------------------------------------------- 41 | 42 | #include 43 | 44 | namespace Imf { 45 | 46 | 47 | template <> 48 | const char * 49 | KeyCodeAttribute::staticTypeName () 50 | { 51 | return "keycode"; 52 | } 53 | 54 | 55 | template <> 56 | void 57 | KeyCodeAttribute::writeValueTo (OStream &os, int version) const 58 | { 59 | Xdr::write (os, _value.filmMfcCode()); 60 | Xdr::write (os, _value.filmType()); 61 | Xdr::write (os, _value.prefix()); 62 | Xdr::write (os, _value.count()); 63 | Xdr::write (os, _value.perfOffset()); 64 | Xdr::write (os, _value.perfsPerFrame()); 65 | Xdr::write (os, _value.perfsPerCount()); 66 | } 67 | 68 | 69 | template <> 70 | void 71 | KeyCodeAttribute::readValueFrom (IStream &is, int size, int version) 72 | { 73 | int tmp; 74 | 75 | Xdr::read (is, tmp); 76 | _value.setFilmMfcCode (tmp); 77 | 78 | Xdr::read (is, tmp); 79 | _value.setFilmType (tmp); 80 | 81 | Xdr::read (is, tmp); 82 | _value.setPrefix (tmp); 83 | 84 | Xdr::read (is, tmp); 85 | _value.setCount (tmp); 86 | 87 | Xdr::read (is, tmp); 88 | _value.setPerfOffset (tmp); 89 | 90 | Xdr::read (is, tmp); 91 | _value.setPerfsPerFrame (tmp); 92 | 93 | Xdr::read (is, tmp); 94 | _value.setPerfsPerCount (tmp); 95 | } 96 | 97 | 98 | } // namespace Imf 99 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfKeyCodeAttribute.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | #ifndef INCLUDED_IMF_KEY_CODE_ATTRIBUTE_H 37 | #define INCLUDED_IMF_KEY_CODE_ATTRIBUTE_H 38 | 39 | 40 | //----------------------------------------------------------------------------- 41 | // 42 | // class KeyCodeAttribute 43 | // 44 | //----------------------------------------------------------------------------- 45 | 46 | #include 47 | #include 48 | 49 | 50 | namespace Imf { 51 | 52 | 53 | typedef TypedAttribute KeyCodeAttribute; 54 | 55 | template <> 56 | const char *KeyCodeAttribute::staticTypeName (); 57 | 58 | template <> 59 | void KeyCodeAttribute::writeValueTo (OStream &, int) const; 60 | 61 | template <> 62 | void KeyCodeAttribute::readValueFrom (IStream &, int, int); 63 | 64 | 65 | } // namespace Imf 66 | 67 | // Metrowerks compiler wants the .cpp file inlined, too 68 | #ifdef __MWERKS__ 69 | #include 70 | #endif 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfLineOrder.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IMF_LINE_ORDER_H 38 | #define INCLUDED_IMF_LINE_ORDER_H 39 | 40 | //----------------------------------------------------------------------------- 41 | // 42 | // enum LineOrder 43 | // 44 | //----------------------------------------------------------------------------- 45 | 46 | namespace Imf { 47 | 48 | 49 | enum LineOrder 50 | { 51 | INCREASING_Y = 0, // first scan line has lowest y coordinate 52 | 53 | DECREASING_Y = 1, // first scan line has highest y coordinate 54 | 55 | RANDOM_Y = 2, // only for tiled files; tiles are written 56 | // in random order 57 | 58 | NUM_LINEORDERS // number of different line orders 59 | }; 60 | 61 | 62 | } // namespace Imf 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfLineOrderAttribute.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | 38 | //----------------------------------------------------------------------------- 39 | // 40 | // class LineOrderAttribute 41 | // 42 | //----------------------------------------------------------------------------- 43 | 44 | #include 45 | 46 | 47 | namespace Imf { 48 | 49 | 50 | template <> 51 | const char * 52 | LineOrderAttribute::staticTypeName () 53 | { 54 | return "lineOrder"; 55 | } 56 | 57 | 58 | template <> 59 | void 60 | LineOrderAttribute::writeValueTo (OStream &os, int version) const 61 | { 62 | unsigned char tmp = _value; 63 | Xdr::write (os, tmp); 64 | } 65 | 66 | 67 | template <> 68 | void 69 | LineOrderAttribute::readValueFrom (IStream &is, int size, int version) 70 | { 71 | unsigned char tmp; 72 | Xdr::read (is, tmp); 73 | _value = LineOrder (tmp); 74 | } 75 | 76 | 77 | } // namespace Imf 78 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfLineOrderAttribute.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IMF_LINE_ORDER_ATTRIBUTE_H 38 | #define INCLUDED_IMF_LINE_ORDER_ATTRIBUTE_H 39 | 40 | //----------------------------------------------------------------------------- 41 | // 42 | // class LineOrderAttribute 43 | // 44 | //----------------------------------------------------------------------------- 45 | 46 | #include 47 | #include 48 | 49 | 50 | namespace Imf { 51 | 52 | 53 | typedef TypedAttribute LineOrderAttribute; 54 | template <> const char *LineOrderAttribute::staticTypeName (); 55 | template <> void LineOrderAttribute::writeValueTo (OStream &, int) const; 56 | template <> void LineOrderAttribute::readValueFrom (IStream &, int, int); 57 | 58 | 59 | } // namespace Imf 60 | 61 | // Metrowerks compiler wants the .cpp file inlined, too 62 | #ifdef __MWERKS__ 63 | #include 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfPixelType.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IMF_PIXEL_TYPE_H 38 | #define INCLUDED_IMF_PIXEL_TYPE_H 39 | 40 | //----------------------------------------------------------------------------- 41 | // 42 | // enum PixelType 43 | // 44 | //----------------------------------------------------------------------------- 45 | 46 | namespace Imf { 47 | 48 | 49 | enum PixelType 50 | { 51 | UINT = 0, // unsigned int (32 bit) 52 | HALF = 1, // half (16 bit floating point) 53 | FLOAT = 2, // float (32 bit floating point) 54 | 55 | NUM_PIXELTYPES // number of different pixel types 56 | }; 57 | 58 | 59 | } // namespace Imf 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfPizCompressor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prideout/pez/a3c6f4afcc3983df0743bf472d1c0c18661399cb/converter/tinylib/openexr/IlmImf/ImfPizCompressor.cpp -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfPreviewImageAttribute.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | #ifndef INCLUDED_IMF_PREVIEW_IMAGE_ATTRIBUTE_H 37 | #define INCLUDED_IMF_PREVIEW_IMAGE_ATTRIBUTE_H 38 | 39 | //----------------------------------------------------------------------------- 40 | // 41 | // class PreviewImageAttribute 42 | // 43 | //----------------------------------------------------------------------------- 44 | 45 | #include 46 | #include 47 | 48 | 49 | namespace Imf { 50 | 51 | 52 | typedef TypedAttribute PreviewImageAttribute; 53 | 54 | template <> 55 | const char *PreviewImageAttribute::staticTypeName (); 56 | 57 | template <> 58 | void PreviewImageAttribute::writeValueTo (OStream &, int) const; 59 | 60 | template <> 61 | void PreviewImageAttribute::readValueFrom (IStream &, int, int); 62 | 63 | 64 | } // namespace Imf 65 | 66 | // Metrowerks compiler wants the .cpp file inlined, too 67 | #ifdef __MWERKS__ 68 | #include 69 | #endif 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfRational.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2006, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | #ifndef INCLUDED_IMF_RATIONAL_H 37 | #define INCLUDED_IMF_RATIONAL_H 38 | 39 | //----------------------------------------------------------------------------- 40 | // 41 | // Rational numbers 42 | // 43 | // A rational number is represented as pair of integers, n and d. 44 | // The value of of the rational number is 45 | // 46 | // n/d for d > 0 47 | // positive infinity for n > 0, d == 0 48 | // negative infinity for n < 0, d == 0 49 | // not a number (NaN) for n == 0, d == 0 50 | // 51 | //----------------------------------------------------------------------------- 52 | 53 | namespace Imf { 54 | 55 | class Rational 56 | { 57 | public: 58 | 59 | int n; // numerator 60 | unsigned int d; // denominator 61 | 62 | 63 | //---------------------------------------- 64 | // Default constructor, sets value to zero 65 | //---------------------------------------- 66 | 67 | Rational (): n (0), d (1) {} 68 | 69 | 70 | //------------------------------------- 71 | // Constructor, explicitly sets n and d 72 | //------------------------------------- 73 | 74 | Rational (int n, int d): n (n), d (d) {} 75 | 76 | 77 | //---------------------------- 78 | // Constructor, approximates x 79 | //---------------------------- 80 | 81 | explicit Rational (double x); 82 | 83 | 84 | //--------------------------------- 85 | // Approximate conversion to double 86 | //--------------------------------- 87 | 88 | operator double () const {return double (n) / double (d);} 89 | }; 90 | 91 | } // namespace Imf 92 | 93 | #endif 94 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfRationalAttribute.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2006, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | //----------------------------------------------------------------------------- 36 | // 37 | // class RationalAttribute 38 | // 39 | //----------------------------------------------------------------------------- 40 | 41 | #include 42 | 43 | 44 | namespace Imf { 45 | 46 | 47 | template <> 48 | const char * 49 | RationalAttribute::staticTypeName () 50 | { 51 | return "rational"; 52 | } 53 | 54 | 55 | template <> 56 | void 57 | RationalAttribute::writeValueTo (OStream &os, int version) const 58 | { 59 | Xdr::write (os, _value.n); 60 | Xdr::write (os, _value.d); 61 | } 62 | 63 | 64 | template <> 65 | void 66 | RationalAttribute::readValueFrom (IStream &is, int size, int version) 67 | { 68 | Xdr::read (is, _value.n); 69 | Xdr::read (is, _value.d); 70 | } 71 | 72 | 73 | } // namespace Imf 74 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfRationalAttribute.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | #ifndef INCLUDED_IMF_RATIONAL_ATTRIBUTE_H 36 | #define INCLUDED_IMF_RATIONAL_ATTRIBUTE_H 37 | 38 | //----------------------------------------------------------------------------- 39 | // 40 | // class RationalAttribute 41 | // 42 | //----------------------------------------------------------------------------- 43 | 44 | #include 45 | #include 46 | 47 | 48 | namespace Imf { 49 | 50 | 51 | typedef TypedAttribute RationalAttribute; 52 | 53 | template <> 54 | const char *RationalAttribute::staticTypeName (); 55 | 56 | template <> 57 | void RationalAttribute::writeValueTo (OStream &, int) const; 58 | 59 | template <> 60 | void RationalAttribute::readValueFrom (IStream &, int, int); 61 | 62 | 63 | } // namespace Imf 64 | 65 | // Metrowerks compiler wants the .cpp file inlined, too 66 | #ifdef __MWERKS__ 67 | #include 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfRleCompressor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prideout/pez/a3c6f4afcc3983df0743bf472d1c0c18661399cb/converter/tinylib/openexr/IlmImf/ImfRleCompressor.cpp -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfRleCompressor.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IMF_RLE_COMPRESSOR_H 38 | #define INCLUDED_IMF_RLE_COMPRESSOR_H 39 | 40 | //----------------------------------------------------------------------------- 41 | // 42 | // class RleCompressor -- performs run-length encoding 43 | // 44 | //----------------------------------------------------------------------------- 45 | 46 | #include 47 | 48 | namespace Imf { 49 | 50 | 51 | class RleCompressor: public Compressor 52 | { 53 | public: 54 | 55 | RleCompressor (const Header &hdr, size_t maxScanLineSize); 56 | virtual ~RleCompressor (); 57 | 58 | virtual int numScanLines () const; 59 | 60 | virtual int compress (const char *inPtr, 61 | int inSize, 62 | int minY, 63 | const char *&outPtr); 64 | 65 | virtual int uncompress (const char *inPtr, 66 | int inSize, 67 | int minY, 68 | const char *&outPtr); 69 | private: 70 | 71 | int _maxScanLineSize; 72 | char * _tmpBuffer; 73 | char * _outBuffer; 74 | }; 75 | 76 | 77 | } // namespace Imf 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfStringAttribute.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | //----------------------------------------------------------------------------- 38 | // 39 | // class StringAttribute 40 | // 41 | //----------------------------------------------------------------------------- 42 | 43 | #include 44 | 45 | 46 | namespace Imf { 47 | 48 | 49 | template <> 50 | const char * 51 | StringAttribute::staticTypeName () 52 | { 53 | return "string"; 54 | } 55 | 56 | 57 | template <> 58 | void 59 | StringAttribute::writeValueTo (OStream &os, int version) const 60 | { 61 | int size = _value.size(); 62 | 63 | for (int i = 0; i < size; i++) 64 | Xdr::write (os, _value[i]); 65 | } 66 | 67 | 68 | template <> 69 | void 70 | StringAttribute::readValueFrom (IStream &is, int size, int version) 71 | { 72 | _value.resize (size); 73 | 74 | for (int i = 0; i < size; i++) 75 | Xdr::read (is, _value[i]); 76 | } 77 | 78 | 79 | } // namespace Imf 80 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfStringAttribute.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IMF_STRING_ATTRIBUTE_H 38 | #define INCLUDED_IMF_STRING_ATTRIBUTE_H 39 | 40 | //----------------------------------------------------------------------------- 41 | // 42 | // class StringAttribute 43 | // 44 | //----------------------------------------------------------------------------- 45 | 46 | #include 47 | #include 48 | 49 | 50 | namespace Imf { 51 | 52 | 53 | typedef TypedAttribute StringAttribute; 54 | template <> const char *StringAttribute::staticTypeName (); 55 | template <> void StringAttribute::writeValueTo (OStream &, int) const; 56 | template <> void StringAttribute::readValueFrom (IStream &, int, int); 57 | 58 | 59 | } // namespace Imf 60 | 61 | // Metrowerks compiler wants the .cpp file inlined, too 62 | #ifdef __MWERKS__ 63 | #include 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfStringVectorAttribute.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2007, Weta Digital Ltd 4 | // 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are 9 | // met: 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above 13 | // copyright notice, this list of conditions and the following disclaimer 14 | // in the documentation and/or other materials provided with the 15 | // distribution. 16 | // * Neither the name of Weta Digital nor the names of 17 | // its contributors may be used to endorse or promote products derived 18 | // from this software without specific prior written permission. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | // 32 | /////////////////////////////////////////////////////////////////////////// 33 | 34 | 35 | 36 | //----------------------------------------------------------------------------- 37 | // 38 | // class StringAttribute 39 | // 40 | //----------------------------------------------------------------------------- 41 | 42 | #include 43 | 44 | 45 | namespace Imf { 46 | 47 | 48 | template <> 49 | const char * 50 | StringVectorAttribute::staticTypeName () 51 | { 52 | return "stringvector"; 53 | } 54 | 55 | 56 | template <> 57 | void 58 | StringVectorAttribute::writeValueTo (OStream &os, int version) const 59 | { 60 | int size = _value.size(); 61 | 62 | for (int i = 0; i < size; i++) 63 | { 64 | int strSize = _value[i].size(); 65 | Xdr::write (os, strSize); 66 | Xdr::write (os, &_value[i][0], strSize); 67 | } 68 | } 69 | 70 | 71 | template <> 72 | void 73 | StringVectorAttribute::readValueFrom (IStream &is, int size, int version) 74 | { 75 | int read = 0; 76 | 77 | while (read < size) 78 | { 79 | int strSize; 80 | Xdr::read (is, strSize); 81 | read += Xdr::size(); 82 | 83 | std::string str; 84 | str.resize (strSize); 85 | 86 | Xdr::read (is, &str[0], strSize); 87 | read += strSize; 88 | 89 | _value.push_back (str); 90 | } 91 | } 92 | 93 | 94 | } // namespace Imf 95 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfStringVectorAttribute.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2007, Weta Digital Ltd 4 | // 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are 9 | // met: 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above 13 | // copyright notice, this list of conditions and the following disclaimer 14 | // in the documentation and/or other materials provided with the 15 | // distribution. 16 | // * Neither the name of Weta Digital nor the names of 17 | // its contributors may be used to endorse or promote products derived 18 | // from this software without specific prior written permission. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | // 32 | /////////////////////////////////////////////////////////////////////////// 33 | 34 | 35 | 36 | #ifndef INCLUDED_IMF_STRINGVECTOR_ATTRIBUTE_H 37 | #define INCLUDED_IMF_STRINGVECTOR_ATTRIBUTE_H 38 | 39 | //----------------------------------------------------------------------------- 40 | // 41 | // class StringVectorAttribute 42 | // 43 | //----------------------------------------------------------------------------- 44 | 45 | #include 46 | #include 47 | #include 48 | 49 | 50 | namespace Imf { 51 | 52 | typedef std::vector StringVector; 53 | typedef TypedAttribute StringVectorAttribute; 54 | template <> const char *StringVectorAttribute::staticTypeName (); 55 | template <> void StringVectorAttribute::writeValueTo (OStream &, int) const; 56 | template <> void StringVectorAttribute::readValueFrom (IStream &, int, int); 57 | 58 | 59 | } // namespace Imf 60 | 61 | // Metrowerks compiler wants the .cpp file inlined, too 62 | #ifdef __MWERKS__ 63 | #include 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfTestFile.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | #ifndef INCLUDED_IMF_TEST_FILE_H 37 | #define INCLUDED_IMF_TEST_FILE_H 38 | 39 | //----------------------------------------------------------------------------- 40 | // 41 | // Utility routines to test quickly if a given 42 | // file is an OpenEXR file, and whether the 43 | // file is scanline-based or tiled. 44 | // 45 | //----------------------------------------------------------------------------- 46 | 47 | 48 | namespace Imf { 49 | 50 | class IStream; 51 | 52 | 53 | bool isOpenExrFile (const char fileName[], bool &isTiled); 54 | bool isOpenExrFile (const char fileName[]); 55 | bool isTiledOpenExrFile (const char fileName[]); 56 | bool isOpenExrFile (IStream &is, bool &isTiled); 57 | bool isOpenExrFile (IStream &is); 58 | bool isTiledOpenExrFile (IStream &is); 59 | 60 | 61 | } // namespace Imf 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfThreading.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2005, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | //----------------------------------------------------------------------------- 36 | // 37 | // Threading support for the IlmImf library 38 | // 39 | //----------------------------------------------------------------------------- 40 | 41 | #include "IlmThreadPool.h" 42 | 43 | namespace Imf { 44 | 45 | 46 | int 47 | globalThreadCount () 48 | { 49 | return IlmThread::ThreadPool::globalThreadPool().numThreads(); 50 | } 51 | 52 | 53 | void 54 | setGlobalThreadCount (int count) 55 | { 56 | IlmThread::ThreadPool::globalThreadPool().setNumThreads (count); 57 | } 58 | 59 | 60 | } // namespace Imf 61 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfTileDescriptionAttribute.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | //----------------------------------------------------------------------------- 37 | // 38 | // class TileDescriptionAttribute 39 | // 40 | //----------------------------------------------------------------------------- 41 | 42 | #include 43 | 44 | 45 | namespace Imf { 46 | 47 | 48 | template <> 49 | const char * 50 | TileDescriptionAttribute::staticTypeName () 51 | { 52 | return "tiledesc"; 53 | } 54 | 55 | 56 | template <> 57 | void 58 | TileDescriptionAttribute::writeValueTo (OStream &os, int version) const 59 | { 60 | Xdr::write (os, _value.xSize); 61 | Xdr::write (os, _value.ySize); 62 | 63 | unsigned char tmp = _value.mode | (_value.roundingMode << 4); 64 | Xdr::write (os, tmp); 65 | } 66 | 67 | 68 | template <> 69 | void 70 | TileDescriptionAttribute::readValueFrom (IStream &is, 71 | int size, 72 | int version) 73 | { 74 | Xdr::read (is, _value.xSize); 75 | Xdr::read (is, _value.ySize); 76 | 77 | unsigned char tmp; 78 | Xdr::read (is, tmp); 79 | _value.mode = LevelMode (tmp & 0x0f); 80 | _value.roundingMode = LevelRoundingMode ((tmp >> 4) & 0x0f); 81 | 82 | } 83 | 84 | 85 | } // namespace Imf 86 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfTileDescriptionAttribute.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | #ifndef INCLUDED_IMF_TILE_DESCRIPTION_ATTRIBUTE_H 37 | #define INCLUDED_IMF_TILE_DESCRIPTION_ATTRIBUTE_H 38 | 39 | //----------------------------------------------------------------------------- 40 | // 41 | // class TileDescriptionAttribute 42 | // 43 | //----------------------------------------------------------------------------- 44 | 45 | #include 46 | #include 47 | 48 | namespace Imf { 49 | 50 | 51 | typedef TypedAttribute TileDescriptionAttribute; 52 | 53 | template <> 54 | const char * 55 | TileDescriptionAttribute::staticTypeName (); 56 | 57 | template <> 58 | void 59 | TileDescriptionAttribute::writeValueTo (OStream &, int) const; 60 | 61 | template <> 62 | void 63 | TileDescriptionAttribute::readValueFrom (IStream &, int, int); 64 | 65 | 66 | } // namespace Imf 67 | 68 | // Metrowerks compiler wants the .cpp file inlined, too 69 | #ifdef __MWERKS__ 70 | #include 71 | #endif 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfTiledMisc.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | #ifndef INCLUDED_IMF_TILED_MISC_H 37 | #define INCLUDED_IMF_TILED_MISC_H 38 | 39 | //----------------------------------------------------------------------------- 40 | // 41 | // Miscellaneous stuff related to tiled files 42 | // 43 | //----------------------------------------------------------------------------- 44 | 45 | #include "ImathBox.h" 46 | #include 47 | #include 48 | 49 | namespace Imf { 50 | 51 | int levelSize (int min, int max, int l, LevelRoundingMode rmode); 52 | 53 | Imath::Box2i dataWindowForLevel (const TileDescription &tileDesc, 54 | int minX, int maxX, 55 | int minY, int maxY, 56 | int lx, int ly); 57 | 58 | Imath::Box2i dataWindowForTile (const TileDescription &tileDesc, 59 | int minX, int maxX, 60 | int minY, int maxY, 61 | int dx, int dy, 62 | int lx, int ly); 63 | 64 | size_t calculateBytesPerPixel (const Header &header); 65 | 66 | void precalculateTileInfo (const TileDescription& tileDesc, 67 | int minX, int maxX, 68 | int minY, int maxY, 69 | int *&numXTiles, int *&numYTiles, 70 | int &numXLevels, int &numYLevels); 71 | 72 | 73 | } // namespace Imf 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfTimeCodeAttribute.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | //----------------------------------------------------------------------------- 37 | // 38 | // class TimeCodeAttribute 39 | // 40 | //----------------------------------------------------------------------------- 41 | 42 | #include 43 | 44 | namespace Imf { 45 | 46 | 47 | template <> 48 | const char * 49 | TimeCodeAttribute::staticTypeName () 50 | { 51 | return "timecode"; 52 | } 53 | 54 | 55 | template <> 56 | void 57 | TimeCodeAttribute::writeValueTo (OStream &os, int version) const 58 | { 59 | Xdr::write (os, _value.timeAndFlags()); 60 | Xdr::write (os, _value.userData()); 61 | } 62 | 63 | 64 | template <> 65 | void 66 | TimeCodeAttribute::readValueFrom (IStream &is, int size, int version) 67 | { 68 | unsigned int tmp; 69 | 70 | Xdr::read (is, tmp); 71 | _value.setTimeAndFlags (tmp); 72 | 73 | Xdr::read (is, tmp); 74 | _value.setUserData (tmp); 75 | } 76 | 77 | 78 | } // namespace Imf 79 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfTimeCodeAttribute.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | #ifndef INCLUDED_IMF_TIME_CODE_ATTRIBUTE_H 37 | #define INCLUDED_IMF_TIME_CODE_ATTRIBUTE_H 38 | 39 | 40 | //----------------------------------------------------------------------------- 41 | // 42 | // class TimeCodeAttribute 43 | // 44 | //----------------------------------------------------------------------------- 45 | 46 | #include 47 | #include 48 | 49 | 50 | namespace Imf { 51 | 52 | 53 | typedef TypedAttribute TimeCodeAttribute; 54 | 55 | template <> 56 | const char *TimeCodeAttribute::staticTypeName (); 57 | 58 | template <> 59 | void TimeCodeAttribute::writeValueTo (OStream &, int) const; 60 | 61 | template <> 62 | void TimeCodeAttribute::readValueFrom (IStream &, int, int); 63 | 64 | 65 | } // namespace Imf 66 | 67 | // Metrowerks compiler wants the .cpp file inlined, too 68 | #ifdef __MWERKS__ 69 | #include 70 | #endif 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfVersion.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | //----------------------------------------------------------------------------- 37 | // 38 | // Magic and version number. 39 | // 40 | //----------------------------------------------------------------------------- 41 | 42 | 43 | #include 44 | 45 | namespace Imf { 46 | 47 | 48 | bool 49 | isImfMagic (const char bytes[4]) 50 | { 51 | return bytes[0] == ((MAGIC >> 0) & 0x00ff) && 52 | bytes[1] == ((MAGIC >> 8) & 0x00ff) && 53 | bytes[2] == ((MAGIC >> 16) & 0x00ff) && 54 | bytes[3] == ((MAGIC >> 24) & 0x00ff); 55 | } 56 | 57 | 58 | } // namespace Imf 59 | 60 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfWav.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IMF_WAV_H 38 | #define INCLUDED_IMF_WAV_H 39 | 40 | //----------------------------------------------------------------------------- 41 | // 42 | // 16-bit Haar Wavelet encoding and decoding 43 | // 44 | //----------------------------------------------------------------------------- 45 | 46 | namespace Imf { 47 | 48 | 49 | void 50 | wav2Encode 51 | (unsigned short *in, // io: values in[y][x] are transformed in place 52 | int nx, // i : x size 53 | int ox, // i : x offset 54 | int ny, // i : y size 55 | int oy, // i : y offset 56 | unsigned short mx); // i : maximum in[x][y] value 57 | 58 | void 59 | wav2Decode 60 | (unsigned short *in, // io: values in[y][x] are transformed in place 61 | int nx, // i : x size 62 | int ox, // i : x offset 63 | int ny, // i : y size 64 | int oy, // i : y offset 65 | unsigned short mx); // i : maximum in[x][y] value 66 | 67 | 68 | } // namespace Imf 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfZipCompressor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prideout/pez/a3c6f4afcc3983df0743bf472d1c0c18661399cb/converter/tinylib/openexr/IlmImf/ImfZipCompressor.cpp -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmImf/ImfZipCompressor.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IMF_ZIP_COMPRESSOR_H 38 | #define INCLUDED_IMF_ZIP_COMPRESSOR_H 39 | 40 | //----------------------------------------------------------------------------- 41 | // 42 | // class ZipCompressor -- performs zlib-style compression 43 | // 44 | //----------------------------------------------------------------------------- 45 | 46 | #include 47 | 48 | namespace Imf { 49 | 50 | 51 | class ZipCompressor: public Compressor 52 | { 53 | public: 54 | 55 | ZipCompressor (const Header &hdr, 56 | size_t maxScanLineSize, 57 | size_t numScanLines); 58 | 59 | virtual ~ZipCompressor (); 60 | 61 | virtual int numScanLines () const; 62 | 63 | virtual int compress (const char *inPtr, 64 | int inSize, 65 | int minY, 66 | const char *&outPtr); 67 | 68 | virtual int uncompress (const char *inPtr, 69 | int inSize, 70 | int minY, 71 | const char *&outPtr); 72 | private: 73 | 74 | int _maxScanLineSize; 75 | int _numScanLines; 76 | char * _tmpBuffer; 77 | char * _outBuffer; 78 | }; 79 | 80 | 81 | } // namespace Imf 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmThread/IlmThread.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2005, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | //----------------------------------------------------------------------------- 36 | // 37 | // class Thread -- dummy implementation for 38 | // platforms that do not support threading 39 | // 40 | //----------------------------------------------------------------------------- 41 | 42 | #include "IlmBaseConfig.h" 43 | 44 | #if !defined (_WIN32) &&!(_WIN64) && !(HAVE_PTHREAD) 45 | 46 | #include "IlmThread.h" 47 | #include "Iex.h" 48 | 49 | namespace IlmThread { 50 | 51 | 52 | bool 53 | supportsThreads () 54 | { 55 | return false; 56 | } 57 | 58 | 59 | Thread::Thread () 60 | { 61 | throw Iex::NoImplExc ("Threads not supported on this platform."); 62 | } 63 | 64 | 65 | Thread::~Thread () 66 | { 67 | throw Iex::NoImplExc ("Threads not supported on this platform."); 68 | } 69 | 70 | 71 | void 72 | Thread::start () 73 | { 74 | throw Iex::NoImplExc ("Threads not supported on this platform."); 75 | } 76 | 77 | 78 | } // namespace IlmThread 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmThread/IlmThreadMutex.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2005, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | //----------------------------------------------------------------------------- 36 | // 37 | // class Mutex, class Lock -- dummy implementation 38 | // for platforms that do not support threading 39 | // 40 | //----------------------------------------------------------------------------- 41 | 42 | #include "IlmBaseConfig.h" 43 | 44 | #if !defined (_WIN32) && !(_WIN64) && !(HAVE_PTHREAD) 45 | 46 | #include "IlmThreadMutex.h" 47 | 48 | namespace IlmThread { 49 | 50 | 51 | Mutex::Mutex () {} 52 | Mutex::~Mutex () {} 53 | void Mutex::lock () const {} 54 | void Mutex::unlock () const {} 55 | 56 | 57 | } // namespace IlmThread 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmThread/IlmThreadMutexPosix.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2005, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | //----------------------------------------------------------------------------- 36 | // 37 | // class Mutex -- implementation for 38 | // platforms that support Posix threads 39 | // 40 | //----------------------------------------------------------------------------- 41 | 42 | #include "IlmBaseConfig.h" 43 | 44 | #if HAVE_PTHREAD 45 | 46 | #include "IlmThreadMutex.h" 47 | #include "Iex.h" 48 | #include 49 | 50 | namespace IlmThread { 51 | 52 | 53 | Mutex::Mutex () 54 | { 55 | if (int error = ::pthread_mutex_init (&_mutex, 0)) 56 | Iex::throwErrnoExc ("Cannot initialize mutex (%T).", error); 57 | } 58 | 59 | 60 | Mutex::~Mutex () 61 | { 62 | int error = ::pthread_mutex_destroy (&_mutex); 63 | assert (error == 0); 64 | } 65 | 66 | 67 | void 68 | Mutex::lock () const 69 | { 70 | if (int error = ::pthread_mutex_lock (&_mutex)) 71 | Iex::throwErrnoExc ("Cannot lock mutex (%T).", error); 72 | } 73 | 74 | 75 | void 76 | Mutex::unlock () const 77 | { 78 | if (int error = ::pthread_mutex_unlock (&_mutex)) 79 | Iex::throwErrnoExc ("Cannot unlock mutex (%T).", error); 80 | } 81 | 82 | 83 | } // namespace IlmThread 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmThread/IlmThreadMutexWin32.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2005, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | //----------------------------------------------------------------------------- 36 | // 37 | // class Mutex -- implementation for Windows 38 | // 39 | //----------------------------------------------------------------------------- 40 | 41 | #include "IlmThreadMutex.h" 42 | #include "Iex.h" 43 | 44 | namespace IlmThread { 45 | 46 | 47 | Mutex::Mutex () 48 | { 49 | ::InitializeCriticalSection (&_mutex); 50 | } 51 | 52 | 53 | Mutex::~Mutex () 54 | { 55 | ::DeleteCriticalSection (&_mutex); 56 | } 57 | 58 | 59 | void 60 | Mutex::lock () const 61 | { 62 | ::EnterCriticalSection (&_mutex); 63 | } 64 | 65 | 66 | void 67 | Mutex::unlock () const 68 | { 69 | ::LeaveCriticalSection (&_mutex); 70 | } 71 | 72 | 73 | } // namespace IlmThread 74 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmThread/IlmThreadPosix.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2005, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | //----------------------------------------------------------------------------- 36 | // 37 | // class Thread -- implementation for 38 | // platforms that support Posix threads 39 | // 40 | //----------------------------------------------------------------------------- 41 | 42 | #include "IlmBaseConfig.h" 43 | 44 | #if HAVE_PTHREAD 45 | 46 | #include "IlmThread.h" 47 | #include "Iex.h" 48 | #include 49 | 50 | extern "C" 51 | { 52 | typedef void * (* Start) (void *); 53 | } 54 | 55 | namespace IlmThread { 56 | 57 | 58 | bool 59 | supportsThreads () 60 | { 61 | return true; 62 | } 63 | 64 | namespace { 65 | 66 | void 67 | threadLoop (void * t) 68 | { 69 | return (reinterpret_cast(t))->run(); 70 | } 71 | 72 | } // namespace 73 | 74 | 75 | Thread::Thread () 76 | { 77 | // empty 78 | } 79 | 80 | 81 | Thread::~Thread () 82 | { 83 | int error = ::pthread_join (_thread, 0); 84 | assert (error == 0); 85 | } 86 | 87 | 88 | void 89 | Thread::start () 90 | { 91 | if (int error = ::pthread_create (&_thread, 0, Start (threadLoop), this)) 92 | Iex::throwErrnoExc ("Cannot create new thread (%T).", error); 93 | } 94 | 95 | 96 | } // namespace IlmThread 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmThread/IlmThreadSemaphore.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2005, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | //----------------------------------------------------------------------------- 36 | // 37 | // class Semaphore -- dummy implementation for 38 | // for platforms that do not support threading 39 | // 40 | //----------------------------------------------------------------------------- 41 | 42 | #include "IlmBaseConfig.h" 43 | 44 | #if !defined (_WIN32) && !(_WIN64) && !(HAVE_PTHREAD) 45 | #include "IlmThreadSemaphore.h" 46 | 47 | namespace IlmThread { 48 | 49 | 50 | Semaphore::Semaphore (unsigned int value) {} 51 | Semaphore::~Semaphore () {} 52 | void Semaphore::wait () {} 53 | bool Semaphore::tryWait () {return true;} 54 | void Semaphore::post () {} 55 | int Semaphore::value () const {return 0;} 56 | 57 | 58 | } // namespace IlmThread 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmThread/IlmThreadSemaphorePosix.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2005, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | //----------------------------------------------------------------------------- 36 | // 37 | // class Semaphore -- implementation for platforms 38 | // that support Posix threads and Posix semaphores 39 | // 40 | //----------------------------------------------------------------------------- 41 | 42 | #include "IlmBaseConfig.h" 43 | 44 | #if HAVE_PTHREAD && HAVE_POSIX_SEMAPHORES 45 | 46 | #include "IlmThreadSemaphore.h" 47 | #include "Iex.h" 48 | #include 49 | 50 | namespace IlmThread { 51 | 52 | 53 | Semaphore::Semaphore (unsigned int value) 54 | { 55 | if (::sem_init (&_semaphore, 0, value)) 56 | Iex::throwErrnoExc ("Cannot initialize semaphore (%T)."); 57 | } 58 | 59 | 60 | Semaphore::~Semaphore () 61 | { 62 | int error = ::sem_destroy (&_semaphore); 63 | assert (error == 0); 64 | } 65 | 66 | 67 | void 68 | Semaphore::wait () 69 | { 70 | ::sem_wait (&_semaphore); 71 | } 72 | 73 | 74 | bool 75 | Semaphore::tryWait () 76 | { 77 | return sem_trywait (&_semaphore) == 0; 78 | } 79 | 80 | 81 | void 82 | Semaphore::post () 83 | { 84 | if (::sem_post (&_semaphore)) 85 | Iex::throwErrnoExc ("Post operation on semaphore failed (%T)."); 86 | } 87 | 88 | 89 | int 90 | Semaphore::value () const 91 | { 92 | int value; 93 | 94 | if (::sem_getvalue (&_semaphore, &value)) 95 | Iex::throwErrnoExc ("Cannot read semaphore value (%T)."); 96 | 97 | return value; 98 | } 99 | 100 | 101 | } // namespace IlmThread 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/IlmThread/IlmThreadWin32.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2005, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | //----------------------------------------------------------------------------- 36 | // 37 | // class Thread -- implementation for Windows 38 | // 39 | //----------------------------------------------------------------------------- 40 | 41 | 42 | #include "IlmThread.h" 43 | #include "Iex.h" 44 | #include 45 | #include 46 | 47 | namespace IlmThread { 48 | 49 | 50 | bool 51 | supportsThreads () 52 | { 53 | return true; 54 | } 55 | 56 | namespace { 57 | 58 | unsigned __stdcall 59 | threadLoop (void * t) 60 | { 61 | reinterpret_cast(t)->run(); 62 | _endthreadex (0); 63 | return 0; 64 | } 65 | 66 | } // namespace 67 | 68 | 69 | Thread::Thread () 70 | { 71 | // empty 72 | } 73 | 74 | 75 | Thread::~Thread () 76 | { 77 | DWORD status = ::WaitForSingleObject (_thread, INFINITE); 78 | assert (status == WAIT_OBJECT_0); 79 | bool ok = ::CloseHandle (_thread) != FALSE; 80 | assert (ok); 81 | } 82 | 83 | 84 | void 85 | Thread::start () 86 | { 87 | unsigned id; 88 | _thread = (HANDLE)::_beginthreadex (0, 0, &threadLoop, this, 0, &id); 89 | 90 | if (_thread == 0) 91 | Iex::throwErrnoExc ("Cannot create new thread (%T)."); 92 | } 93 | 94 | 95 | } // namespace IlmThread 96 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/Imath/ImathBox.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | #include "ImathBox.h" 36 | 37 | // this file is necessary for template instantiation on windows 38 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/Imath/ImathExc.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IMATHEXC_H 38 | #define INCLUDED_IMATHEXC_H 39 | 40 | 41 | //----------------------------------------------- 42 | // 43 | // Imath library-specific exceptions 44 | // 45 | //----------------------------------------------- 46 | 47 | #include "IexBaseExc.h" 48 | 49 | namespace Imath { 50 | 51 | 52 | DEFINE_EXC (NullVecExc, ::Iex::MathExc) // Attempt to normalize 53 | // null vector 54 | 55 | DEFINE_EXC (InfPointExc, ::Iex::MathExc) // Attempt to normalize 56 | // a point at infinity 57 | 58 | DEFINE_EXC (NullQuatExc, ::Iex::MathExc) // Attempt to normalize 59 | // null quaternion 60 | 61 | DEFINE_EXC (SingMatrixExc, ::Iex::MathExc) // Attempt to invert 62 | // singular matrix 63 | 64 | DEFINE_EXC (ZeroScaleExc, ::Iex::MathExc) // Attempt to remove zero 65 | // scaling from matrix 66 | 67 | DEFINE_EXC (IntVecNormalizeExc, ::Iex::MathExc) // Attempt to normalize 68 | // a vector of whose elements 69 | // are an integer type 70 | 71 | } // namespace Imath 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/Imath/ImathGLU.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IMATHGLU_H 38 | #define INCLUDED_IMATHGLU_H 39 | 40 | #include 41 | #include 42 | 43 | #include "ImathVec.h" 44 | 45 | inline 46 | void 47 | gluLookAt(const Imath::V3f &pos, const Imath::V3f &interest, const Imath::V3f &up) 48 | { 49 | gluLookAt(pos.x, pos.y, pos.z, 50 | interest.x, interest.y, interest.z, 51 | up.x, up.y, up.z); 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/Imath/ImathHalfLimits.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | #ifndef INCLUDED_IMATHHALFLIMITS_H 38 | #define INCLUDED_IMATHHALFLIMITS_H 39 | 40 | //-------------------------------------------------- 41 | // 42 | // Imath-style limits for class half. 43 | // 44 | //-------------------------------------------------- 45 | 46 | #include "ImathLimits.h" 47 | #include "half.h" 48 | 49 | namespace Imath { 50 | 51 | 52 | template <> 53 | struct limits 54 | { 55 | static float min() {return -HALF_MAX;} 56 | static float max() {return HALF_MAX;} 57 | static float smallest() {return HALF_MIN;} 58 | static float epsilon() {return HALF_EPSILON;} 59 | static bool isIntegral() {return false;} 60 | static bool isSigned() {return true;} 61 | }; 62 | 63 | 64 | } // namespace Imath 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/Imath/ImathInt64.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2006, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | #ifndef INCLUDED_IMATH_INT64_H 37 | #define INCLUDED_IMATH_INT64_H 38 | 39 | //---------------------------------------------------------------------------- 40 | // 41 | // Int64 -- unsigned 64-bit integers 42 | // 43 | //---------------------------------------------------------------------------- 44 | 45 | #include 46 | 47 | namespace Imath { 48 | 49 | 50 | #if (defined _WIN32 || defined _WIN64) && _MSC_VER >= 1300 51 | typedef unsigned __int64 Int64; 52 | #elif ULONG_MAX == 18446744073709551615LU 53 | typedef long unsigned int Int64; 54 | #else 55 | typedef long long unsigned int Int64; 56 | #endif 57 | 58 | 59 | } // namespace Imath 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/Imath/ImathMatrixAlgo.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | 38 | 39 | //---------------------------------------------------------------------------- 40 | // 41 | // Implementation of non-template items declared in ImathMatrixAlgo.h 42 | // 43 | //---------------------------------------------------------------------------- 44 | 45 | #include "ImathMatrixAlgo.h" 46 | 47 | #if defined(OPENEXR_DLL) 48 | #define EXPORT_CONST __declspec(dllexport) 49 | #else 50 | #define EXPORT_CONST const 51 | #endif 52 | 53 | namespace Imath { 54 | 55 | EXPORT_CONST M33f identity33f ( 1, 0, 0, 56 | 0, 1, 0, 57 | 0, 0, 1); 58 | 59 | EXPORT_CONST M33d identity33d ( 1, 0, 0, 60 | 0, 1, 0, 61 | 0, 0, 1); 62 | 63 | EXPORT_CONST M44f identity44f ( 1, 0, 0, 0, 64 | 0, 1, 0, 0, 65 | 0, 0, 1, 0, 66 | 0, 0, 0, 1); 67 | 68 | EXPORT_CONST M44d identity44d ( 1, 0, 0, 0, 69 | 0, 1, 0, 0, 70 | 0, 0, 1, 0, 71 | 0, 0, 0, 1); 72 | 73 | } // namespace Imath 74 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/Imath/ImathShear.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas 4 | // Digital Ltd. LLC 5 | // 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // * Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following disclaimer 15 | // in the documentation and/or other materials provided with the 16 | // distribution. 17 | // * Neither the name of Industrial Light & Magic nor the names of 18 | // its contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | // 33 | /////////////////////////////////////////////////////////////////////////// 34 | 35 | 36 | 37 | 38 | //---------------------------------------------------------------------------- 39 | // 40 | // Specializations of the Shear6 template. 41 | // 42 | //---------------------------------------------------------------------------- 43 | 44 | #include "ImathShear.h" 45 | 46 | namespace Imath { 47 | 48 | 49 | 50 | // empty 51 | 52 | 53 | 54 | } // namespace Imath 55 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/OpenEXRConfig.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prideout/pez/a3c6f4afcc3983df0743bf472d1c0c18661399cb/converter/tinylib/openexr/OpenEXRConfig.h -------------------------------------------------------------------------------- /converter/tinylib/openexr/config.win/IlmBaseConfig.h: -------------------------------------------------------------------------------- 1 | // Hand-crafted version of config/IlmBaseConfig.h for Windows 2 | // 3 | // Define and set to 1 if the target system has POSIX thread support 4 | // and you want IlmBase to use it for multithreaded file I/O. 5 | // 6 | 7 | #undef HAVE_PTHREAD 8 | 9 | // 10 | // Define and set to 1 if the target system supports POSIX semaphores 11 | // and you want OpenEXR to use them; otherwise, OpenEXR will use its 12 | // own semaphore implementation. 13 | // 14 | 15 | #undef HAVE_POSIX_SEMAPHORES 16 | 17 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/config.x11/IlmBaseConfig.h: -------------------------------------------------------------------------------- 1 | /* config/IlmBaseConfig.h. Generated by configure. */ 2 | // 3 | // Define and set to 1 if the target system has POSIX thread support 4 | // and you want IlmBase to use it for multithreaded file I/O. 5 | // 6 | 7 | #define HAVE_PTHREAD 1 8 | 9 | // 10 | // Define and set to 1 if the target system supports POSIX semaphores 11 | // and you want OpenEXR to use them; otherwise, OpenEXR will use its 12 | // own semaphore implementation. 13 | // 14 | 15 | #define HAVE_POSIX_SEMAPHORES 1 16 | 17 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/config.x11/IlmBaseConfig.h.in: -------------------------------------------------------------------------------- 1 | // 2 | // Define and set to 1 if the target system has POSIX thread support 3 | // and you want IlmBase to use it for multithreaded file I/O. 4 | // 5 | 6 | #undef HAVE_PTHREAD 7 | 8 | // 9 | // Define and set to 1 if the target system supports POSIX semaphores 10 | // and you want OpenEXR to use them; otherwise, OpenEXR will use its 11 | // own semaphore implementation. 12 | // 13 | 14 | #undef HAVE_POSIX_SEMAPHORES 15 | 16 | -------------------------------------------------------------------------------- /converter/tinylib/openexr/config.x11/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | configincludedir = $(includedir)/OpenEXR 4 | 5 | configinclude_HEADERS = IlmBaseConfig.h 6 | 7 | EXTRA_DIST = IlmBaseConfig.h.in 8 | -------------------------------------------------------------------------------- /converter/tinylib/wscript: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | import sys 4 | 5 | def build(gc): 6 | 7 | glob = gc.path.ant_glob 8 | ignores = 'toFloat.cpp minigzip.c b44ExpLogTable.cpp eLut.cpp' 9 | files = glob(incl = ['**/*.c*' ], excl = ['**/' + x for x in ignores.split(' ')]) 10 | 11 | dirs = glob(dir = True, src = False, excl = '.hg') 12 | dirs.append(gc.path.make_node('../build')) 13 | 14 | tableMaker = 'g++ ${SRC} -o ${TGT} -Xlinker --enable-auto-import' 15 | gc(rule = tableMaker, source = 'openexr/Half/toFloat.cpp', target = 'generate-toFloat.exe') 16 | gc(rule = tableMaker, source = 'openexr/Half/eLut.cpp', target = 'generate-eLut.exe') 17 | 18 | tableUser = glob('**/half.cpp')[0] 19 | gc(rule='${SRC} > toFloat.h', source='generate-toFloat.exe', target = tableUser) 20 | gc(rule='${SRC} > eLut.h', source='generate-eLut.exe', target = tableUser) 21 | 22 | gc.stlib( 23 | source = files, 24 | includes = dirs, 25 | defines = gc.env.COMMON_DEFS + ' NO_VIZ ZLIB_WINAPI', 26 | cflags = ['-O3', '-w'], 27 | cxxflags = ['-O3', '-w'], 28 | target = 'ecosystem') 29 | -------------------------------------------------------------------------------- /converter/tinylib/zlib/compress.c: -------------------------------------------------------------------------------- 1 | /* compress.c -- compress a memory buffer 2 | * Copyright (C) 1995-2005 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Compresses the source buffer into the destination buffer. The level 13 | parameter has the same meaning as in deflateInit. sourceLen is the byte 14 | length of the source buffer. Upon entry, destLen is the total size of the 15 | destination buffer, which must be at least 0.1% larger than sourceLen plus 16 | 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. 17 | 18 | compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough 19 | memory, Z_BUF_ERROR if there was not enough room in the output buffer, 20 | Z_STREAM_ERROR if the level parameter is invalid. 21 | */ 22 | int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) 23 | Bytef *dest; 24 | uLongf *destLen; 25 | const Bytef *source; 26 | uLong sourceLen; 27 | int level; 28 | { 29 | z_stream stream; 30 | int err; 31 | 32 | stream.next_in = (Bytef*)source; 33 | stream.avail_in = (uInt)sourceLen; 34 | #ifdef MAXSEG_64K 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | #endif 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt)*destLen; 40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | stream.opaque = (voidpf)0; 45 | 46 | err = deflateInit(&stream, level); 47 | if (err != Z_OK) return err; 48 | 49 | err = deflate(&stream, Z_FINISH); 50 | if (err != Z_STREAM_END) { 51 | deflateEnd(&stream); 52 | return err == Z_OK ? Z_BUF_ERROR : err; 53 | } 54 | *destLen = stream.total_out; 55 | 56 | err = deflateEnd(&stream); 57 | return err; 58 | } 59 | 60 | /* =========================================================================== 61 | */ 62 | int ZEXPORT compress (dest, destLen, source, sourceLen) 63 | Bytef *dest; 64 | uLongf *destLen; 65 | const Bytef *source; 66 | uLong sourceLen; 67 | { 68 | return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); 69 | } 70 | 71 | /* =========================================================================== 72 | If the default memLevel or windowBits for deflateInit() is changed, then 73 | this function needs to be updated. 74 | */ 75 | uLong ZEXPORT compressBound (sourceLen) 76 | uLong sourceLen; 77 | { 78 | return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 79 | (sourceLen >> 25) + 13; 80 | } 81 | -------------------------------------------------------------------------------- /converter/tinylib/zlib/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(file) 12 | gzFile file; 13 | { 14 | #ifndef NO_GZCOMPRESS 15 | gz_statep state; 16 | 17 | if (file == NULL) 18 | return Z_STREAM_ERROR; 19 | state = (gz_statep)file; 20 | 21 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 22 | #else 23 | return gzclose_r(file); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /converter/tinylib/zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /converter/tinylib/zlib/inftrees.h: -------------------------------------------------------------------------------- 1 | /* inftrees.h -- header to use inftrees.c 2 | * Copyright (C) 1995-2005, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | /* Structure for decoding tables. Each entry provides either the 12 | information needed to do the operation requested by the code that 13 | indexed that table entry, or it provides a pointer to another 14 | table that indexes more bits of the code. op indicates whether 15 | the entry is a pointer to another table, a literal, a length or 16 | distance, an end-of-block, or an invalid code. For a table 17 | pointer, the low four bits of op is the number of index bits of 18 | that table. For a length or distance, the low four bits of op 19 | is the number of extra bits to get after the code. bits is 20 | the number of bits in this code or part of the code to drop off 21 | of the bit buffer. val is the actual byte to output in the case 22 | of a literal, the base length or distance, or the offset from 23 | the current table to the next table. Each entry is four bytes. */ 24 | typedef struct { 25 | unsigned char op; /* operation, extra bits, table bits */ 26 | unsigned char bits; /* bits in this part of the code */ 27 | unsigned short val; /* offset in table or code value */ 28 | } code; 29 | 30 | /* op values as set by inflate_table(): 31 | 00000000 - literal 32 | 0000tttt - table link, tttt != 0 is the number of table index bits 33 | 0001eeee - length or distance, eeee is the number of extra bits 34 | 01100000 - end of block 35 | 01000000 - invalid code 36 | */ 37 | 38 | /* Maximum size of the dynamic table. The maximum number of code structures is 39 | 1444, which is the sum of 852 for literal/length codes and 592 for distance 40 | codes. These values were found by exhaustive searches using the program 41 | examples/enough.c found in the zlib distribtution. The arguments to that 42 | program are the number of symbols, the initial root table size, and the 43 | maximum bit length of a code. "enough 286 9 15" for literal/length codes 44 | returns returns 852, and "enough 30 6 15" for distance codes returns 592. 45 | The initial root table size (9 or 6) is found in the fifth argument of the 46 | inflate_table() calls in inflate.c and infback.c. If the root table size is 47 | changed, then these maximum sizes would be need to be recalculated and 48 | updated. */ 49 | #define ENOUGH_LENS 852 50 | #define ENOUGH_DISTS 592 51 | #define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS) 52 | 53 | /* Type of code to build for inflate_table() */ 54 | typedef enum { 55 | CODES, 56 | LENS, 57 | DISTS 58 | } codetype; 59 | 60 | int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens, 61 | unsigned codes, code FAR * FAR *table, 62 | unsigned FAR *bits, unsigned short FAR *work)); 63 | -------------------------------------------------------------------------------- /converter/tinylib/zlib/uncompr.c: -------------------------------------------------------------------------------- 1 | /* uncompr.c -- decompress a memory buffer 2 | * Copyright (C) 1995-2003, 2010 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Decompresses the source buffer into the destination buffer. sourceLen is 13 | the byte length of the source buffer. Upon entry, destLen is the total 14 | size of the destination buffer, which must be large enough to hold the 15 | entire uncompressed data. (The size of the uncompressed data must have 16 | been saved previously by the compressor and transmitted to the decompressor 17 | by some mechanism outside the scope of this compression library.) 18 | Upon exit, destLen is the actual size of the compressed buffer. 19 | 20 | uncompress returns Z_OK if success, Z_MEM_ERROR if there was not 21 | enough memory, Z_BUF_ERROR if there was not enough room in the output 22 | buffer, or Z_DATA_ERROR if the input data was corrupted. 23 | */ 24 | int ZEXPORT uncompress (dest, destLen, source, sourceLen) 25 | Bytef *dest; 26 | uLongf *destLen; 27 | const Bytef *source; 28 | uLong sourceLen; 29 | { 30 | z_stream stream; 31 | int err; 32 | 33 | stream.next_in = (Bytef*)source; 34 | stream.avail_in = (uInt)sourceLen; 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt)*destLen; 40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | 45 | err = inflateInit(&stream); 46 | if (err != Z_OK) return err; 47 | 48 | err = inflate(&stream, Z_FINISH); 49 | if (err != Z_STREAM_END) { 50 | inflateEnd(&stream); 51 | if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) 52 | return Z_DATA_ERROR; 53 | return err; 54 | } 55 | *destLen = stream.total_out; 56 | 57 | err = inflateEnd(&stream); 58 | return err; 59 | } 60 | -------------------------------------------------------------------------------- /converter/wscript: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | import sys 4 | import urllib 5 | import subprocess 6 | import os 7 | import stat 8 | 9 | VERSION = '0.0.1' 10 | APPNAME = 'pez-viewer' 11 | 12 | if sys.platform == 'win32': 13 | EXE = r'.\build\%s.exe' % APPNAME 14 | else: 15 | EXE = r'./build/%s' % APPNAME 16 | 17 | def run(gc): 18 | gc.exec_command(EXE) 19 | print 20 | 21 | def debug(gc): 22 | gc.exec_command('gdb ' + EXE) 23 | print 24 | 25 | def options(opt): 26 | opt.load('gcc') 27 | opt.load('g++') 28 | #opt.load('parallel_debug', tooldir='.') 29 | 30 | def configure(gc): 31 | gc.load('gcc') 32 | gc.load('g++') 33 | #gc.load('parallel_debug', tooldir='.') 34 | gc.env.COMMON_DEFS = 'OPENCTM_STATIC' 35 | gc.check_cc(fragment=c99test, msg="Checking for C99", cflags='-std=c99') 36 | gc.env.CFLAGS = ['-std=c99', '-Wc++-compat'] 37 | #gc.env.CFLAGS += ['-O3'] 38 | gc.env.CFLAGS += ['-g'] 39 | if sys.platform == 'win32': 40 | gc.env.COMMON_DEFS += ' WIN32' 41 | if sys.platform == 'darwin': 42 | gc.env.LIBPATH = '/usr/X11R6/lib' 43 | 44 | def build(gc): 45 | 46 | gc.recurse('tinylib') 47 | if sys.platform == 'win32': 48 | libs = 'opengl32 gdi32 comdlg32 stdc++ gdiplus' 49 | else: 50 | libs = 'X11 GL stdc++' 51 | 52 | glob = gc.path.ant_glob 53 | 54 | headerFolders = glob(dir = True, src = False, excl = '.hg build waf* **/*.x11') 55 | 56 | gc.program( 57 | source = glob('*.c*'), 58 | includes = headerFolders, 59 | lib = libs, 60 | use = 'ecosystem', 61 | defines = gc.env.COMMON_DEFS, 62 | target = 'pez-viewer') 63 | 64 | def path_list(paths, prefix): 65 | paths = paths.split(' ') 66 | return map(lambda x:prefix+x, paths) 67 | 68 | if __name__ == "__main__": 69 | urllib.urlretrieve("http://bitbucket.org/prideout/pez-generator/raw/tip/generated/pez.h", "pez.h") 70 | urllib.urlretrieve("http://bitbucket.org/prideout/pez-generator/raw/tip/generated/pez.c", "pez.c") 71 | urllib.urlretrieve("http://waf.googlecode.com/svn/trunk/waflib/extras/parallel_debug.py", "parallel_debug.py") 72 | #urllib.urlretrieve("http://waf.googlecode.com/files/waf-1.6.2", "waf") 73 | #os.chmod('waf', stat.S_IEXEC) 74 | 75 | c99test = ''' 76 | int main() { 77 | int i; 78 | i = 0; 79 | int j = 0; 80 | for (int k = 0; k < 3; ++k) { 81 | j += k; 82 | } 83 | return i+j; 84 | } 85 | ''' -------------------------------------------------------------------------------- /generator/bstrlib-license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2008 Paul Hsieh 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | 10 | Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | Neither the name of bstrlib nor the names of its contributors may be used 15 | to endorse or promote products derived from this software without 16 | specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | POSSIBILITY OF SUCH DAMAGE. 29 | 30 | -------------------------------------------------------------------------------- /generator/glbo.h: -------------------------------------------------------------------------------- 1 | 2 | typedef struct GlboAttribRec { 3 | const GLchar* Name; 4 | GLint Size; 5 | GLenum Type; 6 | GLsizei Stride; 7 | int FrameCount; 8 | GLvoid* Frames; 9 | } GlboAttrib; 10 | 11 | typedef struct GlboVertsRec { 12 | int AttribCount; 13 | int IndexCount; 14 | int VertexCount; 15 | GLenum IndexType; 16 | GLsizeiptr IndexBufferSize; 17 | GlboAttrib* Attribs; 18 | GLvoid* Indices; 19 | void* RawHeader; 20 | } GlboVerts; 21 | 22 | typedef struct GlboPixelsRec { 23 | int FrameCount; 24 | GLsizei Width; 25 | GLsizei Height; 26 | GLsizei Depth; 27 | GLint MipLevels; 28 | GLenum Format; 29 | GLenum InternalFormat; 30 | GLenum Type; 31 | GLsizeiptr BytesPerFrame; 32 | GLvoid* Frames; 33 | void* RawHeader; 34 | } GlboPixels; 35 | 36 | GlboVerts glboLoadVerts(const char* filename); 37 | GlboVerts glboGenQuad(float left, float top, float right, float bottom); 38 | void glboFreeVerts(GlboVerts verts); 39 | void glboSaveVerts(GlboVerts verts, const char* filename); 40 | 41 | GlboPixels glboLoadPixels(const char* filename); 42 | void glboFreePixels(GlboPixels pixels); 43 | void glboSavePixels(GlboPixels pixels, const char* filename); 44 | void glboRenderText(GlboPixels pixels, const char* message); 45 | GlboPixels glboGenNoise(GlboPixels desc, float alpha, float beta, int n); 46 | -------------------------------------------------------------------------------- /generator/glsw.h: -------------------------------------------------------------------------------- 1 | 2 | int glswInit(); 3 | int glswShutdown(); 4 | int glswAddPath(const char* pathPrefix, const char* pathSuffix); 5 | const char* glswGetShader(const char* effectKey); 6 | const char* glswGetError(); 7 | int glswAddDirective(const char* token, const char* directive); 8 | 9 | -------------------------------------------------------------------------------- /generator/lzfx-license.txt: -------------------------------------------------------------------------------- 1 | LZFX is copyright (c) 2009 Andrew Collette and subject to the BSD license 2 | (below). Original LZF copyright statement follows. 3 | 4 | Copyright (c) 2000-2007 Marc Alexander Lehmann 5 | 6 | Redistribution and use in source and binary forms, with or without modifica- 7 | tion, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- 18 | CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 19 | EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE- 20 | CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 22 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTH- 24 | ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 25 | OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /generator/platform.h: -------------------------------------------------------------------------------- 1 | 2 | #include "glew.h" 3 | 4 | #define ZEP_FORWARD_COMPATIBLE_GL 1 5 | 6 | typedef struct ZepConfigRec 7 | { 8 | const char* Title; 9 | int Width; 10 | int Height; 11 | int Multisampling; 12 | int VerticalSync; 13 | } ZepConfig; 14 | 15 | #ifdef ZEP_MAINLOOP 16 | ZepConfig ZepGetConfig(); 17 | void ZepInitialize(); 18 | void ZepRender(); 19 | void ZepUpdate(float seconds); 20 | 21 | #ifdef ZEP_MOUSE_HANDLER 22 | void ZepHandleMouse(int x, int y, int action); 23 | #endif 24 | 25 | #ifdef ZEP_DROP_HANDLER 26 | void ZepReceiveDrop(const char* filename); 27 | #endif 28 | 29 | #else 30 | void zepSwapBuffers(); 31 | #endif 32 | 33 | enum {ZEP_DOWN, ZEP_UP, ZEP_MOVE, ZEP_DOUBLECLICK}; 34 | #define TwoPi (6.28318531f) 35 | #define Pi (3.14159265f) 36 | #define countof(A) (sizeof(A) / sizeof(A[0])) 37 | 38 | void zepPrintString(const char* pStr, ...); 39 | void zepFatal(const char* pStr, ...); 40 | void zepCheck(int condition, ...); 41 | int zepIsPressing(char key); 42 | const char* zepResourcePath(); 43 | const char* zepOpenFileDialog(); 44 | const char* zepGetDesktopFolder(); 45 | -------------------------------------------------------------------------------- /pez.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #define PEZ_MAINLOOP 1 8 | 9 | #define PEZ_MOUSE_HANDLER 1 10 | 11 | #define PEZ_DROP_HANDLER 1 12 | 13 | #include "glew.h" 14 | 15 | #define PEZ_FORWARD_COMPATIBLE_GL 1 16 | 17 | typedef struct PezConfigRec 18 | { 19 | const char* Title; 20 | int Width; 21 | int Height; 22 | int Multisampling; 23 | int VerticalSync; 24 | } PezConfig; 25 | 26 | #ifdef PEZ_MAINLOOP 27 | PezConfig PezGetConfig(); 28 | void PezInitialize(); 29 | void PezRender(); 30 | void PezUpdate(float seconds); 31 | 32 | #ifdef PEZ_MOUSE_HANDLER 33 | void PezHandleMouse(int x, int y, int action); 34 | #endif 35 | 36 | #ifdef PEZ_DROP_HANDLER 37 | void PezReceiveDrop(const char* filename); 38 | #endif 39 | 40 | #else 41 | void pezSwapBuffers(); 42 | #endif 43 | 44 | enum {PEZ_DOWN, PEZ_UP, PEZ_MOVE, PEZ_DOUBLECLICK}; 45 | #define TwoPi (6.28318531f) 46 | #define Pi (3.14159265f) 47 | #define countof(A) (sizeof(A) / sizeof(A[0])) 48 | 49 | void pezPrintString(const char* pStr, ...); 50 | void pezFatal(const char* pStr, ...); 51 | void pezCheck(int condition, ...); 52 | int pezIsPressing(char key); 53 | const char* pezResourcePath(); 54 | const char* pezOpenFileDialog(); 55 | const char* pezGetDesktopFolder(); 56 | 57 | int pezInit(); 58 | int pezShutdown(); 59 | int pezAddPath(const char* pathPrefix, const char* pathSuffix); 60 | const char* pezGetShader(const char* effectKey); 61 | const char* pezGetError(); 62 | int pezAddDirective(const char* token, const char* directive); 63 | 64 | 65 | typedef struct PezAttribRec { 66 | const GLchar* Name; 67 | GLint Size; 68 | GLenum Type; 69 | GLsizei Stride; 70 | int FrameCount; 71 | GLvoid* Frames; 72 | } PezAttrib; 73 | 74 | typedef struct PezVertsRec { 75 | int AttribCount; 76 | int IndexCount; 77 | int VertexCount; 78 | GLenum IndexType; 79 | GLsizeiptr IndexBufferSize; 80 | PezAttrib* Attribs; 81 | GLvoid* Indices; 82 | void* RawHeader; 83 | } PezVerts; 84 | 85 | typedef struct PezPixelsRec { 86 | int FrameCount; 87 | GLsizei Width; 88 | GLsizei Height; 89 | GLsizei Depth; 90 | GLint MipLevels; 91 | GLenum Format; 92 | GLenum InternalFormat; 93 | GLenum Type; 94 | GLsizeiptr BytesPerFrame; 95 | GLvoid* Frames; 96 | void* RawHeader; 97 | } PezPixels; 98 | 99 | PezVerts pezLoadVerts(const char* filename); 100 | PezVerts pezGenQuad(float left, float top, float right, float bottom); 101 | void pezFreeVerts(PezVerts verts); 102 | void pezSaveVerts(PezVerts verts, const char* filename); 103 | 104 | PezPixels pezLoadPixels(const char* filename); 105 | void pezFreePixels(PezPixels pixels); 106 | void pezSavePixels(PezPixels pixels, const char* filename); 107 | void pezRenderText(PezPixels pixels, const char* message); 108 | PezPixels pezGenNoise(PezPixels desc, float alpha, float beta, int n); 109 | #ifdef __cplusplus 110 | } 111 | #endif 112 | --------------------------------------------------------------------------------