| @@ -208,7 +208,7 @@ _T(PixelFormat::RGBA_F32); | |||||
| #undef _T | #undef _T | ||||
| /* Special case for the "any" format: return the last active buffer */ | /* Special case for the "any" format: return the last active buffer */ | ||||
| template<> void *Image::Lock<PixelFormat::Unknown>() | |||||
| void *Image::Lock() | |||||
| { | { | ||||
| ASSERT(m_data->m_format != PixelFormat::Unknown); | ASSERT(m_data->m_format != PixelFormat::Unknown); | ||||
| @@ -59,7 +59,7 @@ bool Image::RenderBayer(ivec2 size) | |||||
| typedef struct | typedef struct | ||||
| { | { | ||||
| int x, y; | int x, y; | ||||
| double dist; | |||||
| float dist; | |||||
| } | } | ||||
| dot_t; | dot_t; | ||||
| @@ -78,10 +78,10 @@ bool Image::RenderHalftone(ivec2 size) | |||||
| for (int y = 0; y < size.y; y++) | for (int y = 0; y < size.y; y++) | ||||
| for (int x = 0; x < size.x; x++) | for (int x = 0; x < size.x; x++) | ||||
| { | { | ||||
| double dy = ((double)y + .07) / size.y - .5; | |||||
| double dx = (double)x / size.x - .5; | |||||
| float dy = ((float)y + 0.07f) / size.y - 0.5f; | |||||
| float dx = (float)x / size.x - 0.5f; | |||||
| /* Using dx²+dy² here creates another interesting halftone. */ | /* Using dx²+dy² here creates another interesting halftone. */ | ||||
| double r = - cos(M_PI * (dx - dy)) - cos(M_PI * (dx + dy)); | |||||
| float r = - lol::cos(F_PI * (dx - dy)) - lol::cos(F_PI * (dx + dy)); | |||||
| circle[y * size.x + x].x = x; | circle[y * size.x + x].x = x; | ||||
| circle[y * size.x + x].y = y; | circle[y * size.x + x].y = y; | ||||
| circle[y * size.x + x].dist = r; | circle[y * size.x + x].dist = r; | ||||
| @@ -98,8 +98,8 @@ bool Image::RenderHalftone(ivec2 size) | |||||
| pixels[y * (2 * size.x) + x] = (float)(2 * n + 1) * mul; | pixels[y * (2 * size.x) + x] = (float)(2 * n + 1) * mul; | ||||
| pixels[(y + size.y) * (2 * size.x) + x + size.x] = (float)(2 * n + 2) * mul; | pixels[(y + size.y) * (2 * size.x) + x + size.x] = (float)(2 * n + 2) * mul; | ||||
| pixels[(y + size.y) * (2 * size.x) + x] = 1. - (float)(2 * n + 1) * mul; | |||||
| pixels[y * (2 * size.x) + x + size.x] = 1. - (float)(2 * n + 2) * mul; | |||||
| pixels[(y + size.y) * (2 * size.x) + x] = 1.0f - (float)(2 * n + 1) * mul; | |||||
| pixels[y * (2 * size.x) + x + size.x] = 1.0f - (float)(2 * n + 2) * mul; | |||||
| } | } | ||||
| Unlock(pixels); | Unlock(pixels); | ||||
| @@ -69,8 +69,8 @@ public: | |||||
| WrapMode GetWrapY() const; | WrapMode GetWrapY() const; | ||||
| void SetWrap(WrapMode wrap_x, WrapMode wrap_y); | void SetWrap(WrapMode wrap_x, WrapMode wrap_y); | ||||
| template<PixelFormat T = PixelFormat::Unknown> | |||||
| typename PixelType<T>::type *Lock(); | |||||
| template<PixelFormat T> typename PixelType<T>::type *Lock(); | |||||
| void *Lock(); | |||||
| void Unlock(void const *pixels); | void Unlock(void const *pixels); | ||||
| bool RetrieveTiles(Array<ivec2, ivec2>& tiles) const; | bool RetrieveTiles(Array<ivec2, ivec2>& tiles) const; | ||||
| @@ -149,7 +149,13 @@ | |||||
| <ClCompile Include="image\codec\zed-palette-image.cpp" /> | <ClCompile Include="image\codec\zed-palette-image.cpp" /> | ||||
| <ClCompile Include="image\color\cie1931.cpp" /> | <ClCompile Include="image\color\cie1931.cpp" /> | ||||
| <ClCompile Include="image\color\color.cpp" /> | <ClCompile Include="image\color\color.cpp" /> | ||||
| <ClCompile Include="image\dither\ediff.cpp" /> | |||||
| <ClCompile Include="image\dither\ostromoukhov.cpp" /> | |||||
| <ClCompile Include="image\dither\random.cpp" /> | |||||
| <ClCompile Include="image\image.cpp" /> | <ClCompile Include="image\image.cpp" /> | ||||
| <ClCompile Include="image\pixels.cpp" /> | |||||
| <ClCompile Include="image\render\noise.cpp" /> | |||||
| <ClCompile Include="image\render\screen.cpp" /> | |||||
| <ClCompile Include="input\controller.cpp" /> | <ClCompile Include="input\controller.cpp" /> | ||||
| <ClCompile Include="input\input.cpp" /> | <ClCompile Include="input\input.cpp" /> | ||||
| <ClCompile Include="layer.cpp" /> | <ClCompile Include="layer.cpp" /> | ||||
| @@ -431,4 +437,4 @@ | |||||
| <ImportGroup Label="ExtensionTargets"> | <ImportGroup Label="ExtensionTargets"> | ||||
| <Import Project="$(SolutionDir)\Lol.Fx.targets" /> | <Import Project="$(SolutionDir)\Lol.Fx.targets" /> | ||||
| </ImportGroup> | </ImportGroup> | ||||
| </Project> | |||||
| </Project> | |||||
| @@ -85,6 +85,12 @@ | |||||
| <Filter Include="platform\nacl"> | <Filter Include="platform\nacl"> | ||||
| <UniqueIdentifier>{f6cc3470-c841-4581-969b-e60cea841c27}</UniqueIdentifier> | <UniqueIdentifier>{f6cc3470-c841-4581-969b-e60cea841c27}</UniqueIdentifier> | ||||
| </Filter> | </Filter> | ||||
| <Filter Include="image\dither"> | |||||
| <UniqueIdentifier>{63e63eea-c96e-4d37-81f6-f3f17e18b751}</UniqueIdentifier> | |||||
| </Filter> | |||||
| <Filter Include="image\render"> | |||||
| <UniqueIdentifier>{23655fca-56e5-48ec-8cf0-a71322f4cc89}</UniqueIdentifier> | |||||
| </Filter> | |||||
| </ItemGroup> | </ItemGroup> | ||||
| <ItemGroup> | <ItemGroup> | ||||
| <ClCompile Include="image\image.cpp"> | <ClCompile Include="image\image.cpp"> | ||||
| @@ -355,6 +361,24 @@ | |||||
| <ClCompile Include="sys\thread.cpp"> | <ClCompile Include="sys\thread.cpp"> | ||||
| <Filter>sys</Filter> | <Filter>sys</Filter> | ||||
| </ClCompile> | </ClCompile> | ||||
| <ClCompile Include="image\dither\ediff.cpp"> | |||||
| <Filter>image\dither</Filter> | |||||
| </ClCompile> | |||||
| <ClCompile Include="image\dither\ostromoukhov.cpp"> | |||||
| <Filter>image\dither</Filter> | |||||
| </ClCompile> | |||||
| <ClCompile Include="image\dither\random.cpp"> | |||||
| <Filter>image\dither</Filter> | |||||
| </ClCompile> | |||||
| <ClCompile Include="image\render\noise.cpp"> | |||||
| <Filter>image\render</Filter> | |||||
| </ClCompile> | |||||
| <ClCompile Include="image\render\screen.cpp"> | |||||
| <Filter>image\render</Filter> | |||||
| </ClCompile> | |||||
| <ClCompile Include="image\pixels.cpp"> | |||||
| <Filter>image</Filter> | |||||
| </ClCompile> | |||||
| </ItemGroup> | </ItemGroup> | ||||
| <ItemGroup> | <ItemGroup> | ||||
| <ClInclude Include="debug\fps.h"> | <ClInclude Include="debug\fps.h"> | ||||
| @@ -760,4 +784,4 @@ | |||||
| </None> | </None> | ||||
| <None Include="Makefile.am" /> | <None Include="Makefile.am" /> | ||||
| </ItemGroup> | </ItemGroup> | ||||
| </Project> | |||||
| </Project> | |||||