Commit 72cfbfef authored by Marcus D. Hanwell's avatar Marcus D. Hanwell
Browse files

ENH: Added an ivar to specify power of two scaling.

Useful with older GPUs, where non power of two textures are not
supported.

Change-Id: Id6cca87482395488c86461b2f3f105e5c34272c6
parent f5e13e73
......@@ -120,6 +120,13 @@ int vtkFreeTypeStringToImage::RenderString(vtkTextProperty *property,
return 0;
}
//-----------------------------------------------------------------------------
void vtkFreeTypeStringToImage::SetScaleToPowerOfTwo(bool scale)
{
this->vtkStringToImage::SetScaleToPowerOfTwo(scale);
this->Implementation->FreeType->SetScaleToPowerTwo(scale);
}
//-----------------------------------------------------------------------------
void vtkFreeTypeStringToImage::DeepCopy(vtkFreeTypeStringToImage *)
{
......
......@@ -59,6 +59,11 @@ public:
const vtkStdString& string,
vtkImageData *data);
// Description:
// Should we produce images at powers of 2, makes rendering on old OpenGL
// hardware easier. Default is false.
virtual void SetScaleToPowerOfTwo(bool scale);
// Description:
// Make a deep copy of the supplied utility class.
void DeepCopy(vtkFreeTypeStringToImage *utility);
......
......@@ -21,6 +21,7 @@
vtkStringToImage::vtkStringToImage()
{
this->Antialias = true;
this->ScaleToPowerOfTwo = false;
}
//-----------------------------------------------------------------------------
......@@ -28,6 +29,16 @@ vtkStringToImage::~vtkStringToImage()
{
}
//-----------------------------------------------------------------------------
void vtkStringToImage::SetScaleToPowerOfTwo(bool scale)
{
if (this->ScaleToPowerOfTwo != scale)
{
this->ScaleToPowerOfTwo = scale;
this->Modified();
}
}
//-----------------------------------------------------------------------------
void vtkStringToImage::PrintSelf(ostream &os, vtkIndent indent)
{
......
......@@ -62,13 +62,18 @@ public:
const vtkStdString& string,
vtkImageData *data) = 0;
// Description:
// Should we produce images at powers of 2, makes rendering on old OpenGL
// hardware easier. Default is false.
virtual void SetScaleToPowerOfTwo(bool scale);
vtkGetMacro(ScaleToPowerOfTwo, bool)
protected:
vtkStringToImage();
~vtkStringToImage();
bool Antialias;
bool ScaleToPowerOfTwo;
private:
vtkStringToImage(const vtkStringToImage &); // Not implemented.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment