summaryrefslogtreecommitdiffstats
path: root/src/kernel/tqpngio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/tqpngio.cpp')
-rw-r--r--src/kernel/tqpngio.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/kernel/tqpngio.cpp b/src/kernel/tqpngio.cpp
index cf4d5ca60..3bc0de639 100644
--- a/src/kernel/tqpngio.cpp
+++ b/src/kernel/tqpngio.cpp
@@ -165,7 +165,7 @@ void setup_qt( TQImage& image, png_structp png_ptr, png_infop info_ptr, float sc
if (!image.create(width, height, 32))
return;
- image.setAlphaBuffer(TRUE);
+ image.setAlphaBuffer(true);
if (TQImage::systemByteOrder() == TQImage::BigEndian)
png_set_swap_alpha(png_ptr);
@@ -193,7 +193,7 @@ void setup_qt( TQImage& image, png_structp png_ptr, png_infop info_ptr, float sc
const int g = info_ptr->trans_values.gray;
#endif
if (g < ncols) {
- image.setAlphaBuffer(TRUE);
+ image.setAlphaBuffer(true);
image.setColor(g, image.color(g) & TQT_RGB_MASK);
}
}
@@ -221,7 +221,7 @@ void setup_qt( TQImage& image, png_structp png_ptr, png_infop info_ptr, float sc
return;
int i = 0;
if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) {
- image.setAlphaBuffer( TRUE );
+ image.setAlphaBuffer( true );
#if PNG_LIBPNG_VER>=10500
while ( i < info_ptr_num_trans ) {
@@ -287,7 +287,7 @@ void setup_qt( TQImage& image, png_structp png_ptr, png_infop info_ptr, float sc
PNG_FILLER_BEFORE : PNG_FILLER_AFTER);
// We want 4 bytes, but it isn't an alpha channel
} else {
- image.setAlphaBuffer(TRUE);
+ image.setAlphaBuffer(true);
}
if ( TQImage::systemByteOrder() == TQImage::BigEndian ) {
@@ -438,7 +438,7 @@ png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)
while ( n-- && tqAlpha(*c++)==0xff )
;
if ( n<0 ) // LIAR!
- image.setAlphaBuffer(FALSE);
+ image.setAlphaBuffer(false);
}
iio->setImage(image);
@@ -531,7 +531,7 @@ bool TQPNGImageWriter::writeImage(const TQImage& image, int quality_in, int off_
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING,0,0,0);
if (!png_ptr) {
- return FALSE;
+ return false;
}
png_set_error_fn(png_ptr, 0, 0, qt_png_warning);
@@ -539,7 +539,7 @@ bool TQPNGImageWriter::writeImage(const TQImage& image, int quality_in, int off_
info_ptr = png_create_info_struct(png_ptr);
if (!info_ptr) {
png_destroy_write_struct(&png_ptr, 0);
- return FALSE;
+ return false;
}
#if PNG_LIBPNG_VER>=10500
@@ -548,7 +548,7 @@ bool TQPNGImageWriter::writeImage(const TQImage& image, int quality_in, int off_
if (setjmp(png_ptr->jmpbuf)) {
#endif /* LIBPNG 1.5 */
png_destroy_write_struct(&png_ptr, &info_ptr);
- return FALSE;
+ return false;
}
int quality = quality_in;
@@ -673,14 +673,14 @@ bool TQPNGImageWriter::writeImage(const TQImage& image, int quality_in, int off_
#ifndef TQT_NO_IMAGE_TEXT
// Write short texts early.
- set_text(image,png_ptr,info_ptr,TRUE);
+ set_text(image,png_ptr,info_ptr,true);
#endif
png_write_info(png_ptr, info_ptr);
#ifndef TQT_NO_IMAGE_TEXT
// Write long texts later.
- set_text(image,png_ptr,info_ptr,FALSE);
+ set_text(image,png_ptr,info_ptr,false);
#endif
if ( image.depth() != 1 )
@@ -733,7 +733,7 @@ bool TQPNGImageWriter::writeImage(const TQImage& image, int quality_in, int off_
png_destroy_write_struct(&png_ptr, &info_ptr);
- return TRUE;
+ return true;
}
static
@@ -816,11 +816,11 @@ bool TQPNGImagePacker::packImage(const TQImage& img)
TQRgb** pjt = (TQRgb**)previous.jumpTable();
// Find left edge of change
- done = FALSE;
+ done = false;
for (minx = 0; minx < w && !done; minx++) {
for (int ty = 0; ty < h; ty++) {
if ( jt[ty][minx] != pjt[ty][minx] ) {
- done = TRUE;
+ done = true;
break;
}
}
@@ -828,11 +828,11 @@ bool TQPNGImagePacker::packImage(const TQImage& img)
minx--;
// Find right edge of change
- done = FALSE;
+ done = false;
for (maxx = w-1; maxx >= 0 && !done; maxx--) {
for (int ty = 0; ty < h; ty++) {
if ( jt[ty][maxx] != pjt[ty][maxx] ) {
- done = TRUE;
+ done = true;
break;
}
}
@@ -840,11 +840,11 @@ bool TQPNGImagePacker::packImage(const TQImage& img)
maxx++;
// Find top edge of change
- done = FALSE;
+ done = false;
for (miny = 0; miny < h && !done; miny++) {
for (int tx = 0; tx < w; tx++) {
if ( jt[miny][tx] != pjt[miny][tx] ) {
- done = TRUE;
+ done = true;
break;
}
}
@@ -852,11 +852,11 @@ bool TQPNGImagePacker::packImage(const TQImage& img)
miny--;
// Find right edge of change
- done = FALSE;
+ done = false;
for (maxy = h-1; maxy >= 0 && !done; maxy--) {
for (int tx = 0; tx < w; tx++) {
if ( jt[maxy][tx] != pjt[maxy][tx] ) {
- done = TRUE;
+ done = true;
break;
}
}
@@ -876,7 +876,7 @@ bool TQPNGImagePacker::packImage(const TQImage& img)
TQImage diff(dw, dh, 32);
- diff.setAlphaBuffer(TRUE);
+ diff.setAlphaBuffer(true);
int x, y;
if ( alignx < 1 )
alignx = 1;
@@ -915,10 +915,10 @@ bool TQPNGImagePacker::packImage(const TQImage& img)
diff = diff.convertDepth(depth,convflags);
if ( !writeImage(diff, minx, miny) )
- return FALSE;
+ return false;
}
previous = image;
- return TRUE;
+ return true;
}
@@ -1239,14 +1239,14 @@ void TQPNGFormat::end(png_structp png, png_infop info)
static bool skip(png_uint_32& max, png_bytep& data)
{
while (*data) {
- if ( !max ) return FALSE;
+ if ( !max ) return false;
max--;
data++;
}
- if ( !max ) return FALSE;
+ if ( !max ) return false;
max--;
data++; // skip to after NUL
- return TRUE;
+ return true;
}
#endif
*/
@@ -1317,7 +1317,7 @@ static TQPNGFormatType* globalPngFormatTypeObject = 0;
#endif // TQT_NO_ASYNC_IMAGE_IO
-static bool done = FALSE;
+static bool done = false;
void qCleanupPngIO()
{
#ifndef TQT_NO_ASYNC_IMAGE_IO
@@ -1326,13 +1326,13 @@ void qCleanupPngIO()
globalPngFormatTypeObject = 0;
}
#endif
- done = FALSE;
+ done = false;
}
void qInitPngIO()
{
if ( !done ) {
- done = TRUE;
+ done = true;
TQImageIO::defineIOHandler( "PNG", "^.PNG\r", 0, read_png_image,
write_png_image);
#ifndef TQT_NO_ASYNC_IMAGE_IO