Browse Source

image: get rid of stock images; we were misusing them where we actually

wanted convolution or dithering kernels.
undefined
Sam Hocevar 10 years ago
parent
commit
b5e3bc6c2f
5 changed files with 7 additions and 25 deletions
  1. +1
    -1
      src/Makefile.am
  2. +1
    -23
      src/image/kernel.cpp
  3. +1
    -1
      src/lol/image/image.h
  4. +1
    -0
      src/lolcore.vcxproj
  5. +3
    -0
      src/lolcore.vcxproj.filters

+ 1
- 1
src/Makefile.am View File

@@ -110,7 +110,7 @@ liblolcore_sources = \
sys/init.cpp sys/timer.cpp sys/file.cpp \
sys/thread.cpp sys/threadbase.h \
\
image/image.cpp image/image-private.h image/stock.cpp image/pixels.cpp \
image/image.cpp image/image-private.h image/kernel.cpp image/pixels.cpp \
image/crop.cpp \
image/codec/gdiplus-image.cpp image/codec/imlib2-image.cpp \
image/codec/sdl-image.cpp image/codec/ios-image.cpp \


src/image/stock.cpp → src/image/kernel.cpp View File

@@ -15,34 +15,12 @@
#include "core.h"

/*
* Stock images and kernels
* Stock kernels
*/

namespace lol
{

bool Image::Stock(char const *name)
{
/* Generate a completely random image. */
if (!strncmp(name, "random:", 7))
{
ivec2 size(0);

size.x = atoi(name + 7);
name = strchr(name + 7, 'x');
if (name)
size.y = atoi(name + 1);
if (!size.y)
size.y = size.x;
if (size.x <= 0 || size.y <= 0)
return false;

return RenderRandom(size);
}

return false;
}

Array2D<float> Image::BayerKernel(ivec2 size)
{
Array2D<float> ret(size);

+ 1
- 1
src/lol/image/image.h View File

@@ -100,7 +100,6 @@ public:
vec2 delta = vec2(0.f, 0.f));

/* Rendering */
bool Stock(char const *desc);
bool RenderRandom(ivec2 size);

/* Image processing */
@@ -112,6 +111,7 @@ public:
Image YUVToRGB() const;
Image RGBToYUV() const;

/* Dithering */
Image DitherRandom() const;
Image DitherEdiff(Array2D<float> const &kernel,
ScanMode scan = ScanMode::Raster) const;


+ 1
- 0
src/lolcore.vcxproj View File

@@ -159,6 +159,7 @@
<ClCompile Include="image\dither\random.cpp" />
<ClCompile Include="image\crop.cpp" />
<ClCompile Include="image\image.cpp" />
<ClCompile Include="image\kernel.cpp" />
<ClCompile Include="image\pixels.cpp" />
<ClCompile Include="image\render\noise.cpp" />
<ClCompile Include="input\controller.cpp" />


+ 3
- 0
src/lolcore.vcxproj.filters View File

@@ -102,6 +102,9 @@
<ClCompile Include="image\image.cpp">
<Filter>image</Filter>
</ClCompile>
<ClCompile Include="image\kernel.cpp">
<Filter>image</Filter>
</ClCompile>
<ClCompile Include="debug\fps.cpp">
<Filter>debug</Filter>
</ClCompile>


Loading…
Cancel
Save