mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-07-01 13:56:06 -04:00
Features:
--Add support for Exr files which use 32-bit floats for each RGBA channel. Seems to come out too washed out. --Allow for clearing an individual color curve. --Allow for saving multiple image types in EmberRender and EmberAnimate. All writes are threaded. --Remove --bpc command line argument. Add format png16 as a replacement. --Remove --enable_jpg_comments and --enable_png_comments command line arguments, and replace them with --enable_comments which applies to jpg, png and exr. --Add menu items to variations and affine spinners which allow for easy entry of specific numeric values like pi. --Make final render dialog be wider rather than so tall. Bug fixes: --Fix some OpenCL compile errors on Mac. --Remove ability to save bitmap files on all platforms but Windows. Code changes: --New dependency on OpenEXR. --Allow Curves class to interact with objects of a different template type. --Make m_Curves member of Ember always use float as template type. --Set the length of the curves array to always be 2^17 which should offer enough precision with new 32-bit float pixel types. --Set pixel types to always be 32-bit float. This results in a major reduction of code in the final accumulation part of Renderer.h/cpp. --Remove corresponding code from RendererCL and FinalAccumOpenCLKernelCreator. --Remove Transparency, NumChannels and BytesPerPixel setters from Renderer.h/cpp. --Add new global functions to format final image buffers and place all alpha calculation and scaling code in them. --Blending is no longer needed in OpenGLWidget because of the new pixel type. --Make new class, AffineDoubleSpinBox. --Attempt to make file save dialog code work the same on all OSes. --Remove some unused functions.
This commit is contained in:
@ -5,6 +5,25 @@
|
||||
#include <list>
|
||||
#include <deque>
|
||||
|
||||
#include <ImfRgbaFile.h>
|
||||
//#include <ImfStringAttribute.h>
|
||||
//#include <ImfMatrixAttribute.h>
|
||||
//#include <ImfArray.h>
|
||||
//#include <ImfChannelList.h>
|
||||
|
||||
//#include "drawImage.h"
|
||||
//
|
||||
//#include <iostream>
|
||||
//#include <algorithm>
|
||||
//
|
||||
//
|
||||
//#include <ImfNamespace.h>
|
||||
//
|
||||
//namespace IMF = Imf;
|
||||
//
|
||||
using namespace Imf;
|
||||
using namespace Imath;
|
||||
|
||||
/// <summary>
|
||||
/// EmberTester is a scratch area used for on the fly testing.
|
||||
/// It may become a more formalized automated testing system
|
||||
@ -17,6 +36,43 @@ using namespace EmberCommon;
|
||||
|
||||
//#define DO_NVIDIA 1
|
||||
|
||||
void writeRgba1(const char filename[],
|
||||
const Rgba* pixels,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
//
|
||||
// Write an RGBA image using class RgbaOutputFile.
|
||||
//
|
||||
// - open the file
|
||||
// - describe the memory layout of the pixels
|
||||
// - store the pixels in the file
|
||||
//
|
||||
//auto& chl = file.header().channels();
|
||||
//chl.findChannel("R")->type = PixelType::FLOAT;
|
||||
//Header header(width, height);
|
||||
//header.channels().insert("R", Channel(IMF::FLOAT));
|
||||
//header.channels().insert("G", Channel(IMF::FLOAT));
|
||||
//header.channels().insert("B", Channel(IMF::FLOAT));
|
||||
////header.channels().insert("A", Channel(IMF::FLOAT));
|
||||
//FrameBuffer frameBuffer;
|
||||
//frameBuffer.insert("Z", // name
|
||||
// Slice(IMF::FLOAT, // type
|
||||
// (char *)zPixels, // base
|
||||
// sizeof(*zPixels) * 1, // xStride
|
||||
// sizeof(*zPixels) * width)); // yStride
|
||||
try
|
||||
{
|
||||
RgbaOutputFile file(filename, width, height, WRITE_RGBA);
|
||||
file.setFrameBuffer(pixels, 1, width);
|
||||
file.writePixels(height);
|
||||
}
|
||||
catch (std::exception e)
|
||||
{
|
||||
cout << e.what() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void SaveFinalImage(Renderer<T, T>& renderer, vector<byte>& pixels, char* suffix)
|
||||
{
|
||||
@ -1981,6 +2037,20 @@ int _tmain(int argc, _TCHAR* argv[])
|
||||
vector<Ember<double>> dv;
|
||||
list<Ember<float>> fl;
|
||||
list<Ember<double>> dl;
|
||||
int w = 1000, h = 1000;
|
||||
string filename = ".\\testexr.exr";
|
||||
vector<Rgba> pixels;
|
||||
pixels.resize(w * h);
|
||||
|
||||
for (auto& pix : pixels)
|
||||
{
|
||||
pix.r = 1.0;
|
||||
pix.b = 0.0;
|
||||
pix.a = 1.0;
|
||||
//pix.r = std::numeric_limits<float>::max();
|
||||
}
|
||||
|
||||
writeRgba1(filename.c_str(), pixels.data(), w, h);
|
||||
/* TestFuncs();
|
||||
string line = "title=\"cj_aerie\" smooth=no", delim = " =\"";
|
||||
auto vec = Split(line, delim, true);
|
||||
@ -2008,25 +2078,24 @@ int _tmain(int argc, _TCHAR* argv[])
|
||||
return 1;
|
||||
*/
|
||||
//MakeTestAllVarsRegPrePostComboFile("testallvarsout.flame");
|
||||
/* return 0;
|
||||
return 0;
|
||||
/*
|
||||
TestThreadedKernel();
|
||||
|
||||
auto palf = PaletteList<float>::Instance();
|
||||
Palette<float>* pal = palf->GetRandomPalette();
|
||||
|
||||
TestThreadedKernel();
|
||||
cout << pal->Size() << endl;
|
||||
|
||||
auto palf = PaletteList<float>::Instance();
|
||||
Palette<float>* pal = palf->GetRandomPalette();
|
||||
double d = 1;
|
||||
|
||||
cout << pal->Size() << endl;
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
cout << "log10(" << d << ") = " << std::max<uint>(1u, uint(std::log10(d)) + 1u) << endl;
|
||||
d *= 10;
|
||||
}
|
||||
|
||||
double d = 1;
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
cout << "log10(" << d << ") = " << std::max<uint>(1u, uint(std::log10(d)) + 1u) << endl;
|
||||
d *= 10;
|
||||
}
|
||||
|
||||
return 0;*/
|
||||
return 0;*/
|
||||
/*
|
||||
uint i, iters = (uint)10e7;
|
||||
size_t total = 0;
|
||||
|
Reference in New Issue
Block a user