tga

Problems converting tga files to black and white

本秂侑毒 提交于 2019-12-25 17:38:07
问题 I have been trying to make this program to convert a tga image for color into black and white. But i have no clue how to go about it. I am verry new to C and have yet to get the hang of the syntax and even proper usage of ubuntu. I think my problem is somthing with tha tga files header cant be read. Because the result i get when trying this program on a tga file is an unopenable picture with no height. "height = 0". Is there some good links for one to read up on C? #include <inttypes.h>

three.js: MTLLoader doesn't load tga textures

青春壹個敷衍的年華 提交于 2019-12-11 05:13:06
问题 I have an export of some .obj files and corresponding .mtl files. Textures are in .tga format in the same folder. Here is the code I use to load all my .obj : function addCar(modelPath, modelName) { var mtlLoader = new THREE.MTLLoader(); mtlLoader.setPath(modelPath); for (var i = 0; i <= 2; i++) { loadObject(mtlLoader, modelPath, modelName, i); } } function loadObject(loader, path, name, i) { var objectName = name + i + '.obj'; loader.load(name + i + '.mtl', function (materials) { materials

Load 24 bit TGA

风格不统一 提交于 2019-12-11 03:06:32
问题 I wrote a TGA loader to load TGA files. It loads and saves 32-bit TGA files just fine but when it comes to loading and saving 24-bit, it messed up. Example TGA 24-bit file from Photoshop: My output: Any idea what is wrong with it? I did the padding the same way as my bitmap loader and it works but the TGA doesn't.. :S The code below can compile and load TGA's just in case anyone is wanting to test it. #include <iostream> #include <vector> #include <stdexcept> #include <fstream> #include

how to get the direction of tga file in java

≡放荡痞女 提交于 2019-12-10 15:23:15
问题 I have read Wiki http://en.wikipedia.org/wiki/Truevision_TGA and I know that the 5-4 bits of the Eighteenth byte of tga file represent the direction of tga file. So, there is 4 permutations(00,01,10,11) to show us the direction, which direction does each permutation stand for? 回答1: From the PDF Truevision TGAª — FILE FORMAT SPECIFICATION — Version 2.0 linked on the Wikipedia page. Bits 5 & 4: These bits are used to indicate the order in which pixel data is transferred from the file to the

Loading a TGA File and Using it with OpenGL

╄→尐↘猪︶ㄣ 提交于 2019-12-10 10:14:27
问题 I currently am trying to load a tag file with c++ and rendering it with OpenGL. Currently the colors are all mixed up (red becomes blue, green becomes red, and blue becomes green). My current code for putting it into the video memory is. glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, data); Where the data is the pixel data and the rest is self explanatory. The files are saved with no compression are in 24 bits saved from photoshop. 回答1: Your glTexImage2D is

Java TGA loader

末鹿安然 提交于 2019-11-30 04:14:23
问题 I am looking for a small and free TGA image loading class or library for java. Ideally the result is a BufferedImage. Yes, I have already googled, but most results are outdated, or are quite big libraries that contain a lot of other stuff i dont need. I am looking for something small and simple that reads just TGA images. Thanks! 回答1: We use this class copied from some open source project to read TGA files. It's really old. It can only handle Targa files with most basic encoding. Give it a