Hugin trunk 0.1
Loading...
Searching...
No Matches
Namespaces | Macros | Functions | Variables
ImageTransformsGPU.cpp File Reference

Support functions for GPU remapping. More...

#include <iostream>
#include <iomanip>
#include <vector>
#include <time.h>
#include "hugin_config.h"
#include <GL/glew.h>
#include <GL/glu.h>
#include <string.h>
#include <vigra/diff2d.hxx>
#include <vigra/utilities.hxx>
#include <vigra/error.hxx>
#include <vigra_ext/ImageTransformsGPU.h>
#include <sys/time.h>
Include dependency graph for ImageTransformsGPU.cpp:

Go to the source code of this file.

Namespaces

namespace  vigra_ext
 

Macros

#define ___NCFILE___   ((char *) __FILE__)
 
#define CHECK_GL()   checkGLErrors(__LINE__, ___NCFILE___)
 
#define GL_GPU_MEM_INFO_TOTAL_AVAILABLE_MEM_NVX   0x9048
 
#define TEXTURE_FREE_MEMORY_ATI   0x87FC
 

Functions

long getms ()
 
static void checkGLErrors (int line, char *file)
 
static void printInfoLog (GLhandleARB obj)
 
static bool checkFramebufferStatus (int line, char *file)
 
static void compileGLSL (const char *programName, GLhandleARB &programObject, GLhandleARB &shaderObject, const char **source)
 
static void makeChunks (const int width, const int height, const int maxTextureSize, const long long int maxPixels, vector< Rect2D > &result)
 
void vigra_ext::SetGPUDebugMessages (const bool doPrint)
 
bool vigra_ext::transformImageGPUIntern (const std::string &coordXformGLSL, const std::string &interpolatorGLSL, const int interpolatorSize, const std::string &photometricGLSL, const vector< double > &invLut, const vector< double > &destLut, const vigra::Diff2D srcSize, const void *const srcBuffer, const int srcGLInternalFormat, const int srcGLTransferFormat, const int srcGLFormat, const int srcGLType, const void *const srcAlphaBuffer, const int srcAlphaGLType, const vigra::Diff2D destUL, const vigra::Diff2D destSize, void *const destBuffer, const int destGLInternalFormat, const int destGLTransferFormat, const int destGLFormat, const int destGLType, void *const destAlphaBuffer, const int destAlphaGLType, const bool warparound)
 

Variables

static GLenum XGLMap []
 
static const charXGLStringMap []
 
static int BytesPerPixel []
 
static const charAlphaCompositeKernelSource
 
static bool printDebug =false
 

Detailed Description

Support functions for GPU remapping.

Author
Andrew Mihal

$Id$

This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU General Public License along with this software. If not, see http://www.gnu.org/licenses/.

Definition in file ImageTransformsGPU.cpp.

Macro Definition Documentation

◆ ___NCFILE___

#define ___NCFILE___   ((char *) __FILE__)

Definition at line 80 of file ImageTransformsGPU.cpp.

◆ CHECK_GL

#define CHECK_GL ( )    checkGLErrors(__LINE__, ___NCFILE___)

Definition at line 81 of file ImageTransformsGPU.cpp.

◆ GL_GPU_MEM_INFO_TOTAL_AVAILABLE_MEM_NVX

#define GL_GPU_MEM_INFO_TOTAL_AVAILABLE_MEM_NVX   0x9048

◆ TEXTURE_FREE_MEMORY_ATI

#define TEXTURE_FREE_MEMORY_ATI   0x87FC

Function Documentation

◆ checkFramebufferStatus()

static bool checkFramebufferStatus ( int  line,
char file 
)
static

Definition at line 181 of file ImageTransformsGPU.cpp.

References threshold().

Referenced by vigra_ext::transformImageGPUIntern().

◆ checkGLErrors()

static void checkGLErrors ( int  line,
char file 
)
static

Definition at line 123 of file ImageTransformsGPU.cpp.

References threshold().

◆ compileGLSL()

static void compileGLSL ( const char programName,
GLhandleARB programObject,
GLhandleARB shaderObject,
const char **  source 
)
static

Definition at line 213 of file ImageTransformsGPU.cpp.

References printDebug, printInfoLog(), and threshold().

Referenced by vigra_ext::transformImageGPUIntern().

◆ getms()

long getms ( )

Definition at line 65 of file ImageTransformsGPU.cpp.

References threshold().

Referenced by vigra_ext::transformImageGPUIntern().

◆ makeChunks()

static void makeChunks ( const int  width,
const int  height,
const int  maxTextureSize,
const long long int  maxPixels,
vector< Rect2D > &  result 
)
static

Definition at line 250 of file ImageTransformsGPU.cpp.

References threshold().

Referenced by vigra_ext::transformImageGPUIntern().

◆ printInfoLog()

static void printInfoLog ( GLhandleARB  obj)
static

Definition at line 167 of file ImageTransformsGPU.cpp.

References threshold().

Referenced by compileGLSL().

Variable Documentation

◆ AlphaCompositeKernelSource

const char* AlphaCompositeKernelSource
static
Initial value:
= {
"#version 110\n"
"#extension GL_ARB_texture_rectangle : enable\n"
"uniform sampler2DRect SrcAlphaTexture;\n"
"void main(void)\n"
"{\n"
" float alpha = texture2DRect(SrcAlphaTexture, gl_TexCoord[0].st).a;\n"
" if (alpha != 0.0) discard;\n"
" gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n"
"}\n"
}

Definition at line 111 of file ImageTransformsGPU.cpp.

Referenced by vigra_ext::transformImageGPUIntern().

◆ BytesPerPixel

int BytesPerPixel[]
static
Initial value:
= {
1, 1, 2, 2, 4, 4, 4,
4, 8, 16, 2, 4, 8,
3, 6, 12, 1, 2, 4,
0, 0, 0, 0
}

Definition at line 104 of file ImageTransformsGPU.cpp.

Referenced by vigra_ext::transformImageGPUIntern().

◆ printDebug

bool printDebug =false
static

◆ XGLMap

GLenum XGLMap[]
static
Initial value:
= {
}
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41

Definition at line 84 of file ImageTransformsGPU.cpp.

Referenced by vigra_ext::transformImageGPUIntern().

◆ XGLStringMap

const char* XGLStringMap[]
static
Initial value:
= {
"GL_BYTE", "GL_UNSIGNED_BYTE", "GL_SHORT", "GL_UNSIGNED_SHORT", "GL_INT", "GL_UNSIGNED_INT", "GL_FLOAT",
"GL_RGBA8", "GL_RGBA16", "GL_RGBA32F_ARB", "GL_LUMINANCE8_ALPHA8", "GL_LUMINANCE16_ALPHA16", "GL_LUMINANCE_ALPHA32F_ARB",
"GL_RGB8", "GL_RGB16", "GL_RGB32F_ARB", "GL_LUMINANCE8", "GL_LUMINANCE16", "GL_LUMINANCE32F_ARB",
"GL_LUMINANCE", "GL_RGB", "GL_LUMINANCE_ALPHA", "GL_RGBA"
}

Definition at line 94 of file ImageTransformsGPU.cpp.

Referenced by vigra_ext::transformImageGPUIntern().