driedfruit / sdl_savepng Goto Github PK
View Code? Open in Web Editor NEWMinimal libpng interface to save SDL_Surfaces as PNG files.
Minimal libpng interface to save SDL_Surfaces as PNG files.
I find some times if you want to save a surface is not argb format(such as abgr), the saved png is not what you want. So I temporarily add some convert code to the save function
int SDL_SavePNG_RW(SDL_Surface *src, SDL_RWops *dst, int freedst)
{
SDL_Surface *surface = SDL_CreateRGBSurface(0, src->w, src->h, 32,
rmask, gmask, bmask, amask);
SDL_Rect rect = {0, 0, src->w, src->h};
SDL_LowerBlit(src, &rect, surface, &rect);
Hi, I've been trying to find a way to set pixels per inch, but despite my best efforts there's nothing available. Do you have any knowhow about how to set them? I'd love to see PPI as an option in a custom version of this library, thanks!
Hi, I'm writing a networked application that would benefit from an easy way to compress a SDL surface to a character string, so it can be sent over a network socket. I haven't spent a ton of time dissecting this library, but I'm slowly making sense of the libPNG calls. If you would be able to create a function similar to SDL_SavePNG that performs a similar function but stores the output of the compressed image in a string of char (or uchar or uint8_t), that would be extremely useful.
Right now, I'm copying uncompressed data over the network. I guess I can use zlib or something to reduce bandwidth, but the app saves in PNG, so native compression would be nice.
Thanks for your work! This library is dead simple and works great for saving files!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.