Procházet zdrojové kódy

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

wanted convolution or dithering kernels.
undefined
Sam Hocevar před 10 roky
rodič
revize
b5e3bc6c2f
5 změnil soubory, kde provedl 7 přidání a 25 odebrání
  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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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>


Načítá se…
Zrušit
Uložit