42 #define C8(TYPE, OFS) { ChannelType_ ## TYPE, ChannelFormat_Clamp, OFS, 1, 0, 8 }
43 #define C16(TYPE, OFS, SIZE) { ChannelType_ ## TYPE, ChannelFormat_Clamp, 0, 2, OFS, SIZE }
44 #define C32(TYPE, OFS) { ChannelType_ ## TYPE, ChannelFormat_Clamp, 0, 4, OFS, 8 }
45 #define CF32(TYPE, OFS) { ChannelType_ ## TYPE, ChannelFormat_Float, OFS, 4, 0, 32 }
49 { 3, 3, {
C8(R,0),
C8(G,1),
C8(B,2) }, GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE,
false },
50 { 4, 4, {
C8(R,0),
C8(G,1),
C8(B,2),
C8(A,3) }, GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE,
false },
51 { 1, 1, {
C8(A,0) }, GL_ALPHA8, GL_ALPHA, GL_UNSIGNED_BYTE,
false },
52 { 4, 3, {
C32(R,0),
C32(G,8),
C32(B,16) }, GL_RGB8, GL_RGBA, GL_UNSIGNED_BYTE,
true },
53 { 4, 4, {
C32(R,0),
C32(G,8),
C32(B,16),
C32(A,24) }, GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE,
true },
55 { 2, 3, {
C16(R,11,5),
C16(G,5,6),
C16(B,0,5) }, GL_RGB5, GL_RGB,
GL_UNSIGNED_SHORT_5_6_5,
false },
56 { 2, 4, {
C16(R,11,5),
C16(G,6,5),
C16(B,1,5),
C16(A,0,1) }, GL_RGB5_A1, GL_RGBA,
GL_UNSIGNED_SHORT_5_5_5_1,
false },
58 { 12, 3, {
CF32(R,0),
CF32(G,4),
CF32(B,8) },
GL_RGB32F, GL_RGB, GL_FLOAT,
false },
59 { 16, 4, {
CF32(R,0),
CF32(G,4),
CF32(B,8),
CF32(A,12) },
GL_RGBA32F, GL_RGBA, GL_FLOAT,
false },
70 #define RGB_565_TO_ABGR_8888(V) ((V >> 8) & 0x000000F8) | (V >> 13) | ((V << 5) & 0x0000FC00) | ((V >> 1) & 0x00000300) | ((V << 19) & 0x00F80000) | ((V >> 14) & 0x00070000) | 0xFF000000
71 #define ABGR_8888_TO_RGB_565(V) (U16)(((V << 8) & 0xF800) | ((V >> 5) & 0x07E0) | ((V >> 19) & 0x001F))
73 #define RGBA_5551_TO_ABGR_8888(V) ((V >> 8) & 0x000000F8) | (V >> 13) | ((V << 5) & 0x0000F800) | (V & 0x00000700) | ((V << 18) & 0x00F80000) | ((V >> 13) & 0x00070000) | ((S32)(V << 31) >> 7)
74 #define ABGR_8888_TO_RGBA_5551(V) (U16)(((V << 8) & 0xF800) | ((V >> 5) & 0x07C0) | ((V >> 18) & 0x003E) | (V >> 31))
87 if (m_genericBPP == f.
bpp &&
89 memcmp(m_genericChannels.getPtr(), f.
channels, m_genericChannels.getNumBytes()) == 0)
114 return (m_id <
ID_Generic) ? s_staticFormats[m_id].
bpp : m_genericBPP;
131 return (m_id <
ID_Generic) ? s_staticFormats[m_id].
channels[idx] : m_genericChannels[idx];
139 for (
int i = 0; i < num; i++)
152 m_genericBPP = other.m_genericBPP;
153 m_genericChannels = other.m_genericChannels;
163 m_genericChannels.clear();
173 m_genericBPP = f.
bpp;
179 m_genericChannels.add(channel);
192 U32 tmp = 0x12345678;
193 if (*(
U8*)&tmp != 0x78)
205 bool isFloat =
false;
212 channels |= 1 < c.
type;
217 if ((channels & 7) == 0)
219 if ((channels & 8) == 0)
232 m_genericBPP == other.m_genericBPP &&
233 m_genericChannels.getSize() == other.m_genericChannels.getSize() &&
234 memcmp(m_genericChannels.getPtr(), other.m_genericChannels.getPtr(), m_genericChannels.getNumBytes()) == 0);
248 lo =
min(stride * (size.y - 1), (
S64)0);
249 hi =
max(stride * (size.y - 1), (
S64)0) + size.x * format.
getBPP();
253 m_buffer =
new Buffer((
U8*)ptr + lo, hi - lo);
287 switch (m_format.
getID())
305 bool hasAlpha =
false;
308 for (
int i = 0; i < m_channelTmp.
getSize(); i++)
310 U32 v = clamp((
int)(m_channelTmp[i] * 255.0
f + 0.5
f), 0x00, 0xFF);
334 switch (m_format.
getID())
350 for (
int i = 0; i < m_channelTmp.
getSize(); i++)
352 F32& channel = m_channelTmp[i];
359 default: channel = 0.0f;
break;
374 switch (m_format.
getID())
393 for (
int i = 0; i < m_channelTmp.
getSize(); i++)
397 value[t] = m_channelTmp[i];
411 switch (m_format.
getID())
413 case ImageFormat::A8: *p = (
U8)clamp((
int)(value.w * 255.0f + 0.5f), 0x00, 0xFF);
break;
428 for (
int i = 0; i < m_channelTmp.
getSize(); i++)
443 for (
int y = 0;
y < m_size.y;
y++)
447 for (
int x = (m_size.x >> 1);
x > 0;
x--)
449 for (
int i = 0; i < bpp; i++)
450 swap(ptrA[i], ptrB[i]);
461 int scanBytes = m_size.x *
getBPP();
463 for (
int y = (m_size.y >> 1) - 1;
y >= 0;
y--)
467 memcpy(tmp.
getPtr(), ptrA, scanBytes);
468 memcpy(ptrA, ptrB, scanBytes);
469 memcpy(ptrB, tmp.
getPtr(), scanBytes);
491 const Image* img =
this;
492 if (m_size.
min() == 0 || m_format.
getID() != formatID || m_stride !=
getBPP() * m_size.x)
494 converted =
new Image(
max(m_size, 1), formatID);
495 converted->
set(*
this);
504 glGetIntegerv(GL_TEXTURE_BINDING_2D, &oldTex);
507 glGenTextures(1, &tex);
508 glBindTexture(GL_TEXTURE_2D, tex);
510 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, (generateMipmaps) ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR);
511 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
520 glBindTexture(GL_TEXTURE_2D, oldTex);
537 fail(
"Image::chooseCudaFormat(): Built without FW_USE_CUDA!");
546 refFormat = desiredFormat;
550 bool isFloat =
false;
551 for (
int i = 0; i < numChannels; i++)
560 CUarray_format datatype;
563 if (isFloat) datatype = CU_AD_FORMAT_FLOAT, wordSize = 4;
564 else if (channelBits <= 8) datatype = CU_AD_FORMAT_UNSIGNED_INT8, wordSize = 1;
565 else if (channelBits <= 16) datatype = CU_AD_FORMAT_UNSIGNED_INT16, wordSize = 2;
566 else datatype = CU_AD_FORMAT_UNSIGNED_INT32, wordSize = 4;
571 for (
int i = 0; i < numChannels; i++)
586 chan.
wordSize = wordSize * numChannels;
596 desc->Width = m_size.x;
597 desc->Height = m_size.y;
598 desc->Format = datatype;
599 desc->NumChannels = numChannels;
601 return (formatB == refFormat) ? formatB : formatA;
613 fail(
"Image::createCudaArray(): Built without FW_USE_CUDA!");
620 CUDA_ARRAY_DESCRIPTOR arrayDesc;
626 const Image* img =
this;
627 if (m_size.
min() == 0 || m_format != cudaFormat)
629 converted =
new Image(
max(m_size, 1), cudaFormat);
630 converted->
set(*
this);
632 arrayDesc.Width = img->
getSize().x;
633 arrayDesc.Height = img->
getSize().y;
643 CUDA_MEMCPY2D copyDesc;
644 copyDesc.srcXInBytes = 0;
646 copyDesc.srcMemoryType = CU_MEMORYTYPE_HOST;
647 copyDesc.srcHost = img->
getPtr();
648 copyDesc.srcPitch = img->
getSize().x * 4;
649 copyDesc.dstXInBytes = 0;
651 copyDesc.dstMemoryType = CU_MEMORYTYPE_ARRAY;
652 copyDesc.dstArray = cudaArray;
653 copyDesc.WidthInBytes = img->
getSize().x * 4;
654 copyDesc.Height = img->
getSize().y;
677 int area = m_size.x * m_size.y;
683 int fw = (m_size.x == 1) ? 1 : ((m_size.x & 1) == 0) ? 2 : 3;
684 int fh = (m_size.y == 1) ? 1 : ((m_size.y & 1) == 0) ? 2 : 3;
685 Vec2i resSize =
max(m_size >> 1, 1);
686 int halfArea = area >> 1;
696 for (
int y = 0;
y < resSize.y;
y++)
706 wy =
Vec3i(resSize.y -
y, resSize.y,
y + 1);
710 for (
int x = 0;
x < resSize.x;
x++)
716 wx =
Vec3i(resSize.x -
x, resSize.x,
x + 1);
723 for (
int yy = 0; yy < fh; yy++)
725 for (
int xx = 0; xx < fw; xx++)
727 U32 abgr = tmpPtr[xx];
728 int weight = wx[xx] * wy[yy];
729 sum.x += (abgr & 0xFF) * weight;
730 sum.y += ((abgr >> 8) & 0xFF) * weight;
731 sum.z += ((abgr >> 16) & 0xFF) * weight;
732 sum.w += (abgr >> 24) * weight;
737 sum = (sum + halfArea) / area;
738 *resPtr++ = sum.x | (sum.y << 8) | (sum.z << 16) | (sum.w << 24);
756 void Image::createBuffer(
void)
758 m_stride = m_size.x * m_format.
getBPP();
760 m_buffer->
resize(m_stride * m_size.y);
767 void Image::replicatePixel(
void)
769 if (m_size.min() == 0)
774 int scanBytes = m_size.x * bpp;
776 for (
int x = 1;
x < m_size.x;
x++)
777 memcpy(ptr +
x * bpp, ptr, bpp);
778 for (
int y = 1;
y < m_size.y;
y++)
779 memcpy(ptr +
y * m_stride, ptr, scanBytes);
784 bool Image::canBlitDirectly(
const ImageFormat& format)
786 switch (format.
getID())
801 default:
return false;
807 bool Image::canBlitThruABGR(
const ImageFormat& format)
809 switch (format.
getID())
824 default:
return false;
841 if (dstFormat == srcFormat)
843 int scanBytes = size.x * dstFormat.
getBPP();
844 for (
int y = 0;
y < size.y;
y++)
845 memcpy(dstPtr + dstStride *
y, srcPtr + srcStride * y, scanBytes);
853 for (
int y = 0;
y < size.y;
y++)
854 blitToABGR((
U32*)(dstPtr + dstStride *
y), srcFormat, srcPtr + srcStride *
y, size.x);
862 for (
int y = 0;
y < size.y;
y++)
863 blitFromABGR(dstFormat, dstPtr + dstStride *
y, (
const U32*)(srcPtr + srcStride *
y), size.x);
869 if (canBlitDirectly(srcFormat) && canBlitDirectly(dstFormat) && canBlitThruABGR(srcFormat))
872 for (
int y = 0; y < size.y; y++)
874 blitToABGR(tmp.getPtr(), srcFormat, srcPtr + srcStride *
y, size.x);
875 blitFromABGR(dstFormat, dstPtr + dstStride * y, tmp.getPtr(), size.x);
897 for (
int y = 0; y < size.y; y++)
899 U8* dstPixel = dstPtr + dstStride *
y;
900 const U8* srcPixel = srcPtr + srcStride *
y;
902 for (
int x = 0;
x < size.x;
x++)
904 getChannels(sv.getPtr(), srcPixel, srcFormat, 0, sv.getSize());
905 for (
int i = 0; i < map.
getSize(); i++)
906 dv[map[i].
x] = sv[map[i].y];
907 setChannels(dstPixel, dv.getPtr(), dstFormat, 0, dv.getSize());
923 const U8* s8 = srcPtr;
924 const U16* s16 = (
const U16*)srcPtr;
927 const F32* sf = (
const F32*)srcPtr;
929 switch (srcFormat.
getID())
931 case ImageFormat::R8_G8_B8:
for (
int x = width;
x > 0;
x--) { *dstPtr++ = s8[0] | (s8[1] << 8) | (s8[2] << 16) | 0xFF000000; s8 += 3; }
break;
932 case ImageFormat::R8_G8_B8_A8:
for (
int x = width;
x > 0;
x--) { *dstPtr++ = s8[0] | (s8[1] << 8) | (s8[2] << 16) | (s8[3] << 24); s8 += 4; }
break;
942 case ImageFormat::A_F32:
for (
int x = width;
x > 0;
x--) *dstPtr++ = clamp((
int)(*sf++ * 255.0
f + 0.5
f), 0x00, 0xFF) << 24;
break;
950 void Image::blitFromABGR(
const ImageFormat& dstFormat,
U8* dstPtr,
const U32* srcPtr,
int width)
962 switch (dstFormat.
getID())
989 for (
int i = 0; i < num; i++)
992 const U8* wordPtr = pixelPtr + c.
wordOfs;
996 case 1: field = *wordPtr;
break;
997 case 2: field = *(
const U16*)wordPtr;
break;
998 case 4: field = *(
const U32*)wordPtr;
break;
1019 FW_ASSERT((pixelPtr && values) || !num);
1022 memset(pixelPtr, 0, format.
getBPP());
1024 for (
int i = 0; i < num; i++)
1041 case 1: *wordPtr |= (
U8)field;
break;
1042 case 2: *(
U16*)wordPtr |= (
U16)field;
break;
1043 case 4: *(
U32*)wordPtr |= field;
break;
1055 #define STREAM(CALL) { File file(fileName, File::Read); BufferedInputStream stream(file); return CALL; }
1063 setError(
"importImage(): Unsupported file extension '%s'!", fileName.
getPtr());
1074 #define STREAM(CALL) { File file(fileName, File::Create); BufferedOutputStream stream(file); CALL; stream.flush(); return; }
1083 setError(
"exportImage(): Unsupported file extension '%s'!", fileName.
getPtr());
1092 "tga;targa:Targa Image,"
1093 "tif;tiff:TIFF Image,"
1104 "tga;targa:Targa Image,"
1105 "tif;tiff:TIFF Image,"
void exportImage(const String &fileName, const Image *image)
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v GLuint v GLenum GLenum GLenum GLuint GLint level GLsizei GLuint framebuffers GLuint const GLchar name GLenum GLintptr GLsizeiptr GLvoid data GLuint GLenum GLint param GLuint GLenum GLint param GLhandleARB programObj GLenum GLenum GLsizei GLsizei height GLenum GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid pixels GLint GLsizei const GLfloat value GLint GLfloat GLfloat v1 GLint GLfloat GLfloat GLfloat v2 GLint GLsizei const GLfloat value GLint GLsizei GLboolean const GLfloat value GLuint program GLuint GLfloat GLfloat GLfloat z GLuint GLint GLenum GLboolean GLsizei const GLvoid pointer GLuint GLuint const GLchar name GLenum GLsizei GLenum GLsizei GLsizei height GLenum GLuint renderbuffer GLenum GLenum GLint params GLuint GLsizei range GLuint GLsizei const GLubyte GLsizei GLenum const GLvoid coords GLuint GLsizei GLsizei GLsizei const GLubyte GLsizei GLenum const GLvoid coords GLuint GLenum GLsizei const GLvoid pathString GLuint GLenum const GLvoid GLbitfield GLuint GLsizei GLenum GLuint GLfloat emScale GLuint GLuint srcPath GLuint GLuint GLenum const GLfloat transformValues GLuint GLenum GLint value GLuint GLenum GLfloat value GLenum GLint GLuint mask
#define ABGR_8888_TO_RGBA_5551(V)
#define GL_GENERATE_MIPMAP
bool endsWith(const String &str) const
const char * getPtr(void) const
#define C16(TYPE, OFS, SIZE)
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer
void setError(const char *fmt,...)
#define RGBA_5551_TO_ABGR_8888(V)
Image * importImage(const String &fileName)
#define GL_UNSIGNED_SHORT_5_5_5_1
U32 getABGR(const Vec2i &pos) const
CUarray createCudaArray(ImageFormat::ID desiredFormat=ImageFormat::ID_Max) const
static void checkErrors(void)
FW_CUDA_FUNC Vec3f getXYZ(void) const
Image(const Vec2i &size, const ImageFormat &format=ImageFormat::ABGR_8888)
void exportTargaImage(OutputStream &stream, const Image *image)
const U8 * getPtr(const Vec2i &pos=0) const
void exportBmpImage(OutputStream &stream, const Image *image)
String toLower(void) const
#define ABGR_8888_TO_RGB_565(V)
void exportRawPngImage(OutputStream &stream, const Image *image)
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v GLuint v GLenum GLenum GLenum GLuint GLint level GLsizei GLuint framebuffers GLuint const GLchar name GLenum GLintptr GLsizeiptr GLvoid data GLuint GLenum GLint param GLuint GLenum GLint param GLhandleARB programObj GLenum GLenum GLsizei GLsizei height GLenum GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid pixels GLint GLsizei const GLfloat value GLint GLfloat GLfloat v1 GLint GLfloat GLfloat GLfloat v2 GLint GLsizei const GLfloat value GLint GLsizei GLboolean const GLfloat value GLuint program GLuint GLfloat x
Image * importBinaryImage(InputStream &stream)
static void checkError(const char *funcName, CUresult res)
void exportTiffImage(OutputStream &stream, const Image *image)
Image * importTiffImage(InputStream &stream)
FW_CUDA_FUNC T sum(const VectorBase< T, L, S > &v)
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v GLuint v GLenum GLenum GLenum GLuint GLint level GLsizei GLuint framebuffers GLuint const GLchar name GLenum GLintptr GLsizeiptr GLvoid data GLuint GLenum GLint param GLuint GLenum GLint param GLhandleARB programObj GLenum GLenum GLsizei GLsizei height GLenum GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid pixels GLint GLsizei const GLfloat value GLint GLfloat GLfloat v1 GLint GLfloat GLfloat GLfloat v2 GLint GLsizei const GLfloat value GLint GLsizei GLboolean const GLfloat value GLuint program GLuint GLfloat GLfloat y
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height cuArrayCreate
GLuint createGLTexture(ImageFormat::ID desiredFormat=ImageFormat::ID_Max, bool generateMipmaps=true) const
void getChannels(F32 *values, const Vec2i &pos, int first, int num) const
void set(const Vec2i &dstPos, const Image &src, const Vec2i &srcPos, const Vec2i &size)
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v
Image * downscale2x(void) const
#define RGB_565_TO_ABGR_8888(V)
void setVec4f(const Vec2i &pos, const Vec4f &value)
void setABGR(const Vec2i &pos, U32 value)
FW_CUDA_FUNC T min(const VectorBase< T, L, S > &v)
Vec4f getVec4f(const Vec2i &pos) const
bool contains(const Vec2i &pos, const Vec2i &size) const
FW_CUDA_FUNC T max(const VectorBase< T, L, S > &v)
Image * importBmpImage(InputStream &stream)
U8 * getMutablePtr(const Vec2i &pos=0)
Image * importLodePngImage(InputStream &stream)
#define GL_UNSIGNED_SHORT_5_6_5
ImageFormat chooseCudaFormat(CUDA_ARRAY_DESCRIPTOR *desc=NULL, ImageFormat::ID desiredFormat=ImageFormat::ID_Max) const
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v GLuint v GLenum GLenum GLenum GLuint GLint level GLsizei GLuint framebuffers GLuint const GLchar name GLenum GLintptr GLsizeiptr GLvoid data GLuint GLenum GLint param GLuint GLenum GLint param GLhandleARB programObj GLenum GLenum GLsizei GLsizei height GLenum GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid pixels GLint GLsizei const GLfloat value GLint GLfloat GLfloat v1 GLint GLfloat GLfloat GLfloat v2 GLint GLsizei const GLfloat value GLint GLsizei GLboolean const GLfloat value GLuint program GLuint GLfloat GLfloat GLfloat z GLuint GLint GLenum GLboolean GLsizei stride
const Vec2i & getSize(void) const
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction f
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value
String getImageImportFilter(void)
Image * importTargaImage(InputStream &stream)
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v GLuint v GLenum GLenum GLenum GLuint GLint level GLsizei GLuint framebuffers GLuint const GLchar name GLenum GLintptr GLsizeiptr GLvoid data GLuint GLenum GLint param GLuint GLenum GLint param GLhandleARB programObj GLenum GLenum GLsizei GLsizei height GLenum GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v GLuint v GLenum GLenum GLenum GLuint GLint level GLsizei GLuint framebuffers GLuint const GLchar name GLenum GLintptr GLsizeiptr GLvoid data GLuint GLenum GLint param GLuint GLenum GLint param GLhandleARB programObj GLenum GLenum GLsizei width
void exportLodePngImage(OutputStream &stream, const Image *image)
static Vec4f fromABGR(U32 abgr)
FW_CUDA_FUNC void swap(T &a, T &b)
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void * p
static void staticInit(void)
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type
void setChannels(const Vec2i &pos, const F32 *values, int first, int num)
void exportBinaryImage(OutputStream &stream, const Image *image)
const T * getPtr(S idx=0) const
void fail(const char *fmt,...)
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void * image
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr size
static void staticInit(void)
FW_CUDA_FUNC T min(void) const
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v GLuint v GLenum GLenum GLenum GLuint GLint level GLsizei GLuint framebuffers GLuint const GLchar name GLenum GLintptr GLsizeiptr GLvoid data GLuint GLenum GLint param GLuint GLenum GLint param GLhandleARB programObj GLenum GLenum GLsizei GLsizei height GLenum GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid pixels GLint GLsizei const GLfloat value GLint GLfloat GLfloat v1 GLint GLfloat GLfloat GLfloat v2 GLint GLsizei const GLfloat value GLint GLsizei GLboolean const GLfloat value GLuint program GLuint GLfloat GLfloat GLfloat z GLuint GLint GLenum GLboolean GLsizei const GLvoid pointer GLuint GLuint const GLchar name GLenum GLsizei GLenum GLsizei GLsizei height GLenum GLuint renderbuffer GLenum GLenum GLint params GLuint GLsizei range GLuint GLsizei const GLubyte GLsizei GLenum const GLvoid coords GLuint GLsizei GLsizei GLsizei const GLubyte GLsizei GLenum const GLvoid coords GLuint GLenum GLsizei const GLvoid pathString GLuint GLenum const GLvoid GLbitfield GLuint GLsizei GLenum GLuint GLfloat emScale GLuint GLuint srcPath GLuint GLuint GLenum const GLfloat transformValues GLuint GLenum GLint value GLuint GLenum GLfloat value GLenum GLint ref
String getImageExportFilter(void)