Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

C++ library to read/write Truevision TGA/TARGA files

License

NotificationsYou must be signed in to change notification settings

aseprite/tga

Repository files navigation

buildMIT Licensed

Library to read/writeTruevision TGA/TARGA files.Tested withlibfuzzer.

Example:

#include"tga/tga.h"#include<cstdio>#include<vector>intmain(int argc,char* argv[]){if (argc <2)return1;  FILE* f =std::fopen(argv[1],"rb");  tga::StdioFileInterfacefile(f);  tga::Decoderdecoder(&file);  tga::Header header;if (!decoder.readHeader(header))return2;  tga::Image image;  image.bytesPerPixel = header.bytesPerPixel();  image.rowstride = header.width * header.bytesPerPixel();  std::vector<uint8_t>buffer(image.rowstride * header.height);  image.pixels = &buffer[0];if (!decoder.readImage(header, image,nullptr))return3;// Optional post-process to fix the alpha channel in// some TGA files where alpha=0 for all pixels when// it shouldn't.  decoder.postProcessImage(header, image);return0;}

About

C++ library to read/write Truevision TGA/TARGA files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp