Explorar el Código

base: VISUQL STUDIO JTE NIAUE Q LQ KQLQSH.

undefined
Sam Hocevar hace 10 años
padre
commit
2a5150e060
Se han modificado 3 ficheros con 14 adiciones y 7 borrados
  1. +2
    -4
      src/image/image.cpp
  2. +8
    -1
      src/lol/image/image.h
  3. +4
    -2
      src/lol/math/arraynd.h

+ 2
- 4
src/image/image.cpp Ver fichero

@@ -197,11 +197,9 @@ template<PixelFormat T> typename PixelType<T>::type *Image::Lock()
}

/* The Lock2D() method */
template<PixelFormat T> array2d<typename PixelType<T>::type> &Image::Lock2D()
void *Image::Lock2DHelper(PixelFormat T)
{
SetFormat(T);

return *(array2d<typename PixelType<T>::type> *)m_data->m_pixels[(int)T]->Data2D();
return m_data->m_pixels[(int)T]->Data2D();
}

template<typename T>


+ 8
- 1
src/lol/image/image.h Ver fichero

@@ -87,7 +87,12 @@ public:
void Unlock(void const *pixels);

template<PixelFormat T>
array2d<typename PixelType<T>::type> &Lock2D();
inline array2d<typename PixelType<T>::type> &Lock2D()
{
/* Hack: this indirection is needed because of a Visual Studio ICE */
return *(array2d<typename PixelType<T>::type> *)Lock2DHelper(T);
}

template<typename T>
void Unlock2D(array2d<T> const &);

@@ -150,6 +155,8 @@ public:
static Image Difference(Image &src1, Image &src2);

private:
void *Lock2DHelper(PixelFormat T);

class ImageData *m_data;
};



+ 4
- 2
src/lol/math/arraynd.h Ver fichero

@@ -257,8 +257,10 @@ private:
{
ptrdiff_t total_size = 1;

for (auto size : m_sizes)
total_size *= size;
/* HACK: we can't use for (auto s : m_sizes) because of an ICE in
* the Visual Studio compiler. */
for (int i = 0; i < N; ++i)
total_size *= m_sizes[i];

this->Resize(total_size, e);
}


Cargando…
Cancelar
Guardar