wanted convolution or dithering kernels.undefined
@@ -110,7 +110,7 @@ liblolcore_sources = \ | |||||
sys/init.cpp sys/timer.cpp sys/file.cpp \ | sys/init.cpp sys/timer.cpp sys/file.cpp \ | ||||
sys/thread.cpp sys/threadbase.h \ | 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/crop.cpp \ | ||||
image/codec/gdiplus-image.cpp image/codec/imlib2-image.cpp \ | image/codec/gdiplus-image.cpp image/codec/imlib2-image.cpp \ | ||||
image/codec/sdl-image.cpp image/codec/ios-image.cpp \ | image/codec/sdl-image.cpp image/codec/ios-image.cpp \ | ||||
@@ -15,34 +15,12 @@ | |||||
#include "core.h" | #include "core.h" | ||||
/* | /* | ||||
* Stock images and kernels | |||||
* Stock kernels | |||||
*/ | */ | ||||
namespace lol | 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> Image::BayerKernel(ivec2 size) | ||||
{ | { | ||||
Array2D<float> ret(size); | Array2D<float> ret(size); |
@@ -100,7 +100,6 @@ public: | |||||
vec2 delta = vec2(0.f, 0.f)); | vec2 delta = vec2(0.f, 0.f)); | ||||
/* Rendering */ | /* Rendering */ | ||||
bool Stock(char const *desc); | |||||
bool RenderRandom(ivec2 size); | bool RenderRandom(ivec2 size); | ||||
/* Image processing */ | /* Image processing */ | ||||
@@ -112,6 +111,7 @@ public: | |||||
Image YUVToRGB() const; | Image YUVToRGB() const; | ||||
Image RGBToYUV() const; | Image RGBToYUV() const; | ||||
/* Dithering */ | |||||
Image DitherRandom() const; | Image DitherRandom() const; | ||||
Image DitherEdiff(Array2D<float> const &kernel, | Image DitherEdiff(Array2D<float> const &kernel, | ||||
ScanMode scan = ScanMode::Raster) const; | ScanMode scan = ScanMode::Raster) const; | ||||
@@ -159,6 +159,7 @@ | |||||
<ClCompile Include="image\dither\random.cpp" /> | <ClCompile Include="image\dither\random.cpp" /> | ||||
<ClCompile Include="image\crop.cpp" /> | <ClCompile Include="image\crop.cpp" /> | ||||
<ClCompile Include="image\image.cpp" /> | <ClCompile Include="image\image.cpp" /> | ||||
<ClCompile Include="image\kernel.cpp" /> | |||||
<ClCompile Include="image\pixels.cpp" /> | <ClCompile Include="image\pixels.cpp" /> | ||||
<ClCompile Include="image\render\noise.cpp" /> | <ClCompile Include="image\render\noise.cpp" /> | ||||
<ClCompile Include="input\controller.cpp" /> | <ClCompile Include="input\controller.cpp" /> | ||||
@@ -102,6 +102,9 @@ | |||||
<ClCompile Include="image\image.cpp"> | <ClCompile Include="image\image.cpp"> | ||||
<Filter>image</Filter> | <Filter>image</Filter> | ||||
</ClCompile> | </ClCompile> | ||||
<ClCompile Include="image\kernel.cpp"> | |||||
<Filter>image</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="debug\fps.cpp"> | <ClCompile Include="debug\fps.cpp"> | ||||
<Filter>debug</Filter> | <Filter>debug</Filter> | ||||
</ClCompile> | </ClCompile> | ||||