Pārlūkot izejas kodu

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

wanted convolution or dithering kernels.
undefined
Sam Hocevar pirms 10 gadiem
vecāks
revīzija
b5e3bc6c2f
5 mainītis faili ar 7 papildinājumiem un 25 dzēšanām
  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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

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


Notiek ielāde…
Atcelt
Saglabāt