mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-01-21 13:10:04 -05:00
Replace unsigned int, and char with uint and uchar.
This commit is contained in:
parent
8a3521206b
commit
47dd9fe35c
@ -110,7 +110,7 @@ public:
|
||||
int rowSize;
|
||||
size_t filterLoop;
|
||||
int keepThresh = 100;
|
||||
unsigned int filterCoefIndex = 0;
|
||||
uint filterCoefIndex = 0;
|
||||
T decFilterCount;
|
||||
T finalMinRad = m_MinRad * m_Supersample + 1;//Should scale the filter width by the oversample.
|
||||
T finalMaxRad = m_MaxRad * m_Supersample + 1;//The '+1' comes from the assumed distance to the first pixel.
|
||||
@ -329,7 +329,7 @@ public:
|
||||
inline size_t CoefsIndicesSizeBytes() const { return (m_CoefIndices.size() * sizeof(m_CoefIndices[0])); }
|
||||
inline const T* Coefs() const { return m_Coefs.data(); }
|
||||
inline const T* Widths() const { return m_Widths.data(); }
|
||||
inline const unsigned int* CoefIndices() const { return m_CoefIndices.data(); }
|
||||
inline const uint* CoefIndices() const { return m_CoefIndices.data(); }
|
||||
|
||||
private:
|
||||
T m_MinRad;
|
||||
@ -342,6 +342,6 @@ private:
|
||||
intmax_t m_FilterWidth;//The new radius after scaling for super sample and rounding. This is what's actually used.
|
||||
vector<T> m_Coefs;
|
||||
vector<T> m_Widths;
|
||||
vector<unsigned int> m_CoefIndices;
|
||||
vector<uint> m_CoefIndices;
|
||||
};
|
||||
}
|
@ -73,6 +73,10 @@ namespace EmberNs
|
||||
#define FLOAT_MIN_TAN -FLOAT_MAX_TAN
|
||||
typedef std::chrono::high_resolution_clock Clock;
|
||||
|
||||
#ifndef byte
|
||||
typedef unsigned char byte;
|
||||
#endif
|
||||
|
||||
#define DO_DOUBLE 1//Comment this out for shorter build times during development. Always uncomment for release.
|
||||
//#define ISAAC_FLAM3_DEBUG 1//This is almost never needed, but is very useful when troubleshooting difficult bugs. Enable it to do a side by side comparison with flam3.
|
||||
|
||||
@ -84,14 +88,14 @@ typedef std::chrono::high_resolution_clock Clock;
|
||||
#define m4T glm::detail::tmat4x4<T, glm::defaultp>
|
||||
#define m23T glm::detail::tmat2x3<T, glm::defaultp>
|
||||
|
||||
enum eInterp : unsigned int { EMBER_INTERP_LINEAR = 0, EMBER_INTERP_SMOOTH = 1 };
|
||||
enum eAffineInterp : unsigned int { INTERP_LINEAR = 0, INTERP_LOG = 1, INTERP_COMPAT = 2, INTERP_OLDER = 3 };
|
||||
enum ePaletteMode : unsigned int { PALETTE_STEP = 0, PALETTE_LINEAR = 1 };
|
||||
enum ePaletteInterp : unsigned int { INTERP_HSV = 0, INTERP_SWEEP = 1 };
|
||||
enum eMotion : unsigned int { MOTION_SIN = 1, MOTION_TRIANGLE = 2, MOTION_HILL = 3 };
|
||||
enum eProcessAction : unsigned int { NOTHING = 0, ACCUM_ONLY = 1, FILTER_AND_ACCUM = 2, KEEP_ITERATING = 3, FULL_RENDER = 4 };
|
||||
enum eProcessState : unsigned int { NONE = 0, ITER_STARTED = 1, ITER_DONE = 2, FILTER_DONE = 3, ACCUM_DONE = 4 };
|
||||
enum eInteractiveFilter : unsigned int { FILTER_LOG = 0, FILTER_DE = 1 };
|
||||
enum eScaleType : unsigned int { SCALE_NONE = 0, SCALE_WIDTH = 1, SCALE_HEIGHT = 2 };
|
||||
enum eRenderStatus : unsigned int { RENDER_OK = 0, RENDER_ERROR = 1, RENDER_ABORT = 2 };
|
||||
enum eInterp : uint { EMBER_INTERP_LINEAR = 0, EMBER_INTERP_SMOOTH = 1 };
|
||||
enum eAffineInterp : uint { INTERP_LINEAR = 0, INTERP_LOG = 1, INTERP_COMPAT = 2, INTERP_OLDER = 3 };
|
||||
enum ePaletteMode : uint { PALETTE_STEP = 0, PALETTE_LINEAR = 1 };
|
||||
enum ePaletteInterp : uint { INTERP_HSV = 0, INTERP_SWEEP = 1 };
|
||||
enum eMotion : uint { MOTION_SIN = 1, MOTION_TRIANGLE = 2, MOTION_HILL = 3 };
|
||||
enum eProcessAction : uint { NOTHING = 0, ACCUM_ONLY = 1, FILTER_AND_ACCUM = 2, KEEP_ITERATING = 3, FULL_RENDER = 4 };
|
||||
enum eProcessState : uint { NONE = 0, ITER_STARTED = 1, ITER_DONE = 2, FILTER_DONE = 3, ACCUM_DONE = 4 };
|
||||
enum eInteractiveFilter : uint { FILTER_LOG = 0, FILTER_DE = 1 };
|
||||
enum eScaleType : uint { SCALE_NONE = 0, SCALE_WIDTH = 1, SCALE_HEIGHT = 2 };
|
||||
enum eRenderStatus : uint { RENDER_OK = 0, RENDER_ERROR = 1, RENDER_ABORT = 2 };
|
||||
}
|
||||
|
@ -63,6 +63,7 @@
|
||||
|
||||
//glm is what's used for matrix math.
|
||||
#include "glm/glm.hpp"
|
||||
#include "glm/detail/type_int.hpp"
|
||||
#include "glm/gtc/matrix_transform.hpp"
|
||||
#include "glm/gtc/type_ptr.hpp"
|
||||
#include "glm/gtx/string_cast.hpp"
|
||||
@ -70,3 +71,5 @@
|
||||
using namespace tbb;
|
||||
using namespace std;
|
||||
using namespace std::chrono;
|
||||
using glm::uint;
|
||||
using glm::uint16;
|
||||
|
@ -32,7 +32,7 @@
|
||||
/// </summary>
|
||||
|
||||
#ifndef __ISAAC64
|
||||
typedef unsigned int ISAAC_INT;
|
||||
typedef uint ISAAC_INT;
|
||||
const ISAAC_INT GOLDEN_RATIO = ISAAC_INT(0x9e3779b9);
|
||||
#else
|
||||
typedef size_t ISAAC_INT;
|
||||
@ -48,7 +48,6 @@ template <int ALPHA = 4, class T = ISAAC_INT>
|
||||
class EMBER_API QTIsaac
|
||||
{
|
||||
public:
|
||||
typedef unsigned char byte;
|
||||
enum { N = (1 << ALPHA) };
|
||||
|
||||
/// <summary>
|
||||
@ -167,7 +166,7 @@ public:
|
||||
/// Returns a random 0 or 1.
|
||||
/// </summary>
|
||||
/// <returns>A random 0 or 1</returns>
|
||||
inline unsigned int RandBit()
|
||||
inline uint RandBit()
|
||||
{
|
||||
return Rand() & 1;
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
/// <summary>
|
||||
/// Accessors.
|
||||
/// </summary>
|
||||
const unsigned char* XformDistributions() const { return m_XformDistributions.empty() ? nullptr : &m_XformDistributions[0]; }
|
||||
const byte* XformDistributions() const { return m_XformDistributions.empty() ? nullptr : &m_XformDistributions[0]; }
|
||||
const size_t XformDistributionsSize() const { return m_XformDistributions.size(); }
|
||||
|
||||
/// <summary>
|
||||
@ -146,7 +146,7 @@ public:
|
||||
while (tempDensity < currentDensityLimit && j < CHOOSE_XFORM_GRAIN)
|
||||
{
|
||||
//printf("offset = %d, xform = %d, running sum = %f\n", j, i, tempDensity);
|
||||
m_XformDistributions[(distrib * CHOOSE_XFORM_GRAIN) + j] = (unsigned char)i;
|
||||
m_XformDistributions[(distrib * CHOOSE_XFORM_GRAIN) + j] = (byte)i;
|
||||
tempDensity += densityPerElement;
|
||||
j++;
|
||||
}
|
||||
@ -262,7 +262,7 @@ protected:
|
||||
return (size_t)m_XformDistributions[(index % CHOOSE_XFORM_GRAIN) + (CHOOSE_XFORM_GRAIN * distribOffset)];
|
||||
}
|
||||
|
||||
vector<unsigned char> m_XformDistributions;
|
||||
vector<byte> m_XformDistributions;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
/// <param name="index">The index in the palette file</param>
|
||||
/// <param name="size">The size of the palette which should be 256</param>
|
||||
/// <param name="xmlPaletteEntries">A pointer to 256 color entries</param>
|
||||
Palette(const string& name, int index, unsigned int size, v4T* xmlPaletteEntries)
|
||||
Palette(const string& name, int index, uint size, v4T* xmlPaletteEntries)
|
||||
{
|
||||
m_Name = name;
|
||||
m_Index = index;
|
||||
@ -52,7 +52,7 @@ public:
|
||||
else//They passed in null, so just fill with hard coded values so they at least have something.
|
||||
{
|
||||
//Palette 15 used in the test ember file.
|
||||
unsigned char palette15[COLORMAP_LENGTH * 4] = {
|
||||
byte palette15[COLORMAP_LENGTH * 4] = {
|
||||
0x00, 0xda, 0xde, 0xbc, 0x00, 0xee, 0xe6, 0xc5, 0x00, 0xee, 0xf2, 0xce, 0x00, 0xee, 0xf2, 0xcf, 0x00, 0xe6, 0xee, 0xe1, 0x00, 0xea, 0xee, 0xd8, 0x00, 0xf2, 0xf1, 0xeb, 0x00, 0xf2, 0xf5, 0xd8,
|
||||
0x00, 0xe6, 0xf2, 0xce, 0x00, 0xde, 0xea, 0xc5, 0x00, 0xd6, 0xda, 0xc6, 0x00, 0xce, 0xd2, 0xbc, 0x00, 0xc2, 0xca, 0xa9, 0x00, 0xbe, 0xca, 0xa0, 0x00, 0xce, 0xd6, 0xaa, 0x00, 0xde, 0xe2, 0xc5,
|
||||
0x00, 0xea, 0xed, 0xce, 0x00, 0xea, 0xf2, 0xc5, 0x00, 0xde, 0xe2, 0xc5, 0x00, 0xc2, 0xca, 0xaa, 0x00, 0xae, 0xbe, 0xaa, 0x00, 0xa5, 0xb2, 0x96, 0x00, 0xa2, 0xa9, 0x8d, 0x00, 0x96, 0xa2, 0x84,
|
||||
@ -86,7 +86,7 @@ public:
|
||||
0x00, 0x81, 0x96, 0x8d, 0x00, 0x81, 0x9a, 0x8d, 0x00, 0x85, 0x9a, 0x8d, 0x00, 0x89, 0x9e, 0x8d, 0x00, 0x89, 0x9e, 0x8d, 0x00, 0x8d, 0xa2, 0x97, 0x00, 0x95, 0xa2, 0x97, 0x00, 0x8d, 0xa2, 0x97,
|
||||
0x00, 0x96, 0xa6, 0x8d, 0x00, 0x9a, 0xa1, 0x8d, 0x00, 0x9e, 0xa9, 0x84, 0x00, 0x9e, 0xa6, 0x7a, 0x00, 0xa2, 0xa5, 0x71, 0x00, 0x9e, 0xa6, 0x71, 0x00, 0x9a, 0xa6, 0x71, 0x00, 0x95, 0x9d, 0x71 };
|
||||
|
||||
for (unsigned int i = 0; i < size; i++)
|
||||
for (uint i = 0; i < size; i++)
|
||||
{
|
||||
m_Entries[i].a = (T)palette15[i * 4 + 0];
|
||||
m_Entries[i].r = (T)palette15[i * 4 + 1];
|
||||
@ -206,7 +206,7 @@ public:
|
||||
palette.m_Name = m_Name;
|
||||
palette.m_Entries.resize(Size());
|
||||
|
||||
for (unsigned int i = 0; i < Size(); i++)
|
||||
for (uint i = 0; i < Size(); i++)
|
||||
{
|
||||
size_t ii = (i * 256) / COLORMAP_LENGTH;
|
||||
T rgb[3], hsv[3];
|
||||
@ -241,7 +241,7 @@ public:
|
||||
/// <param name="cont">Contrast -1 - 2</param>
|
||||
/// <param name="blur">Blur 0 - 127</param>
|
||||
/// <param name="freq">Frequency 1 - 10</param>
|
||||
void MakeAdjustedPalette(Palette<T>& palette, int rot, T hue, T sat, T bright, T cont, unsigned int blur, unsigned int freq)
|
||||
void MakeAdjustedPalette(Palette<T>& palette, int rot, T hue, T sat, T bright, T cont, uint blur, uint freq)
|
||||
{
|
||||
T rgb[3], hsv[3];
|
||||
|
||||
@ -344,7 +344,7 @@ public:
|
||||
if (palette.Size() != Size())
|
||||
palette.m_Entries.resize(Size());
|
||||
|
||||
for (unsigned int j = 0; j < palette.Size(); j++)
|
||||
for (uint j = 0; j < palette.Size(); j++)
|
||||
{
|
||||
palette.m_Entries[j] = m_Entries[j] * colorScalar;
|
||||
palette.m_Entries[j].a = 1;
|
||||
@ -358,20 +358,20 @@ public:
|
||||
/// </summary>
|
||||
/// <param name="height">The height of the output block</param>
|
||||
/// <returns>A vector holding the color values</returns>
|
||||
vector<unsigned char> MakeRgbPaletteBlock(unsigned int height)
|
||||
vector<byte> MakeRgbPaletteBlock(uint height)
|
||||
{
|
||||
size_t width = Size();
|
||||
vector<unsigned char> v(height * width * 3);
|
||||
vector<byte> v(height * width * 3);
|
||||
|
||||
if (v.size() == (height * Size() * 3))
|
||||
{
|
||||
for (unsigned int i = 0; i < height; i++)
|
||||
for (uint i = 0; i < height; i++)
|
||||
{
|
||||
for (unsigned int j = 0; j < width; j++)
|
||||
for (uint j = 0; j < width; j++)
|
||||
{
|
||||
v[(width * 3 * i) + (j * 3)] = (unsigned char)(m_Entries[j][0] * T(255));//Palettes are as [0..1], so convert to [0..255] here since it's for GUI display.
|
||||
v[(width * 3 * i) + (j * 3) + 1] = (unsigned char)(m_Entries[j][1] * T(255));
|
||||
v[(width * 3 * i) + (j * 3) + 2] = (unsigned char)(m_Entries[j][2] * T(255));
|
||||
v[(width * 3 * i) + (j * 3)] = (byte)(m_Entries[j][0] * T(255));//Palettes are as [0..1], so convert to [0..255] here since it's for GUI display.
|
||||
v[(width * 3 * i) + (j * 3) + 1] = (byte)(m_Entries[j][1] * T(255));
|
||||
v[(width * 3 * i) + (j * 3) + 2] = (byte)(m_Entries[j][2] * T(255));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ public:
|
||||
/// <returns>A pointer to the palette if found, else nullptr</returns>
|
||||
Palette<T>* GetPaletteByName(const string&& name)
|
||||
{
|
||||
for (unsigned int i = 0; i < Size(); i++)
|
||||
for (uint i = 0; i < Size(); i++)
|
||||
if (m_Palettes[i].m_Name == name)
|
||||
return &m_Palettes[i];
|
||||
|
||||
@ -166,7 +166,7 @@ private:
|
||||
if (!Compare(attr->name, "data"))
|
||||
{
|
||||
int colorIndex = 0;
|
||||
unsigned int r, g, b;
|
||||
uint r, g, b;
|
||||
int colorCount = 0;
|
||||
hexError = false;
|
||||
|
||||
|
@ -318,7 +318,7 @@ bool Renderer<T, bucketT>::CreateTemporalFilter(bool& newAlloc)
|
||||
/// <param name="finalOffset">Offset in finalImage to store the pixels to. Default: 0.</param>
|
||||
/// <returns>True if nothing went wrong, else false.</returns>
|
||||
template <typename T, typename bucketT>
|
||||
eRenderStatus Renderer<T, bucketT>::Run(vector<unsigned char>& finalImage, double time, size_t subBatchCountOverride, bool forceOutput, size_t finalOffset)
|
||||
eRenderStatus Renderer<T, bucketT>::Run(vector<byte>& finalImage, double time, size_t subBatchCountOverride, bool forceOutput, size_t finalOffset)
|
||||
{
|
||||
m_InRender = true;
|
||||
EnterRender();
|
||||
@ -988,7 +988,7 @@ eRenderStatus Renderer<T, bucketT>::GaussianDensityFilter()
|
||||
/// <param name="finalOffset">Offset in the buffer to store the pixels to</param>
|
||||
/// <returns>True if not prematurely aborted, else false.</returns>
|
||||
template <typename T, typename bucketT>
|
||||
eRenderStatus Renderer<T, bucketT>::AccumulatorToFinalImage(vector<unsigned char>& pixels, size_t finalOffset)
|
||||
eRenderStatus Renderer<T, bucketT>::AccumulatorToFinalImage(vector<byte>& pixels, size_t finalOffset)
|
||||
{
|
||||
if (PrepFinalAccumVector(pixels))
|
||||
return AccumulatorToFinalImage(pixels.data(), finalOffset);
|
||||
@ -1004,7 +1004,7 @@ eRenderStatus Renderer<T, bucketT>::AccumulatorToFinalImage(vector<unsigned char
|
||||
/// <param name="finalOffset">Offset in the buffer to store the pixels to. Default: 0.</param>
|
||||
/// <returns>True if not prematurely aborted, else false.</returns>
|
||||
template <typename T, typename bucketT>
|
||||
eRenderStatus Renderer<T, bucketT>::AccumulatorToFinalImage(unsigned char* pixels, size_t finalOffset)
|
||||
eRenderStatus Renderer<T, bucketT>::AccumulatorToFinalImage(byte* pixels, size_t finalOffset)
|
||||
{
|
||||
if (!pixels)
|
||||
return RENDER_ERROR;
|
||||
@ -1048,7 +1048,7 @@ eRenderStatus Renderer<T, bucketT>::AccumulatorToFinalImage(unsigned char* pixel
|
||||
Color<bucketT> newBucket;
|
||||
size_t pixelsRowStart = (m_YAxisUp ? ((FinalRasH() - j) - 1) : j) * FinalRowSize();//Pull out of inner loop for optimization.
|
||||
size_t y = m_DensityFilterOffset + (j * Supersample());//Start at the beginning row of each super sample block.
|
||||
unsigned short* p16;
|
||||
uint16* p16;
|
||||
|
||||
for (size_t i = 0; i < FinalRasW(); i++, pixelsRowStart += PixelSize())
|
||||
{
|
||||
@ -1074,18 +1074,18 @@ eRenderStatus Renderer<T, bucketT>::AccumulatorToFinalImage(unsigned char* pixel
|
||||
|
||||
if (BytesPerChannel() == 2)
|
||||
{
|
||||
p16 = (unsigned short*)(pixels + pixelsRowStart);
|
||||
p16 = (uint16*)(pixels + pixelsRowStart);
|
||||
|
||||
if (EarlyClip())
|
||||
{
|
||||
p16[0] = (unsigned short)(Clamp<bucketT>(newBucket.r, 0, 255) * bucketT(256));
|
||||
p16[1] = (unsigned short)(Clamp<bucketT>(newBucket.g, 0, 255) * bucketT(256));
|
||||
p16[2] = (unsigned short)(Clamp<bucketT>(newBucket.b, 0, 255) * bucketT(256));
|
||||
p16[0] = (uint16)(Clamp<bucketT>(newBucket.r, 0, 255) * bucketT(256));
|
||||
p16[1] = (uint16)(Clamp<bucketT>(newBucket.g, 0, 255) * bucketT(256));
|
||||
p16[2] = (uint16)(Clamp<bucketT>(newBucket.b, 0, 255) * bucketT(256));
|
||||
|
||||
if (NumChannels() > 3)
|
||||
{
|
||||
if (Transparency())
|
||||
p16[3] = (unsigned char)(Clamp<bucketT>(newBucket.a, 0, 1) * bucketT(65535.0));
|
||||
p16[3] = (byte)(Clamp<bucketT>(newBucket.a, 0, 1) * bucketT(65535.0));
|
||||
else
|
||||
p16[3] = 65535;
|
||||
}
|
||||
@ -1099,14 +1099,14 @@ eRenderStatus Renderer<T, bucketT>::AccumulatorToFinalImage(unsigned char* pixel
|
||||
{
|
||||
if (EarlyClip())
|
||||
{
|
||||
pixels[pixelsRowStart] = (unsigned char)Clamp<bucketT>(newBucket.r, 0, 255);
|
||||
pixels[pixelsRowStart + 1] = (unsigned char)Clamp<bucketT>(newBucket.g, 0, 255);
|
||||
pixels[pixelsRowStart + 2] = (unsigned char)Clamp<bucketT>(newBucket.b, 0, 255);
|
||||
pixels[pixelsRowStart] = (byte)Clamp<bucketT>(newBucket.r, 0, 255);
|
||||
pixels[pixelsRowStart + 1] = (byte)Clamp<bucketT>(newBucket.g, 0, 255);
|
||||
pixels[pixelsRowStart + 2] = (byte)Clamp<bucketT>(newBucket.b, 0, 255);
|
||||
|
||||
if (NumChannels() > 3)
|
||||
{
|
||||
if (Transparency())
|
||||
pixels[pixelsRowStart + 3] = (unsigned char)(Clamp<bucketT>(newBucket.a, 0, 1) * bucketT(255.0));
|
||||
pixels[pixelsRowStart + 3] = (byte)(Clamp<bucketT>(newBucket.a, 0, 1) * bucketT(255.0));
|
||||
else
|
||||
pixels[pixelsRowStart + 3] = 255;
|
||||
}
|
||||
@ -1131,11 +1131,11 @@ eRenderStatus Renderer<T, bucketT>::AccumulatorToFinalImage(unsigned char* pixel
|
||||
{
|
||||
for (i = 0; i < FinalRasW(); i++)
|
||||
{
|
||||
unsigned char* p = pixels + (NumChannels() * (i + j * FinalRasW()));
|
||||
byte* p = pixels + (NumChannels() * (i + j * FinalRasW()));
|
||||
|
||||
p[0] = (unsigned char)(m_TempEmber.m_Palette[i * 256 / FinalRasW()][0] * WHITE);//The palette is [0..1], output image is [0..255].
|
||||
p[1] = (unsigned char)(m_TempEmber.m_Palette[i * 256 / FinalRasW()][1] * WHITE);
|
||||
p[2] = (unsigned char)(m_TempEmber.m_Palette[i * 256 / FinalRasW()][2] * WHITE);
|
||||
p[0] = (byte)(m_TempEmber.m_Palette[i * 256 / FinalRasW()][0] * WHITE);//The palette is [0..1], output image is [0..255].
|
||||
p[1] = (byte)(m_TempEmber.m_Palette[i * 256 / FinalRasW()][1] * WHITE);
|
||||
p[2] = (byte)(m_TempEmber.m_Palette[i * 256 / FinalRasW()][2] * WHITE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1357,7 +1357,7 @@ template <typename T, typename bucketT> size_t Renderer<T, bucketT>::FuseCount()
|
||||
/// Non-virtual iterator wrappers.
|
||||
/// </summary>
|
||||
|
||||
template <typename T, typename bucketT> const unsigned char* Renderer<T, bucketT>::XformDistributions() const { return m_Iterator != nullptr ? m_Iterator->XformDistributions() : nullptr; }
|
||||
template <typename T, typename bucketT> const byte* Renderer<T, bucketT>::XformDistributions() const { return m_Iterator != nullptr ? m_Iterator->XformDistributions() : nullptr; }
|
||||
template <typename T, typename bucketT> const size_t Renderer<T, bucketT>::XformDistributionsSize() const { return m_Iterator != nullptr ? m_Iterator->XformDistributionsSize() : 0; }
|
||||
template <typename T, typename bucketT> Point<T>* Renderer<T, bucketT>::Samples(size_t threadIndex) const { return threadIndex < m_Samples.size() ? (Point<T>*)m_Samples[threadIndex].data() : nullptr; }
|
||||
|
||||
@ -1523,7 +1523,7 @@ void Renderer<T, bucketT>::AddToAccum(const glm::detail::tvec4<bucketT, glm::def
|
||||
/// Because this code is used in both early and late clipping, a few extra arguments are passed
|
||||
/// to specify what actions to take. Coupled with an additional template argument, this allows
|
||||
/// using one function to perform all color clipping, gamma correction and final accumulation.
|
||||
/// Template argument accumT is expected to match T for the case of early clipping, unsigned char for late clip for
|
||||
/// Template argument accumT is expected to match T for the case of early clipping, byte for late clip for
|
||||
/// images with one byte per channel and unsigned short for images with two bytes per channel.
|
||||
/// </summary>
|
||||
/// <param name="bucket">The pixel to correct</param>
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
virtual bool CreateSpatialFilter(bool& newAlloc) override;
|
||||
virtual bool CreateTemporalFilter(bool& newAlloc) override;
|
||||
virtual size_t HistBucketSize() const override { return sizeof(glm::detail::tvec4<bucketT, glm::defaultp>); }
|
||||
virtual eRenderStatus Run(vector<unsigned char>& finalImage, double time = 0, size_t subBatchCountOverride = 0, bool forceOutput = false, size_t finalOffset = 0) override;
|
||||
virtual eRenderStatus Run(vector<byte>& finalImage, double time = 0, size_t subBatchCountOverride = 0, bool forceOutput = false, size_t finalOffset = 0) override;
|
||||
virtual EmberImageComments ImageComments(EmberStats& stats, size_t printEditDepth = 0, bool intPalette = false, bool hexPalette = true) override;
|
||||
|
||||
protected:
|
||||
@ -73,8 +73,8 @@ protected:
|
||||
virtual bool ResetBuckets(bool resetHist = true, bool resetAccum = true);
|
||||
virtual eRenderStatus LogScaleDensityFilter();
|
||||
virtual eRenderStatus GaussianDensityFilter();
|
||||
virtual eRenderStatus AccumulatorToFinalImage(vector<unsigned char>& pixels, size_t finalOffset);
|
||||
virtual eRenderStatus AccumulatorToFinalImage(unsigned char* pixels, size_t finalOffset);
|
||||
virtual eRenderStatus AccumulatorToFinalImage(vector<byte>& pixels, size_t finalOffset);
|
||||
virtual eRenderStatus AccumulatorToFinalImage(byte* pixels, size_t finalOffset);
|
||||
virtual EmberStats Iterate(size_t iterCount, size_t temporalSample);
|
||||
|
||||
public:
|
||||
@ -139,7 +139,7 @@ public:
|
||||
virtual size_t FuseCount() const override;
|
||||
|
||||
//Non-virtual iterator wrappers.
|
||||
const unsigned char* XformDistributions() const;
|
||||
const byte* XformDistributions() const;
|
||||
const size_t XformDistributionsSize() const;
|
||||
Point<T>* Samples(size_t threadIndex) const;
|
||||
|
||||
|
@ -176,7 +176,7 @@ bool RendererBase::RandVec(vector<QTIsaac<ISAAC_SIZE, ISAAC_INT>>& randVec)
|
||||
/// </summary>
|
||||
/// <param name="pixels">The vector to allocate</param>
|
||||
/// <returns>True if the vector contains enough space to hold the output image</returns>
|
||||
bool RendererBase::PrepFinalAccumVector(vector<unsigned char>& pixels)
|
||||
bool RendererBase::PrepFinalAccumVector(vector<byte>& pixels)
|
||||
{
|
||||
EnterResize();
|
||||
size_t size = FinalBufferSize();
|
||||
@ -470,7 +470,7 @@ void RendererBase::ThreadCount(size_t threads, const char* seedString)
|
||||
m_Rand.push_back(isaac);
|
||||
|
||||
for (i = 0; i < (isaacSize * sizeof(ISAAC_INT)); i++)
|
||||
((unsigned char*)seeds)[i]++;
|
||||
((byte*)seeds)[i]++;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -100,7 +100,7 @@ public:
|
||||
void ChangeVal(std::function<void(void)> func, eProcessAction action);
|
||||
size_t MemoryRequired(size_t strips, bool includeFinal);
|
||||
vector<QTIsaac<ISAAC_SIZE, ISAAC_INT>> RandVec();
|
||||
bool PrepFinalAccumVector(vector<unsigned char>& pixels);
|
||||
bool PrepFinalAccumVector(vector<byte>& pixels);
|
||||
|
||||
//Virtual processing functions.
|
||||
virtual bool Ok() const;
|
||||
@ -117,7 +117,7 @@ public:
|
||||
virtual bool CreateTemporalFilter(bool& newAlloc) = 0;
|
||||
virtual void ComputeBounds() = 0;
|
||||
virtual void ComputeCamera() = 0;
|
||||
virtual eRenderStatus Run(vector<unsigned char>& finalImage, double time = 0, size_t subBatchCountOverride = 0, bool forceOutput = false, size_t finalOffset = 0) = 0;
|
||||
virtual eRenderStatus Run(vector<byte>& finalImage, double time = 0, size_t subBatchCountOverride = 0, bool forceOutput = false, size_t finalOffset = 0) = 0;
|
||||
virtual EmberImageComments ImageComments(EmberStats& stats, size_t printEditDepth = 0, bool intPalette = false, bool hexPalette = true) = 0;
|
||||
virtual DensityFilterBase* GetDensityFilter() = 0;
|
||||
|
||||
|
@ -285,7 +285,7 @@ public:
|
||||
else if (mode == MUTATE_POST_XFORMS)
|
||||
{
|
||||
bool same = (m_Rand.Rand() & 3) > 0;//25% chance of using the same post for all of them.
|
||||
unsigned int b = 1 + m_Rand.Rand() % 6;
|
||||
uint b = 1 + m_Rand.Rand() % 6;
|
||||
|
||||
sprintf_s(ministr, 32, "(%d%s)", b, same ? " same" : "");
|
||||
os << "mutate post xforms " << ministr;
|
||||
@ -444,7 +444,7 @@ public:
|
||||
/// <returns>A string describing what was done</returns>
|
||||
string Cross(Ember<T>& ember0, Ember<T>& ember1, Ember<T>& emberOut, int crossMode)
|
||||
{
|
||||
unsigned int rb;
|
||||
uint rb;
|
||||
size_t i;
|
||||
T t;
|
||||
ostringstream os;
|
||||
@ -582,7 +582,7 @@ public:
|
||||
{
|
||||
//Select the starting parent.
|
||||
size_t ci;
|
||||
unsigned int startParent = m_Rand.RandBit();
|
||||
uint startParent = m_Rand.RandBit();
|
||||
|
||||
os << " cmap_cross " << startParent << ":";
|
||||
|
||||
@ -856,7 +856,7 @@ public:
|
||||
/// <returns>The number of histogram cells that weren't black</returns>
|
||||
T TryColors(Ember<T>& ember, int colorResolution)
|
||||
{
|
||||
unsigned char* p;
|
||||
byte* p;
|
||||
size_t i, hits = 0, res = colorResolution;
|
||||
size_t pixTotal, res3 = res * res * res;
|
||||
T scalar;
|
||||
@ -1389,8 +1389,8 @@ private:
|
||||
string m_Comment;
|
||||
|
||||
vector<Point<T>> m_Samples;
|
||||
vector<unsigned char> m_FinalImage;
|
||||
vector<unsigned int> m_Hist;
|
||||
vector<byte> m_FinalImage;
|
||||
vector<uint> m_Hist;
|
||||
EmberToXml<T> m_EmberToXml;
|
||||
Iterator<T>* m_Iterator;
|
||||
unique_ptr<StandardIterator<T>> m_StandardIterator;
|
||||
|
@ -159,7 +159,7 @@ protected:
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Open a file in binary mode and read its entire contents into a vector of unsigned chars. Optionally null terminate.
|
||||
/// Open a file in binary mode and read its entire contents into a vector of bytes. Optionally null terminate.
|
||||
/// </summary>
|
||||
/// <param name="filename">The full path to the file to read</param>
|
||||
/// <param name="buf">The vector which will be populated with the file's contents</param>
|
||||
@ -262,7 +262,7 @@ static void CopyVec(vector<T>& dest, const vector<U>& source, std::function<void
|
||||
template <typename T>
|
||||
static void ClearVec(vector<T*>& vec, bool arrayDelete = false)
|
||||
{
|
||||
for (unsigned int i = 0; i < vec.size(); i++)
|
||||
for (uint i = 0; i < vec.size(); i++)
|
||||
{
|
||||
if (vec[i] != nullptr)
|
||||
{
|
||||
@ -451,7 +451,7 @@ static inline float LRint(float x)
|
||||
/// <returns>The rounded value</returns>
|
||||
static inline double LRint(double x)
|
||||
{
|
||||
int64_t temp = (x >= 0 ? (int64_t)(x + 0.5) : (int64_t)(x - 0.5));
|
||||
glm::int64_t temp = (x >= 0 ? (int64_t)(x + 0.5) : (int64_t)(x - 0.5));
|
||||
return (double)temp;
|
||||
}
|
||||
|
||||
@ -893,7 +893,7 @@ int Arg<int>(char* name, int def)
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Template specialization for Arg<>() with a type of unsigned int.
|
||||
/// Template specialization for Arg<>() with a type of uint.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the environment variable to query</param>
|
||||
/// <param name="def">The default value to return if the environment variable was not present</param>
|
||||
@ -902,7 +902,7 @@ template <>
|
||||
#ifdef _WIN32
|
||||
static
|
||||
#endif
|
||||
unsigned int Arg<unsigned int>(char* name, unsigned int def)
|
||||
uint Arg<uint>(char* name, uint def)
|
||||
{
|
||||
return Arg<int>(name, (int)def);
|
||||
}
|
||||
@ -1003,9 +1003,9 @@ string Arg<string>(char* name, string def)
|
||||
/// <param name="replace">The value to replace with</param>
|
||||
/// <returns>The number of instances replaced</returns>
|
||||
template<typename T>
|
||||
static unsigned int FindAndReplace(T& source, const T& find, const T& replace)
|
||||
static uint FindAndReplace(T& source, const T& find, const T& replace)
|
||||
{
|
||||
unsigned int replaceCount = 0;
|
||||
uint replaceCount = 0;
|
||||
typename T::size_type fLen = find.size();
|
||||
typename T::size_type rLen = replace.size();
|
||||
|
||||
|
@ -355,7 +355,7 @@ public:
|
||||
|
||||
//Keep a list of which variations derive from ParametricVariation.
|
||||
//Note that these are not new copies, rather just pointers to the original instances in m_Variations.
|
||||
for (unsigned int i = 0; i < m_Variations.size(); i++)
|
||||
for (uint i = 0; i < m_Variations.size(); i++)
|
||||
{
|
||||
if (ParametricVariation<T>* parVar = dynamic_cast<ParametricVariation<T>*>(m_Variations[i]))
|
||||
m_ParametricVariations.push_back(parVar);
|
||||
@ -412,7 +412,7 @@ public:
|
||||
/// <returns>A pointer to the variation if found, else nullptr.</returns>
|
||||
Variation<T>* GetVariation(eVariationId id)
|
||||
{
|
||||
for (unsigned int i = 0; i < m_Variations.size() && m_Variations[i] != nullptr; i++)
|
||||
for (uint i = 0; i < m_Variations.size() && m_Variations[i] != nullptr; i++)
|
||||
if (id == m_Variations[i]->VariationId())
|
||||
return m_Variations[i];
|
||||
|
||||
@ -435,7 +435,7 @@ public:
|
||||
/// <returns>A pointer to the variation if found, else nullptr.</returns>
|
||||
Variation<T>* GetVariation(const string& name)
|
||||
{
|
||||
for (unsigned int i = 0; i < m_Variations.size() && m_Variations[i] != nullptr; i++)
|
||||
for (uint i = 0; i < m_Variations.size() && m_Variations[i] != nullptr; i++)
|
||||
if (!_stricmp(name.c_str(), m_Variations[i]->Name().c_str()))
|
||||
return m_Variations[i];
|
||||
|
||||
@ -466,7 +466,7 @@ public:
|
||||
/// <returns>The parametric variation with a matching name, else nullptr.</returns>
|
||||
ParametricVariation<T>* GetParametricVariation(const string& name)
|
||||
{
|
||||
for (unsigned int i = 0; i < m_ParametricVariations.size() && m_ParametricVariations[i] != nullptr; i++)
|
||||
for (uint i = 0; i < m_ParametricVariations.size() && m_ParametricVariations[i] != nullptr; i++)
|
||||
if (!_stricmp(name.c_str(), m_ParametricVariations[i]->Name().c_str()))
|
||||
return m_ParametricVariations[i];
|
||||
|
||||
@ -480,7 +480,7 @@ public:
|
||||
/// <returns>The index of the variation with the matching name, else -1</returns>
|
||||
int GetVariationIndex(const string& name)
|
||||
{
|
||||
for (unsigned int i = 0; i < m_Variations.size() && m_Variations[i] != nullptr; i++)
|
||||
for (uint i = 0; i < m_Variations.size() && m_Variations[i] != nullptr; i++)
|
||||
if (!_stricmp(name.c_str(), m_Variations[i]->Name().c_str()))
|
||||
return i;
|
||||
|
||||
|
@ -5594,7 +5594,7 @@ public:
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T a = helper.m_PrecalcAtanyx;
|
||||
int n = rand.Rand((unsigned int)m_Spread);
|
||||
int n = rand.Rand((uint)m_Spread);
|
||||
|
||||
if (a < 0)
|
||||
n++;
|
||||
|
@ -1495,7 +1495,7 @@ public:
|
||||
T z = helper.In.z / m_AbsN;
|
||||
T r = m_Weight * pow(helper.m_PrecalcSumSquares + SQR(z), m_Cn);
|
||||
T tmp = r * helper.m_PrecalcSqrtSumSquares;
|
||||
T ang = (helper.m_PrecalcAtanyx + M_2PI * rand.Rand((unsigned int)m_AbsN)) / m_N;
|
||||
T ang = (helper.m_PrecalcAtanyx + M_2PI * rand.Rand((uint)m_AbsN)) / m_N;
|
||||
|
||||
helper.Out.x = tmp * cos(ang);
|
||||
helper.Out.y = tmp * sin(ang);
|
||||
@ -1574,7 +1574,7 @@ public:
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T r = m_Weight * pow(helper.m_PrecalcSumSquares, m_Cn);
|
||||
T temp = (helper.m_PrecalcAtanyx + M_2PI * rand.Rand((unsigned int)m_AbsN)) / m_N;
|
||||
T temp = (helper.m_PrecalcAtanyx + M_2PI * rand.Rand((uint)m_AbsN)) / m_N;
|
||||
|
||||
helper.Out.x = r * cos(temp);
|
||||
helper.Out.y = r * sin(temp);
|
||||
|
@ -183,8 +183,8 @@ public:
|
||||
T x, y, z;
|
||||
T p = 2 * rand.Frand01<T>() - 1;
|
||||
T q = 2 * rand.Frand01<T>() - 1;
|
||||
unsigned int i = rand.Rand(3);
|
||||
unsigned int j = rand.RandBit();
|
||||
uint i = rand.Rand(3);
|
||||
uint j = rand.RandBit();
|
||||
|
||||
switch (i)
|
||||
{
|
||||
|
@ -250,7 +250,7 @@ public:
|
||||
/// <param name="filename">Full path and filename, optionally empty</param>
|
||||
/// <param name="embers">The newly constructed embers based on what was parsed</param>
|
||||
/// <returns>True if there were no errors, else false.</returns>
|
||||
bool Parse(unsigned char* buf, const char* filename, vector<Ember<T>>& embers)
|
||||
bool Parse(byte* buf, const char* filename, vector<Ember<T>>& embers)
|
||||
{
|
||||
char* bn;
|
||||
const char* xmlPtr;
|
||||
@ -310,7 +310,7 @@ public:
|
||||
//An adjustment of +/- 360 degrees is made until this is true.
|
||||
if (emberSize > 1)
|
||||
{
|
||||
for (unsigned int i = 1; i < emberSize; i++)
|
||||
for (uint i = 1; i < emberSize; i++)
|
||||
{
|
||||
//Only do this adjustment if not in compat mode..
|
||||
if (embers[i - 1].m_AffineInterp != INTERP_COMPAT && embers[i - 1].m_AffineInterp != INTERP_OLDER)
|
||||
@ -349,7 +349,7 @@ public:
|
||||
if (ReadFile(filename, buf))
|
||||
{
|
||||
std::replace(buf.begin(), buf.end(), '&', '+');
|
||||
return Parse((unsigned char*)buf.data(), filename, embers);
|
||||
return Parse((byte*)buf.data(), filename, embers);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
@ -395,19 +395,19 @@ public:
|
||||
/// See error report for errors.
|
||||
/// </summary>
|
||||
/// <param name="str">The string to convert</param>
|
||||
/// <param name="val">The converted unsigned integer value</param>
|
||||
/// <param name="val">The converted uinteger value</param>
|
||||
/// <returns>True if success, else false.</returns>
|
||||
bool Atoi(const char* str, unsigned int& val)
|
||||
bool Atoi(const char* str, uint& val)
|
||||
{
|
||||
return Atoi(str, (int&)val);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert the string to an unsigned integer value and return a bool indicating success.
|
||||
/// Convert the string to an uinteger value and return a bool indicating success.
|
||||
/// See error report for errors.
|
||||
/// </summary>
|
||||
/// <param name="str">The string to convert</param>
|
||||
/// <param name="val">The converted unsigned integer value</param>
|
||||
/// <param name="val">The converted uinteger value</param>
|
||||
/// <returns>True if success, else false.</returns>
|
||||
bool Atoi(const char* str, int& val)
|
||||
{
|
||||
@ -542,11 +542,11 @@ private:
|
||||
bool ParseEmberElement(xmlNode* emberNode, Ember<T>& currentEmber)
|
||||
{
|
||||
bool ret = true;
|
||||
unsigned int newLinear = 0;
|
||||
uint newLinear = 0;
|
||||
char* attStr;
|
||||
const char* loc = __FUNCTION__;
|
||||
int soloXform = -1;
|
||||
unsigned int i, count, index = 0;
|
||||
uint i, count, index = 0;
|
||||
double vals[10];
|
||||
xmlAttrPtr att, curAtt;
|
||||
xmlNodePtr editNode, childNode, motionNode;
|
||||
@ -1041,7 +1041,7 @@ private:
|
||||
bool success = true;
|
||||
char* attStr;
|
||||
const char* loc = __FUNCTION__;
|
||||
unsigned int j;
|
||||
uint j;
|
||||
T temp;
|
||||
double a, b, c, d, e, f;
|
||||
double vals[10];
|
||||
@ -1203,7 +1203,7 @@ private:
|
||||
|
||||
if (Atof(attStr, temp))
|
||||
{
|
||||
unsigned int iTemp = (unsigned int)temp;
|
||||
uint iTemp = (uint)temp;
|
||||
|
||||
if (iTemp < xform.TotalVariationCount())
|
||||
{
|
||||
@ -1246,7 +1246,7 @@ private:
|
||||
}
|
||||
|
||||
//Now that all xforms have been parsed, go through and try to find params for the parametric variations.
|
||||
for (unsigned int i = 0; i < xform.TotalVariationCount(); i++)
|
||||
for (uint i = 0; i < xform.TotalVariationCount(); i++)
|
||||
{
|
||||
if (ParametricVariation<T>* parVar = dynamic_cast<ParametricVariation<T>*>(xform.GetVariation(i)))
|
||||
{
|
||||
@ -1361,7 +1361,7 @@ private:
|
||||
{
|
||||
int colorIndex = 0;
|
||||
int colorCount = 0;
|
||||
unsigned int r, g, b, a;
|
||||
uint r, g, b, a;
|
||||
int ret;
|
||||
char tmps[2];
|
||||
int skip = (int)abs(chan);
|
||||
|
@ -32,11 +32,11 @@ bool EmberAnimate(EmberOptions& opt)
|
||||
bool startXml = false;
|
||||
bool finishXml = false;
|
||||
bool appendXml = false;
|
||||
unsigned char* finalImagep;
|
||||
unsigned int i, channels, ftime;
|
||||
byte* finalImagep;
|
||||
uint i, channels, ftime;
|
||||
string s, flameName, filename, inputPath = GetPath(opt.Input());
|
||||
ostringstream os;
|
||||
vector<unsigned char> finalImage, vecRgb;
|
||||
vector<byte> finalImage, vecRgb;
|
||||
vector<Ember<T>> embers;
|
||||
EmberStats stats;
|
||||
EmberReport emberReport;
|
||||
@ -190,8 +190,8 @@ bool EmberAnimate(EmberOptions& opt)
|
||||
embers[i].m_SubBatchSize = opt.SubBatchSize();
|
||||
|
||||
embers[i].m_Quality *= T(opt.QualityScale());
|
||||
embers[i].m_FinalRasW = (unsigned int)((T)embers[i].m_FinalRasW * opt.SizeScale());
|
||||
embers[i].m_FinalRasH = (unsigned int)((T)embers[i].m_FinalRasH * opt.SizeScale());
|
||||
embers[i].m_FinalRasW = (uint)((T)embers[i].m_FinalRasW * opt.SizeScale());
|
||||
embers[i].m_FinalRasH = (uint)((T)embers[i].m_FinalRasH * opt.SizeScale());
|
||||
embers[i].m_PixelsPerUnit *= T(opt.SizeScale());
|
||||
|
||||
//Cast to double in case the value exceeds 2^32.
|
||||
@ -236,7 +236,7 @@ bool EmberAnimate(EmberOptions& opt)
|
||||
opt.FirstFrame((int)embers[0].m_Time);
|
||||
|
||||
if (opt.LastFrame() == UINT_MAX)
|
||||
opt.LastFrame(ClampGte<unsigned int>((unsigned int)embers.back().m_Time - 1, opt.FirstFrame()));
|
||||
opt.LastFrame(ClampGte<uint>((uint)embers.back().m_Time - 1, opt.FirstFrame()));
|
||||
}
|
||||
|
||||
if (!opt.Out().empty())
|
||||
|
@ -97,7 +97,7 @@ template <typename T> string DEOpenCLKernelCreator<T>::LogScaleAssignDEEntryPoin
|
||||
/// <param name="filterWidth">Filter width</param>
|
||||
/// <returns>The kernel source</returns>
|
||||
template <typename T>
|
||||
string DEOpenCLKernelCreator<T>::GaussianDEKernel(size_t ss, unsigned int filterWidth)
|
||||
string DEOpenCLKernelCreator<T>::GaussianDEKernel(size_t ss, uint filterWidth)
|
||||
{
|
||||
#ifndef ROW_ONLY_DE
|
||||
if ((typeid(T) == typeid(double)) || (filterWidth > MaxDEFilterSize()))//Type double does not use cache.
|
||||
@ -134,7 +134,7 @@ string DEOpenCLKernelCreator<T>::GaussianDEKernel(size_t ss, unsigned int filter
|
||||
/// <param name="filterWidth">Filter width</param>
|
||||
/// <returns>The name of the density estimation filtering entry point kernel function</returns>
|
||||
template <typename T>
|
||||
string DEOpenCLKernelCreator<T>::GaussianDEEntryPoint(size_t ss, unsigned int filterWidth)
|
||||
string DEOpenCLKernelCreator<T>::GaussianDEEntryPoint(size_t ss, uint filterWidth)
|
||||
{
|
||||
#ifndef ROW_ONLY_DE
|
||||
if ((typeid(T) == typeid(double)) || (filterWidth > MaxDEFilterSize()))//Type double does not use cache.
|
||||
@ -170,11 +170,11 @@ string DEOpenCLKernelCreator<T>::GaussianDEEntryPoint(size_t ss, unsigned int fi
|
||||
/// </summary>
|
||||
/// <returns>The maximum filter size allowed for running the local memory version of density filtering</returns>
|
||||
template <typename T>
|
||||
unsigned int DEOpenCLKernelCreator<T>::MaxDEFilterSize() { return 9; }//The true max would be (maxBoxSize - 1) / 2, but that's impractical because it can give us a tiny block size.
|
||||
uint DEOpenCLKernelCreator<T>::MaxDEFilterSize() { return 9; }//The true max would be (maxBoxSize - 1) / 2, but that's impractical because it can give us a tiny block size.
|
||||
|
||||
/// <summary>
|
||||
/// Solve for the maximum filter radius.
|
||||
/// The final filter width is calculated by: (unsigned int)(ceil(m_MaxRad) * (T)m_Supersample) + (m_Supersample - 1);
|
||||
/// The final filter width is calculated by: (uint)(ceil(m_MaxRad) * (T)m_Supersample) + (m_Supersample - 1);
|
||||
/// Must solve for what max rad should be in order to give a maximum final width of (maxBoxSize - 1) / 2, assuming
|
||||
/// a minimum block size of 1 which processes 1 pixel.
|
||||
/// Example: If a box size of 20 was allowed, a filter
|
||||
@ -186,9 +186,9 @@ unsigned int DEOpenCLKernelCreator<T>::MaxDEFilterSize() { return 9; }//The true
|
||||
/// <param name="ss">The supersample being used</param>
|
||||
/// <returns>The maximum filter radius allowed</returns>
|
||||
template <typename T>
|
||||
T DEOpenCLKernelCreator<T>::SolveMaxDERad(unsigned int maxBoxSize, T desiredFilterSize, T ss)
|
||||
T DEOpenCLKernelCreator<T>::SolveMaxDERad(uint maxBoxSize, T desiredFilterSize, T ss)
|
||||
{
|
||||
unsigned int finalFilterSize = (unsigned int)((ceil(desiredFilterSize) * ss) + (ss - 1.0));
|
||||
uint finalFilterSize = (uint)((ceil(desiredFilterSize) * ss) + (ss - 1.0));
|
||||
|
||||
//Return the desired size if the final size of it will fit.
|
||||
if (finalFilterSize <= MaxDEFilterSize())
|
||||
@ -205,9 +205,9 @@ T DEOpenCLKernelCreator<T>::SolveMaxDERad(unsigned int maxBoxSize, T desiredFilt
|
||||
/// <param name="localMem">The local memory available to a block</param>
|
||||
/// <returns>The maximum filter box size allowed</returns>
|
||||
template <typename T>
|
||||
unsigned int DEOpenCLKernelCreator<T>::SolveMaxBoxSize(unsigned int localMem)
|
||||
uint DEOpenCLKernelCreator<T>::SolveMaxBoxSize(uint localMem)
|
||||
{
|
||||
return (unsigned int)floor(sqrt(floor((T)localMem / 16.0)));//Divide by 16 because each element is float4.
|
||||
return (uint)floor(sqrt(floor((T)localMem / 16.0)));//Divide by 16 because each element is float4.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -39,13 +39,13 @@ public:
|
||||
//Accessors.
|
||||
string LogScaleAssignDEKernel();
|
||||
string LogScaleAssignDEEntryPoint();
|
||||
string GaussianDEKernel(size_t ss, unsigned int filterWidth);
|
||||
string GaussianDEEntryPoint(size_t ss, unsigned int filterWidth);
|
||||
string GaussianDEKernel(size_t ss, uint filterWidth);
|
||||
string GaussianDEEntryPoint(size_t ss, uint filterWidth);
|
||||
|
||||
//Miscellaneous static functions.
|
||||
static unsigned int MaxDEFilterSize();
|
||||
static T SolveMaxDERad(unsigned int maxBoxSize, T desiredFilterSize, T ss);
|
||||
static unsigned int SolveMaxBoxSize(unsigned int localMem);
|
||||
static uint MaxDEFilterSize();
|
||||
static T SolveMaxDERad(uint maxBoxSize, T desiredFilterSize, T ss);
|
||||
static uint SolveMaxBoxSize(uint localMem);
|
||||
|
||||
private:
|
||||
//Kernel creators.
|
||||
|
@ -322,9 +322,9 @@ static const char* AddToAccumWithCheckFunctionString =
|
||||
/// OpenCL equivalent various CarToRas member functions.
|
||||
/// </summary>
|
||||
static const char* CarToRasFunctionString =
|
||||
"inline void CarToRasConvertPointToSingle(__constant CarToRasCL* carToRas, Point* point, unsigned int* singleBufferIndex)\n"
|
||||
"inline void CarToRasConvertPointToSingle(__constant CarToRasCL* carToRas, Point* point, uint* singleBufferIndex)\n"
|
||||
"{\n"
|
||||
" *singleBufferIndex = (unsigned int)(carToRas->m_PixPerImageUnitW * point->m_X - carToRas->m_RasLlX) + (carToRas->m_RasWidth * (unsigned int)(carToRas->m_PixPerImageUnitH * point->m_Y - carToRas->m_RasLlY));\n"
|
||||
" *singleBufferIndex = (uint)(carToRas->m_PixPerImageUnitW * point->m_X - carToRas->m_RasLlX) + (carToRas->m_RasWidth * (uint)(carToRas->m_PixPerImageUnitH * point->m_Y - carToRas->m_RasLlY));\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"inline bool CarToRasInBounds(__constant CarToRasCL* carToRas, Point* point)\n"
|
||||
|
@ -48,7 +48,7 @@ static string ConstantDefinesString(bool doublePrecision)
|
||||
else
|
||||
{
|
||||
os << "typedef int intPrec;\n"
|
||||
"typedef unsigned int atomi;\n"
|
||||
"typedef uint atomi;\n"
|
||||
"typedef float real_t;\n"
|
||||
"typedef float4 real4;\n"
|
||||
"#define EPS (FLT_EPSILON)\n"
|
||||
@ -131,7 +131,7 @@ struct ALIGN PointCL
|
||||
T m_Y;
|
||||
T m_Z;
|
||||
T m_ColorX;
|
||||
unsigned int m_LastXfUsed;
|
||||
uint m_LastXfUsed;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
@ -239,7 +239,7 @@ template <typename T>
|
||||
struct ALIGN CarToRasCL
|
||||
{
|
||||
T m_PixPerImageUnitW, m_RasLlX;
|
||||
unsigned int m_RasWidth;
|
||||
uint m_RasWidth;
|
||||
T m_PixPerImageUnitH, m_RasLlY;
|
||||
T m_CarLlX, m_CarUrX, m_CarUrY, m_CarLlY;
|
||||
};
|
||||
@ -268,13 +268,13 @@ struct ALIGN DensityFilterCL
|
||||
T m_Curve;
|
||||
T m_K1;
|
||||
T m_K2;
|
||||
unsigned int m_Supersample;
|
||||
unsigned int m_SuperRasW;
|
||||
unsigned int m_SuperRasH;
|
||||
unsigned int m_KernelSize;
|
||||
unsigned int m_MaxFilterIndex;
|
||||
unsigned int m_MaxFilteredCounts;
|
||||
unsigned int m_FilterWidth;
|
||||
uint m_Supersample;
|
||||
uint m_SuperRasW;
|
||||
uint m_SuperRasH;
|
||||
uint m_KernelSize;
|
||||
uint m_MaxFilterIndex;
|
||||
uint m_MaxFilteredCounts;
|
||||
uint m_FilterWidth;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
@ -304,17 +304,17 @@ static const char* DensityFilterCLStructString =
|
||||
template <typename T>
|
||||
struct ALIGN SpatialFilterCL
|
||||
{
|
||||
unsigned int m_SuperRasW;
|
||||
unsigned int m_SuperRasH;
|
||||
unsigned int m_FinalRasW;
|
||||
unsigned int m_FinalRasH;
|
||||
unsigned int m_Supersample;
|
||||
unsigned int m_FilterWidth;
|
||||
unsigned int m_NumChannels;
|
||||
unsigned int m_BytesPerChannel;
|
||||
unsigned int m_DensityFilterOffset;
|
||||
unsigned int m_Transparency;
|
||||
unsigned int m_YAxisUp;
|
||||
uint m_SuperRasW;
|
||||
uint m_SuperRasH;
|
||||
uint m_FinalRasW;
|
||||
uint m_FinalRasH;
|
||||
uint m_Supersample;
|
||||
uint m_FilterWidth;
|
||||
uint m_NumChannels;
|
||||
uint m_BytesPerChannel;
|
||||
uint m_DensityFilterOffset;
|
||||
uint m_Transparency;
|
||||
uint m_YAxisUp;
|
||||
T m_Vibrancy;
|
||||
T m_HighlightPower;
|
||||
T m_Gamma;
|
||||
|
@ -239,15 +239,15 @@ string FinalAccumOpenCLKernelCreator<T>::CreateFinalAccumKernelString(bool early
|
||||
" if ((GLOBAL_ID_Y >= spatialFilter->m_FinalRasH) || (GLOBAL_ID_X >= spatialFilter->m_FinalRasW))\n"
|
||||
" return;\n"
|
||||
"\n"
|
||||
" unsigned int accumX = spatialFilter->m_DensityFilterOffset + (GLOBAL_ID_X * spatialFilter->m_Supersample);\n"
|
||||
" unsigned int accumY = spatialFilter->m_DensityFilterOffset + (GLOBAL_ID_Y * spatialFilter->m_Supersample);\n"
|
||||
" uint accumX = spatialFilter->m_DensityFilterOffset + (GLOBAL_ID_X * spatialFilter->m_Supersample);\n"
|
||||
" uint accumY = spatialFilter->m_DensityFilterOffset + (GLOBAL_ID_Y * spatialFilter->m_Supersample);\n"
|
||||
" int2 finalCoord;\n"
|
||||
" finalCoord.x = GLOBAL_ID_X;\n"
|
||||
" finalCoord.y = (int)((spatialFilter->m_YAxisUp == 1) ? ((spatialFilter->m_FinalRasH - GLOBAL_ID_Y) - 1) : GLOBAL_ID_Y);\n"
|
||||
" float4floats finalColor;\n"
|
||||
" real_t alpha, ls;\n"
|
||||
" int ii, jj;\n"
|
||||
" unsigned int filterKRowIndex;\n"
|
||||
" uint filterKRowIndex;\n"
|
||||
" const __global real4reals* accumBucket;\n"
|
||||
" real4reals newBucket;\n"
|
||||
" newBucket.m_Real4 = 0;\n"
|
||||
@ -356,7 +356,7 @@ string FinalAccumOpenCLKernelCreator<T>::CreateGammaCorrectionFunctionString(boo
|
||||
<< "\n"
|
||||
<< " CalcNewRgb(bucket, ls, highlightPower, &newRgb);\n"
|
||||
<< "\n"
|
||||
<< " for (unsigned int rgbi = 0; rgbi < 3; rgbi++)\n"
|
||||
<< " for (uint rgbi = 0; rgbi < 3; rgbi++)\n"
|
||||
<< " {\n"
|
||||
<< " a = newRgb.m_Reals[rgbi] + ((1.0 - vibrancy) * 256.0 * pow(bucket->m_Reals[rgbi], g));\n"
|
||||
<< "\n";
|
||||
@ -504,7 +504,7 @@ string FinalAccumOpenCLKernelCreator<T>::CreateGammaCorrectionKernelString(bool
|
||||
" if (GLOBAL_ID_Y >= (spatialFilter->m_SuperRasH - testGutter) || GLOBAL_ID_X >= (spatialFilter->m_SuperRasW - testGutter))\n"
|
||||
" return;\n"
|
||||
"\n"
|
||||
" unsigned int superIndex = (GLOBAL_ID_Y * spatialFilter->m_SuperRasW) + GLOBAL_ID_X;\n"
|
||||
" uint superIndex = (GLOBAL_ID_Y * spatialFilter->m_SuperRasW) + GLOBAL_ID_X;\n"
|
||||
" __global real4reals* bucket = accumulator + superIndex;\n"
|
||||
//Pass in an alphaBase and alphaScale of 0, 1 which means to just directly assign the computed alpha value.
|
||||
" GammaCorrectionFloats(bucket, &(spatialFilter->m_Background[0]), spatialFilter->m_Gamma, spatialFilter->m_LinRange, spatialFilter->m_Vibrancy, spatialFilter->m_HighlightPower, 0.0, 1.0, &(bucket->m_Reals[0]));\n"
|
||||
|
@ -59,10 +59,10 @@ private:
|
||||
//template EMBERCL_API bool IterOpenCLKernelCreator::IsBuildRequired<double>(Ember<double>& ember1, Ember<double>& ember2);
|
||||
|
||||
#ifdef OPEN_CL_TEST_AREA
|
||||
typedef void (*KernelFuncPointer) (unsigned int gridWidth, unsigned int gridHeight, unsigned int blockWidth, unsigned int blockHeight,
|
||||
unsigned int BLOCK_ID_X, unsigned int BLOCK_ID_Y, unsigned int THREAD_ID_X, unsigned int THREAD_ID_Y);
|
||||
typedef void (*KernelFuncPointer) (uint gridWidth, uint gridHeight, uint blockWidth, uint blockHeight,
|
||||
uint BLOCK_ID_X, uint BLOCK_ID_Y, uint THREAD_ID_X, uint THREAD_ID_Y);
|
||||
|
||||
static void OpenCLSim(unsigned int gridWidth, unsigned int gridHeight, unsigned int blockWidth, unsigned int blockHeight, KernelFuncPointer func)
|
||||
static void OpenCLSim(uint gridWidth, uint gridHeight, uint blockWidth, uint blockHeight, KernelFuncPointer func)
|
||||
{
|
||||
cout << "OpenCLSim(): " << endl;
|
||||
cout << " Params: " << endl;
|
||||
@ -71,13 +71,13 @@ static void OpenCLSim(unsigned int gridWidth, unsigned int gridHeight, unsigned
|
||||
cout << " blockW: " << blockWidth << endl;
|
||||
cout << " blockH: " << blockHeight << endl;
|
||||
|
||||
for (unsigned int i = 0; i < gridHeight; i += blockHeight)
|
||||
for (uint i = 0; i < gridHeight; i += blockHeight)
|
||||
{
|
||||
for (unsigned int j = 0; j < gridWidth; j += blockWidth)
|
||||
for (uint j = 0; j < gridWidth; j += blockWidth)
|
||||
{
|
||||
for (unsigned int k = 0; k < blockHeight; k++)
|
||||
for (uint k = 0; k < blockHeight; k++)
|
||||
{
|
||||
for (unsigned int l = 0; l < blockWidth; l++)
|
||||
for (uint l = 0; l < blockWidth; l++)
|
||||
{
|
||||
func(gridWidth, gridHeight, blockWidth, blockHeight, j / blockWidth, i / blockHeight, l, k);
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ bool OpenCLWrapper::CheckOpenCL()
|
||||
/// <param name="device">The index device of the device to use</param>
|
||||
/// <param name="shared">True if shared with OpenGL, else false.</param>
|
||||
/// <returns>True if success, else false.</returns>
|
||||
bool OpenCLWrapper::Init(unsigned int platform, unsigned int device, bool shared)
|
||||
bool OpenCLWrapper::Init(uint platform, uint device, bool shared)
|
||||
{
|
||||
cl_int err;
|
||||
|
||||
@ -70,7 +70,7 @@ bool OpenCLWrapper::Init(unsigned int platform, unsigned int device, bool shared
|
||||
m_Device = m_Devices[m_PlatformIndex][device];
|
||||
m_DeviceVec.clear();
|
||||
m_DeviceVec.push_back(m_Device);
|
||||
m_LocalMemSize = (unsigned int)GetInfo<cl_ulong>(m_PlatformIndex, m_DeviceIndex, CL_DEVICE_LOCAL_MEM_SIZE);
|
||||
m_LocalMemSize = (uint)GetInfo<cl_ulong>(m_PlatformIndex, m_DeviceIndex, CL_DEVICE_LOCAL_MEM_SIZE);
|
||||
m_Shared = shared;
|
||||
m_Init = true;//Command queue is ok, it's now ok to begin building and running programs.
|
||||
}
|
||||
@ -215,7 +215,7 @@ bool OpenCLWrapper::WriteBuffer(const string& name, void* data, size_t size)
|
||||
/// <param name="data">A pointer to the buffer</param>
|
||||
/// <param name="size">The size in bytes of the buffer</param>
|
||||
/// <returns>True if success, else false.</returns>
|
||||
bool OpenCLWrapper::WriteBuffer(unsigned int bufferIndex, void* data, size_t size)
|
||||
bool OpenCLWrapper::WriteBuffer(uint bufferIndex, void* data, size_t size)
|
||||
{
|
||||
if (m_Init && (bufferIndex < m_Buffers.size()) && (GetBufferSize(bufferIndex) == size))
|
||||
{
|
||||
@ -253,7 +253,7 @@ bool OpenCLWrapper::ReadBuffer(const string& name, void* data, size_t size)
|
||||
/// <param name="data">A pointer to a buffer to copy the data to</param>
|
||||
/// <param name="size">The size in bytes of the buffer</param>
|
||||
/// <returns>True if success, else false.</returns>
|
||||
bool OpenCLWrapper::ReadBuffer(unsigned int bufferIndex, void* data, size_t size)
|
||||
bool OpenCLWrapper::ReadBuffer(uint bufferIndex, void* data, size_t size)
|
||||
{
|
||||
if (m_Init && (bufferIndex < m_Buffers.size()) && (GetBufferSize(bufferIndex) == size))
|
||||
{
|
||||
@ -277,7 +277,7 @@ bool OpenCLWrapper::ReadBuffer(unsigned int bufferIndex, void* data, size_t size
|
||||
/// <returns>The index if found, else -1.</returns>
|
||||
int OpenCLWrapper::FindBufferIndex(const string& name)
|
||||
{
|
||||
for (unsigned int i = 0; i < m_Buffers.size(); i++)
|
||||
for (uint i = 0; i < m_Buffers.size(); i++)
|
||||
if (m_Buffers[i].m_Name == name)
|
||||
return (int)i;
|
||||
|
||||
@ -289,7 +289,7 @@ int OpenCLWrapper::FindBufferIndex(const string& name)
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the buffer to search for</param>
|
||||
/// <returns>The size of the buffer if found, else 0.</returns>
|
||||
unsigned int OpenCLWrapper::GetBufferSize(const string& name)
|
||||
uint OpenCLWrapper::GetBufferSize(const string& name)
|
||||
{
|
||||
int bufferIndex = FindBufferIndex(name);
|
||||
|
||||
@ -301,10 +301,10 @@ unsigned int OpenCLWrapper::GetBufferSize(const string& name)
|
||||
/// </summary>
|
||||
/// <param name="name">The index of the buffer to get the size of</param>
|
||||
/// <returns>The size of the buffer if found, else 0.</returns>
|
||||
unsigned int OpenCLWrapper::GetBufferSize(unsigned int bufferIndex)
|
||||
uint OpenCLWrapper::GetBufferSize(uint bufferIndex)
|
||||
{
|
||||
if (m_Init && bufferIndex < m_Buffers.size())
|
||||
return (unsigned int)m_Buffers[bufferIndex].m_Buffer.getInfo<CL_MEM_SIZE>(nullptr);
|
||||
return (uint)m_Buffers[bufferIndex].m_Buffer.getInfo<CL_MEM_SIZE>(nullptr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -355,7 +355,7 @@ bool OpenCLWrapper::AddAndWriteImage(const string& name, cl_mem_flags flags, con
|
||||
m_GLImages.push_back(namedImageGL);
|
||||
|
||||
if (data)
|
||||
return WriteImage2D((unsigned int)m_GLImages.size() - 1, true, width, height, row_pitch, data);//OpenGL images/textures require a separate write.
|
||||
return WriteImage2D((uint)m_GLImages.size() - 1, true, width, height, row_pitch, data);//OpenGL images/textures require a separate write.
|
||||
else
|
||||
return true;
|
||||
}
|
||||
@ -430,7 +430,7 @@ bool OpenCLWrapper::AddAndWriteImage(const string& name, cl_mem_flags flags, con
|
||||
/// <param name="row_pitch">The row pitch (usually zero)</param>
|
||||
/// <param name="data">The image data</param>
|
||||
/// <returns>True if success, else false.</returns>
|
||||
bool OpenCLWrapper::WriteImage2D(unsigned int index, bool shared, ::size_t width, ::size_t height, ::size_t row_pitch, void* data)
|
||||
bool OpenCLWrapper::WriteImage2D(uint index, bool shared, ::size_t width, ::size_t height, ::size_t row_pitch, void* data)
|
||||
{
|
||||
if (m_Init)
|
||||
{
|
||||
@ -505,7 +505,7 @@ bool OpenCLWrapper::ReadImage(const string& name, ::size_t width, ::size_t heigh
|
||||
/// <param name="shared">True if shared with an OpenGL texture, else false.</param>
|
||||
/// <param name="data">A pointer to a buffer to copy the data to</param>
|
||||
/// <returns>True if success, else false.</returns>
|
||||
bool OpenCLWrapper::ReadImage(unsigned int imageIndex, ::size_t width, ::size_t height, ::size_t row_pitch, bool shared, void* data)
|
||||
bool OpenCLWrapper::ReadImage(uint imageIndex, ::size_t width, ::size_t height, ::size_t row_pitch, bool shared, void* data)
|
||||
{
|
||||
if (m_Init)
|
||||
{
|
||||
@ -552,13 +552,13 @@ int OpenCLWrapper::FindImageIndex(const string& name, bool shared)
|
||||
{
|
||||
if (shared)
|
||||
{
|
||||
for (unsigned int i = 0; i < m_GLImages.size(); i++)
|
||||
for (uint i = 0; i < m_GLImages.size(); i++)
|
||||
if (m_GLImages[i].m_Name == name)
|
||||
return i;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (unsigned int i = 0; i < m_Images.size(); i++)
|
||||
for (uint i = 0; i < m_Images.size(); i++)
|
||||
if (m_Images[i].m_Name == name)
|
||||
return i;
|
||||
}
|
||||
@ -572,7 +572,7 @@ int OpenCLWrapper::FindImageIndex(const string& name, bool shared)
|
||||
/// <param name="name">The name of the image to search for</param>
|
||||
/// <param name="shared">True if shared with an OpenGL texture, else false.</param>
|
||||
/// <returns>The size of the 2D image if found, else 0.</returns>
|
||||
unsigned int OpenCLWrapper::GetImageSize(const string& name, bool shared)
|
||||
uint OpenCLWrapper::GetImageSize(const string& name, bool shared)
|
||||
{
|
||||
int imageIndex = FindImageIndex(name, shared);
|
||||
return GetImageSize(imageIndex, shared);
|
||||
@ -584,7 +584,7 @@ unsigned int OpenCLWrapper::GetImageSize(const string& name, bool shared)
|
||||
/// <param name="imageIndex">Index of the image to search for</param>
|
||||
/// <param name="shared">True if shared with an OpenGL texture, else false.</param>
|
||||
/// <returns>The size of the 2D image if found, else 0.</returns>
|
||||
unsigned int OpenCLWrapper::GetImageSize(unsigned int imageIndex, bool shared)
|
||||
uint OpenCLWrapper::GetImageSize(uint imageIndex, bool shared)
|
||||
{
|
||||
size_t size = 0;
|
||||
|
||||
@ -608,7 +608,7 @@ unsigned int OpenCLWrapper::GetImageSize(unsigned int imageIndex, bool shared)
|
||||
}
|
||||
}
|
||||
|
||||
return (unsigned int)size;
|
||||
return (uint)size;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -840,7 +840,7 @@ bool OpenCLWrapper::CreateSampler(cl::Sampler& sampler, cl_bool normalizedCoords
|
||||
/// <param name="argIndex">Index of the argument</param>
|
||||
/// <param name="name">The name of the buffer</param>
|
||||
/// <returns>True if success, else false.</returns>
|
||||
bool OpenCLWrapper::SetBufferArg(unsigned int kernelIndex, unsigned int argIndex, const string& name)
|
||||
bool OpenCLWrapper::SetBufferArg(uint kernelIndex, uint argIndex, const string& name)
|
||||
{
|
||||
int bufferIndex = OpenCLWrapper::FindBufferIndex(name);
|
||||
|
||||
@ -855,7 +855,7 @@ bool OpenCLWrapper::SetBufferArg(unsigned int kernelIndex, unsigned int argIndex
|
||||
/// <param name="argIndex">Index of the argument</param>
|
||||
/// <param name="bufferIndex">Index of the buffer</param>
|
||||
/// <returns>True if success, else false.</returns>
|
||||
bool OpenCLWrapper::SetBufferArg(unsigned int kernelIndex, unsigned int argIndex, unsigned int bufferIndex)
|
||||
bool OpenCLWrapper::SetBufferArg(uint kernelIndex, uint argIndex, uint bufferIndex)
|
||||
{
|
||||
if (m_Init && bufferIndex < m_Buffers.size())
|
||||
return SetArg<cl::Buffer>(kernelIndex, argIndex, m_Buffers[bufferIndex].m_Buffer);
|
||||
@ -872,7 +872,7 @@ bool OpenCLWrapper::SetBufferArg(unsigned int kernelIndex, unsigned int argIndex
|
||||
/// <param name="shared">True if shared with an OpenGL texture, else false</param>
|
||||
/// <param name="name">The name of the 2D image</param>
|
||||
/// <returns>True if success, else false.</returns>
|
||||
bool OpenCLWrapper::SetImageArg(unsigned int kernelIndex, unsigned int argIndex, bool shared, const string& name)
|
||||
bool OpenCLWrapper::SetImageArg(uint kernelIndex, uint argIndex, bool shared, const string& name)
|
||||
{
|
||||
if (m_Init)
|
||||
{
|
||||
@ -892,7 +892,7 @@ bool OpenCLWrapper::SetImageArg(unsigned int kernelIndex, unsigned int argIndex,
|
||||
/// <param name="shared">True if shared with an OpenGL texture, else false</param>
|
||||
/// <param name="imageIndex">Index of the 2D image</param>
|
||||
/// <returns>True if success, else false.</returns>
|
||||
bool OpenCLWrapper::SetImageArg(unsigned int kernelIndex, unsigned int argIndex, bool shared, unsigned int imageIndex)
|
||||
bool OpenCLWrapper::SetImageArg(uint kernelIndex, uint argIndex, bool shared, uint imageIndex)
|
||||
{
|
||||
cl_int err;
|
||||
|
||||
@ -920,7 +920,7 @@ bool OpenCLWrapper::SetImageArg(unsigned int kernelIndex, unsigned int argIndex,
|
||||
/// <returns>The index if found, else -1.</returns>
|
||||
int OpenCLWrapper::FindKernelIndex(const string& name)
|
||||
{
|
||||
for (unsigned int i = 0; i < m_Programs.size(); i++)
|
||||
for (uint i = 0; i < m_Programs.size(); i++)
|
||||
if (m_Programs[i].m_Name == name)
|
||||
return (int)i;
|
||||
|
||||
@ -938,8 +938,8 @@ int OpenCLWrapper::FindKernelIndex(const string& name)
|
||||
/// <param name="blockHeight">Height of each block</param>
|
||||
/// <param name="blockDepth">Depth of each block</param>
|
||||
/// <returns>True if success, else false.</returns>
|
||||
bool OpenCLWrapper::RunKernel(unsigned int kernelIndex, unsigned int totalGridWidth, unsigned int totalGridHeight, unsigned int totalGridDepth,
|
||||
unsigned int blockWidth, unsigned int blockHeight, unsigned int blockDepth)
|
||||
bool OpenCLWrapper::RunKernel(uint kernelIndex, uint totalGridWidth, uint totalGridHeight, uint totalGridDepth,
|
||||
uint blockWidth, uint blockHeight, uint blockDepth)
|
||||
{
|
||||
if (m_Init && kernelIndex < m_Programs.size())
|
||||
{
|
||||
@ -999,7 +999,7 @@ vector<string> OpenCLWrapper::PlatformNames()
|
||||
|
||||
platforms.reserve(m_Platforms.size());
|
||||
|
||||
for (unsigned int i = 0; i < m_Platforms.size(); i++)
|
||||
for (uint i = 0; i < m_Platforms.size(); i++)
|
||||
platforms.push_back(PlatformName(i));
|
||||
|
||||
return platforms;
|
||||
@ -1030,7 +1030,7 @@ string OpenCLWrapper::DeviceName(size_t platform, size_t device)
|
||||
/// <returns>All available device names on the platform at the specified index as a vector of strings</returns>
|
||||
vector<string> OpenCLWrapper::DeviceNames(size_t platform)
|
||||
{
|
||||
unsigned int i = 0;
|
||||
uint i = 0;
|
||||
string s;
|
||||
vector<string> devices;
|
||||
|
||||
@ -1124,9 +1124,9 @@ string OpenCLWrapper::DumpInfo()
|
||||
bool OpenCLWrapper::Ok() const { return m_Init; }
|
||||
bool OpenCLWrapper::Shared() const { return m_Shared; }
|
||||
cl::Context OpenCLWrapper::Context() const { return m_Context; }
|
||||
unsigned int OpenCLWrapper::PlatformIndex() const { return m_PlatformIndex; }
|
||||
unsigned int OpenCLWrapper::DeviceIndex() const { return m_DeviceIndex; }
|
||||
unsigned int OpenCLWrapper::LocalMemSize() const { return m_LocalMemSize; }
|
||||
uint OpenCLWrapper::PlatformIndex() const { return m_PlatformIndex; }
|
||||
uint OpenCLWrapper::DeviceIndex() const { return m_DeviceIndex; }
|
||||
uint OpenCLWrapper::LocalMemSize() const { return m_LocalMemSize; }
|
||||
|
||||
/// <summary>
|
||||
/// Makes the even grid dims.
|
||||
@ -1135,7 +1135,7 @@ unsigned int OpenCLWrapper::LocalMemSize() const { return m_LocalMemSize; }
|
||||
/// <param name="blockH">The block h.</param>
|
||||
/// <param name="gridW">The grid w.</param>
|
||||
/// <param name="gridH">The grid h.</param>
|
||||
void OpenCLWrapper::MakeEvenGridDims(unsigned int blockW, unsigned int blockH, unsigned int& gridW, unsigned int& gridH)
|
||||
void OpenCLWrapper::MakeEvenGridDims(uint blockW, uint blockH, uint& gridW, uint& gridH)
|
||||
{
|
||||
if (gridW % blockW != 0)
|
||||
gridW += (blockW - (gridW % blockW));
|
||||
|
@ -104,7 +104,7 @@ class EMBERCL_API OpenCLWrapper : public EmberReport
|
||||
public:
|
||||
OpenCLWrapper();
|
||||
bool CheckOpenCL();
|
||||
bool Init(unsigned int platform, unsigned int device, bool shared = false);
|
||||
bool Init(uint platform, uint device, bool shared = false);
|
||||
|
||||
//Programs.
|
||||
bool AddProgram(const string& name, const string& program, const string& entryPoint, bool doublePrecision);
|
||||
@ -114,22 +114,22 @@ public:
|
||||
bool AddBuffer(const string& name, size_t size, cl_mem_flags flags = CL_MEM_READ_WRITE);
|
||||
bool AddAndWriteBuffer(const string& name, void* data, size_t size, cl_mem_flags flags = CL_MEM_READ_WRITE);
|
||||
bool WriteBuffer(const string& name, void* data, size_t size);
|
||||
bool WriteBuffer(unsigned int bufferIndex, void* data, size_t size);
|
||||
bool WriteBuffer(uint bufferIndex, void* data, size_t size);
|
||||
bool ReadBuffer(const string& name, void* data, size_t size);
|
||||
bool ReadBuffer(unsigned int bufferIndex, void* data, size_t size);
|
||||
bool ReadBuffer(uint bufferIndex, void* data, size_t size);
|
||||
int FindBufferIndex(const string& name);
|
||||
unsigned int GetBufferSize(const string& name);
|
||||
unsigned int GetBufferSize(unsigned int bufferIndex);
|
||||
uint GetBufferSize(const string& name);
|
||||
uint GetBufferSize(uint bufferIndex);
|
||||
void ClearBuffers();
|
||||
|
||||
//Images.
|
||||
bool AddAndWriteImage(const string& name, cl_mem_flags flags, const cl::ImageFormat& format, ::size_t width, ::size_t height, ::size_t row_pitch, void* data = NULL, bool shared = false, GLuint texName = 0);
|
||||
bool WriteImage2D(unsigned int index, bool shared, ::size_t width, ::size_t height, ::size_t row_pitch, void* data);
|
||||
bool WriteImage2D(uint index, bool shared, ::size_t width, ::size_t height, ::size_t row_pitch, void* data);
|
||||
bool ReadImage(const string& name, ::size_t width, ::size_t height, ::size_t row_pitch, bool shared, void* data);
|
||||
bool ReadImage(unsigned int imageIndex, ::size_t width, ::size_t height, ::size_t row_pitch, bool shared, void* data);
|
||||
bool ReadImage(uint imageIndex, ::size_t width, ::size_t height, ::size_t row_pitch, bool shared, void* data);
|
||||
int FindImageIndex(const string& name, bool shared);
|
||||
unsigned int GetImageSize(const string& name, bool shared);
|
||||
unsigned int GetImageSize(unsigned int imageIndex, bool shared);
|
||||
uint GetImageSize(const string& name, bool shared);
|
||||
uint GetImageSize(uint imageIndex, bool shared);
|
||||
bool CompareImageParams(cl::Image& image, cl_mem_flags flags, const cl::ImageFormat& format, ::size_t width, ::size_t height, ::size_t row_pitch);
|
||||
void ClearImages(bool shared);
|
||||
bool CreateImage2D(cl::Image2D& image2D, cl_mem_flags flags, cl::ImageFormat format, ::size_t width, ::size_t height, ::size_t row_pitch = 0, void* data = NULL);
|
||||
@ -143,10 +143,10 @@ public:
|
||||
bool CreateSampler(cl::Sampler& sampler, cl_bool normalizedCoords, cl_addressing_mode addressingMode, cl_filter_mode filterMode);
|
||||
|
||||
//Arguments.
|
||||
bool SetBufferArg(unsigned int kernelIndex, unsigned int argIndex, const string& name);
|
||||
bool SetBufferArg(unsigned int kernelIndex, unsigned int argIndex, unsigned int bufferIndex);
|
||||
bool SetImageArg(unsigned int kernelIndex, unsigned int argIndex, bool shared, const string& name);
|
||||
bool SetImageArg(unsigned int kernelIndex, unsigned int argIndex, bool shared, unsigned int imageIndex);
|
||||
bool SetBufferArg(uint kernelIndex, uint argIndex, const string& name);
|
||||
bool SetBufferArg(uint kernelIndex, uint argIndex, uint bufferIndex);
|
||||
bool SetImageArg(uint kernelIndex, uint argIndex, bool shared, const string& name);
|
||||
bool SetImageArg(uint kernelIndex, uint argIndex, bool shared, uint imageIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Set an argument in the specified kernel, at the specified argument index.
|
||||
@ -157,7 +157,7 @@ public:
|
||||
/// <param name="arg">The argument value to set</param>
|
||||
/// <returns>True if success, else false</returns>
|
||||
template <typename T>
|
||||
bool SetArg(unsigned int kernelIndex, unsigned int argIndex, T arg)
|
||||
bool SetArg(uint kernelIndex, uint argIndex, T arg)
|
||||
{
|
||||
if (m_Init && kernelIndex < m_Programs.size())
|
||||
{
|
||||
@ -171,7 +171,7 @@ public:
|
||||
|
||||
//Kernels.
|
||||
int FindKernelIndex(const string& name);
|
||||
bool RunKernel(unsigned int kernelIndex, unsigned int totalGridWidth, unsigned int totalGridHeight, unsigned int totalGridDepth, unsigned int blockWidth, unsigned int blockHeight, unsigned int blockDepth);
|
||||
bool RunKernel(uint kernelIndex, uint totalGridWidth, uint totalGridHeight, uint totalGridDepth, uint blockWidth, uint blockHeight, uint blockDepth);
|
||||
|
||||
//Info.
|
||||
template<typename T>
|
||||
@ -187,11 +187,11 @@ public:
|
||||
bool Ok() const;
|
||||
bool Shared() const;
|
||||
cl::Context Context() const;
|
||||
unsigned int PlatformIndex() const;
|
||||
unsigned int DeviceIndex() const;
|
||||
unsigned int LocalMemSize() const;
|
||||
uint PlatformIndex() const;
|
||||
uint DeviceIndex() const;
|
||||
uint LocalMemSize() const;
|
||||
|
||||
static void MakeEvenGridDims(unsigned int blockW, unsigned int blockH, unsigned int& gridW, unsigned int& gridH);
|
||||
static void MakeEvenGridDims(uint blockW, uint blockH, uint& gridW, uint& gridH);
|
||||
|
||||
private:
|
||||
bool CreateContext(bool shared);
|
||||
@ -201,9 +201,9 @@ private:
|
||||
|
||||
bool m_Init;
|
||||
bool m_Shared;
|
||||
unsigned int m_PlatformIndex;
|
||||
unsigned int m_DeviceIndex;
|
||||
unsigned int m_LocalMemSize;
|
||||
uint m_PlatformIndex;
|
||||
uint m_DeviceIndex;
|
||||
uint m_LocalMemSize;
|
||||
cl::Platform m_Platform;
|
||||
cl::Context m_Context;
|
||||
cl::Device m_Device;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -19,7 +19,7 @@ class EMBERCL_API RendererCLBase
|
||||
{
|
||||
public:
|
||||
virtual ~RendererCLBase() { }
|
||||
virtual bool ReadFinal(unsigned char* pixels) = 0;
|
||||
virtual bool ReadFinal(byte* pixels) = 0;
|
||||
virtual bool ClearFinal() = 0;
|
||||
};
|
||||
|
||||
@ -54,35 +54,35 @@ using EmberNs::Renderer<T, T>::m_RotMat;
|
||||
using EmberNs::Renderer<T, T>::m_Ember;
|
||||
|
||||
public:
|
||||
RendererCL(unsigned int platform = 0, unsigned int device = 0, bool shared = false, GLuint outputTexID = 0);
|
||||
RendererCL(uint platform = 0, uint device = 0, bool shared = false, GLuint outputTexID = 0);
|
||||
~RendererCL();
|
||||
|
||||
//Non-virtual member functions for OpenCL specific tasks.
|
||||
bool Init(unsigned int platform, unsigned int device, bool shared, GLuint outputTexID);
|
||||
bool Init(uint platform, uint device, bool shared, GLuint outputTexID);
|
||||
bool SetOutputTexture(GLuint outputTexID);
|
||||
|
||||
//Iters per kernel/block/grid.
|
||||
inline unsigned int IterCountPerKernel() const;
|
||||
inline unsigned int IterCountPerBlock() const;
|
||||
inline unsigned int IterCountPerGrid() const;
|
||||
inline uint IterCountPerKernel() const;
|
||||
inline uint IterCountPerBlock() const;
|
||||
inline uint IterCountPerGrid() const;
|
||||
|
||||
//Kernels per block.
|
||||
inline unsigned int IterBlockKernelWidth() const;
|
||||
inline unsigned int IterBlockKernelHeight() const;
|
||||
inline unsigned int IterBlockKernelCount() const;
|
||||
inline uint IterBlockKernelWidth() const;
|
||||
inline uint IterBlockKernelHeight() const;
|
||||
inline uint IterBlockKernelCount() const;
|
||||
|
||||
//Kernels per grid.
|
||||
inline unsigned int IterGridKernelWidth() const;
|
||||
inline unsigned int IterGridKernelHeight() const;
|
||||
inline unsigned int IterGridKernelCount() const;
|
||||
inline uint IterGridKernelWidth() const;
|
||||
inline uint IterGridKernelHeight() const;
|
||||
inline uint IterGridKernelCount() const;
|
||||
|
||||
//Blocks per grid.
|
||||
inline unsigned int IterGridBlockWidth() const;
|
||||
inline unsigned int IterGridBlockHeight() const;
|
||||
inline unsigned int IterGridBlockCount() const;
|
||||
inline uint IterGridBlockWidth() const;
|
||||
inline uint IterGridBlockHeight() const;
|
||||
inline uint IterGridBlockCount() const;
|
||||
|
||||
unsigned int PlatformIndex();
|
||||
unsigned int DeviceIndex();
|
||||
uint PlatformIndex();
|
||||
uint DeviceIndex();
|
||||
bool ReadHist();
|
||||
bool ReadAccum();
|
||||
bool ReadPoints(vector<PointCL<T>>& vec);
|
||||
@ -95,7 +95,7 @@ public:
|
||||
string IterKernel();
|
||||
|
||||
//Virtual functions overridden from RendererCLBase.
|
||||
virtual bool ReadFinal(unsigned char* pixels);
|
||||
virtual bool ReadFinal(byte* pixels);
|
||||
virtual bool ClearFinal();
|
||||
|
||||
//Public virtual functions overridden from Renderer or RendererBase.
|
||||
@ -122,7 +122,7 @@ protected:
|
||||
virtual bool ResetBuckets(bool resetHist = true, bool resetAccum = true) override;
|
||||
virtual eRenderStatus LogScaleDensityFilter() override;
|
||||
virtual eRenderStatus GaussianDensityFilter() override;
|
||||
virtual eRenderStatus AccumulatorToFinalImage(unsigned char* pixels, size_t finalOffset) override;
|
||||
virtual eRenderStatus AccumulatorToFinalImage(byte* pixels, size_t finalOffset) override;
|
||||
virtual EmberStats Iterate(size_t iterCount, size_t temporalSample) override;
|
||||
|
||||
private:
|
||||
@ -132,9 +132,9 @@ private:
|
||||
eRenderStatus RunLogScaleFilter();
|
||||
eRenderStatus RunDensityFilter();
|
||||
eRenderStatus RunFinalAccum();
|
||||
bool ClearBuffer(const string& bufferName, unsigned int width, unsigned int height, unsigned int elementSize);
|
||||
bool RunDensityFilterPrivate(unsigned int kernelIndex, unsigned int gridW, unsigned int gridH, unsigned int blockW, unsigned int blockH, unsigned int chunkSizeW, unsigned int chunkSizeH, unsigned int chunkW, unsigned int chunkH);
|
||||
int MakeAndGetDensityFilterProgram(size_t ss, unsigned int filterWidth);
|
||||
bool ClearBuffer(const string& bufferName, uint width, uint height, uint elementSize);
|
||||
bool RunDensityFilterPrivate(uint kernelIndex, uint gridW, uint gridH, uint blockW, uint blockH, uint chunkSizeW, uint chunkSizeH, uint chunkW, uint chunkH);
|
||||
int MakeAndGetDensityFilterProgram(size_t ss, uint filterWidth);
|
||||
int MakeAndGetFinalAccumProgram(T& alphaBase, T& alphaScale);
|
||||
int MakeAndGetGammaCorrectionProgram();
|
||||
void FillSeeds();
|
||||
@ -148,12 +148,12 @@ private:
|
||||
bool m_Init;
|
||||
bool m_NVidia;
|
||||
bool m_DoublePrecision;
|
||||
unsigned int m_IterCountPerKernel;
|
||||
unsigned int m_IterBlocksWide, m_IterBlockWidth;
|
||||
unsigned int m_IterBlocksHigh, m_IterBlockHeight;
|
||||
unsigned int m_MaxDEBlockSizeW;
|
||||
unsigned int m_MaxDEBlockSizeH;
|
||||
unsigned int m_WarpSize;
|
||||
uint m_IterCountPerKernel;
|
||||
uint m_IterBlocksWide, m_IterBlockWidth;
|
||||
uint m_IterBlocksHigh, m_IterBlockHeight;
|
||||
uint m_MaxDEBlockSizeW;
|
||||
uint m_MaxDEBlockSizeH;
|
||||
uint m_WarpSize;
|
||||
size_t m_Calls;
|
||||
|
||||
//Buffer names.
|
||||
|
@ -129,11 +129,11 @@ static bool InitPaletteList(const string& filename)
|
||||
/// <param name="rgb">The RGB buffer</param>
|
||||
/// <param name="width">The width of the image in pixels</param>
|
||||
/// <param name="height">The height of the image in pixels</param>
|
||||
static void RgbaToRgb(vector<unsigned char>& rgba, vector<unsigned char>& rgb, size_t width, size_t height)
|
||||
static void RgbaToRgb(vector<byte>& rgba, vector<byte>& rgb, size_t width, size_t height)
|
||||
{
|
||||
rgb.resize(width * height * 3);
|
||||
|
||||
for (unsigned int i = 0, j = 0; i < (width * height * 4); i += 4, j += 3)
|
||||
for (uint i = 0, j = 0; i < (width * height * 4); i += 4, j += 3)
|
||||
{
|
||||
rgb[j] = rgba[i];
|
||||
rgb[j + 1] = rgba[i + 1];
|
||||
@ -149,9 +149,9 @@ static void RgbaToRgb(vector<unsigned char>& rgba, vector<unsigned char>& rgb, s
|
||||
/// <param name="memAvailable">Amount of memory available on the system</param>
|
||||
/// <param name="useMem">The maximum amount of memory to use. Use max if 0.</param>
|
||||
/// <returns>The number of strips to use</returns>
|
||||
static unsigned int CalcStrips(double memRequired, double memAvailable, double useMem)
|
||||
static uint CalcStrips(double memRequired, double memAvailable, double useMem)
|
||||
{
|
||||
unsigned int strips;
|
||||
uint strips;
|
||||
|
||||
if (useMem > 0)
|
||||
memAvailable = useMem;
|
||||
@ -161,7 +161,7 @@ static unsigned int CalcStrips(double memRequired, double memAvailable, double u
|
||||
if (memAvailable >= memRequired)
|
||||
return 1;
|
||||
|
||||
strips = (unsigned int)ceil(memRequired / memAvailable);
|
||||
strips = (uint)ceil(memRequired / memAvailable);
|
||||
|
||||
return strips;
|
||||
}
|
||||
@ -239,7 +239,7 @@ static T NextLowestEvenDiv(T numerator, T denominator)
|
||||
/// <param name="errorReport">The error report for holding errors if anything goes wrong</param>
|
||||
/// <returns>A pointer to the created renderer if successful, else false.</returns>
|
||||
template <typename T, typename bucketT>
|
||||
static Renderer<T, bucketT>* CreateRenderer(eRendererType renderType, unsigned int platform, unsigned int device, bool shared, GLuint texId, EmberReport& errorReport)
|
||||
static Renderer<T, bucketT>* CreateRenderer(eRendererType renderType, uint platform, uint device, bool shared, GLuint texId, EmberReport& errorReport)
|
||||
{
|
||||
string s;
|
||||
unique_ptr<Renderer<T, bucketT>> renderer;
|
||||
@ -275,7 +275,7 @@ static Renderer<T, bucketT>* CreateRenderer(eRendererType renderType, unsigned i
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static bool StripsRender(RendererBase* renderer, Ember<T>& ember, vector<unsigned char>& finalImage, double time, size_t strips, bool yAxisUp,
|
||||
static bool StripsRender(RendererBase* renderer, Ember<T>& ember, vector<byte>& finalImage, double time, size_t strips, bool yAxisUp,
|
||||
std::function<void(size_t strip)> perStripStart,
|
||||
std::function<void(size_t strip)> perStripFinish,
|
||||
std::function<void(size_t strip)> perStripError,
|
||||
|
@ -126,7 +126,7 @@ class EmberOptions;
|
||||
|
||||
/// <summary>
|
||||
/// A single option.
|
||||
/// Template argument expected to be bool, int, unsigned int, double or string.
|
||||
/// Template argument expected to be bool, int, uint, double or string.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class EmberOptionEntry
|
||||
@ -217,7 +217,7 @@ private:
|
||||
break
|
||||
|
||||
//Uint.
|
||||
#define Eou EmberOptionEntry<unsigned int>
|
||||
#define Eou EmberOptionEntry<uint>
|
||||
#define INITUINTOPTION(member, option) \
|
||||
member = option; \
|
||||
m_UintArgs.push_back(&member)
|
||||
@ -431,7 +431,7 @@ public:
|
||||
PARSEINTOPTION(OPT_SYMMETRY, Symmetry);//Int args
|
||||
PARSEINTOPTION(OPT_SHEEP_GEN, SheepGen);
|
||||
PARSEINTOPTION(OPT_SHEEP_ID, SheepId);
|
||||
PARSEUINTOPTION(OPT_OPENCL_PLATFORM, Platform);//Unsigned int args.
|
||||
PARSEUINTOPTION(OPT_OPENCL_PLATFORM, Platform);//uint args.
|
||||
PARSEUINTOPTION(OPT_OPENCL_DEVICE, Device);
|
||||
PARSEUINTOPTION(OPT_SEED, Seed);
|
||||
PARSEUINTOPTION(OPT_NTHREADS, ThreadCount);
|
||||
@ -645,27 +645,27 @@ public:
|
||||
EmberOptionEntry<int> Symmetry;//Value int.
|
||||
EmberOptionEntry<int> SheepGen;
|
||||
EmberOptionEntry<int> SheepId;
|
||||
EmberOptionEntry<unsigned int> Platform;//Value unsigned int.
|
||||
EmberOptionEntry<unsigned int> Device;
|
||||
EmberOptionEntry<unsigned int> Seed;
|
||||
EmberOptionEntry<unsigned int> ThreadCount;
|
||||
EmberOptionEntry<unsigned int> Strips;
|
||||
EmberOptionEntry<unsigned int> Supersample;
|
||||
EmberOptionEntry<unsigned int> BitsPerChannel;
|
||||
EmberOptionEntry<unsigned int> SubBatchSize;
|
||||
EmberOptionEntry<unsigned int> Bits;
|
||||
EmberOptionEntry<unsigned int> PrintEditDepth;
|
||||
EmberOptionEntry<unsigned int> JpegQuality;
|
||||
EmberOptionEntry<unsigned int> FirstFrame;
|
||||
EmberOptionEntry<unsigned int> LastFrame;
|
||||
EmberOptionEntry<unsigned int> Frame;
|
||||
EmberOptionEntry<unsigned int> Time;
|
||||
EmberOptionEntry<unsigned int> Dtime;
|
||||
EmberOptionEntry<unsigned int> Frames;
|
||||
EmberOptionEntry<unsigned int> Loops;
|
||||
EmberOptionEntry<unsigned int> Repeat;
|
||||
EmberOptionEntry<unsigned int> Tries;
|
||||
EmberOptionEntry<unsigned int> MaxXforms;
|
||||
EmberOptionEntry<uint> Platform;//Value uint.
|
||||
EmberOptionEntry<uint> Device;
|
||||
EmberOptionEntry<uint> Seed;
|
||||
EmberOptionEntry<uint> ThreadCount;
|
||||
EmberOptionEntry<uint> Strips;
|
||||
EmberOptionEntry<uint> Supersample;
|
||||
EmberOptionEntry<uint> BitsPerChannel;
|
||||
EmberOptionEntry<uint> SubBatchSize;
|
||||
EmberOptionEntry<uint> Bits;
|
||||
EmberOptionEntry<uint> PrintEditDepth;
|
||||
EmberOptionEntry<uint> JpegQuality;
|
||||
EmberOptionEntry<uint> FirstFrame;
|
||||
EmberOptionEntry<uint> LastFrame;
|
||||
EmberOptionEntry<uint> Frame;
|
||||
EmberOptionEntry<uint> Time;
|
||||
EmberOptionEntry<uint> Dtime;
|
||||
EmberOptionEntry<uint> Frames;
|
||||
EmberOptionEntry<uint> Loops;
|
||||
EmberOptionEntry<uint> Repeat;
|
||||
EmberOptionEntry<uint> Tries;
|
||||
EmberOptionEntry<uint> MaxXforms;
|
||||
|
||||
EmberOptionEntry<double> SizeScale;//Value double.
|
||||
EmberOptionEntry<double> QualityScale;
|
||||
@ -711,7 +711,7 @@ public:
|
||||
private:
|
||||
vector<EmberOptionEntry<bool>*> m_BoolArgs;
|
||||
vector<EmberOptionEntry<int>*> m_IntArgs;
|
||||
vector<EmberOptionEntry<unsigned int>*> m_UintArgs;
|
||||
vector<EmberOptionEntry<uint>*> m_UintArgs;
|
||||
vector<EmberOptionEntry<double>*> m_DoubleArgs;
|
||||
vector<EmberOptionEntry<string>*> m_StringArgs;
|
||||
};
|
||||
|
@ -12,7 +12,7 @@
|
||||
/// <param name="width">Width of the image in pixels</param>
|
||||
/// <param name="height">Height of the image in pixels</param>
|
||||
/// <returns>True if success, else false</returns>
|
||||
static bool WritePpm(const char* filename, unsigned char* image, size_t width, size_t height)
|
||||
static bool WritePpm(const char* filename, byte* image, size_t width, size_t height)
|
||||
{
|
||||
bool b = false;
|
||||
size_t size = width * height * 3;
|
||||
@ -44,7 +44,7 @@ static bool WritePpm(const char* filename, unsigned char* image, size_t width, s
|
||||
/// <param name="url">Url of the author</param>
|
||||
/// <param name="nick">Nickname of the author</param>
|
||||
/// <returns>True if success, else false</returns>
|
||||
static bool WriteJpeg(const char* filename, unsigned char* image, size_t width, size_t height, int quality, bool enableComments, EmberImageComments& comments, string id, string url, string nick)
|
||||
static bool WriteJpeg(const char* filename, byte* image, size_t width, size_t height, int quality, bool enableComments, EmberImageComments& comments, string id, string url, string nick)
|
||||
{
|
||||
bool b = false;
|
||||
FILE* file;
|
||||
@ -79,36 +79,36 @@ static bool WriteJpeg(const char* filename, unsigned char* image, size_t width,
|
||||
//Write comments to jpeg.
|
||||
if (enableComments)
|
||||
{
|
||||
jpeg_write_marker(&info, JPEG_COM, (unsigned char*)verString, (int)strlen(verString));
|
||||
jpeg_write_marker(&info, JPEG_COM, (byte*)verString, (int)strlen(verString));
|
||||
|
||||
if (nick != "")
|
||||
{
|
||||
snprintf_s(nickString, 64, "flam3_nickname: %s", nick.c_str());
|
||||
jpeg_write_marker(&info, JPEG_COM, (unsigned char*)nickString, (int)strlen(nickString));
|
||||
jpeg_write_marker(&info, JPEG_COM, (byte*)nickString, (int)strlen(nickString));
|
||||
}
|
||||
|
||||
if (url != "")
|
||||
{
|
||||
snprintf_s(urlString, 128, "flam3_url: %s", url.c_str());
|
||||
jpeg_write_marker(&info, JPEG_COM, (unsigned char*)urlString, (int)strlen(urlString));
|
||||
jpeg_write_marker(&info, JPEG_COM, (byte*)urlString, (int)strlen(urlString));
|
||||
}
|
||||
|
||||
if (id != "")
|
||||
{
|
||||
snprintf_s(idString, 128, "flam3_id: %s", id.c_str());
|
||||
jpeg_write_marker(&info, JPEG_COM, (unsigned char*)idString, (int)strlen(idString));
|
||||
jpeg_write_marker(&info, JPEG_COM, (byte*)idString, (int)strlen(idString));
|
||||
}
|
||||
|
||||
jpeg_write_marker(&info, JPEG_COM, (unsigned char*)bvString, (int)strlen(bvString));
|
||||
jpeg_write_marker(&info, JPEG_COM, (unsigned char*)niString, (int)strlen(niString));
|
||||
jpeg_write_marker(&info, JPEG_COM, (unsigned char*)rtString, (int)strlen(rtString));
|
||||
jpeg_write_marker(&info, JPEG_COM, (unsigned char*)genomeString, (int)strlen(genomeString));
|
||||
jpeg_write_marker(&info, JPEG_COM, (byte*)bvString, (int)strlen(bvString));
|
||||
jpeg_write_marker(&info, JPEG_COM, (byte*)niString, (int)strlen(niString));
|
||||
jpeg_write_marker(&info, JPEG_COM, (byte*)rtString, (int)strlen(rtString));
|
||||
jpeg_write_marker(&info, JPEG_COM, (byte*)genomeString, (int)strlen(genomeString));
|
||||
}
|
||||
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
JSAMPROW row_pointer[1];
|
||||
row_pointer[0] = (unsigned char*)image + (3 * width * i);
|
||||
row_pointer[0] = (byte*)image + (3 * width * i);
|
||||
jpeg_write_scanlines(&info, row_pointer, 1);
|
||||
}
|
||||
|
||||
@ -135,7 +135,7 @@ static bool WriteJpeg(const char* filename, unsigned char* image, size_t width,
|
||||
/// <param name="url">Url of the author</param>
|
||||
/// <param name="nick">Nickname of the author</param>
|
||||
/// <returns>True if success, else false</returns>
|
||||
static bool WritePng(const char* filename, unsigned char* image, size_t width, size_t height, size_t bytesPerChannel, bool enableComments, EmberImageComments& comments, string id, string url, string nick)
|
||||
static bool WritePng(const char* filename, byte* image, size_t width, size_t height, size_t bytesPerChannel, bool enableComments, EmberImageComments& comments, string id, string url, string nick)
|
||||
{
|
||||
bool b = false;
|
||||
FILE* file;
|
||||
@ -146,8 +146,8 @@ static bool WritePng(const char* filename, unsigned char* image, size_t width, s
|
||||
png_infop info_ptr;
|
||||
png_text text[PNG_COMMENT_MAX];
|
||||
size_t i;
|
||||
unsigned short testbe = 1;
|
||||
vector<unsigned char*> rows(height);
|
||||
uint16 testbe = 1;
|
||||
vector<byte*> rows(height);
|
||||
|
||||
text[0].compression = PNG_TEXT_COMPRESSION_NONE;
|
||||
text[0].key = (png_charp)"flam3_version";
|
||||
@ -182,7 +182,7 @@ static bool WritePng(const char* filename, unsigned char* image, size_t width, s
|
||||
text[7].text = (png_charp)comments.m_Genome.c_str();
|
||||
|
||||
for (i = 0; i < height; i++)
|
||||
rows[i] = (unsigned char*)image + i * width * 4 * bytesPerChannel;
|
||||
rows[i] = (byte*)image + i * width * 4 * bytesPerChannel;
|
||||
|
||||
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
|
||||
info_ptr = png_create_info_struct(png_ptr);
|
||||
@ -232,7 +232,7 @@ static bool WritePng(const char* filename, unsigned char* image, size_t width, s
|
||||
/// <param name="height">The height.</param>
|
||||
/// <param name="newSize">The size of the new buffer created</param>
|
||||
/// <returns>The converted buffer if successful, else NULL.</returns>
|
||||
static unsigned char* ConvertRGBToBMPBuffer(unsigned char* buffer, size_t width, size_t height, size_t& newSize)
|
||||
static byte* ConvertRGBToBMPBuffer(byte* buffer, size_t width, size_t height, size_t& newSize)
|
||||
{
|
||||
if (buffer == nullptr || width == 0 || height == 0)
|
||||
return nullptr;
|
||||
@ -245,7 +245,7 @@ static unsigned char* ConvertRGBToBMPBuffer(unsigned char* buffer, size_t width,
|
||||
size_t psw = scanlinebytes + padding;
|
||||
|
||||
newSize = height * psw;
|
||||
unsigned char* newBuf = new unsigned char[newSize];
|
||||
byte* newBuf = new byte[newSize];
|
||||
|
||||
if (newBuf)
|
||||
{
|
||||
@ -286,7 +286,7 @@ static unsigned char* ConvertRGBToBMPBuffer(unsigned char* buffer, size_t width,
|
||||
/// <param name="height">Height of the image in pixels</param>
|
||||
/// <param name="paddedSize">Padded size, greater than or equal to total image size.</param>
|
||||
/// <returns>True if success, else false</returns>
|
||||
static bool SaveBmp(const char* filename, unsigned char* image, size_t width, size_t height, size_t paddedSize)
|
||||
static bool SaveBmp(const char* filename, byte* image, size_t width, size_t height, size_t paddedSize)
|
||||
{
|
||||
#ifdef WIN32
|
||||
BITMAPFILEHEADER bmfh;
|
||||
@ -351,11 +351,11 @@ static bool SaveBmp(const char* filename, unsigned char* image, size_t width, si
|
||||
/// <param name="width">Width of the image in pixels</param>
|
||||
/// <param name="height">Height of the image in pixels</param>
|
||||
/// <returns>True if success, else false</returns>
|
||||
static bool WriteBmp(const char* filename, unsigned char* image, size_t width, size_t height)
|
||||
static bool WriteBmp(const char* filename, byte* image, size_t width, size_t height)
|
||||
{
|
||||
bool b = false;
|
||||
size_t newSize;
|
||||
unique_ptr<unsigned char> bgrBuf(ConvertRGBToBMPBuffer(image, width, height, newSize));
|
||||
unique_ptr<byte> bgrBuf(ConvertRGBToBMPBuffer(image, width, height, newSize));
|
||||
|
||||
if (bgrBuf.get())
|
||||
b = SaveBmp(filename, bgrBuf.get(), width, height, newSize);
|
||||
|
@ -176,7 +176,7 @@ enum SG_Error {
|
||||
# endif
|
||||
# define sg_strcmp ::_mbscmp
|
||||
# define sg_strcasecmp ::_mbsicmp
|
||||
# define SOCHAR_T unsigned char
|
||||
# define SOCHAR_T byte
|
||||
#else
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
@ -309,7 +309,7 @@ struct SimpleGlobBase
|
||||
{
|
||||
SimpleGlobBase() : m_hFind(INVALID_HANDLE_VALUE) { }
|
||||
|
||||
int FindFirstFileS(const char * a_pszFileSpec, unsigned int) {
|
||||
int FindFirstFileS(const char * a_pszFileSpec, uint) {
|
||||
m_hFind = FindFirstFileA(a_pszFileSpec, &m_oFindDataA);
|
||||
if (m_hFind != INVALID_HANDLE_VALUE) {
|
||||
return SG_SUCCESS;
|
||||
@ -320,7 +320,7 @@ struct SimpleGlobBase
|
||||
}
|
||||
return SG_ERR_FAILURE;
|
||||
}
|
||||
int FindFirstFileS(const wchar_t * a_pszFileSpec, unsigned int) {
|
||||
int FindFirstFileS(const wchar_t * a_pszFileSpec, uint) {
|
||||
m_hFind = FindFirstFileW(a_pszFileSpec, &m_oFindDataW);
|
||||
if (m_hFind != INVALID_HANDLE_VALUE) {
|
||||
return SG_SUCCESS;
|
||||
@ -405,7 +405,7 @@ struct SimpleGlobBase
|
||||
}
|
||||
}
|
||||
|
||||
int FindFirstFileS(const char * a_pszFileSpec, unsigned int a_uiFlags) {
|
||||
int FindFirstFileS(const char * a_pszFileSpec, uint a_uiFlags) {
|
||||
int nFlags = GLOB_MARK | GLOB_NOSORT;
|
||||
if (a_uiFlags & SG_GLOB_ERR) nFlags |= GLOB_ERR;
|
||||
if (a_uiFlags & SG_GLOB_TILDE) nFlags |= GLOB_TILDE;
|
||||
@ -419,7 +419,7 @@ struct SimpleGlobBase
|
||||
}
|
||||
|
||||
#if SG_HAVE_ICU
|
||||
int FindFirstFileS(const UChar * a_pszFileSpec, unsigned int a_uiFlags) {
|
||||
int FindFirstFileS(const UChar * a_pszFileSpec, uint a_uiFlags) {
|
||||
char buf[PATH_MAX] = { 0 };
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
u_strToUTF8(buf, sizeof(buf), nullptr, a_pszFileSpec, -1, &status);
|
||||
@ -531,7 +531,7 @@ public:
|
||||
argv[0] ... argv[a_nReservedSlots-1] will be left empty for
|
||||
the caller to fill in.
|
||||
*/
|
||||
CSimpleGlobTempl(unsigned int a_uiFlags = 0, int a_nReservedSlots = 0);
|
||||
CSimpleGlobTempl(uint a_uiFlags = 0, int a_nReservedSlots = 0);
|
||||
|
||||
/*! @brief Deallocate all memory buffers. */
|
||||
~CSimpleGlobTempl();
|
||||
@ -548,7 +548,7 @@ public:
|
||||
argv[0] ... argv[a_nReservedSlots-1] will be left empty for
|
||||
the caller to fill in.
|
||||
*/
|
||||
int Init(unsigned int a_uiFlags = 0, int a_nReservedSlots = 0);
|
||||
int Init(uint a_uiFlags = 0, int a_nReservedSlots = 0);
|
||||
|
||||
/*! @brief Add a new filespec to the glob.
|
||||
|
||||
@ -624,7 +624,7 @@ private:
|
||||
static int fileSortCompare(const void *a1, const void *a2);
|
||||
|
||||
private:
|
||||
unsigned int m_uiFlags;
|
||||
uint m_uiFlags;
|
||||
ARG_ARRAY_TYPE m_nArgArrayType; //!< argv is indexes or pointers
|
||||
SOCHAR ** m_rgpArgs; //!< argv
|
||||
int m_nReservedSlots; //!< # client slots in argv array
|
||||
@ -642,7 +642,7 @@ private:
|
||||
|
||||
template<class SOCHAR>
|
||||
CSimpleGlobTempl<SOCHAR>::CSimpleGlobTempl(
|
||||
unsigned int a_uiFlags,
|
||||
uint a_uiFlags,
|
||||
int a_nReservedSlots
|
||||
)
|
||||
{
|
||||
@ -664,7 +664,7 @@ CSimpleGlobTempl<SOCHAR>::~CSimpleGlobTempl()
|
||||
template<class SOCHAR>
|
||||
int
|
||||
CSimpleGlobTempl<SOCHAR>::Init(
|
||||
unsigned int a_uiFlags,
|
||||
uint a_uiFlags,
|
||||
int a_nReservedSlots
|
||||
)
|
||||
{
|
||||
|
@ -58,15 +58,15 @@ bool EmberGenome(EmberOptions& opt)
|
||||
//Regular variables.
|
||||
Timing t;
|
||||
bool exactTimeMatch, randomMode, didColor, seqFlag;
|
||||
unsigned int i, j, i0, i1, rep, val, frame, frameCount, count = 0;
|
||||
unsigned int ftime, firstFrame, lastFrame;
|
||||
uint i, j, i0, i1, rep, val, frame, frameCount, count = 0;
|
||||
uint ftime, firstFrame, lastFrame;
|
||||
size_t n, tot, totb, totw;
|
||||
T avgPix, fractionBlack, fractionWhite, blend, spread, mix0, mix1;
|
||||
string token, filename;
|
||||
ostringstream os, os2;
|
||||
vector<Ember<T>> embers, embers2, templateEmbers;
|
||||
vector<eVariationId> vars, noVars;
|
||||
vector<unsigned char> finalImage;
|
||||
vector<byte> finalImage;
|
||||
eCrossMode crossMeth;
|
||||
eMutateMode mutMeth;
|
||||
Ember<T> orig, save, selp0, selp1, parent0, parent1;
|
||||
@ -312,8 +312,8 @@ bool EmberGenome(EmberOptions& opt)
|
||||
embers[i].DeleteMotionElements();
|
||||
}
|
||||
|
||||
firstFrame = (unsigned int)(opt.FirstFrame() == UINT_MAX ? embers[0].m_Time : opt.FirstFrame());
|
||||
lastFrame = (unsigned int)(opt.LastFrame() == UINT_MAX ? embers.back().m_Time : opt.LastFrame());
|
||||
firstFrame = (uint)(opt.FirstFrame() == UINT_MAX ? embers[0].m_Time : opt.FirstFrame());
|
||||
lastFrame = (uint)(opt.LastFrame() == UINT_MAX ? embers.back().m_Time : opt.LastFrame());
|
||||
|
||||
if (lastFrame < firstFrame)
|
||||
lastFrame = firstFrame;
|
||||
@ -326,7 +326,7 @@ bool EmberGenome(EmberOptions& opt)
|
||||
|
||||
for (i = 0; i < embers.size(); i++)
|
||||
{
|
||||
if (ftime == (unsigned int)embers[i].m_Time)
|
||||
if (ftime == (uint)embers[i].m_Time)
|
||||
{
|
||||
interpolated = embers[i];
|
||||
exactTimeMatch = true;
|
||||
@ -340,7 +340,7 @@ bool EmberGenome(EmberOptions& opt)
|
||||
|
||||
for (i = 0; i < embers.size(); i++)
|
||||
{
|
||||
if (ftime == (unsigned int)(embers[i].m_Time - 1))
|
||||
if (ftime == (uint)(embers[i].m_Time - 1))
|
||||
{
|
||||
exactTimeMatch = true;
|
||||
break;
|
||||
@ -480,7 +480,7 @@ bool EmberGenome(EmberOptions& opt)
|
||||
|
||||
oldX = embers[i].m_CenterX;
|
||||
oldY = embers[i].m_CenterY;
|
||||
embers[i].m_FinalRasH = (unsigned int)((T)embers[i].m_FinalRasH / (T)opt.Frames());
|
||||
embers[i].m_FinalRasH = (uint)((T)embers[i].m_FinalRasH / (T)opt.Frames());
|
||||
|
||||
embers[i].m_CenterY = embers[i].m_CenterY - ((opt.Frames() - 1) * embers[i].m_FinalRasH) /
|
||||
(2 * embers[i].m_PixelsPerUnit * pow(T(2.0), embers[i].m_Zoom));
|
||||
|
@ -27,7 +27,7 @@ bool EmberRender(EmberOptions& opt)
|
||||
|
||||
Timing t;
|
||||
bool writeSuccess = false;
|
||||
unsigned char* finalImagep;
|
||||
byte* finalImagep;
|
||||
size_t i, channels;
|
||||
size_t strips;
|
||||
size_t iterCount;
|
||||
@ -35,7 +35,7 @@ bool EmberRender(EmberOptions& opt)
|
||||
string inputPath = GetPath(opt.Input());
|
||||
ostringstream os;
|
||||
vector<Ember<T>> embers;
|
||||
vector<unsigned char> finalImage, vecRgb;
|
||||
vector<byte> finalImage, vecRgb;
|
||||
EmberStats stats;
|
||||
EmberReport emberReport;
|
||||
EmberImageComments comments;
|
||||
@ -168,8 +168,8 @@ bool EmberRender(EmberOptions& opt)
|
||||
|
||||
embers[i].m_TemporalSamples = 1;//Force temporal samples to 1 for render.
|
||||
embers[i].m_Quality *= T(opt.QualityScale());
|
||||
embers[i].m_FinalRasW = (unsigned int)((T)embers[i].m_FinalRasW * opt.SizeScale());
|
||||
embers[i].m_FinalRasH = (unsigned int)((T)embers[i].m_FinalRasH * opt.SizeScale());
|
||||
embers[i].m_FinalRasW = (uint)((T)embers[i].m_FinalRasW * opt.SizeScale());
|
||||
embers[i].m_FinalRasH = (uint)((T)embers[i].m_FinalRasH * opt.SizeScale());
|
||||
embers[i].m_PixelsPerUnit *= T(opt.SizeScale());
|
||||
|
||||
if (embers[i].m_FinalRasW == 0 || embers[i].m_FinalRasH == 0)
|
||||
|
@ -16,7 +16,7 @@ using namespace EmberNs;
|
||||
//#define TEST_CL 1
|
||||
|
||||
template <typename T>
|
||||
void SaveFinalImage(Renderer<T, T>& renderer, vector<unsigned char>& pixels, char* suffix)
|
||||
void SaveFinalImage(Renderer<T, T>& renderer, vector<byte>& pixels, char* suffix)
|
||||
{
|
||||
Timing t;
|
||||
//renderer.AccumulatorToFinalImage(pixels);
|
||||
@ -31,7 +31,7 @@ void SaveFinalImage(Renderer<T, T>& renderer, vector<unsigned char>& pixels, cha
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
Ember<T> CreateBasicEmber(unsigned int width, unsigned int height, unsigned int ss, T quality, T centerX, T centerY, T rotate)
|
||||
Ember<T> CreateBasicEmber(uint width, uint height, uint ss, T quality, T centerX, T centerY, T rotate)
|
||||
{
|
||||
Timing t;
|
||||
QTIsaac<ISAAC_SIZE, ISAAC_INT> rand;
|
||||
@ -69,7 +69,7 @@ Ember<T> CreateBasicEmber(unsigned int width, unsigned int height, unsigned int
|
||||
return ember1;
|
||||
}
|
||||
|
||||
string GetEmberCLKernelString(Ember<float>& ember, bool iter, bool log, bool de, unsigned int ss, bool accum)
|
||||
string GetEmberCLKernelString(Ember<float>& ember, bool iter, bool log, bool de, uint ss, bool accum)
|
||||
{
|
||||
ostringstream os;
|
||||
IterOpenCLKernelCreator<float> iterCreator;
|
||||
@ -99,7 +99,7 @@ void MakeTestAllVarsRegPrePostComboFile(const string& filename)
|
||||
EmberToXml<float> writer;
|
||||
vector<Ember<float>> embers;
|
||||
VariationList<float> varList;
|
||||
unsigned int index = 0;
|
||||
uint index = 0;
|
||||
PaletteList<float> paletteList;
|
||||
ostringstream ss;
|
||||
QTIsaac<ISAAC_SIZE, ISAAC_INT> rand;
|
||||
@ -221,13 +221,13 @@ void TestAtomicAdd()
|
||||
"{\n"
|
||||
" union\n"
|
||||
" {\n"
|
||||
" unsigned int intVal;\n"
|
||||
" uint intVal;\n"
|
||||
" float floatVal;\n"
|
||||
" } newVal;\n"
|
||||
"\n"
|
||||
" union\n"
|
||||
" {\n"
|
||||
" unsigned int intVal;\n"
|
||||
" uint intVal;\n"
|
||||
" float floatVal;\n"
|
||||
" } prevVal;\n"
|
||||
"\n"
|
||||
@ -235,15 +235,15 @@ void TestAtomicAdd()
|
||||
" {\n"
|
||||
" prevVal.floatVal = *source;\n"
|
||||
" newVal.floatVal = prevVal.floatVal + operand;\n"
|
||||
" } while (atomic_cmpxchg((volatile __global unsigned int*)source, prevVal.intVal, newVal.intVal) != prevVal.intVal);\n"
|
||||
" } while (atomic_cmpxchg((volatile __global uint*)source, prevVal.intVal, newVal.intVal) != prevVal.intVal);\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"__kernel void MyKernel(\n"
|
||||
" __global float* buff,\n"
|
||||
" unsigned int lockit\n"
|
||||
" uint lockit\n"
|
||||
"\t)\n"
|
||||
"{\n"
|
||||
" unsigned int index = THREAD_ID_X;\n"
|
||||
" uint index = THREAD_ID_X;\n"
|
||||
"\n"
|
||||
" if (lockit)\n"
|
||||
" {\n"
|
||||
@ -263,12 +263,12 @@ void TestAtomicAdd()
|
||||
for (i = 0; i < vec.size(); i++)
|
||||
vec[i] = (i * 10.2234f);
|
||||
|
||||
if (wrapper.AddAndWriteBuffer("buff", (void*)vec.data(), (unsigned int)vec.size() * sizeof(vec[0])))
|
||||
if (wrapper.AddAndWriteBuffer("buff", (void*)vec.data(), (uint)vec.size() * sizeof(vec[0])))
|
||||
{
|
||||
if (wrapper.AddProgram(entry, program, entry, false))
|
||||
{
|
||||
wrapper.SetBufferArg(0, 0, 0);
|
||||
wrapper.SetArg<unsigned int>(0, 1, 0);
|
||||
wrapper.SetArg<uint>(0, 1, 0);
|
||||
|
||||
if (wrapper.RunKernel(0,
|
||||
32,//Total grid dims.
|
||||
@ -278,7 +278,7 @@ void TestAtomicAdd()
|
||||
1,
|
||||
1))
|
||||
{
|
||||
wrapper.ReadBuffer(0, vec.data(), (unsigned int)vec.size() * sizeof(vec[0]));
|
||||
wrapper.ReadBuffer(0, vec.data(), (uint)vec.size() * sizeof(vec[0]));
|
||||
cout << "Vector after unlocked add: " << endl;
|
||||
|
||||
for (i = 0; i < vec.size(); i++)
|
||||
@ -289,9 +289,9 @@ void TestAtomicAdd()
|
||||
for (i = 0; i < vec.size(); i++)
|
||||
vec[i] = (i * 10.2234f);
|
||||
|
||||
wrapper.AddAndWriteBuffer("buff", (void*)vec.data(), (unsigned int)vec.size() * sizeof(vec[0]));
|
||||
wrapper.AddAndWriteBuffer("buff", (void*)vec.data(), (uint)vec.size() * sizeof(vec[0]));
|
||||
wrapper.SetBufferArg(0, 0, 0);
|
||||
wrapper.SetArg<unsigned int>(0, 1, 1);
|
||||
wrapper.SetArg<uint>(0, 1, 1);
|
||||
|
||||
if (wrapper.RunKernel(0,
|
||||
32,//Total grid dims.
|
||||
@ -301,7 +301,7 @@ void TestAtomicAdd()
|
||||
1,
|
||||
1))
|
||||
{
|
||||
wrapper.ReadBuffer(0, vec.data(), (unsigned int)vec.size() * sizeof(vec[0]));
|
||||
wrapper.ReadBuffer(0, vec.data(), (uint)vec.size() * sizeof(vec[0]));
|
||||
cout << "\n\nVector after locked add: " << endl;
|
||||
|
||||
for (i = 0; i < vec.size(); i++)
|
||||
@ -383,14 +383,14 @@ bool TestVarCounts()
|
||||
#else
|
||||
bool success = true;
|
||||
#endif
|
||||
unsigned int start = (unsigned int)VAR_ARCH;
|
||||
uint start = (uint)VAR_ARCH;
|
||||
|
||||
if (!success)
|
||||
{
|
||||
cout << "Variation list size " << vlf.Size() << " does not equal the max var ID enum " << (unsigned int)LAST_VAR << "." << endl;
|
||||
cout << "Variation list size " << vlf.Size() << " does not equal the max var ID enum " << (uint)LAST_VAR << "." << endl;
|
||||
}
|
||||
|
||||
for (; start < (unsigned int)LAST_VAR; start++)
|
||||
for (; start < (uint)LAST_VAR; start++)
|
||||
{
|
||||
Variation<float>* var = vlf.GetVariation((eVariationId)start);
|
||||
|
||||
@ -709,7 +709,7 @@ bool TestParVars()
|
||||
names.reserve(parVar->ParamCount());
|
||||
addresses.reserve(parVar->ParamCount());
|
||||
|
||||
for (unsigned int j = 0; j < parVar->ParamCount(); j++)
|
||||
for (uint j = 0; j < parVar->ParamCount(); j++)
|
||||
{
|
||||
if (std::find(names.begin(), names.end(), params[j].Name()) != names.end())
|
||||
{
|
||||
@ -1123,7 +1123,7 @@ bool TestConstants()
|
||||
|
||||
void PrintAllVars()
|
||||
{
|
||||
unsigned int i = 0;
|
||||
uint i = 0;
|
||||
VariationList<float> vlf;
|
||||
|
||||
while(Variation<float>* var = vlf.GetVariation(i++))
|
||||
@ -1132,7 +1132,7 @@ void PrintAllVars()
|
||||
|
||||
void TestXformsInOutPoints()
|
||||
{
|
||||
unsigned int index = 0;
|
||||
uint index = 0;
|
||||
VariationList<float> varList;
|
||||
PaletteList<float> paletteList;
|
||||
QTIsaac<ISAAC_SIZE, ISAAC_INT> rand;
|
||||
@ -1417,13 +1417,13 @@ void TestVarsSimilar()
|
||||
|
||||
if (parVar)
|
||||
{
|
||||
for (unsigned int v = 0; v < parVar->ParamCount(); v++)
|
||||
for (uint v = 0; v < parVar->ParamCount(); v++)
|
||||
parVar->SetParamVal(v, (T)iter);
|
||||
}
|
||||
|
||||
if (parVarComp)
|
||||
{
|
||||
for (unsigned int v = 0; v < parVarComp->ParamCount(); v++)
|
||||
for (uint v = 0; v < parVarComp->ParamCount(); v++)
|
||||
parVarComp->SetParamVal(v, (T)iter);
|
||||
}
|
||||
|
||||
@ -1620,7 +1620,7 @@ void TestGpuVectorRead()
|
||||
if (!renderer.Alloc())
|
||||
return;
|
||||
|
||||
unsigned int i, iters = renderer.IterCountPerKernel() * renderer.TotalIterKernelCount();//Make each thread in each block run at least once.
|
||||
uint i, iters = renderer.IterCountPerKernel() * renderer.TotalIterKernelCount();//Make each thread in each block run at least once.
|
||||
renderer.Iterate(iters, 0, 1);
|
||||
renderer.ReadPoints(points);
|
||||
|
||||
|
@ -144,7 +144,7 @@ public:
|
||||
/// </summary>
|
||||
/// <param name="i">The index in the file of the ember</param>
|
||||
/// <returns>The default ember name</returns>
|
||||
static QString DefaultEmberName(unsigned int i)
|
||||
static QString DefaultEmberName(uint i)
|
||||
{
|
||||
return DefaultFilename() + "-" + ToString(i);
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
/// <param name="v">The vector containing the RGB pixels [0..255] which will make up the preview image</param>
|
||||
/// <param name="width">The width of the image in pixels</param>
|
||||
/// <param name="height">The height of the image in pixels</param>
|
||||
void SetImage(vector<unsigned char>& v, unsigned int width, unsigned int height)
|
||||
void SetImage(vector<byte>& v, uint width, uint height)
|
||||
{
|
||||
int size = 64;
|
||||
|
||||
|
@ -16,7 +16,7 @@ FractoriumFinalRenderDialog::FractoriumFinalRenderDialog(FractoriumSettings* set
|
||||
ui.setupUi(this);
|
||||
|
||||
int row = 0, spinHeight = 20;
|
||||
unsigned int i;
|
||||
uint i;
|
||||
double dmax = numeric_limits<double>::max();
|
||||
QTableWidget* table = ui.FinalRenderParamsTable;
|
||||
QTableWidgetItem* item = NULL;
|
||||
@ -197,16 +197,16 @@ QString FractoriumFinalRenderDialog::Path() { return ui.FinalRenderParamsTable->
|
||||
void FractoriumFinalRenderDialog::Path(const QString& s) { ui.FinalRenderParamsTable->item(m_PathCellIndex, 1)->setText(s); }
|
||||
QString FractoriumFinalRenderDialog::Prefix() { return m_PrefixEdit->text(); }
|
||||
QString FractoriumFinalRenderDialog::Suffix() { return m_SuffixEdit->text(); }
|
||||
unsigned int FractoriumFinalRenderDialog::Current() { return ui.FinalRenderCurrentSpin->value(); }
|
||||
unsigned int FractoriumFinalRenderDialog::PlatformIndex() { return ui.FinalRenderPlatformCombo->currentIndex(); }
|
||||
unsigned int FractoriumFinalRenderDialog::DeviceIndex() { return ui.FinalRenderDeviceCombo->currentIndex(); }
|
||||
unsigned int FractoriumFinalRenderDialog::ThreadCount() { return ui.FinalRenderThreadCountSpin->value(); }
|
||||
uint FractoriumFinalRenderDialog::Current() { return ui.FinalRenderCurrentSpin->value(); }
|
||||
uint FractoriumFinalRenderDialog::PlatformIndex() { return ui.FinalRenderPlatformCombo->currentIndex(); }
|
||||
uint FractoriumFinalRenderDialog::DeviceIndex() { return ui.FinalRenderDeviceCombo->currentIndex(); }
|
||||
uint FractoriumFinalRenderDialog::ThreadCount() { return ui.FinalRenderThreadCountSpin->value(); }
|
||||
double FractoriumFinalRenderDialog::WidthScale() { return m_WidthScaleSpin->value(); }
|
||||
double FractoriumFinalRenderDialog::HeightScale() { return m_HeightScaleSpin->value(); }
|
||||
double FractoriumFinalRenderDialog::Quality() { return m_QualitySpin->value(); }
|
||||
unsigned int FractoriumFinalRenderDialog::TemporalSamples() { return m_TemporalSamplesSpin->value(); }
|
||||
unsigned int FractoriumFinalRenderDialog::Supersample() { return m_SupersampleSpin->value(); }
|
||||
unsigned int FractoriumFinalRenderDialog::Strips() { return m_StripsSpin->value(); }
|
||||
uint FractoriumFinalRenderDialog::TemporalSamples() { return m_TemporalSamplesSpin->value(); }
|
||||
uint FractoriumFinalRenderDialog::Supersample() { return m_SupersampleSpin->value(); }
|
||||
uint FractoriumFinalRenderDialog::Strips() { return m_StripsSpin->value(); }
|
||||
|
||||
/// <summary>
|
||||
/// Capture the current state of the Gui.
|
||||
|
@ -61,16 +61,16 @@ public:
|
||||
void Path(const QString& s);
|
||||
QString Prefix();
|
||||
QString Suffix();
|
||||
unsigned int Current();
|
||||
unsigned int PlatformIndex();
|
||||
unsigned int DeviceIndex();
|
||||
unsigned int ThreadCount();
|
||||
uint Current();
|
||||
uint PlatformIndex();
|
||||
uint DeviceIndex();
|
||||
uint ThreadCount();
|
||||
double WidthScale();
|
||||
double HeightScale();
|
||||
double Quality();
|
||||
unsigned int TemporalSamples();
|
||||
unsigned int Supersample();
|
||||
unsigned int Strips();
|
||||
uint TemporalSamples();
|
||||
uint Supersample();
|
||||
uint Strips();
|
||||
FinalRenderGuiState State();
|
||||
|
||||
public Q_SLOTS:
|
||||
|
@ -125,7 +125,7 @@ FinalRenderEmberController<T>::FinalRenderEmberController(FractoriumFinalRenderD
|
||||
m_FinalPreviewRenderer->SetEmber(m_PreviewEmber);
|
||||
m_FinalPreviewRenderer->PrepFinalAccumVector(m_PreviewFinalImage);//Must manually call this first because it could be erroneously made smaller due to strips if called inside Renderer::Run().
|
||||
|
||||
unsigned int strips = VerifyStrips(m_PreviewEmber.m_FinalRasH, m_FinalRenderDialog->Strips(),
|
||||
uint strips = VerifyStrips(m_PreviewEmber.m_FinalRasH, m_FinalRenderDialog->Strips(),
|
||||
[&](const string& s) { }, [&](const string& s) { }, [&](const string& s) { });
|
||||
|
||||
StripsRender<T>(m_FinalPreviewRenderer.get(), m_PreviewEmber, m_PreviewFinalImage, 0, strips, m_FinalRenderDialog->YAxisUp(),
|
||||
@ -154,7 +154,7 @@ FinalRenderEmberController<T>::FinalRenderEmberController(FractoriumFinalRenderD
|
||||
size_t i;
|
||||
m_GuiState = m_FinalRenderDialog->State();//Cache render settings from the GUI before running.
|
||||
bool doAll = m_GuiState.m_DoAll && m_EmberFile.Size() > 1;
|
||||
unsigned int currentStripForProgress = 0;//Sort of a hack to get the strip value to the progress function.
|
||||
uint currentStripForProgress = 0;//Sort of a hack to get the strip value to the progress function.
|
||||
QString path = doAll ? ComposePath(QString::fromStdString(m_EmberFile.m_Embers[0].m_Name)) : ComposePath(Name());
|
||||
QString backup = path + "_backup.flame";
|
||||
|
||||
@ -395,11 +395,11 @@ bool FinalRenderEmberController<T>::Render()
|
||||
/// <param name="shared">True if shared with OpenGL, else false. Default: true.</param>
|
||||
/// <returns>True if nothing went wrong, else false.</returns>
|
||||
template <typename T>
|
||||
bool FinalRenderEmberController<T>::CreateRenderer(eRendererType renderType, unsigned int platform, unsigned int device, bool shared)
|
||||
bool FinalRenderEmberController<T>::CreateRenderer(eRendererType renderType, uint platform, uint device, bool shared)
|
||||
{
|
||||
bool ok = true;
|
||||
vector<string> errorReport;
|
||||
unsigned int channels = m_FinalRenderDialog->Ext() == "png" ? 4 : 3;
|
||||
uint channels = m_FinalRenderDialog->Ext() == "png" ? 4 : 3;
|
||||
|
||||
CancelRender();
|
||||
|
||||
@ -464,7 +464,7 @@ template <typename T>
|
||||
int FinalRenderEmberController<T>::ProgressFunc(Ember<T>& ember, void* foo, double fraction, int stage, double etaMs)
|
||||
{
|
||||
static int count = 0;
|
||||
unsigned int strip = *((unsigned int*)m_Renderer->m_ProgressParameter);
|
||||
uint strip = *((uint*)m_Renderer->m_ProgressParameter);
|
||||
double fracPerStrip = ceil(100.0 / m_GuiState.m_Strips);
|
||||
double stripsfrac = ceil(fracPerStrip * strip) + ceil(fraction / m_GuiState.m_Strips);
|
||||
int intFract = (int)stripsfrac;
|
||||
@ -573,7 +573,7 @@ pair<size_t, size_t> FinalRenderEmberController<T>::SyncAndComputeMemory()
|
||||
if (m_Renderer.get())
|
||||
{
|
||||
bool b = false;
|
||||
unsigned int channels = m_FinalRenderDialog->Ext() == "png" ? 4 : 3;//4 channels for Png, else 3.
|
||||
uint channels = m_FinalRenderDialog->Ext() == "png" ? 4 : 3;//4 channels for Png, else 3.
|
||||
size_t strips = VerifyStrips(m_Ember->m_FinalRasH, m_FinalRenderDialog->Strips(),
|
||||
[&](const string& s) { }, [&](const string& s) { }, [&](const string& s) { });
|
||||
|
||||
|
@ -34,15 +34,15 @@ struct FinalRenderGuiState
|
||||
QString m_Ext;
|
||||
QString m_Prefix;
|
||||
QString m_Suffix;
|
||||
unsigned int m_PlatformIndex;
|
||||
unsigned int m_DeviceIndex;
|
||||
unsigned int m_ThreadCount;
|
||||
uint m_PlatformIndex;
|
||||
uint m_DeviceIndex;
|
||||
uint m_ThreadCount;
|
||||
double m_WidthScale;
|
||||
double m_HeightScale;
|
||||
double m_Quality;
|
||||
unsigned int m_TemporalSamples;
|
||||
unsigned int m_Supersample;
|
||||
unsigned int m_Strips;
|
||||
uint m_TemporalSamples;
|
||||
uint m_Supersample;
|
||||
uint m_Strips;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
@ -74,8 +74,8 @@ public:
|
||||
protected:
|
||||
bool m_Run;
|
||||
bool m_PreviewRun;
|
||||
unsigned int m_ImageCount;
|
||||
unsigned int m_FinishedImageCount;
|
||||
uint m_ImageCount;
|
||||
uint m_FinishedImageCount;
|
||||
|
||||
QFuture<void> m_Result;
|
||||
QFuture<void> m_FinalPreviewResult;
|
||||
@ -111,10 +111,10 @@ public:
|
||||
#endif
|
||||
virtual void SetEmber(size_t index) override;
|
||||
virtual bool Render() override;
|
||||
virtual bool CreateRenderer(eRendererType renderType, unsigned int platform, unsigned int device, bool shared = true) override;
|
||||
virtual bool CreateRenderer(eRendererType renderType, uint platform, uint device, bool shared = true) override;
|
||||
virtual int ProgressFunc(Ember<T>& ember, void* foo, double fraction, int stage, double etaMs) override;
|
||||
virtual size_t Index() const override { return m_Ember->m_Index; }
|
||||
virtual unsigned int SizeOfT() const override { return sizeof(T); }
|
||||
virtual uint SizeOfT() const override { return sizeof(T); }
|
||||
|
||||
//Virtual functions overridden from FinalRenderEmberControllerBase.
|
||||
virtual void SyncCurrentToGui() override;
|
||||
|
@ -15,7 +15,7 @@ Fractorium::Fractorium(QWidget* parent)
|
||||
Timing t;
|
||||
ui.setupUi(this);
|
||||
qRegisterMetaType<QVector<int>>("QVector<int>");//For previews.
|
||||
qRegisterMetaType<vector<unsigned char>>("vector<unsigned char>");
|
||||
qRegisterMetaType<vector<byte>>("vector<byte>");
|
||||
qRegisterMetaType<EmberTreeWidgetItemBase*>("EmberTreeWidgetItemBase*");
|
||||
|
||||
m_FontSize = 9;
|
||||
|
@ -74,7 +74,7 @@ public:
|
||||
void SetCoordinateStatus(int x, int y, float worldX, float worldY);
|
||||
|
||||
//Xforms.
|
||||
void CurrentXform(unsigned int i);
|
||||
void CurrentXform(uint i);
|
||||
|
||||
//Xforms Affine.
|
||||
bool DrawAllPre();
|
||||
@ -236,7 +236,7 @@ public slots:
|
||||
void ShowCritical(const QString& title, const QString& text, bool invokeRequired = false);
|
||||
|
||||
//Can't have a template function be a slot.
|
||||
void SetLibraryTreeItemData(EmberTreeWidgetItemBase* item, vector<unsigned char>& v, unsigned int width, unsigned int height);
|
||||
void SetLibraryTreeItemData(EmberTreeWidgetItemBase* item, vector<byte>& v, uint width, uint height);
|
||||
|
||||
public:
|
||||
//template<typename spinType, typename valType>//See below.
|
||||
|
@ -84,7 +84,7 @@ FractoriumEmberController<T>::FractoriumEmberController(Fractorium* fractorium)
|
||||
m_PreviewRenderer->SetEmber(m_Ember);//Give it an initial ember, will be updated many times later.
|
||||
//m_PreviewRenderer->ThreadCount(1);//For debugging.
|
||||
|
||||
m_PreviewRenderFunc = [&](unsigned int start, unsigned int end)
|
||||
m_PreviewRenderFunc = [&](uint start, uint end)
|
||||
{
|
||||
while(m_PreviewRun || m_PreviewRunning)
|
||||
{
|
||||
@ -117,9 +117,9 @@ FractoriumEmberController<T>::FractoriumEmberController(Fractorium* fractorium)
|
||||
//until the update is complete.
|
||||
QMetaObject::invokeMethod(m_Fractorium, "SetLibraryTreeItemData", Qt::BlockingQueuedConnection,
|
||||
Q_ARG(EmberTreeWidgetItemBase*, (EmberTreeWidgetItemBase*)treeItem),
|
||||
Q_ARG(vector<unsigned char>&, m_PreviewFinalImage),
|
||||
Q_ARG(unsigned int, PREVIEW_SIZE),
|
||||
Q_ARG(unsigned int, PREVIEW_SIZE));
|
||||
Q_ARG(vector<byte>&, m_PreviewFinalImage),
|
||||
Q_ARG(uint, PREVIEW_SIZE),
|
||||
Q_ARG(uint, PREVIEW_SIZE));
|
||||
|
||||
//treeItem->SetImage(m_PreviewFinalImage, PREVIEW_SIZE, PREVIEW_SIZE);
|
||||
}
|
||||
@ -189,7 +189,7 @@ void FractoriumEmberController<T>::SetEmber(size_t index)
|
||||
{
|
||||
if (QTreeWidgetItem* top = m_Fractorium->ui.LibraryTree->topLevelItem(0))
|
||||
{
|
||||
for (unsigned int i = 0; i < top->childCount(); i++)
|
||||
for (uint i = 0; i < top->childCount(); i++)
|
||||
{
|
||||
if (EmberTreeWidgetItem<T>* emberItem = dynamic_cast<EmberTreeWidgetItem<T>*>(top->child(i)))
|
||||
emberItem->setSelected(i == index);
|
||||
|
@ -11,7 +11,7 @@
|
||||
/// <summary>
|
||||
/// An enum representing the type of edit being done.
|
||||
/// </summary>
|
||||
enum eEditUndoState : unsigned int { REGULAR_EDIT = 0, UNDO_REDO = 1, EDIT_UNDO = 2 };
|
||||
enum eEditUndoState : uint { REGULAR_EDIT = 0, UNDO_REDO = 1, EDIT_UNDO = 2 };
|
||||
|
||||
/// <summary>
|
||||
/// FractoriumEmberController and Fractorium need each other, but each can't include the other.
|
||||
@ -66,16 +66,16 @@ public:
|
||||
virtual size_t TotalXformCount() const { return 0; }
|
||||
virtual QString Name() const { return ""; }
|
||||
virtual void Name(const string& s) { }
|
||||
virtual unsigned int FinalRasW() const { return 0; }
|
||||
virtual void FinalRasW(unsigned int w) { }
|
||||
virtual unsigned int FinalRasH() const { return 0; }
|
||||
virtual void FinalRasH(unsigned int h) { }
|
||||
virtual uint FinalRasW() const { return 0; }
|
||||
virtual void FinalRasW(uint w) { }
|
||||
virtual uint FinalRasH() const { return 0; }
|
||||
virtual void FinalRasH(uint h) { }
|
||||
virtual size_t Index() const { return 0; }
|
||||
virtual void AddSymmetry(int sym, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) { }
|
||||
virtual void CalcNormalizedWeights() { }
|
||||
|
||||
//Menu.
|
||||
virtual void NewFlock(unsigned int count) { }//File.
|
||||
virtual void NewFlock(uint count) { }//File.
|
||||
virtual void NewEmptyFlameInCurrentFile() { }
|
||||
virtual void NewRandomFlameInCurrentFile() { }
|
||||
virtual void CopyFlameInCurrentFile() { }
|
||||
@ -106,9 +106,9 @@ public:
|
||||
virtual void GammaThresholdChanged(double d) { }
|
||||
virtual void VibrancyChanged(double d) { }
|
||||
virtual void HighlightPowerChanged(double d) { }
|
||||
virtual void PaletteModeChanged(unsigned int i) { }
|
||||
virtual void WidthChanged(unsigned int i) { }
|
||||
virtual void HeightChanged(unsigned int i) { }
|
||||
virtual void PaletteModeChanged(uint i) { }
|
||||
virtual void WidthChanged(uint i) { }
|
||||
virtual void HeightChanged(uint i) { }
|
||||
virtual void CenterXChanged(double d) { }
|
||||
virtual void CenterYChanged(double d) { }
|
||||
virtual void ScaleChanged(double d) { }
|
||||
@ -164,7 +164,7 @@ public:
|
||||
|
||||
//Xforms Xaos.
|
||||
virtual void FillXaosWithCurrentXform() { }
|
||||
virtual QString MakeXaosNameString(unsigned int i) { return ""; }
|
||||
virtual QString MakeXaosNameString(uint i) { return ""; }
|
||||
virtual void XaosChanged(DoubleSpinBox* sender) { }
|
||||
virtual void ClearXaos() { }
|
||||
virtual void RandomXaos() { }
|
||||
@ -173,7 +173,7 @@ public:
|
||||
virtual bool InitPaletteTable(const string& s) { return false; }
|
||||
virtual void ApplyPaletteToEmber() { }
|
||||
virtual void PaletteAdjust() { }
|
||||
virtual QRgb GetQRgbFromPaletteIndex(unsigned int i) { return QRgb(); }
|
||||
virtual QRgb GetQRgbFromPaletteIndex(uint i) { return QRgb(); }
|
||||
virtual void PaletteCellClicked(int row, int col) { }
|
||||
|
||||
//Library.
|
||||
@ -182,15 +182,15 @@ public:
|
||||
virtual void UpdateLibraryTree() { }
|
||||
virtual void EmberTreeItemChanged(QTreeWidgetItem* item, int col) { }
|
||||
virtual void EmberTreeItemDoubleClicked(QTreeWidgetItem* item, int col) { }
|
||||
virtual void RenderPreviews(unsigned int start = UINT_MAX, unsigned int end = UINT_MAX) { }
|
||||
virtual void RenderPreviews(uint start = UINT_MAX, uint end = UINT_MAX) { }
|
||||
virtual void StopPreviewRender() { }
|
||||
|
||||
//Info.
|
||||
|
||||
//Rendering/progress.
|
||||
virtual bool Render() { return false; }
|
||||
virtual bool CreateRenderer(eRendererType renderType, unsigned int platform, unsigned int device, bool shared = true) { return false; }
|
||||
virtual unsigned int SizeOfT() const { return 0; }
|
||||
virtual bool CreateRenderer(eRendererType renderType, uint platform, uint device, bool shared = true) { return false; }
|
||||
virtual uint SizeOfT() const { return 0; }
|
||||
virtual void ClearUndo() { }
|
||||
virtual GLEmberControllerBase* GLController() { return NULL; }
|
||||
bool RenderTimerRunning();
|
||||
@ -202,8 +202,8 @@ public:
|
||||
void DeleteRenderer();
|
||||
void SaveCurrentRender(const QString& filename, bool forcePull);
|
||||
RendererBase* Renderer() { return m_Renderer.get(); }
|
||||
vector<unsigned char>* FinalImage() { return &m_FinalImage; }
|
||||
vector<unsigned char>* PreviewFinalImage() { return &m_PreviewFinalImage; }
|
||||
vector<byte>* FinalImage() { return &m_FinalImage; }
|
||||
vector<byte>* PreviewFinalImage() { return &m_PreviewFinalImage; }
|
||||
|
||||
protected:
|
||||
//Rendering/progress.
|
||||
@ -215,11 +215,11 @@ protected:
|
||||
bool m_Rendering;
|
||||
bool m_Shared;
|
||||
bool m_LastEditWasUndoRedo;
|
||||
unsigned int m_Platform;
|
||||
unsigned int m_Device;
|
||||
unsigned int m_SubBatchCount;
|
||||
unsigned int m_FailedRenders;
|
||||
unsigned int m_UndoIndex;
|
||||
uint m_Platform;
|
||||
uint m_Device;
|
||||
uint m_SubBatchCount;
|
||||
uint m_FailedRenders;
|
||||
uint m_UndoIndex;
|
||||
eRendererType m_RenderType;
|
||||
eEditUndoState m_EditState;
|
||||
GLuint m_OutputTexID;
|
||||
@ -229,8 +229,8 @@ protected:
|
||||
QString m_LastSaveAll;
|
||||
QString m_LastSaveCurrent;
|
||||
CriticalSection m_Cs;
|
||||
vector<unsigned char> m_FinalImage;
|
||||
vector<unsigned char> m_PreviewFinalImage;
|
||||
vector<byte> m_FinalImage;
|
||||
vector<byte> m_PreviewFinalImage;
|
||||
vector<eProcessAction> m_ProcessActions;
|
||||
unique_ptr<EmberNs::RendererBase> m_Renderer;
|
||||
QTIsaac<ISAAC_SIZE, ISAAC_INT> m_Rand;
|
||||
@ -275,15 +275,15 @@ public:
|
||||
virtual void DeleteCurrentXform() override;
|
||||
virtual void AddFinalXform() override;
|
||||
virtual bool UseFinalXform() override { return m_Ember.UseFinalXform(); }
|
||||
//virtual bool IsFinal(unsigned int i) { return false; }
|
||||
//virtual bool IsFinal(uint i) { return false; }
|
||||
virtual size_t XformCount() const override { return m_Ember.XformCount(); }
|
||||
virtual size_t TotalXformCount() const override { return m_Ember.TotalXformCount(); }
|
||||
virtual QString Name() const override { return QString::fromStdString(m_Ember.m_Name); }
|
||||
virtual void Name(const string& s) override { m_Ember.m_Name = s; }
|
||||
virtual unsigned int FinalRasW() const override { return m_Ember.m_FinalRasW; }
|
||||
virtual void FinalRasW(unsigned int w) override { m_Ember.m_FinalRasW = w; }
|
||||
virtual unsigned int FinalRasH() const override { return m_Ember.m_FinalRasH; }
|
||||
virtual void FinalRasH(unsigned int h) override { m_Ember.m_FinalRasH = h; }
|
||||
virtual uint FinalRasW() const override { return m_Ember.m_FinalRasW; }
|
||||
virtual void FinalRasW(uint w) override { m_Ember.m_FinalRasW = w; }
|
||||
virtual uint FinalRasH() const override { return m_Ember.m_FinalRasH; }
|
||||
virtual void FinalRasH(uint h) override { m_Ember.m_FinalRasH = h; }
|
||||
virtual size_t Index() const override { return m_Ember.m_Index; }
|
||||
virtual void AddSymmetry(int sym, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override { m_Ember.AddSymmetry(sym, rand); }
|
||||
virtual void CalcNormalizedWeights() override { m_Ember.CalcNormalizedWeights(m_NormalizedWeights); }
|
||||
@ -291,7 +291,7 @@ public:
|
||||
Ember<T>* CurrentEmber();
|
||||
|
||||
//Menu.
|
||||
virtual void NewFlock(unsigned int count) override;
|
||||
virtual void NewFlock(uint count) override;
|
||||
virtual void NewEmptyFlameInCurrentFile() override;
|
||||
virtual void NewRandomFlameInCurrentFile() override;
|
||||
virtual void CopyFlameInCurrentFile() override;
|
||||
@ -322,9 +322,9 @@ public:
|
||||
virtual void GammaThresholdChanged(double d) override;
|
||||
virtual void VibrancyChanged(double d) override;
|
||||
virtual void HighlightPowerChanged(double d) override;
|
||||
virtual void PaletteModeChanged(unsigned int i) override;
|
||||
virtual void WidthChanged(unsigned int i) override;
|
||||
virtual void HeightChanged(unsigned int i) override;
|
||||
virtual void PaletteModeChanged(uint i) override;
|
||||
virtual void WidthChanged(uint i) override;
|
||||
virtual void HeightChanged(uint i) override;
|
||||
virtual void CenterXChanged(double d) override;
|
||||
virtual void CenterYChanged(double d) override;
|
||||
virtual void ScaleChanged(double d) override;
|
||||
@ -384,7 +384,7 @@ public:
|
||||
|
||||
//Xforms Xaos.
|
||||
virtual void FillXaosWithCurrentXform() override;
|
||||
virtual QString MakeXaosNameString(unsigned int i) override;
|
||||
virtual QString MakeXaosNameString(uint i) override;
|
||||
virtual void XaosChanged(DoubleSpinBox* sender) override;
|
||||
virtual void ClearXaos() override;
|
||||
virtual void RandomXaos() override;
|
||||
@ -393,7 +393,7 @@ public:
|
||||
virtual bool InitPaletteTable(const string& s) override;
|
||||
virtual void ApplyPaletteToEmber() override;
|
||||
virtual void PaletteAdjust() override;
|
||||
virtual QRgb GetQRgbFromPaletteIndex(unsigned int i) override { return QRgb(); }
|
||||
virtual QRgb GetQRgbFromPaletteIndex(uint i) override { return QRgb(); }
|
||||
virtual void PaletteCellClicked(int row, int col) override;
|
||||
|
||||
//Library.
|
||||
@ -402,15 +402,15 @@ public:
|
||||
virtual void UpdateLibraryTree() override;
|
||||
virtual void EmberTreeItemChanged(QTreeWidgetItem* item, int col) override;
|
||||
virtual void EmberTreeItemDoubleClicked(QTreeWidgetItem* item, int col) override;
|
||||
virtual void RenderPreviews(unsigned int start = UINT_MAX, unsigned int end = UINT_MAX) override;
|
||||
virtual void RenderPreviews(uint start = UINT_MAX, uint end = UINT_MAX) override;
|
||||
virtual void StopPreviewRender() override;
|
||||
|
||||
//Info.
|
||||
|
||||
//Rendering/progress.
|
||||
virtual bool Render() override;
|
||||
virtual bool CreateRenderer(eRendererType renderType, unsigned int platform, unsigned int device, bool shared = true) override;
|
||||
virtual unsigned int SizeOfT() const override { return sizeof(T); }
|
||||
virtual bool CreateRenderer(eRendererType renderType, uint platform, uint device, bool shared = true) override;
|
||||
virtual uint SizeOfT() const override { return sizeof(T); }
|
||||
virtual int ProgressFunc(Ember<T>& ember, void* foo, double fraction, int stage, double etaMs) override;
|
||||
virtual void ClearUndo() override;
|
||||
virtual GLEmberControllerBase* GLController() override { return m_GLController.get(); }
|
||||
@ -453,7 +453,7 @@ private:
|
||||
unique_ptr<GLEmberController<T>> m_GLController;
|
||||
unique_ptr<EmberNs::Renderer<T, T>> m_PreviewRenderer;
|
||||
QFuture<void> m_PreviewResult;
|
||||
std::function<void (unsigned int, unsigned int)> m_PreviewRenderFunc;
|
||||
std::function<void (uint, uint)> m_PreviewRenderFunc;
|
||||
};
|
||||
|
||||
template class FractoriumEmberController<float>;
|
||||
|
@ -28,7 +28,7 @@ void Fractorium::UpdateHistogramBounds()
|
||||
|
||||
if (r->GetDensityFilter())
|
||||
{
|
||||
unsigned int deWidth = (r->GetDensityFilter()->FilterWidth() * 2) + 1;
|
||||
uint deWidth = (r->GetDensityFilter()->FilterWidth() * 2) + 1;
|
||||
|
||||
sprintf_s(m_DEString, 16, "%d x %d", deWidth, deWidth);
|
||||
ui.InfoBoundsTable->item(1, 1)->setText(QString(m_DEString));
|
||||
|
@ -17,7 +17,7 @@ void Fractorium::InitLibraryUI()
|
||||
/// <param name="v">The vector holding the RGBA bitmap</param>
|
||||
/// <param name="width">The width of the bitmap</param>
|
||||
/// <param name="height">The height of the bitmap</param>
|
||||
void Fractorium::SetLibraryTreeItemData(EmberTreeWidgetItemBase* item, vector<unsigned char>& v, unsigned int width, unsigned int height)
|
||||
void Fractorium::SetLibraryTreeItemData(EmberTreeWidgetItemBase* item, vector<byte>& v, uint width, uint height)
|
||||
{
|
||||
item->SetImage(v, width, height);
|
||||
}
|
||||
@ -55,9 +55,9 @@ void FractoriumEmberController<T>::SyncNames()
|
||||
template <typename T>
|
||||
void FractoriumEmberController<T>::FillLibraryTree(int selectIndex)
|
||||
{
|
||||
unsigned int i, j, size = 64;
|
||||
uint i, j, size = 64;
|
||||
QTreeWidget* tree = m_Fractorium->ui.LibraryTree;
|
||||
vector<unsigned char> v(size * size * 4);
|
||||
vector<byte> v(size * size * 4);
|
||||
|
||||
StopPreviewRender();
|
||||
tree->clear();
|
||||
@ -107,9 +107,9 @@ void FractoriumEmberController<T>::FillLibraryTree(int selectIndex)
|
||||
template <typename T>
|
||||
void FractoriumEmberController<T>::UpdateLibraryTree()
|
||||
{
|
||||
unsigned int i, size = 64;
|
||||
uint i, size = 64;
|
||||
QTreeWidget* tree = m_Fractorium->ui.LibraryTree;
|
||||
vector<unsigned char> v(size * size * 4);
|
||||
vector<byte> v(size * size * 4);
|
||||
|
||||
if (QTreeWidgetItem* top = tree->topLevelItem(0))
|
||||
{
|
||||
@ -229,7 +229,7 @@ void Fractorium::OnEmberTreeItemDoubleClicked(QTreeWidgetItem* item, int col) {
|
||||
/// <param name="start">The 0-based index to start rendering previews for</param>
|
||||
/// <param name="end">The 0-based index which is one beyond the last ember to render a preview for</param>
|
||||
template <typename T>
|
||||
void FractoriumEmberController<T>::RenderPreviews(unsigned int start, unsigned int end)
|
||||
void FractoriumEmberController<T>::RenderPreviews(uint start, uint end)
|
||||
{
|
||||
StopPreviewRender();
|
||||
|
||||
@ -242,7 +242,7 @@ void FractoriumEmberController<T>::RenderPreviews(unsigned int start, unsigned i
|
||||
if (QTreeWidgetItem* top = tree->topLevelItem(0))
|
||||
{
|
||||
int childCount = top->childCount();
|
||||
vector<unsigned char> emptyPreview(PREVIEW_SIZE * PREVIEW_SIZE * 3);
|
||||
vector<byte> emptyPreview(PREVIEW_SIZE * PREVIEW_SIZE * 3);
|
||||
|
||||
for (int i = 0; i < childCount; i++)
|
||||
if (EmberTreeWidgetItem<T>* treeItem = dynamic_cast<EmberTreeWidgetItem<T>*>(top->child(i)))
|
||||
|
@ -48,7 +48,7 @@ void Fractorium::InitMenusUI()
|
||||
/// </summary>
|
||||
/// <param name="count">The number of embers to include in the flock</param>
|
||||
template <typename T>
|
||||
void FractoriumEmberController<T>::NewFlock(unsigned int count)
|
||||
void FractoriumEmberController<T>::NewFlock(uint count)
|
||||
{
|
||||
Ember<T> ember;
|
||||
|
||||
@ -57,7 +57,7 @@ void FractoriumEmberController<T>::NewFlock(unsigned int count)
|
||||
m_EmberFile.m_Embers.reserve(count);
|
||||
m_EmberFile.m_Filename = EmberFile<T>::DefaultFilename();
|
||||
|
||||
for (unsigned int i = 0; i < count; i++)
|
||||
for (uint i = 0; i < count; i++)
|
||||
{
|
||||
m_SheepTools->Random(ember);
|
||||
ParamsToEmber(ember);
|
||||
@ -174,7 +174,7 @@ void FractoriumEmberController<T>::OpenAndPrepFiles(const QStringList& filenames
|
||||
EmberFile<T> emberFile;
|
||||
XmlToEmber<T> parser;
|
||||
vector<Ember<T>> embers;
|
||||
unsigned int previousSize = append ? m_EmberFile.Size() : 0;
|
||||
uint previousSize = append ? m_EmberFile.Size() : 0;
|
||||
|
||||
StopPreviewRender();
|
||||
emberFile.m_Filename = filenames[0];
|
||||
@ -423,7 +423,7 @@ void FractoriumEmberController<T>::Redo()
|
||||
int index = m_Ember.GetTotalXformIndex(CurrentXform());
|
||||
|
||||
m_LastEditWasUndoRedo = true;
|
||||
m_UndoIndex = min<unsigned int>(m_UndoIndex + 1, m_UndoList.size() - 1);
|
||||
m_UndoIndex = min<uint>(m_UndoIndex + 1, m_UndoList.size() - 1);
|
||||
SetEmber(m_UndoList[m_UndoIndex], true);
|
||||
m_EditState = UNDO_REDO;
|
||||
|
||||
@ -493,7 +493,7 @@ void Fractorium::OnActionCopyAllXml(bool checked) { m_Controller->CopyAllXml();
|
||||
template <typename T>
|
||||
void FractoriumEmberController<T>::PasteXmlAppend()
|
||||
{
|
||||
unsigned int i, previousSize = m_EmberFile.Size();
|
||||
uint i, previousSize = m_EmberFile.Size();
|
||||
string s, errors;
|
||||
XmlToEmber<T> parser;
|
||||
vector<Ember<T>> embers;
|
||||
@ -504,13 +504,13 @@ void FractoriumEmberController<T>::PasteXmlAppend()
|
||||
|
||||
for (i = 0; i < b.size(); i++)
|
||||
{
|
||||
if ((unsigned int)b[i] < 128u)
|
||||
if ((uint)b[i] < 128u)
|
||||
s.push_back(b[i]);
|
||||
}
|
||||
|
||||
b.clear();
|
||||
StopPreviewRender();
|
||||
parser.Parse((unsigned char*)s.c_str(), "", embers);
|
||||
parser.Parse((byte*)s.c_str(), "", embers);
|
||||
errors = parser.ErrorReportString();
|
||||
|
||||
if (errors != "")
|
||||
@ -548,7 +548,7 @@ void Fractorium::OnActionPasteXmlAppend(bool checked) { m_Controller->PasteXmlAp
|
||||
template <typename T>
|
||||
void FractoriumEmberController<T>::PasteXmlOver()
|
||||
{
|
||||
unsigned int i;
|
||||
uint i;
|
||||
string s, errors;
|
||||
XmlToEmber<T> parser;
|
||||
Ember<T> backupEmber = m_EmberFile.m_Embers[0];
|
||||
@ -559,14 +559,14 @@ void FractoriumEmberController<T>::PasteXmlOver()
|
||||
|
||||
for (i = 0; i < b.size(); i++)
|
||||
{
|
||||
if ((unsigned int)b[i] < 128u)
|
||||
if ((uint)b[i] < 128u)
|
||||
s.push_back(b[i]);
|
||||
}
|
||||
|
||||
b.clear();
|
||||
StopPreviewRender();
|
||||
m_EmberFile.m_Embers.clear();//Will invalidate the pointers contained in the EmberTreeWidgetItems, UpdateLibraryTree() will resync.
|
||||
parser.Parse((unsigned char*)s.c_str(), "", m_EmberFile.m_Embers);
|
||||
parser.Parse((byte*)s.c_str(), "", m_EmberFile.m_Embers);
|
||||
errors = parser.ErrorReportString();
|
||||
|
||||
if (errors != "")
|
||||
|
@ -76,7 +76,7 @@ bool FractoriumEmberController<T>::InitPaletteTable(const string& s)
|
||||
for (size_t i = 0; i < m_PaletteList.Size(); i++)
|
||||
{
|
||||
Palette<T>* p = m_PaletteList.GetPalette(i);
|
||||
vector<unsigned char> v = p->MakeRgbPaletteBlock(PALETTE_CELL_HEIGHT);
|
||||
vector<byte> v = p->MakeRgbPaletteBlock(PALETTE_CELL_HEIGHT);
|
||||
QTableWidgetItem* nameCol = new QTableWidgetItem(p->m_Name.c_str());
|
||||
|
||||
nameCol->setToolTip(p->m_Name.c_str());
|
||||
@ -109,8 +109,8 @@ template <typename T>
|
||||
void FractoriumEmberController<T>::ApplyPaletteToEmber()
|
||||
{
|
||||
int i, rot = 0;
|
||||
unsigned int blur = m_Fractorium->m_PaletteBlurSpin->value();
|
||||
unsigned int freq = m_Fractorium->m_PaletteFrequencySpin->value();
|
||||
uint blur = m_Fractorium->m_PaletteBlurSpin->value();
|
||||
uint freq = m_Fractorium->m_PaletteFrequencySpin->value();
|
||||
double sat = (double)m_Fractorium->m_PaletteSaturationSpin->value() / 100.0;
|
||||
double brightness = (double)m_Fractorium->m_PaletteBrightnessSpin->value() / 255.0;
|
||||
double contrast = (double)(m_Fractorium->m_PaletteContrastSpin->value() > 0 ? (m_Fractorium->m_PaletteContrastSpin->value() * 2) : m_Fractorium->m_PaletteContrastSpin->value()) / 100.0;
|
||||
@ -138,7 +138,7 @@ void FractoriumEmberController<T>::UpdateAdjustedPaletteGUI(Palette<T>& palette)
|
||||
if (previewPaletteItem)//This can be null if the palette file was moved or corrupted.
|
||||
{
|
||||
//Use the adjusted palette to fill the preview palette control so the user can see the effects of applying the adjustements.
|
||||
vector<unsigned char> v = palette.MakeRgbPaletteBlock(PALETTE_CELL_HEIGHT);//Make the palette repeat for PALETTE_CELL_HEIGHT rows.
|
||||
vector<byte> v = palette.MakeRgbPaletteBlock(PALETTE_CELL_HEIGHT);//Make the palette repeat for PALETTE_CELL_HEIGHT rows.
|
||||
|
||||
m_FinalPaletteImage = QImage(palette.Size(), PALETTE_CELL_HEIGHT, QImage::Format_RGB888);//Create a QImage out of it.
|
||||
memcpy(m_FinalPaletteImage.scanLine(0), v.data(), v.size() * sizeof(v[0]));//Memcpy the data in.
|
||||
@ -232,7 +232,7 @@ void Fractorium::OnPaletteCellDoubleClicked(int row, int col)
|
||||
/// <param name="row">The current row selected</param>
|
||||
void Fractorium::OnPaletteRandomSelectButtonClicked(bool checked)
|
||||
{
|
||||
unsigned int i = 0;
|
||||
uint i = 0;
|
||||
int rowCount = ui.PaletteListTable->rowCount() - 1;
|
||||
|
||||
while ((i = QTIsaac<ISAAC_SIZE, ISAAC_INT>::GlobalRand->Rand(rowCount)) == m_PreviousPaletteRow);
|
||||
|
@ -207,7 +207,7 @@ void Fractorium::OnColorSelected(const QColor& color) { m_Controller->Background
|
||||
/// Resets the rendering process.
|
||||
/// </summary>
|
||||
/// <param name="index">The index of the palette mode combo box</param>
|
||||
template <typename T> void FractoriumEmberController<T>::PaletteModeChanged(unsigned int i) { Update([&] { m_Ember.m_PaletteMode = i == 0 ? PALETTE_STEP : PALETTE_LINEAR; }); }
|
||||
template <typename T> void FractoriumEmberController<T>::PaletteModeChanged(uint i) { Update([&] { m_Ember.m_PaletteMode = i == 0 ? PALETTE_STEP : PALETTE_LINEAR; }); }
|
||||
void Fractorium::OnPaletteModeComboCurrentIndexChanged(int index) { m_Controller->PaletteModeChanged(index); }
|
||||
|
||||
/// <summary>
|
||||
@ -219,7 +219,7 @@ void Fractorium::OnPaletteModeComboCurrentIndexChanged(int index) { m_Controller
|
||||
/// Dimensions are set automatically to match the dimensions of GLWidget.
|
||||
/// </summary>
|
||||
/// <param name="d">Ignored</param>
|
||||
template <typename T> void FractoriumEmberController<T>::WidthChanged(unsigned int i) { Update([&] { m_Ember.m_FinalRasW = i; }); }
|
||||
template <typename T> void FractoriumEmberController<T>::WidthChanged(uint i) { Update([&] { m_Ember.m_FinalRasW = i; }); }
|
||||
void Fractorium::OnWidthChanged(int i) { m_Controller->WidthChanged(i); }
|
||||
|
||||
/// <summary>
|
||||
@ -227,7 +227,7 @@ void Fractorium::OnWidthChanged(int i) { m_Controller->WidthChanged(i); }
|
||||
/// Dimensions are set automatically to match the dimensions of GLWidget.
|
||||
/// </summary>
|
||||
/// <param name="d">Ignored</param>
|
||||
template <typename T> void FractoriumEmberController<T>::HeightChanged(unsigned int i) { Update([&] { m_Ember.m_FinalRasH = i; }); }
|
||||
template <typename T> void FractoriumEmberController<T>::HeightChanged(uint i) { Update([&] { m_Ember.m_FinalRasH = i; }); }
|
||||
void Fractorium::OnHeightChanged(int i) { m_Controller->HeightChanged(i); }
|
||||
|
||||
/// <summary>
|
||||
|
@ -114,11 +114,11 @@ void FractoriumEmberControllerBase::SaveCurrentRender(const QString& filename, b
|
||||
if (filename != "")
|
||||
{
|
||||
bool b = false;
|
||||
unsigned int i, j;
|
||||
unsigned int width = m_Renderer->FinalRasW();
|
||||
unsigned int height = m_Renderer->FinalRasH();
|
||||
unsigned char* data = NULL;
|
||||
vector<unsigned char> vecRgb;
|
||||
uint i, j;
|
||||
uint width = m_Renderer->FinalRasW();
|
||||
uint height = m_Renderer->FinalRasH();
|
||||
byte* data = NULL;
|
||||
vector<byte> vecRgb;
|
||||
QFileInfo fileInfo(filename);
|
||||
QString suffix = fileInfo.suffix();
|
||||
FractoriumSettings* settings = m_Fractorium->m_Settings;
|
||||
@ -379,7 +379,7 @@ bool FractoriumEmberController<T>::Render()
|
||||
{
|
||||
EmberStats stats = m_Renderer->Stats();
|
||||
QString iters = ToString(stats.m_Iters);
|
||||
QString scaledQuality = ToString((unsigned int)m_Renderer->ScaledQuality());
|
||||
QString scaledQuality = ToString((uint)m_Renderer->ScaledQuality());
|
||||
string renderTime = m_RenderElapsedTimer.Format(m_RenderElapsedTimer.Toc());
|
||||
|
||||
m_Fractorium->m_ProgressBar->setValue(100);
|
||||
@ -485,7 +485,7 @@ bool FractoriumEmberController<T>::Render()
|
||||
/// <param name="shared">True if shared with OpenGL, else false. Default: true.</param>
|
||||
/// <returns>True if nothing went wrong, else false.</returns>
|
||||
template <typename T>
|
||||
bool FractoriumEmberController<T>::CreateRenderer(eRendererType renderType, unsigned int platform, unsigned int device, bool shared)
|
||||
bool FractoriumEmberController<T>::CreateRenderer(eRendererType renderType, uint platform, uint device, bool shared)
|
||||
{
|
||||
bool ok = true;
|
||||
FractoriumSettings* s = m_Fractorium->m_Settings;
|
||||
|
@ -117,14 +117,14 @@ void FractoriumSettings::Double(bool b) { setValue(DOUBLEPRECISION, b);
|
||||
bool FractoriumSettings::ShowAllXforms() { return value(SHOWALLXFORMS).toBool(); }
|
||||
void FractoriumSettings::ShowAllXforms(bool b) { setValue(SHOWALLXFORMS, b); }
|
||||
|
||||
unsigned int FractoriumSettings::PlatformIndex() { return value(PLATFORMINDEX).toUInt(); }
|
||||
void FractoriumSettings::PlatformIndex(unsigned int i) { setValue(PLATFORMINDEX, i); }
|
||||
uint FractoriumSettings::PlatformIndex() { return value(PLATFORMINDEX).toUInt(); }
|
||||
void FractoriumSettings::PlatformIndex(uint i) { setValue(PLATFORMINDEX, i); }
|
||||
|
||||
unsigned int FractoriumSettings::DeviceIndex() { return value(DEVICEINDEX).toUInt(); }
|
||||
void FractoriumSettings::DeviceIndex(unsigned int i) { setValue(DEVICEINDEX, i); }
|
||||
uint FractoriumSettings::DeviceIndex() { return value(DEVICEINDEX).toUInt(); }
|
||||
void FractoriumSettings::DeviceIndex(uint i) { setValue(DEVICEINDEX, i); }
|
||||
|
||||
unsigned int FractoriumSettings::ThreadCount() { return value(THREADCOUNT).toUInt(); }
|
||||
void FractoriumSettings::ThreadCount(unsigned int i) { setValue(THREADCOUNT, i); }
|
||||
uint FractoriumSettings::ThreadCount() { return value(THREADCOUNT).toUInt(); }
|
||||
void FractoriumSettings::ThreadCount(uint i) { setValue(THREADCOUNT, i); }
|
||||
|
||||
bool FractoriumSettings::CpuDEFilter() { return value(CPUDEFILTER).toBool(); }
|
||||
void FractoriumSettings::CpuDEFilter(bool b) { setValue(CPUDEFILTER, b); }
|
||||
@ -132,11 +132,11 @@ void FractoriumSettings::CpuDEFilter(bool b) { setValue(CPUDEFI
|
||||
bool FractoriumSettings::OpenCLDEFilter() { return value(OPENCLDEFILTER).toBool(); }
|
||||
void FractoriumSettings::OpenCLDEFilter(bool b) { setValue(OPENCLDEFILTER, b); }
|
||||
|
||||
unsigned int FractoriumSettings::CpuSubBatch() { return value(CPUSUBBATCH).toUInt(); }
|
||||
void FractoriumSettings::CpuSubBatch(unsigned int b) { setValue(CPUSUBBATCH, b); }
|
||||
uint FractoriumSettings::CpuSubBatch() { return value(CPUSUBBATCH).toUInt(); }
|
||||
void FractoriumSettings::CpuSubBatch(uint b) { setValue(CPUSUBBATCH, b); }
|
||||
|
||||
unsigned int FractoriumSettings::OpenCLSubBatch() { return value(OPENCLSUBBATCH).toUInt(); }
|
||||
void FractoriumSettings::OpenCLSubBatch(unsigned int b) { setValue(OPENCLSUBBATCH, b); }
|
||||
uint FractoriumSettings::OpenCLSubBatch() { return value(OPENCLSUBBATCH).toUInt(); }
|
||||
void FractoriumSettings::OpenCLSubBatch(uint b) { setValue(OPENCLSUBBATCH, b); }
|
||||
|
||||
/// <summary>
|
||||
/// Final render settings.
|
||||
@ -169,45 +169,45 @@ void FractoriumSettings::FinalDoSequence(bool b) { setValue(FINALDOSEQUENCE,
|
||||
bool FractoriumSettings::FinalKeepAspect() { return value(FINALKEEPASPECT).toBool(); }
|
||||
void FractoriumSettings::FinalKeepAspect(bool b) { setValue(FINALKEEPASPECT, b); }
|
||||
|
||||
unsigned int FractoriumSettings::FinalScale() { return value(FINALSCALE).toUInt(); }
|
||||
void FractoriumSettings::FinalScale(unsigned int i) { setValue(FINALSCALE, i); }
|
||||
uint FractoriumSettings::FinalScale() { return value(FINALSCALE).toUInt(); }
|
||||
void FractoriumSettings::FinalScale(uint i) { setValue(FINALSCALE, i); }
|
||||
|
||||
QString FractoriumSettings::FinalExt() { return value(FINALEXT).toString(); }
|
||||
void FractoriumSettings::FinalExt(const QString& s) { setValue(FINALEXT, s); }
|
||||
|
||||
unsigned int FractoriumSettings::FinalPlatformIndex() { return value(FINALPLATFORMINDEX).toUInt(); }
|
||||
void FractoriumSettings::FinalPlatformIndex(unsigned int i) { setValue(FINALPLATFORMINDEX, i); }
|
||||
uint FractoriumSettings::FinalPlatformIndex() { return value(FINALPLATFORMINDEX).toUInt(); }
|
||||
void FractoriumSettings::FinalPlatformIndex(uint i) { setValue(FINALPLATFORMINDEX, i); }
|
||||
|
||||
unsigned int FractoriumSettings::FinalDeviceIndex() { return value(FINALDEVICEINDEX).toUInt(); }
|
||||
void FractoriumSettings::FinalDeviceIndex(unsigned int i) { setValue(FINALDEVICEINDEX, i); }
|
||||
uint FractoriumSettings::FinalDeviceIndex() { return value(FINALDEVICEINDEX).toUInt(); }
|
||||
void FractoriumSettings::FinalDeviceIndex(uint i) { setValue(FINALDEVICEINDEX, i); }
|
||||
|
||||
unsigned int FractoriumSettings::FinalThreadCount() { return value(FINALTHREADCOUNT).toUInt(); }
|
||||
void FractoriumSettings::FinalThreadCount(unsigned int i) { setValue(FINALTHREADCOUNT, i); }
|
||||
uint FractoriumSettings::FinalThreadCount() { return value(FINALTHREADCOUNT).toUInt(); }
|
||||
void FractoriumSettings::FinalThreadCount(uint i) { setValue(FINALTHREADCOUNT, i); }
|
||||
|
||||
unsigned int FractoriumSettings::FinalQuality() { return value(FINALQUALITY).toUInt(); }
|
||||
void FractoriumSettings::FinalQuality(unsigned int i) { setValue(FINALQUALITY, i); }
|
||||
uint FractoriumSettings::FinalQuality() { return value(FINALQUALITY).toUInt(); }
|
||||
void FractoriumSettings::FinalQuality(uint i) { setValue(FINALQUALITY, i); }
|
||||
|
||||
unsigned int FractoriumSettings::FinalTemporalSamples() { return value(FINALTEMPORALSAMPLES).toUInt(); }
|
||||
void FractoriumSettings::FinalTemporalSamples(unsigned int i) { setValue(FINALTEMPORALSAMPLES, i); }
|
||||
uint FractoriumSettings::FinalTemporalSamples() { return value(FINALTEMPORALSAMPLES).toUInt(); }
|
||||
void FractoriumSettings::FinalTemporalSamples(uint i) { setValue(FINALTEMPORALSAMPLES, i); }
|
||||
|
||||
unsigned int FractoriumSettings::FinalSupersample() { return value(FINALSUPERSAMPLE).toUInt(); }
|
||||
void FractoriumSettings::FinalSupersample(unsigned int i) { setValue(FINALSUPERSAMPLE, i); }
|
||||
uint FractoriumSettings::FinalSupersample() { return value(FINALSUPERSAMPLE).toUInt(); }
|
||||
void FractoriumSettings::FinalSupersample(uint i) { setValue(FINALSUPERSAMPLE, i); }
|
||||
|
||||
unsigned int FractoriumSettings::FinalStrips() { return value(FINALSTRIPS).toUInt(); }
|
||||
void FractoriumSettings::FinalStrips(unsigned int i) { setValue(FINALSTRIPS, i); }
|
||||
uint FractoriumSettings::FinalStrips() { return value(FINALSTRIPS).toUInt(); }
|
||||
void FractoriumSettings::FinalStrips(uint i) { setValue(FINALSTRIPS, i); }
|
||||
|
||||
/// <summary>
|
||||
/// Xml file saving settings.
|
||||
/// </summary>
|
||||
|
||||
unsigned int FractoriumSettings::XmlTemporalSamples() { return value(XMLTEMPORALSAMPLES).toUInt(); }
|
||||
void FractoriumSettings::XmlTemporalSamples(unsigned int i) { setValue(XMLTEMPORALSAMPLES, i); }
|
||||
uint FractoriumSettings::XmlTemporalSamples() { return value(XMLTEMPORALSAMPLES).toUInt(); }
|
||||
void FractoriumSettings::XmlTemporalSamples(uint i) { setValue(XMLTEMPORALSAMPLES, i); }
|
||||
|
||||
unsigned int FractoriumSettings::XmlQuality() { return value(XMLQUALITY).toUInt(); }
|
||||
void FractoriumSettings::XmlQuality(unsigned int i) { setValue(XMLQUALITY, i); }
|
||||
uint FractoriumSettings::XmlQuality() { return value(XMLQUALITY).toUInt(); }
|
||||
void FractoriumSettings::XmlQuality(uint i) { setValue(XMLQUALITY, i); }
|
||||
|
||||
unsigned int FractoriumSettings::XmlSupersample() { return value(XMLSUPERSAMPLE).toUInt(); }
|
||||
void FractoriumSettings::XmlSupersample(unsigned int i) { setValue(XMLSUPERSAMPLE, i); }
|
||||
uint FractoriumSettings::XmlSupersample() { return value(XMLSUPERSAMPLE).toUInt(); }
|
||||
void FractoriumSettings::XmlSupersample(uint i) { setValue(XMLSUPERSAMPLE, i); }
|
||||
|
||||
QString FractoriumSettings::Id() { return value(IDENTITYID).toString(); }
|
||||
void FractoriumSettings::Id(const QString& s) { setValue(IDENTITYID, s); }
|
||||
|
@ -87,14 +87,14 @@ public:
|
||||
bool ShowAllXforms();
|
||||
void ShowAllXforms(bool b);
|
||||
|
||||
unsigned int PlatformIndex();
|
||||
void PlatformIndex(unsigned int b);
|
||||
uint PlatformIndex();
|
||||
void PlatformIndex(uint b);
|
||||
|
||||
unsigned int DeviceIndex();
|
||||
void DeviceIndex(unsigned int b);
|
||||
uint DeviceIndex();
|
||||
void DeviceIndex(uint b);
|
||||
|
||||
unsigned int ThreadCount();
|
||||
void ThreadCount(unsigned int b);
|
||||
uint ThreadCount();
|
||||
void ThreadCount(uint b);
|
||||
|
||||
bool CpuDEFilter();
|
||||
void CpuDEFilter(bool b);
|
||||
@ -102,11 +102,11 @@ public:
|
||||
bool OpenCLDEFilter();
|
||||
void OpenCLDEFilter(bool b);
|
||||
|
||||
unsigned int CpuSubBatch();
|
||||
void CpuSubBatch(unsigned int b);
|
||||
uint CpuSubBatch();
|
||||
void CpuSubBatch(uint b);
|
||||
|
||||
unsigned int OpenCLSubBatch();
|
||||
void OpenCLSubBatch(unsigned int b);
|
||||
uint OpenCLSubBatch();
|
||||
void OpenCLSubBatch(uint b);
|
||||
|
||||
bool FinalEarlyClip();
|
||||
void FinalEarlyClip(bool b);
|
||||
@ -135,41 +135,41 @@ public:
|
||||
bool FinalKeepAspect();
|
||||
void FinalKeepAspect(bool b);
|
||||
|
||||
unsigned int FinalScale();
|
||||
void FinalScale(unsigned int i);
|
||||
uint FinalScale();
|
||||
void FinalScale(uint i);
|
||||
|
||||
QString FinalExt();
|
||||
void FinalExt(const QString& s);
|
||||
|
||||
unsigned int FinalPlatformIndex();
|
||||
void FinalPlatformIndex(unsigned int b);
|
||||
uint FinalPlatformIndex();
|
||||
void FinalPlatformIndex(uint b);
|
||||
|
||||
unsigned int FinalDeviceIndex();
|
||||
void FinalDeviceIndex(unsigned int b);
|
||||
uint FinalDeviceIndex();
|
||||
void FinalDeviceIndex(uint b);
|
||||
|
||||
unsigned int FinalThreadCount();
|
||||
void FinalThreadCount(unsigned int b);
|
||||
uint FinalThreadCount();
|
||||
void FinalThreadCount(uint b);
|
||||
|
||||
unsigned int FinalQuality();
|
||||
void FinalQuality(unsigned int i);
|
||||
uint FinalQuality();
|
||||
void FinalQuality(uint i);
|
||||
|
||||
unsigned int FinalTemporalSamples();
|
||||
void FinalTemporalSamples(unsigned int i);
|
||||
uint FinalTemporalSamples();
|
||||
void FinalTemporalSamples(uint i);
|
||||
|
||||
unsigned int FinalSupersample();
|
||||
void FinalSupersample(unsigned int i);
|
||||
uint FinalSupersample();
|
||||
void FinalSupersample(uint i);
|
||||
|
||||
unsigned int FinalStrips();
|
||||
void FinalStrips(unsigned int i);
|
||||
uint FinalStrips();
|
||||
void FinalStrips(uint i);
|
||||
|
||||
unsigned int XmlTemporalSamples();
|
||||
void XmlTemporalSamples(unsigned int i);
|
||||
uint XmlTemporalSamples();
|
||||
void XmlTemporalSamples(uint i);
|
||||
|
||||
unsigned int XmlQuality();
|
||||
void XmlQuality(unsigned int i);
|
||||
uint XmlQuality();
|
||||
void XmlQuality(uint i);
|
||||
|
||||
unsigned int XmlSupersample();
|
||||
void XmlSupersample(unsigned int i);
|
||||
uint XmlSupersample();
|
||||
void XmlSupersample(uint i);
|
||||
|
||||
QString OpenFolder();
|
||||
void OpenFolder(const QString& s);
|
||||
|
@ -46,7 +46,7 @@ Xform<T>* FractoriumEmberController<T>::CurrentXform()
|
||||
/// Set the current xform to the index passed in.
|
||||
/// </summary>
|
||||
/// <param name="i">The index to set the current xform to</param>
|
||||
void Fractorium::CurrentXform(unsigned int i)
|
||||
void Fractorium::CurrentXform(uint i)
|
||||
{
|
||||
if (i < ui.CurrentXformCombo->count())
|
||||
ui.CurrentXformCombo->setCurrentIndex(i);
|
||||
|
@ -163,7 +163,7 @@ void FractoriumEmberController<T>::SetCurrentXformColorIndex(double d)
|
||||
entry.g *= 255;
|
||||
entry.b *= 255;
|
||||
|
||||
QRgb rgb = (unsigned int)entry.r << 16 | (unsigned int)entry.g << 8 | (unsigned int)entry.b;
|
||||
QRgb rgb = (uint)entry.r << 16 | (uint)entry.g << 8 | (uint)entry.b;
|
||||
m_Fractorium->ui.XformColorIndexTable->item(0, 0)->setBackgroundColor(QColor::fromRgb(rgb));
|
||||
}, false);
|
||||
}
|
||||
|
@ -106,14 +106,14 @@ void FractoriumEmberController<T>::ClearVariationsTree()
|
||||
{
|
||||
QTreeWidget* tree = m_Fractorium->ui.VariationsTree;
|
||||
|
||||
for (unsigned int i = 0; i < tree->topLevelItemCount(); i++)
|
||||
for (uint i = 0; i < tree->topLevelItemCount(); i++)
|
||||
{
|
||||
QTreeWidgetItem* item = tree->topLevelItem(i);
|
||||
VariationTreeDoubleSpinBox<T>* spinBox = dynamic_cast<VariationTreeDoubleSpinBox<T>*>(tree->itemWidget(item, 1));
|
||||
|
||||
spinBox->SetValueStealth(0);
|
||||
|
||||
for (unsigned int j = 0; j < item->childCount(); j++)//Iterate through all of the children, which will be the params.
|
||||
for (uint j = 0; j < item->childCount(); j++)//Iterate through all of the children, which will be the params.
|
||||
{
|
||||
if (spinBox = dynamic_cast<VariationTreeDoubleSpinBox<T>*>(tree->itemWidget(item->child(j), 1)))//Cast the child widget to the VariationTreeDoubleSpinBox type.
|
||||
spinBox->SetValueStealth(0);
|
||||
@ -223,7 +223,7 @@ void FractoriumEmberController<T>::FillVariationTreeWithXform(Xform<T>* xform)
|
||||
|
||||
tree->blockSignals(true);
|
||||
|
||||
for (unsigned int i = 0; i < tree->topLevelItemCount(); i++)
|
||||
for (uint i = 0; i < tree->topLevelItemCount(); i++)
|
||||
{
|
||||
VariationTreeWidgetItem<T>* item = dynamic_cast<VariationTreeWidgetItem<T>*>(tree->topLevelItem(i));
|
||||
Variation<T>* var = xform->GetVariationById(item->Id());//See if this variation in the tree was contained in the xform.
|
||||
@ -235,7 +235,7 @@ void FractoriumEmberController<T>::FillVariationTreeWithXform(Xform<T>* xform)
|
||||
spinBox->SetValueStealth(var ? var->m_Weight : 0);//If the variation was present, set the spin box to its weight, else zero.
|
||||
item->setBackgroundColor(0, var ? QColor(200, 200, 200) : QColor(255, 255, 255));//Ensure background is always white if the value goes to zero, else gray if var present.
|
||||
|
||||
for (unsigned int j = 0; j < item->childCount(); j++)//Iterate through all of the children, which will be the params if it was a parametric variation.
|
||||
for (uint j = 0; j < item->childCount(); j++)//Iterate through all of the children, which will be the params if it was a parametric variation.
|
||||
{
|
||||
T* param = NULL;
|
||||
QTreeWidgetItem* childItem = item->child(j);//Get the child.
|
||||
@ -293,7 +293,7 @@ void Fractorium::OnVariationsFilterLineEditTextChanged(const QString& text)
|
||||
|
||||
tree->setUpdatesEnabled(false);
|
||||
|
||||
for (unsigned int i = 0; i < tree->topLevelItemCount(); i++)
|
||||
for (uint i = 0; i < tree->topLevelItemCount(); i++)
|
||||
{
|
||||
QTreeWidgetItem* item = tree->topLevelItem(i);
|
||||
QString varName = item->text(0);
|
||||
|
@ -50,7 +50,7 @@ void FractoriumEmberController<T>::FillXaosWithCurrentXform()
|
||||
/// <param name="i">The index of the xform whose xaos will be used</param>
|
||||
/// <returns>The xaos name string</returns>
|
||||
template <typename T>
|
||||
QString FractoriumEmberController<T>::MakeXaosNameString(unsigned int i)
|
||||
QString FractoriumEmberController<T>::MakeXaosNameString(uint i)
|
||||
{
|
||||
Xform<T>* xform = m_Ember.GetXform(i);
|
||||
QString name;
|
||||
|
@ -119,7 +119,7 @@ typename v3T GLEmberController<T>::SnapToGrid(v3T& vec)
|
||||
/// <param name="divisions">The divisions of a circle to use for snapping</param>
|
||||
/// <returns>The snapped world cartesian coordinate</returns>
|
||||
template <typename T>
|
||||
typename v3T GLEmberController<T>::SnapToNormalizedAngle(v3T& vec, unsigned int divisions)
|
||||
typename v3T GLEmberController<T>::SnapToNormalizedAngle(v3T& vec, uint divisions)
|
||||
{
|
||||
T rsq, theta;
|
||||
T bestRsq = numeric_limits<T>::max();
|
||||
@ -128,7 +128,7 @@ typename v3T GLEmberController<T>::SnapToNormalizedAngle(v3T& vec, unsigned int
|
||||
best.x = 1;
|
||||
best.y = 0;
|
||||
|
||||
for (unsigned int i = 0; i < divisions; i++)
|
||||
for (uint i = 0; i < divisions; i++)
|
||||
{
|
||||
theta = 2.0 * M_PI * (T)i / (T)divisions;
|
||||
c.x = cos(theta);
|
||||
|
@ -65,7 +65,7 @@ public:
|
||||
virtual void QueryMatrices(bool print) { }
|
||||
|
||||
protected:
|
||||
unsigned int m_DragModifier;
|
||||
uint m_DragModifier;
|
||||
glm::ivec2 m_MousePos;
|
||||
glm::ivec2 m_MouseDownPos;
|
||||
glm::ivec4 m_Viewport;
|
||||
@ -111,7 +111,7 @@ public:
|
||||
|
||||
private:
|
||||
v3T SnapToGrid(v3T& vec);
|
||||
v3T SnapToNormalizedAngle(v3T& vec, unsigned int divisions);
|
||||
v3T SnapToNormalizedAngle(v3T& vec, uint divisions);
|
||||
v3T WindowToWorld(v3T& v, bool flip);
|
||||
void QueryVMP();
|
||||
void MultMatrix(m4T& mat);
|
||||
|
@ -51,7 +51,7 @@ void GLWidget::DrawQuad()
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
RendererBase* renderer = m_Fractorium->m_Controller->Renderer();
|
||||
vector<unsigned char>* finalImage = m_Fractorium->m_Controller->FinalImage();
|
||||
vector<byte>* finalImage = m_Fractorium->m_Controller->FinalImage();
|
||||
|
||||
//Ensure all allocation has taken place first.
|
||||
if (m_OutputTexID != 0 && finalImage && !finalImage->empty())
|
||||
@ -270,7 +270,7 @@ void GLEmberController<T>::DrawImage()
|
||||
|
||||
if (SizesMatch())//Ensure all sizes are correct. If not, do nothing.
|
||||
{
|
||||
vector<unsigned char>* finalImage = m_FractoriumEmberController->FinalImage();
|
||||
vector<byte>* finalImage = m_FractoriumEmberController->FinalImage();
|
||||
|
||||
if (renderer->RendererType() == OPENCL_RENDERER || finalImage)//Final image only matters for CPU renderer.
|
||||
if (renderer->RendererType() == OPENCL_RENDERER || finalImage->size() == renderer->FinalBufferSize())
|
||||
@ -310,7 +310,7 @@ void GLEmberController<T>::DrawAffines(bool pre, bool post)
|
||||
{
|
||||
if (pre && m_Fractorium->DrawAllPre())//Draw all pre affine if specified.
|
||||
{
|
||||
for (unsigned int i = 0; i < ember->TotalXformCount(); i++)
|
||||
for (uint i = 0; i < ember->TotalXformCount(); i++)
|
||||
{
|
||||
Xform<T>* xform = ember->GetTotalXform(i);
|
||||
bool selected = dragging ? (m_SelectedXform == xform) : (m_HoverXform == xform);
|
||||
@ -325,7 +325,7 @@ void GLEmberController<T>::DrawAffines(bool pre, bool post)
|
||||
|
||||
if (post && m_Fractorium->DrawAllPost())//Draw all post affine if specified.
|
||||
{
|
||||
for (unsigned int i = 0; i < ember->TotalXformCount(); i++)
|
||||
for (uint i = 0; i < ember->TotalXformCount(); i++)
|
||||
{
|
||||
Xform<T>* xform = ember->GetTotalXform(i);
|
||||
bool selected = dragging ? (m_SelectedXform == xform) : (m_HoverXform == xform);
|
||||
@ -1073,7 +1073,7 @@ int GLEmberController<T>::UpdateHover(v3T& glCoords)
|
||||
bool post = m_Fractorium->ui.PostAffineGroupBox->isChecked();
|
||||
bool preAll = pre && m_Fractorium->DrawAllPre();
|
||||
bool postAll = post && m_Fractorium->DrawAllPost();
|
||||
unsigned int bestIndex = -1;
|
||||
uint bestIndex = -1;
|
||||
T bestDist = 10;
|
||||
Ember<T>* ember = m_FractoriumEmberController->CurrentEmber();
|
||||
|
||||
@ -1096,7 +1096,7 @@ int GLEmberController<T>::UpdateHover(v3T& glCoords)
|
||||
}
|
||||
|
||||
//Check all xforms.
|
||||
for (unsigned int i = 0; i < ember->TotalXformCount(); i++)
|
||||
for (uint i = 0; i < ember->TotalXformCount(); i++)
|
||||
{
|
||||
Xform<T>* xform = ember->GetTotalXform(i);
|
||||
|
||||
|
@ -12,7 +12,7 @@ FractoriumOptionsDialog::FractoriumOptionsDialog(FractoriumSettings* settings, Q
|
||||
: QDialog(parent, f)
|
||||
{
|
||||
int row = 0, spinHeight = 20;
|
||||
unsigned int i;
|
||||
uint i;
|
||||
|
||||
ui.setupUi(this);
|
||||
m_Settings = settings;
|
||||
@ -102,9 +102,9 @@ bool FractoriumOptionsDialog::Transparency() { return ui.TransparencyCheckBox->i
|
||||
bool FractoriumOptionsDialog::OpenCL() { return ui.OpenCLCheckBox->isChecked(); }
|
||||
bool FractoriumOptionsDialog::Double() { return ui.DoublePrecisionCheckBox->isChecked(); }
|
||||
bool FractoriumOptionsDialog::ShowAllXforms() { return ui.ShowAllXformsCheckBox->isChecked(); }
|
||||
unsigned int FractoriumOptionsDialog::PlatformIndex() { return ui.PlatformCombo->currentIndex(); }
|
||||
unsigned int FractoriumOptionsDialog::DeviceIndex() { return ui.DeviceCombo->currentIndex(); }
|
||||
unsigned int FractoriumOptionsDialog::ThreadCount() { return ui.ThreadCountSpin->value(); }
|
||||
uint FractoriumOptionsDialog::PlatformIndex() { return ui.PlatformCombo->currentIndex(); }
|
||||
uint FractoriumOptionsDialog::DeviceIndex() { return ui.DeviceCombo->currentIndex(); }
|
||||
uint FractoriumOptionsDialog::ThreadCount() { return ui.ThreadCountSpin->value(); }
|
||||
|
||||
/// <summary>
|
||||
/// Disable or enable the OpenCL related controls based on the state passed in.
|
||||
|
@ -40,9 +40,9 @@ private:
|
||||
bool OpenCL();
|
||||
bool Double();
|
||||
bool ShowAllXforms();
|
||||
unsigned int PlatformIndex();
|
||||
unsigned int DeviceIndex();
|
||||
unsigned int ThreadCount();
|
||||
uint PlatformIndex();
|
||||
uint DeviceIndex();
|
||||
uint ThreadCount();
|
||||
|
||||
Ui::OptionsDialog ui;
|
||||
OpenCLWrapper m_Wrapper;
|
||||
|
Loading…
Reference in New Issue
Block a user