From cd11345693fcec821ae754abe1517ff962bc71ec Mon Sep 17 00:00:00 2001 From: John Bowler Date: Wed, 16 Feb 2011 06:15:13 -0600 Subject: [PATCH] [devel] Correct png_get_current_row_number documentation --- libpng-manual.txt | 18 ++++++++++++++++-- libpng.3 | 18 ++++++++++++++++-- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/libpng-manual.txt b/libpng-manual.txt index 46f9a16aa..a01dd54b3 100644 --- a/libpng-manual.txt +++ b/libpng-manual.txt @@ -1563,6 +1563,14 @@ supported if user transforms are supported, secondly they may well return unexpected results unless the row is actually being processed at the moment they are called. +With interlaced +images the value returned is the row in the input sub-image image. Use +PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to +find the output pixel (x,y) given an interlaced sub-image pixel (row,col,pass). + +The discussion of interlace handling above contains more information on how to +use these values. + You can also set up a pointer to a user structure for use by your callback function, and you can inform libpng that your transform function will change the number of channels or bit depth with the @@ -2821,9 +2829,15 @@ libpng also supplies an information routine that may be called from your callback: png_get_current_row_number(png_ptr); + png_get_current_pass_number(png_ptr); -This returns the current row passed to the transform. Even with interlaced -images the value returned is the row in the final output image. +This returns the current row passed to the transform. With interlaced +images the value returned is the row in the input sub-image image. Use +PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to +find the output pixel (x,y) given an interlaced sub-image pixel (row,col,pass). + +The discussion of interlace handling above contains more information on how to +use these values. You can also set up a pointer to a user structure for use by your callback function. diff --git a/libpng.3 b/libpng.3 index 1607fabbd..999ed3934 100644 --- a/libpng.3 +++ b/libpng.3 @@ -2490,6 +2490,14 @@ supported if user transforms are supported, secondly they may well return unexpected results unless the row is actually being processed at the moment they are called. +With interlaced +images the value returned is the row in the input sub-image image. Use +PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to +find the output pixel (x,y) given an interlaced sub-image pixel (row,col,pass). + +The discussion of interlace handling above contains more information on how to +use these values. + You can also set up a pointer to a user structure for use by your callback function, and you can inform libpng that your transform function will change the number of channels or bit depth with the @@ -3748,9 +3756,15 @@ libpng also supplies an information routine that may be called from your callback: png_get_current_row_number(png_ptr); + png_get_current_pass_number(png_ptr); -This returns the current row passed to the transform. Even with interlaced -images the value returned is the row in the final output image. +This returns the current row passed to the transform. With interlaced +images the value returned is the row in the input sub-image image. Use +PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to +find the output pixel (x,y) given an interlaced sub-image pixel (row,col,pass). + +The discussion of interlace handling above contains more information on how to +use these values. You can also set up a pointer to a user structure for use by your callback function.