122 questions
1
vote
2
answers
191
views
how to efficiently save a large image using stbi_write_png which is stored in a multidimensional array
In my initial question there was some confusion as to what I was really trying to do.
Specifically, when I edit large images i store them in an array of pixels where Pixel image[iwid][ihei] is my ...
0
votes
1
answer
265
views
How can I align numpy array outputs from PDFium and stb_image when rendering identical content?
In C++, I'm trying to obtain a numpy array from a pdf page using PDFium:
py::array_t<uint8_t> render_page_helper(FPDF_PAGE page, int target_width = 0, int target_height = 0, int dpi = 80) {
...
1
vote
1
answer
92
views
Why isn't this program correctly texturing models?
I'm trying to basic 3D rendering working using OpenGL 1.1:
#define GLFW_INCLUDE_GLU
#include <GLFW/glfw3.h>
#include <gl/GL.h>
#include <gl/GLU.h>
#include <stdio.h>
#include &...
5
votes
1
answer
119
views
OpenGL fails to draw textured triangle?
In this program the 3 triangles aren't drawn, even when I replace the texture by vec4(0.0f, 0.5f, 0.0f, 1.0f);, trying to draw the third triangle in green:
#define GLFW_INCLUDE_NONE
#include <GLFW/...
0
votes
0
answers
75
views
GLSL Program crashing when attempting to include a textured background [duplicate]
I have been displaying animations:
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <iostream>
#include <fstream>
#include <sstream>
#include <cmath>
#include &...
0
votes
1
answer
103
views
Issue with OpenGL Texture Creation for 1066x1600 Resolution [duplicate]
I am trying to load image data using stbi_load into an OpenGL texture object. I've successfully done this in multiple projects, but in my current approach, I’m encountering an access violation error (...
8
votes
0
answers
279
views
What is the correct way to export enum values for an unnamed enum in C++ modules?
I stumbled upon the image processing libraries from https://github.com/nothings/stb/ and as I experiment with C++ modules I tried to use stb_image.h "as module".
For this I wrote a small ...
0
votes
0
answers
271
views
The stb_image.h library gives a segmentation fault when using clang
I am writing a project an opengl project where i need to read a png file from memory and store the bytes in a buffer. For this I am using the stb_image library. The only two lines of code which comes ...
1
vote
0
answers
214
views
Error: L6200E: Symbol __stdout multipy defined (by stdio_streams.o and retarget.o), when include stb_image.h
I am using keil to develop my mcu project.
After I include stb_image.h in main.c, I got this error message
.\Objects\JinshenTekDigitalLightingBoard(M433LE8AE).axf: Error: L6200E: Symbol __stdout ...
2
votes
1
answer
79
views
Multiple models not rendering together but rendering seperately
I am building a simple test to see if I can render multiple separate objects using multiple EBOs, VAOs, and VBOs. I've gotten this to work in the past with just quads, but now that I am using a cube ...
0
votes
1
answer
77
views
Texture stretching over sides of cube but not on front and back sides
My cube:
#define _CRT_SECURE_NO_WARNINGS
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <stdio.h>
#include "stb/stb_image.h"
#include <cglm/cglm.h>
typedef ...
0
votes
1
answer
50
views
Select specific pixels of an image
I'm using C and stb_image, and image data is stored in an unsigned char* where a group of 4 elements represents a pixel, with r, g, b, and a channels respectively. I'm trying to get pixels of part of ...
-2
votes
1
answer
153
views
how to apply gaussian filter correctly
I'm trying to implement Canny edge detection in C++ using only stb_image and no third-party libraries. Currently, I'm stuck at the Gaussian blur step. When I apply it to a grayscale image, the top ...
-1
votes
1
answer
156
views
OpenGL shows black texture on quad [closed]
No matter what i try , i cant seem to make the quad show any textures, tried with solid color in the fragshader works fine, tried drawing the gradient tex coords worked fine .. as soon as i introduced ...
1
vote
1
answer
95
views
Black screen when rendering PNG texture in openGL
When trying to render a PNG file as a texture in OpenGL, I am only drawing a black screen.
If I feed the tex coord data straight into a colour in the fragment shader, I can render a shaded cube.
I ...