diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-10-08 17:45:23 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-10-08 17:45:23 +0000 |
commit | bb4ba2586d4cfe9302278a427ee4cf7a89aef53b (patch) | |
tree | e48d17b2acafd26e2367c33d96d56cf58eb1f858 /converter/other/srftopam.c | |
parent | 4b091760fddc73ffc877563b445599db21557e78 (diff) | |
download | netpbm-mirror-bb4ba2586d4cfe9302278a427ee4cf7a89aef53b.tar.gz netpbm-mirror-bb4ba2586d4cfe9302278a427ee4cf7a89aef53b.tar.xz netpbm-mirror-bb4ba2586d4cfe9302278a427ee4cf7a89aef53b.zip |
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4736 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/srftopam.c')
-rw-r--r-- | converter/other/srftopam.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/converter/other/srftopam.c b/converter/other/srftopam.c index efe55253..78d535fb 100644 --- a/converter/other/srftopam.c +++ b/converter/other/srftopam.c @@ -82,18 +82,21 @@ srfRed(uint16_t const pixel) { } + static unsigned int srfGrn(uint16_t const pixel) { return ((pixel >> 6) & 0x1f) << 3; } + static unsigned int srfBlu(uint16_t const pixel) { return ((pixel >> 0) & 0x1f) << 3; } + static uint8_t srfAlpha(uint8_t const d) { @@ -130,7 +133,7 @@ writeRaster(struct pam * const pamP, uint16_t const alpha = imgP->alpha.data[rowStart + col]; assert(col < pamP->width); - + tuplerow[col][PAM_RED_PLANE] = srfRed(data); tuplerow[col][PAM_GRN_PLANE] = srfGrn(data); tuplerow[col][PAM_BLU_PLANE] = srfBlu(data); @@ -142,7 +145,7 @@ writeRaster(struct pam * const pamP, tuplerow[col][PAM_GRN_PLANE] = 0; tuplerow[col][PAM_BLU_PLANE] = 0; tuplerow[col][PAM_TRN_PLANE] = 0; - } + } pnm_writepamrow(pamP, tuplerow); } |