Add LICENSE
This commit is contained in:
24
LICENSE
Normal file
24
LICENSE
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
allegro_qoi
|
||||||
|
Copyright © 2025 Canithesis Interactive
|
||||||
|
|
||||||
|
Uses code from qoi.h
|
||||||
|
Copyright (c) 2022 Dominic Szablewski
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice (including the next
|
||||||
|
paragraph) shall be included in all copies or substantial portions of the
|
||||||
|
Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
DEALINGS IN THE SOFTWARE.
|
||||||
@@ -36,7 +36,7 @@ ALLEGRO_BITMAP* _al_load_qoi_f(ALLEGRO_FILE* file, int flags) {
|
|||||||
ALLEGRO_BITMAP* bmp = al_create_bitmap(meta.width, meta.height);
|
ALLEGRO_BITMAP* bmp = al_create_bitmap(meta.width, meta.height);
|
||||||
ALLEGRO_LOCKED_REGION* lock = al_lock_bitmap(
|
ALLEGRO_LOCKED_REGION* lock = al_lock_bitmap(
|
||||||
bmp, fmt,
|
bmp, fmt,
|
||||||
ALLEGRO_LOCK_READWRITE
|
ALLEGRO_LOCK_WRITEONLY
|
||||||
);
|
);
|
||||||
al_set_new_bitmap_flags(oldflags);
|
al_set_new_bitmap_flags(oldflags);
|
||||||
if (!lock) return NULL;
|
if (!lock) return NULL;
|
||||||
|
|||||||
9
sample.c
9
sample.c
@@ -1,6 +1,6 @@
|
|||||||
// This program simply loads a QOI file into Allegro
|
// This program simply loads a QOI file into Allegro
|
||||||
// as a texture and then dumps the texture data as a PNG.
|
// as a texture and then dumps the texture data as a PNG.
|
||||||
// Take notice of lines 26 and 27. You only need to initialize
|
// Take notice of lines 32 and 33. You only need to initialize
|
||||||
// the QOI plugin (this registers the function hooks that Allegro
|
// the QOI plugin (this registers the function hooks that Allegro
|
||||||
// will use whenever you want to I/O on a filename ending in .qoi)
|
// will use whenever you want to I/O on a filename ending in .qoi)
|
||||||
//
|
//
|
||||||
@@ -21,10 +21,17 @@ int main(int argc, char **argv) {
|
|||||||
printf("Usage: sample <filename>\n");
|
printf("Usage: sample <filename>\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
al_init();
|
al_init();
|
||||||
al_init_image_addon();
|
al_init_image_addon();
|
||||||
al_init_qoi();
|
al_init_qoi();
|
||||||
|
|
||||||
|
// We don't want to multiply color by alpha because
|
||||||
|
// we're writing back to another image here, in a
|
||||||
|
// game you would leave this flag unset.
|
||||||
|
al_set_new_bitmap_flags(ALLEGRO_NO_PREMULTIPLIED_ALPHA);
|
||||||
ALLEGRO_BITMAP* bmp = al_load_bitmap(argv[1]);
|
ALLEGRO_BITMAP* bmp = al_load_bitmap(argv[1]);
|
||||||
|
|
||||||
al_save_bitmap("out.png", bmp);
|
al_save_bitmap("out.png", bmp);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
sample_AlphaMultiply.qoi
Normal file
BIN
sample_AlphaMultiply.qoi
Normal file
Binary file not shown.
Reference in New Issue
Block a user