Clean up.
This commit is contained in:
@@ -31,19 +31,6 @@ static void rescaleSubImages(vector<float>& textureBuffer, int subImages) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fmri::Texture fmri::loadTexture(DType const *data, int width, int height, int subImages)
|
|
||||||
{
|
|
||||||
// Load and scale texture
|
|
||||||
vector<float> textureBuffer(data, data + (width * height));
|
|
||||||
rescaleSubImages(textureBuffer, subImages);
|
|
||||||
|
|
||||||
Texture texture;
|
|
||||||
texture.configure(GL_TEXTURE_2D);
|
|
||||||
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_LUMINANCE, width, height, GL_LUMINANCE, GL_FLOAT, textureBuffer.data());
|
|
||||||
|
|
||||||
return texture;
|
|
||||||
}
|
|
||||||
|
|
||||||
void fmri::changeWindowSize(int w, int h)
|
void fmri::changeWindowSize(int w, int h)
|
||||||
{
|
{
|
||||||
// Prevent a divide by zero, when window is too short
|
// Prevent a divide by zero, when window is too short
|
||||||
|
|||||||
@@ -7,16 +7,6 @@
|
|||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
|
||||||
namespace fmri {
|
namespace fmri {
|
||||||
/**
|
|
||||||
* Create a texture from an array of data.
|
|
||||||
*
|
|
||||||
* @param data
|
|
||||||
* @param width
|
|
||||||
* @param height
|
|
||||||
* @param subImages Number of subimages in the original image. Sub images are rescaled individually to preserve contrast. Optional, default 1.
|
|
||||||
* @return A texture reference.
|
|
||||||
*/
|
|
||||||
fmri::Texture loadTexture(DType const *data, int width, int height, int subImages = 1);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback handler to handle resizing windows.
|
* Callback handler to handle resizing windows.
|
||||||
|
|||||||
Reference in New Issue
Block a user