diff --git a/rawzor_lin32/rwz_sdk.h b/rawzor_lin32/rwz_sdk.h index ac5dbcf71..c047e4723 100755 --- a/rawzor_lin32/rwz_sdk.h +++ b/rawzor_lin32/rwz_sdk.h @@ -1,81 +1,81 @@ -//Copyright (c)2008 Sachin Garg. All Rights Reserved. -//http://www.rawzor.com/ sachingarg@rawzor.com - -#ifndef _rawzor_sdk_pub_h -#define _rawzor_sdk_pub_h - -#ifdef _MSC_VER - #ifdef __export - #define _declspec __declspec(dllexport) - #else - #define _declspec - #endif -#else - #ifdef __export - #define _declspec __attribute__ ((visibility("default"),cdecl)) - #else - #define _declspec __attribute__ ((cdecl)) - #endif - #define __cdecl -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Checks if the file loaded in 'data' is a valid rawzor compressed - file that this version of rawzor can decompress. If the file can - be decompressed returns 0, a positive error code on error. - Also gets size of uncompressed raw file. - - NOTE: You don't have to load the entire rwz file in memory just to check - that if its a valid rwz file. This function needs only first 50 bytes, - set rwz_size to size of memory buffer. - - 1 Not a rwz compressed file - 2 A rwz file that needs a newer version of rawzor SDK to decompress - (>2 means other errors) -*/ -_declspec int __cdecl m_rwz_check(char *rwz_data,int rwz_size, int *raw_size); - - -/* Decompress a rzw file to get the uncompressed raw image file. - Returns 0 on success, a positive error code on error. -*/ -_declspec int __cdecl m_rwz_decompress(char *rwz_data,int rwz_size,char *raw_data,int raw_size); - - -/* Decompress only the raw image's meta data. Recreates the original raw file - except the raw pixel data and the embedded thumbnail. Use this function to - get quick access to raw file's meta information when the application - doesn't needs access to pixel data or thumbnail. - - Returns 0 on success, a positive error code on error. -*/ -_declspec int __cdecl m_rwz_get_meta_only(char *rwz_data,int rwz_size,char *raw_data,int raw_size); - - -/* Decompress only the raw image's meta data and embedded thumbnail (if any). - Recreates the original raw file including the embedded thumbnail but except - the raw pixel data. Use this function to get quick access to raw file's - meta information or thumbnail when the application doesn't needs access to - raw pixel data. - - Returns 0 on success, a positive error code on error. -*/ -_declspec int __cdecl m_rwz_get_meta_and_thumbnail(char *rwz_data,int rwz_size,char *raw_data,int raw_size); - - -/* Returns the version of SDK core. Can be used for diagnostics or to - verify compatibility with SDK when manually parsing .rwz files. - - SDK cannot open .rwz files which need a newer version of SDK, this is - also checked by m_rwz_check above. -*/ -_declspec int __cdecl rwz_sdk_get_max_version(); - -#ifdef __cplusplus -} -#endif - -#endif +//Copyright (c)2008 Sachin Garg. All Rights Reserved. +//http://www.rawzor.com/ sachingarg@rawzor.com + +#ifndef _rawzor_sdk_pub_h +#define _rawzor_sdk_pub_h + +#ifdef _MSC_VER + #ifdef __export + #define _declspec __declspec(dllexport) + #else + #define _declspec + #endif +#else + #ifdef __export + #define _declspec __attribute__ ((visibility("default"),cdecl)) + #else + #define _declspec __attribute__ ((cdecl)) + #endif + #define __cdecl +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Checks if the file loaded in 'data' is a valid rawzor compressed + file that this version of rawzor can decompress. If the file can + be decompressed returns 0, a positive error code on error. + Also gets size of uncompressed raw file. + + NOTE: You don't have to load the entire rwz file in memory just to check + that if its a valid rwz file. This function needs only first 50 bytes, + set rwz_size to size of memory buffer. + + 1 Not a rwz compressed file + 2 A rwz file that needs a newer version of rawzor SDK to decompress + (>2 means other errors) +*/ +_declspec int __cdecl m_rwz_check(char *rwz_data,int rwz_size, int *raw_size); + + +/* Decompress a rzw file to get the uncompressed raw image file. + Returns 0 on success, a positive error code on error. +*/ +_declspec int __cdecl m_rwz_decompress(char *rwz_data,int rwz_size,char *raw_data,int raw_size); + + +/* Decompress only the raw image's meta data. Recreates the original raw file + except the raw pixel data and the embedded thumbnail. Use this function to + get quick access to raw file's meta information when the application + doesn't needs access to pixel data or thumbnail. + + Returns 0 on success, a positive error code on error. +*/ +_declspec int __cdecl m_rwz_get_meta_only(char *rwz_data,int rwz_size,char *raw_data,int raw_size); + + +/* Decompress only the raw image's meta data and embedded thumbnail (if any). + Recreates the original raw file including the embedded thumbnail but except + the raw pixel data. Use this function to get quick access to raw file's + meta information or thumbnail when the application doesn't needs access to + raw pixel data. + + Returns 0 on success, a positive error code on error. +*/ +_declspec int __cdecl m_rwz_get_meta_and_thumbnail(char *rwz_data,int rwz_size,char *raw_data,int raw_size); + + +/* Returns the version of SDK core. Can be used for diagnostics or to + verify compatibility with SDK when manually parsing .rwz files. + + SDK cannot open .rwz files which need a newer version of SDK, this is + also checked by m_rwz_check above. +*/ +_declspec int __cdecl rwz_sdk_get_max_version(); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/rawzor_lin64/rwz_sdk.h b/rawzor_lin64/rwz_sdk.h index ac5dbcf71..c047e4723 100755 --- a/rawzor_lin64/rwz_sdk.h +++ b/rawzor_lin64/rwz_sdk.h @@ -1,81 +1,81 @@ -//Copyright (c)2008 Sachin Garg. All Rights Reserved. -//http://www.rawzor.com/ sachingarg@rawzor.com - -#ifndef _rawzor_sdk_pub_h -#define _rawzor_sdk_pub_h - -#ifdef _MSC_VER - #ifdef __export - #define _declspec __declspec(dllexport) - #else - #define _declspec - #endif -#else - #ifdef __export - #define _declspec __attribute__ ((visibility("default"),cdecl)) - #else - #define _declspec __attribute__ ((cdecl)) - #endif - #define __cdecl -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Checks if the file loaded in 'data' is a valid rawzor compressed - file that this version of rawzor can decompress. If the file can - be decompressed returns 0, a positive error code on error. - Also gets size of uncompressed raw file. - - NOTE: You don't have to load the entire rwz file in memory just to check - that if its a valid rwz file. This function needs only first 50 bytes, - set rwz_size to size of memory buffer. - - 1 Not a rwz compressed file - 2 A rwz file that needs a newer version of rawzor SDK to decompress - (>2 means other errors) -*/ -_declspec int __cdecl m_rwz_check(char *rwz_data,int rwz_size, int *raw_size); - - -/* Decompress a rzw file to get the uncompressed raw image file. - Returns 0 on success, a positive error code on error. -*/ -_declspec int __cdecl m_rwz_decompress(char *rwz_data,int rwz_size,char *raw_data,int raw_size); - - -/* Decompress only the raw image's meta data. Recreates the original raw file - except the raw pixel data and the embedded thumbnail. Use this function to - get quick access to raw file's meta information when the application - doesn't needs access to pixel data or thumbnail. - - Returns 0 on success, a positive error code on error. -*/ -_declspec int __cdecl m_rwz_get_meta_only(char *rwz_data,int rwz_size,char *raw_data,int raw_size); - - -/* Decompress only the raw image's meta data and embedded thumbnail (if any). - Recreates the original raw file including the embedded thumbnail but except - the raw pixel data. Use this function to get quick access to raw file's - meta information or thumbnail when the application doesn't needs access to - raw pixel data. - - Returns 0 on success, a positive error code on error. -*/ -_declspec int __cdecl m_rwz_get_meta_and_thumbnail(char *rwz_data,int rwz_size,char *raw_data,int raw_size); - - -/* Returns the version of SDK core. Can be used for diagnostics or to - verify compatibility with SDK when manually parsing .rwz files. - - SDK cannot open .rwz files which need a newer version of SDK, this is - also checked by m_rwz_check above. -*/ -_declspec int __cdecl rwz_sdk_get_max_version(); - -#ifdef __cplusplus -} -#endif - -#endif +//Copyright (c)2008 Sachin Garg. All Rights Reserved. +//http://www.rawzor.com/ sachingarg@rawzor.com + +#ifndef _rawzor_sdk_pub_h +#define _rawzor_sdk_pub_h + +#ifdef _MSC_VER + #ifdef __export + #define _declspec __declspec(dllexport) + #else + #define _declspec + #endif +#else + #ifdef __export + #define _declspec __attribute__ ((visibility("default"),cdecl)) + #else + #define _declspec __attribute__ ((cdecl)) + #endif + #define __cdecl +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Checks if the file loaded in 'data' is a valid rawzor compressed + file that this version of rawzor can decompress. If the file can + be decompressed returns 0, a positive error code on error. + Also gets size of uncompressed raw file. + + NOTE: You don't have to load the entire rwz file in memory just to check + that if its a valid rwz file. This function needs only first 50 bytes, + set rwz_size to size of memory buffer. + + 1 Not a rwz compressed file + 2 A rwz file that needs a newer version of rawzor SDK to decompress + (>2 means other errors) +*/ +_declspec int __cdecl m_rwz_check(char *rwz_data,int rwz_size, int *raw_size); + + +/* Decompress a rzw file to get the uncompressed raw image file. + Returns 0 on success, a positive error code on error. +*/ +_declspec int __cdecl m_rwz_decompress(char *rwz_data,int rwz_size,char *raw_data,int raw_size); + + +/* Decompress only the raw image's meta data. Recreates the original raw file + except the raw pixel data and the embedded thumbnail. Use this function to + get quick access to raw file's meta information when the application + doesn't needs access to pixel data or thumbnail. + + Returns 0 on success, a positive error code on error. +*/ +_declspec int __cdecl m_rwz_get_meta_only(char *rwz_data,int rwz_size,char *raw_data,int raw_size); + + +/* Decompress only the raw image's meta data and embedded thumbnail (if any). + Recreates the original raw file including the embedded thumbnail but except + the raw pixel data. Use this function to get quick access to raw file's + meta information or thumbnail when the application doesn't needs access to + raw pixel data. + + Returns 0 on success, a positive error code on error. +*/ +_declspec int __cdecl m_rwz_get_meta_and_thumbnail(char *rwz_data,int rwz_size,char *raw_data,int raw_size); + + +/* Returns the version of SDK core. Can be used for diagnostics or to + verify compatibility with SDK when manually parsing .rwz files. + + SDK cannot open .rwz files which need a newer version of SDK, this is + also checked by m_rwz_check above. +*/ +_declspec int __cdecl rwz_sdk_get_max_version(); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/rawzor_mac/rwz_sdk.h b/rawzor_mac/rwz_sdk.h index ac5dbcf71..c047e4723 100644 --- a/rawzor_mac/rwz_sdk.h +++ b/rawzor_mac/rwz_sdk.h @@ -1,81 +1,81 @@ -//Copyright (c)2008 Sachin Garg. All Rights Reserved. -//http://www.rawzor.com/ sachingarg@rawzor.com - -#ifndef _rawzor_sdk_pub_h -#define _rawzor_sdk_pub_h - -#ifdef _MSC_VER - #ifdef __export - #define _declspec __declspec(dllexport) - #else - #define _declspec - #endif -#else - #ifdef __export - #define _declspec __attribute__ ((visibility("default"),cdecl)) - #else - #define _declspec __attribute__ ((cdecl)) - #endif - #define __cdecl -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Checks if the file loaded in 'data' is a valid rawzor compressed - file that this version of rawzor can decompress. If the file can - be decompressed returns 0, a positive error code on error. - Also gets size of uncompressed raw file. - - NOTE: You don't have to load the entire rwz file in memory just to check - that if its a valid rwz file. This function needs only first 50 bytes, - set rwz_size to size of memory buffer. - - 1 Not a rwz compressed file - 2 A rwz file that needs a newer version of rawzor SDK to decompress - (>2 means other errors) -*/ -_declspec int __cdecl m_rwz_check(char *rwz_data,int rwz_size, int *raw_size); - - -/* Decompress a rzw file to get the uncompressed raw image file. - Returns 0 on success, a positive error code on error. -*/ -_declspec int __cdecl m_rwz_decompress(char *rwz_data,int rwz_size,char *raw_data,int raw_size); - - -/* Decompress only the raw image's meta data. Recreates the original raw file - except the raw pixel data and the embedded thumbnail. Use this function to - get quick access to raw file's meta information when the application - doesn't needs access to pixel data or thumbnail. - - Returns 0 on success, a positive error code on error. -*/ -_declspec int __cdecl m_rwz_get_meta_only(char *rwz_data,int rwz_size,char *raw_data,int raw_size); - - -/* Decompress only the raw image's meta data and embedded thumbnail (if any). - Recreates the original raw file including the embedded thumbnail but except - the raw pixel data. Use this function to get quick access to raw file's - meta information or thumbnail when the application doesn't needs access to - raw pixel data. - - Returns 0 on success, a positive error code on error. -*/ -_declspec int __cdecl m_rwz_get_meta_and_thumbnail(char *rwz_data,int rwz_size,char *raw_data,int raw_size); - - -/* Returns the version of SDK core. Can be used for diagnostics or to - verify compatibility with SDK when manually parsing .rwz files. - - SDK cannot open .rwz files which need a newer version of SDK, this is - also checked by m_rwz_check above. -*/ -_declspec int __cdecl rwz_sdk_get_max_version(); - -#ifdef __cplusplus -} -#endif - -#endif +//Copyright (c)2008 Sachin Garg. All Rights Reserved. +//http://www.rawzor.com/ sachingarg@rawzor.com + +#ifndef _rawzor_sdk_pub_h +#define _rawzor_sdk_pub_h + +#ifdef _MSC_VER + #ifdef __export + #define _declspec __declspec(dllexport) + #else + #define _declspec + #endif +#else + #ifdef __export + #define _declspec __attribute__ ((visibility("default"),cdecl)) + #else + #define _declspec __attribute__ ((cdecl)) + #endif + #define __cdecl +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Checks if the file loaded in 'data' is a valid rawzor compressed + file that this version of rawzor can decompress. If the file can + be decompressed returns 0, a positive error code on error. + Also gets size of uncompressed raw file. + + NOTE: You don't have to load the entire rwz file in memory just to check + that if its a valid rwz file. This function needs only first 50 bytes, + set rwz_size to size of memory buffer. + + 1 Not a rwz compressed file + 2 A rwz file that needs a newer version of rawzor SDK to decompress + (>2 means other errors) +*/ +_declspec int __cdecl m_rwz_check(char *rwz_data,int rwz_size, int *raw_size); + + +/* Decompress a rzw file to get the uncompressed raw image file. + Returns 0 on success, a positive error code on error. +*/ +_declspec int __cdecl m_rwz_decompress(char *rwz_data,int rwz_size,char *raw_data,int raw_size); + + +/* Decompress only the raw image's meta data. Recreates the original raw file + except the raw pixel data and the embedded thumbnail. Use this function to + get quick access to raw file's meta information when the application + doesn't needs access to pixel data or thumbnail. + + Returns 0 on success, a positive error code on error. +*/ +_declspec int __cdecl m_rwz_get_meta_only(char *rwz_data,int rwz_size,char *raw_data,int raw_size); + + +/* Decompress only the raw image's meta data and embedded thumbnail (if any). + Recreates the original raw file including the embedded thumbnail but except + the raw pixel data. Use this function to get quick access to raw file's + meta information or thumbnail when the application doesn't needs access to + raw pixel data. + + Returns 0 on success, a positive error code on error. +*/ +_declspec int __cdecl m_rwz_get_meta_and_thumbnail(char *rwz_data,int rwz_size,char *raw_data,int raw_size); + + +/* Returns the version of SDK core. Can be used for diagnostics or to + verify compatibility with SDK when manually parsing .rwz files. + + SDK cannot open .rwz files which need a newer version of SDK, this is + also checked by m_rwz_check above. +*/ +_declspec int __cdecl rwz_sdk_get_max_version(); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/rawzor_win/rwz_sdk.h b/rawzor_win/rwz_sdk.h index ac5dbcf71..c047e4723 100755 --- a/rawzor_win/rwz_sdk.h +++ b/rawzor_win/rwz_sdk.h @@ -1,81 +1,81 @@ -//Copyright (c)2008 Sachin Garg. All Rights Reserved. -//http://www.rawzor.com/ sachingarg@rawzor.com - -#ifndef _rawzor_sdk_pub_h -#define _rawzor_sdk_pub_h - -#ifdef _MSC_VER - #ifdef __export - #define _declspec __declspec(dllexport) - #else - #define _declspec - #endif -#else - #ifdef __export - #define _declspec __attribute__ ((visibility("default"),cdecl)) - #else - #define _declspec __attribute__ ((cdecl)) - #endif - #define __cdecl -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Checks if the file loaded in 'data' is a valid rawzor compressed - file that this version of rawzor can decompress. If the file can - be decompressed returns 0, a positive error code on error. - Also gets size of uncompressed raw file. - - NOTE: You don't have to load the entire rwz file in memory just to check - that if its a valid rwz file. This function needs only first 50 bytes, - set rwz_size to size of memory buffer. - - 1 Not a rwz compressed file - 2 A rwz file that needs a newer version of rawzor SDK to decompress - (>2 means other errors) -*/ -_declspec int __cdecl m_rwz_check(char *rwz_data,int rwz_size, int *raw_size); - - -/* Decompress a rzw file to get the uncompressed raw image file. - Returns 0 on success, a positive error code on error. -*/ -_declspec int __cdecl m_rwz_decompress(char *rwz_data,int rwz_size,char *raw_data,int raw_size); - - -/* Decompress only the raw image's meta data. Recreates the original raw file - except the raw pixel data and the embedded thumbnail. Use this function to - get quick access to raw file's meta information when the application - doesn't needs access to pixel data or thumbnail. - - Returns 0 on success, a positive error code on error. -*/ -_declspec int __cdecl m_rwz_get_meta_only(char *rwz_data,int rwz_size,char *raw_data,int raw_size); - - -/* Decompress only the raw image's meta data and embedded thumbnail (if any). - Recreates the original raw file including the embedded thumbnail but except - the raw pixel data. Use this function to get quick access to raw file's - meta information or thumbnail when the application doesn't needs access to - raw pixel data. - - Returns 0 on success, a positive error code on error. -*/ -_declspec int __cdecl m_rwz_get_meta_and_thumbnail(char *rwz_data,int rwz_size,char *raw_data,int raw_size); - - -/* Returns the version of SDK core. Can be used for diagnostics or to - verify compatibility with SDK when manually parsing .rwz files. - - SDK cannot open .rwz files which need a newer version of SDK, this is - also checked by m_rwz_check above. -*/ -_declspec int __cdecl rwz_sdk_get_max_version(); - -#ifdef __cplusplus -} -#endif - -#endif +//Copyright (c)2008 Sachin Garg. All Rights Reserved. +//http://www.rawzor.com/ sachingarg@rawzor.com + +#ifndef _rawzor_sdk_pub_h +#define _rawzor_sdk_pub_h + +#ifdef _MSC_VER + #ifdef __export + #define _declspec __declspec(dllexport) + #else + #define _declspec + #endif +#else + #ifdef __export + #define _declspec __attribute__ ((visibility("default"),cdecl)) + #else + #define _declspec __attribute__ ((cdecl)) + #endif + #define __cdecl +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Checks if the file loaded in 'data' is a valid rawzor compressed + file that this version of rawzor can decompress. If the file can + be decompressed returns 0, a positive error code on error. + Also gets size of uncompressed raw file. + + NOTE: You don't have to load the entire rwz file in memory just to check + that if its a valid rwz file. This function needs only first 50 bytes, + set rwz_size to size of memory buffer. + + 1 Not a rwz compressed file + 2 A rwz file that needs a newer version of rawzor SDK to decompress + (>2 means other errors) +*/ +_declspec int __cdecl m_rwz_check(char *rwz_data,int rwz_size, int *raw_size); + + +/* Decompress a rzw file to get the uncompressed raw image file. + Returns 0 on success, a positive error code on error. +*/ +_declspec int __cdecl m_rwz_decompress(char *rwz_data,int rwz_size,char *raw_data,int raw_size); + + +/* Decompress only the raw image's meta data. Recreates the original raw file + except the raw pixel data and the embedded thumbnail. Use this function to + get quick access to raw file's meta information when the application + doesn't needs access to pixel data or thumbnail. + + Returns 0 on success, a positive error code on error. +*/ +_declspec int __cdecl m_rwz_get_meta_only(char *rwz_data,int rwz_size,char *raw_data,int raw_size); + + +/* Decompress only the raw image's meta data and embedded thumbnail (if any). + Recreates the original raw file including the embedded thumbnail but except + the raw pixel data. Use this function to get quick access to raw file's + meta information or thumbnail when the application doesn't needs access to + raw pixel data. + + Returns 0 on success, a positive error code on error. +*/ +_declspec int __cdecl m_rwz_get_meta_and_thumbnail(char *rwz_data,int rwz_size,char *raw_data,int raw_size); + + +/* Returns the version of SDK core. Can be used for diagnostics or to + verify compatibility with SDK when manually parsing .rwz files. + + SDK cannot open .rwz files which need a newer version of SDK, this is + also checked by m_rwz_check above. +*/ +_declspec int __cdecl rwz_sdk_get_max_version(); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/rtdata/languages/Czech b/rtdata/languages/Czech index 69fe26fe4..148d489f6 100644 --- a/rtdata/languages/Czech +++ b/rtdata/languages/Czech @@ -1,635 +1,635 @@ -# -# This file is part of RawTherapee. -# -# Copyright (c) 2004-2010 Gabor Horvath -# -# RawTherapee is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# RawTherapee is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with RawTherapee. If not, see . -# -# czech -# ---------------------------------------- -# 20.1.2008: translated by absolution -# 21.2.2008: updated by mkyral (typos and some missing strings) -# 24.4.2008: updated by mkyral (for version 2.4m1) -# 28.10.2008: updated by mkyral (for version 2.4 beta1) -# -ADJUSTER_RESET_TO_DEFAULT;Vrátit se k původnímu -CURVEEDITOR_FILEDLGFILTERANY;Jakékoliv soubory -CURVEEDITOR_FILEDLGFILTERCURVE;Soubory křivek -CURVEEDITOR_LINEAR;Lineární -CURVEEDITOR_LOADDLGLABEL;Načíst křivku... -CURVEEDITOR_SAVEDLGLABEL;Uložit křivku... -CURVEEDITOR_TOOLTIPLINEAR;Vrátit se k lineární křivce -CURVEEDITOR_TOOLTIPLOAD;Načíst křivku ze souboru -CURVEEDITOR_TOOLTIPSAVE;Uložit současnou křivku -EXIFFILTER_APERTURE;Clona -EXIFFILTER_CAMERA;Aparát -EXIFFILTER_DIALOGLABEL;Filtruj dle Exif -EXIFFILTER_FOCALLEN;Ohnisková vzdálenost -EXIFFILTER_ISO;ISO -EXIFFILTER_LENS;Objektiv -EXIFFILTER_SHUTTER;Rychlost závěrky -EXIFPANEL_ADDEDITHINT;Přidej/Oprav štítek -EXIFPANEL_ADDEDIT;Přidej/Změň -EXIFPANEL_ADDTAGDLG_ENTERVALUE;Vlož hodnotu -EXIFPANEL_ADDTAGDLG_SELECTTAG;Vyber štítek -EXIFPANEL_ADDTAGDLG_TITLE;Přidej/Změň štítek -EXIFPANEL_KEEPHINT;Ulož vybrané štítky při zápisu do souboru -EXIFPANEL_KEEP;Zachovej -EXIFPANEL_REMOVEHINT;Neulož vybrané štítky při zápisu do souboru -EXIFPANEL_REMOVE;Zahoď -EXIFPANEL_RESETALLHINT;Obnov původní hodnoty u všech štítků -EXIFPANEL_RESETALL;Obnov vše -EXIFPANEL_RESETHINT;Obnov původní hodnoty u vybraných štítků -EXIFPANEL_RESET;Obnov -EXIFPANEL_SUBDIRECTORY;Podadresář -FILEBROWSER_APPLYPROFILE;Aplikuj profil -FILEBROWSER_ARRANGEMENTHINT;Přepnutí mezi vertikálním/horizontálním zarovnáním náhledů -FILEBROWSER_CLEARPROFILE;Vymaž profil -FILEBROWSER_COPYPROFILE;Kopíruj profil -FILEBROWSER_DELETEDLGLABEL;Potvrzení smazání souboru -FILEBROWSER_DELETEDLGMSG;Opravdu chcete vymazat %1 souborů? -FILEBROWSER_EMPTYTRASHHINT;Navždy vymaže soubory v koši -FILEBROWSER_EMPTYTRASH;Vysypat koš -FILEBROWSER_EXIFFILTERAPPLYHINT;Zapne/Vypne filtrování dle exif v prohlížeči souborů -FILEBROWSER_EXIFFILTERAPPLY;Použij -FILEBROWSER_EXIFFILTERLABEL;Exif Filtr -FILEBROWSER_EXIFFILTERSETTINGSHINT;Změna nastavení exif filtru -FILEBROWSER_EXIFFILTERSETTINGS;Nastavení -FILEBROWSER_PARTIALPASTEPROFILE;Vlož částečně -FILEBROWSER_PASTEPROFILE;Vlož profil -FILEBROWSER_POPUPCANCELJOB;Zruš úlohu -FILEBROWSER_POPUPMOVEEND;Přesuň na konec fronty -FILEBROWSER_POPUPMOVEHEAD;Přesuň na začátek fronty -FILEBROWSER_POPUPOPEN;Otevři -FILEBROWSER_POPUPPROCESS;Vlož do fronty -FILEBROWSER_POPUPRANK1;Hodnocení 1 -FILEBROWSER_POPUPRANK2;Hodnocení 2 -FILEBROWSER_POPUPRANK3;Hodnocení 3 -FILEBROWSER_POPUPRANK4;Hodnocení 4 -FILEBROWSER_POPUPRANK5;Hodnocení 5 -FILEBROWSER_POPUPREMOVE;Odstraň ze systému souborů -FILEBROWSER_POPUPRENAME;Přejmenuj -FILEBROWSER_POPUPSELECTALL;Vyber vše -FILEBROWSER_POPUPTRASH;Přesuň do koše -FILEBROWSER_POPUPUNRANK;Odstraň hodnocení -FILEBROWSER_POPUPUNTRASH;Vymaž z koše -FILEBROWSER_PROCESSINGSETTINGSHINT;Nastavení formátu souboru a výstupního adresáře -FILEBROWSER_PROCESSINGSETTINGS;Nastavení -FILEBROWSER_RENAMEDLGLABEL;Přejmenování souboru -FILEBROWSER_RENAMEDLGMSG;Přejmenovat soubor "%1" na: -FILEBROWSER_SHOWDIRHINT;Ukaž všechny obrázky v adresáři -FILEBROWSER_SHOWQUEUEHINT;Ukaž obsah fronty -FILEBROWSER_SHOWRANK1HINT;Ukaž obrázky hodnocené 1 hvězdičkou -FILEBROWSER_SHOWRANK2HINT;Ukaž obrázky hodnocené 2 hvězdičkama -FILEBROWSER_SHOWRANK3HINT;Ukaž obrázky hodnocené 3 hvězdičkama -FILEBROWSER_SHOWRANK4HINT;Ukaž obrázky hodnocené 4 hvězdičkama -FILEBROWSER_SHOWRANK5HINT;Ukaž obrázky hodnocené 5 hvězdičkama -FILEBROWSER_SHOWTRASHHINT;Ukaž obsah koše -FILEBROWSER_SHOWUNRANKHINT;Ukaž nehodnocené obrázky -FILEBROWSER_STARTPROCESSINGHINT;Spustí zpracování nebo ukládání obrázků ve frontě -FILEBROWSER_STARTPROCESSING;Spusť zpracování -FILEBROWSER_STOPPROCESSINGHINT;Zastaví zpracovávaní obrázků -FILEBROWSER_STOPPROCESSING;Zastav zpracovávaní -FILEBROWSER_THUMBSIZE;Velikost náhledů -FILEBROWSER_ZOOMINHINT;Zvětší velikost náhledů -FILEBROWSER_ZOOMOUTHINT;Zmenší velikost náhledů -GENERAL_ABOUT;O programu -GENERAL_CANCEL;Storno -GENERAL_DISABLED;Vypnuto -GENERAL_DISABLE;Vypnout -GENERAL_ENABLED;Zapnuto -GENERAL_ENABLE;Zapnout -GENERAL_LANDSCAPE;Na šířku -GENERAL_LOAD;Načíst -GENERAL_NA;n/a -GENERAL_NO;Ne -GENERAL_OK;OK -GENERAL_PORTRAIT;Na výšku -GENERAL_SAVE;Uschovat -GENERAL_YES;Ano -HISTOGRAM_LABEL;Histogram -HISTOGRAM_TOOLTIP_B;Schovej či zobraz histogram pro MODROU -HISTOGRAM_TOOLTIP_G;Schovej či zobraz histogram pro ZELENOU -HISTOGRAM_TOOLTIP_L;Schovej či zobraz histogram pro JAS v CIELAB -HISTOGRAM_TOOLTIP_R;Schovej či zobraz histogram pro ČERVENOU -HISTORY_CHANGED;Změněno -HISTORY_CUSTOMCURVE;Vlastní křivka -HISTORY_DELSNAPSHOT;Odstranit snímek -HISTORY_FROMCLIPBOARD;Ze schránky -HISTORY_LABEL;Historie -HISTORY_MSG_10;Komprese stínů -HISTORY_MSG_11;Tónová křivka -HISTORY_MSG_12;Automatická expozice -HISTORY_MSG_13;Oříznutí exozice -HISTORY_MSG_14;Jas (CIELAB) -HISTORY_MSG_15;Kontrast (CIELAB) -HISTORY_MSG_16;Černá (CIELAB) -HISTORY_MSG_17;Komprese světel (CIELAB) -HISTORY_MSG_18;Komprese stínů (CIELAB) -HISTORY_MSG_19;Tónová křivka (CIELAB) -HISTORY_MSG_1;Obrázek načten -HISTORY_MSG_20;Doostření -HISTORY_MSG_21;Poloměr doostření -HISTORY_MSG_22;Míra doostření -HISTORY_MSG_23;Práh doostření -HISTORY_MSG_24;Doostření pouze v okrajích -HISTORY_MSG_25;Poloměr detekce okrajů při doostření -HISTORY_MSG_26;Tolerance okrajů při doostření -HISTORY_MSG_27;Omezení haló artefatů při doostření -HISTORY_MSG_28;Míra omezení haló artefatů -HISTORY_MSG_29;Metoda doostření -HISTORY_MSG_2;Profil načten -HISTORY_MSG_30;Poloměr dekonvoluce -HISTORY_MSG_31;Míra dekonvoluce -HISTORY_MSG_32;Útlum dekonvoluce -HISTORY_MSG_33;Počet opakování dekonvoluce -HISTORY_MSG_34;Zabránit oříznutí barev -HISTORY_MSG_35;Omezování sytosti -HISTORY_MSG_36;Omezení sytosti -HISTORY_MSG_37;Sytost barev -HISTORY_MSG_38;Metoda vyvážení bílé -HISTORY_MSG_39;Barevná teplota -HISTORY_MSG_3;Profil změněn -HISTORY_MSG_40;Odstín vyvážení bílé -HISTORY_MSG_41;Posun barev "A" -HISTORY_MSG_42;Posun barev "B" -HISTORY_MSG_43;Redukce šumu v jasech -HISTORY_MSG_44;Poloměr redukce šumu v jasech -HISTORY_MSG_45;Okrajová telorence v redukce šumu v jasech -HISTORY_MSG_46;Redukce barevného šumu -HISTORY_MSG_47;Poloměr redukce barevného šumu -HISTORY_MSG_48;Okrajová toleranve v redukci barevného šumu -HISTORY_MSG_49;Redukce barevného šumu s ohledem na okraje -HISTORY_MSG_4;Prohlížení historie -HISTORY_MSG_50;Nástroj Stíny/světla -HISTORY_MSG_51;Zvýraznění světel -HISTORY_MSG_52;Zvýraznění stínů -HISTORY_MSG_53;Tónová rozsah jasů -HISTORY_MSG_54;Tónový rozsah stínů -HISTORY_MSG_55;Místní kontrast -HISTORY_MSG_56;Poloměr světel a stínů -HISTORY_MSG_57;Hrubé otáčení -HISTORY_MSG_58;Horizontální překlopení -HISTORY_MSG_59;Vertikální překlopení -HISTORY_MSG_5;Jas -HISTORY_MSG_60;Otáčení -HISTORY_MSG_61;Otočení -HISTORY_MSG_62;Úprava zkreslení objektivu -HISTORY_MSG_63;Záložka zvolena -HISTORY_MSG_64;Oříznout obrázek -HISTORY_MSG_65;Úprava chromatické vady -HISTORY_MSG_66;Obnovení jasů -HISTORY_MSG_67;Míra obnovení jasů -HISTORY_MSG_68;Metoda obnovení jasů -HISTORY_MSG_69;Pracovní barevný prostor -HISTORY_MSG_6;Kontrast -HISTORY_MSG_70;Výstupní barevný prostor -HISTORY_MSG_71;Vstupní barevný prostor -HISTORY_MSG_72;Úprave vinětace -HISTORY_MSG_73;Míchání kanálů -HISTORY_MSG_74;Míra změny rozměrů -HISTORY_MSG_75;Metoda změny rozměru -HISTORY_MSG_76;Exif Metadata -HISTORY_MSG_77;IPTC Metadata -HISTORY_MSG_78;Data specified for resize -HISTORY_MSG_79;Resize width -HISTORY_MSG_7;Černá -HISTORY_MSG_80;Resize height -HISTORY_MSG_81;Resize enabled -HISTORY_MSG_8;Expoziční korekce -HISTORY_MSG_9;Komprese světel -HISTORY_NEWSNAPSHOTAS;Jako... -HISTORY_NEWSNAPSHOT;Nový snímek -HISTORY_NEWSSDIALOGLABEL;Titulek snímku: -HISTORY_NEWSSDIALOGTITLE;Přidat nový snímek -HISTORY_SETTO;Nastavit na -HISTORY_SNAPSHOT;Snímek -HISTORY_SNAPSHOTS;Snímky -ICMPANEL_FILEDLGFILTERANY;Jakékoliv soubory -ICMPANEL_FILEDLGFILTERICM;Soubory ICC profilů -ICMPANEL_GAMMABEFOREINPUT;Profil provádí Gama korekci -ICMPANEL_INPUTCAMERA;Výchozí profil fotoaparátu -ICMPANEL_INPUTCUSTOM;Vlastní -ICMPANEL_INPUTDLGLABEL;Vyber vstupní ICC profil... -ICMPANEL_INPUTEMBEDDED;Použít vložený profil, pokud je k dispozici -ICMPANEL_INPUTPROFILE;Vstupní profil -ICMPANEL_NOICM;Bez správy barev: sRGB výstup -ICMPANEL_OUTPUTDLGLABEL;Vyber výstupní ICC profil... -ICMPANEL_OUTPUTPROFILE;Výstupní barevný prostor -ICMPANEL_SAVEREFERENCE;Uložit referenční obrázek pro profilování -ICMPANEL_WORKINGPROFILE;Pracovní barevný prostor -IMAGEAREA_DETAILVIEW;Detailní pohled -IPTCPANEL_AUTHOR;Autor -IPTCPANEL_AUTHORHINT;Jméno autora, například spisovatele, fotografa nebo grafika (By-line). -IPTCPANEL_AUTHORSPOSITION;Autorova pozice -IPTCPANEL_AUTHORSPOSITIONHINT;Titul/pozice autora nebo autorů obrázku (By-line Title). -IPTCPANEL_CAPTIONHINT;Textový popis dat (Popis - Shrnutí) -IPTCPANEL_CAPTION;Popis -IPTCPANEL_CAPTIONWRITERHINT;Jméno osoby, která vložila, změnila nebo opravila obrázek nebo popis/shrnutí (Autor - Editor) -IPTCPANEL_CAPTIONWRITER;Popisovač -IPTCPANEL_CATEGORYHINT;Obsah obrázku dle názoru dodavatele (Kategorie). -IPTCPANEL_CATEGORY;Kategorie -IPTCPANEL_CITYHINT;Místo vzniku obrázku (Město). -IPTCPANEL_CITY;Město -IPTCPANEL_COPYHINT;Zkopíruj IPTC nastavení do schránky -IPTCPANEL_COPYRIGHT;Copyright -IPTCPANEL_COPYRIGHTHINT;Autorská práva (Copyright Notice). -IPTCPANEL_COUNTRYHINT;Jméno země/lokace kde byl obrázek vytvořen (Země - Lokace). -IPTCPANEL_COUNTRY;Země -IPTCPANEL_CREDITHINT;Dodavatel obrázku, ne nutně vlastník/autor (Credit). -IPTCPANEL_CREDIT;Zásluhy -IPTCPANEL_DATECREATED;Datum vytvoření -IPTCPANEL_DATECREATEDHINT;Kdy byl obrázek vytvořen; Formát: RRRRMMDD (Datum vytvoření). -IPTCPANEL_EMBEDDEDHINT;Obnov IPTC data z obrázku -IPTCPANEL_EMBEDDED;Uložené -IPTCPANEL_HEADLINEHINT;Uveřejnitelný krátký popis obrázku (Nadpis). -IPTCPANEL_HEADLINE;Nadpis -IPTCPANEL_INSTRUCTIONSHINT;Další instrukce vztahující se k obrázku (Speciální instrukce). -IPTCPANEL_INSTRUCTIONS;Instrukce -IPTCPANEL_KEYWORDSHINT;Jednoslovná hesla popisující obrázek (Klíčová slova). -IPTCPANEL_KEYWORDS;Klíčová slova -IPTCPANEL_PASTEHINT;Vlož IPTC nastavení ze schránky -IPTCPANEL_PROVINCEHINT;Kraj/stát kde byl obrázek vytvořen (Kraj-Stát). -IPTCPANEL_PROVINCE;Kraj -IPTCPANEL_RESETHINT;Obnov výchozí profil -IPTCPANEL_RESET;Obnov -IPTCPANEL_SOURCEHINT;Původní vlastník intelektuálního obsahu obrázku (Zdroj). -IPTCPANEL_SOURCE;Zdroj -IPTCPANEL_SUPPCATEGORIES;Dodat. kategorie -IPTCPANEL_SUPPCATEGORIESHINT;Upřesňující popis obsahu obrázku (Dodatečné kategorie). -IPTCPANEL_TITLEHINT;Zkrácený popis obrázku (Jméno obrázku). -IPTCPANEL_TITLE;Titulek -IPTCPANEL_TRANSREFERENCEHINT;Kód místa, odkud byl převzat originální obrázek (Original Transmission Reference). -IPTCPANEL_TRANSREFERENCE;Trans. Reference -MAIN_BUTTON_EXIT;Exit -MAIN_BUTTON_PREFERENCES;Volby -MAIN_BUTTON_QUEUE;Put to queue -MAIN_BUTTON_SAVEAS;jako... -MAIN_BUTTON_SAVE;Uložit -MAIN_BUTTON_SENDTOEDITOR;Odeslat do editoru -MAIN_FRAME_BATCHQUEUE;Batch Queue -MAIN_FRAME_FILEBROWSER;File Browser -MAIN_FRAME_PLACES_ADD;Add -MAIN_FRAME_PLACES_DEL;Del -MAIN_FRAME_PLACES;Places -MAIN_FRAME_RECENT;Recent Folders -MAIN_MSG_ALREADYEXISTS;Soubor již existuje. -MAIN_MSG_CANNOTLOAD;Nepodařilo se načíst obrázek -MAIN_MSG_CANNOTSAVE;Chyba při ukládání souboru. -MAIN_MSG_CANNOTSTARTEDITOR;Can not start editor. -MAIN_MSG_CANNOTSTARTEDITOR_SECONDARY;Please set the correct path in the "Preferences" dialog. -MAIN_MSG_EXITJOBSINQUEUEINFO;Nezpracované obrázky ve frontě budou ztraceny! -MAIN_MSG_EXITJOBSINQUEUEQUEST;OPravdu chcete skončit? Ve frontě jsou nezpracované obrázky. -MAIN_MSG_JOBSINQUEUE;Úlohy ve frontě -MAIN_MSG_QOVERWRITE;Chcete jej přepsat? -MAIN_TAB_BASIC;Základní -MAIN_TAB_COLOR;Barvy -MAIN_TAB_DETAIL;Detaily -MAIN_TAB_DEVELOP;Develop -MAIN_TAB_EXIF;Exif -MAIN_TAB_EXPOSURE;Expozice -MAIN_TAB_FILTER;Filter -MAIN_TAB_ICM;ICM -MAIN_TAB_IPTC;IPTC -MAIN_TAB_METADATA;Metadata -MAIN_TAB_TAGGING;Tagging -MAIN_TAB_TRANSFORM;Transformace -MAIN_TOOLTIP_HIDEFP;Zobrazit či schovat dolní panel (složky a prohlížeč souborů, shortcut key: F)) -MAIN_TOOLTIP_HIDEHP;Zobrazit či schovat levý panel (obsahující historii, shortcut key: H) -MAIN_TOOLTIP_INDCLIPPEDH;Zvýraznit oříznuté jasy -MAIN_TOOLTIP_INDCLIPPEDS;Zvýraznit oříznuté stíny -MAIN_TOOLTIP_PREFERENCES;Změnit volby -MAIN_TOOLTIP_QINFO;Stručné informace o obrázku -MAIN_TOOLTIP_SAVEAS;Uložit obrázek do vybrané složky -MAIN_TOOLTIP_SAVE;Uložit obrázek do výchozí složky -PARTIALPASTE_BASICGROUP;Základní nastavení -PARTIALPASTE_CACORRECTION;Korekce C/A -PARTIALPASTE_COARSETRANS;Orientace / převrácení -PARTIALPASTE_COLORBOOST;Posílení barev -PARTIALPASTE_COLORDENOISE;Odstranění barevného šumu -PARTIALPASTE_COLORGROUP;Nastavení barev -PARTIALPASTE_COLORMIXER;Mixér barev -PARTIALPASTE_COLORSHIFT;Posun barev -PARTIALPASTE_COMPOSITIONGROUP;Nastavení kompozice -PARTIALPASTE_CROP;Ořez -PARTIALPASTE_DIALOGLABEL;Nastavení profilu částečného vložení -PARTIALPASTE_DISTORTION;Korekce zkreslení -PARTIALPASTE_EXIFCHANGES;Upravené exif data -PARTIALPASTE_EXPOSURE;Expozice -PARTIALPASTE_HLRECOVERY;Obnovení světel -PARTIALPASTE_ICMSETTINGS;Nastavení ICM -PARTIALPASTE_IPTCINFO;IPTC info -PARTIALPASTE_LENSGROUP;Nastavení objektivu -PARTIALPASTE_LUMACURVE;Křivka jasu -PARTIALPASTE_LUMADENOISE;Redukce šumu v jasech -PARTIALPASTE_LUMINANCEGROUP;Nastavení světel -PARTIALPASTE_METAICMGROUP;Nastavení metadat a ICM -PARTIALPASTE_RESIZE;Změna velikosti -PARTIALPASTE_ROTATION;Rotace -PARTIALPASTE_SHADOWSHIGHLIGHTS;Stíny/Světla -PARTIALPASTE_SHARPENING;Doostření -PARTIALPASTE_VIGNETTING;Korekce vinětace -PARTIALPASTE_WHITEBALANCE;Nastavení bílé -PREFERENCES_APPLNEXTSTARTUP;Projeví se při dalším spuštění -PREFERENCES_BLINKCLIPPED;Blikání v oříznutých oblastech -PREFERENCES_CACHECLEARALL;Vymaž vše -PREFERENCES_CACHECLEARPROFILES;Vymaž profily -PREFERENCES_CACHECLEARTHUMBS;Vymaž náhledy -PREFERENCES_CACHEFORMAT1;Vlastní (rychlejší a kvalitnější) -PREFERENCES_CACHEFORMAT2;JPEG (Menší velikost) -PREFERENCES_CACHEMAXENTRIES;Maximální počet záznamů v cache. -PREFERENCES_CACHEOPTS;Vlastnosti cache -PREFERENCES_CACHESTRAT1;Upřednostnit rychlost před spotřebou paměti -PREFERENCES_CACHESTRAT2;Upřednostnit menší spotřebu paměti před rychlostí -PREFERENCES_CACHESTRAT;Strategie cache -PREFERENCES_CACHETHUMBFORM;Formát náhledů v cache -PREFERENCES_CACHETHUMBHEIGHT;Maximální velikost náhledu -PREFERENCES_CLEARDLG_LINE1;Čištění cache -PREFERENCES_CLEARDLG_LINE2;může trvat několik sekund. -PREFERENCES_CLEARDLG_TITLE;Prosím počkejte. -PREFERENCES_CLIPPINGIND;Zvýraznění oříznutých jasů či stínů -PREFERENCES_CMETRICINTENT;Kolorimetrická metoda -PREFERENCES_DATEFORMAT;Formát data -PREFERENCES_DATEFORMATHINT;Lze použít následující formátovací řetězce:\n%y : rok (year)\n%m : měsíc (month)\n%d : den (day)\n\nNapříklad český formát data:\n%d. %m. %y -PREFERENCES_DEFAULTLANG;Výchozí jazyk -PREFERENCES_DEFAULTTHEME;Výchozí vzhled -PREFERENCES_DEMOSAICINGALGO;Demozajkovací algoritmus -PREFERENCES_DIRHOME;Domovská složka -PREFERENCES_DIRLAST;Poslední navštívená složka -PREFERENCES_DIROTHER;Jiná -PREFERENCES_DIRSELECTDLG;Zvolte složku s obrázky pro spuštění... -PREFERENCES_DIRSOFTWARE;Instalační složka -PREFERENCES_DMETHOD;Metoda -PREFERENCES_EDITORCMDLINE;Jiný příkaz -PREFERENCES_EXTERNALEDITOR;Externí editor -PREFERENCES_FALSECOLOR;Počet kroků při potlačování chybných barev -PREFERENCES_FBROWSEROPTS;Volby prohlížeče souborů -PREFERENCES_FILEFORMAT;Formát souboru -PREFERENCES_FORIMAGE;Pro obrázkové soubory -PREFERENCES_FORRAW;Pro RAW soubory -PREFERENCES_GIMPPATH;GIMP instalační adresář -PREFERENCES_GTKTHEME;GTK výchozí -PREFERENCES_HINT;Nápověda -PREFERENCES_HLTHRESHOLD;Práh pro oříznutá světla -PREFERENCES_ICCDIR;Složka ICC profilů -PREFERENCES_IMPROCPARAMS;Výchozí profily pro zpracování obrázku -PREFERENCES_INTENT_ABSOLUTE;Absolutní kolorimetrie -PREFERENCES_INTENT_PERCEPTUAL;Vnímání -PREFERENCES_INTENT_RELATIVE;Relativní kolorimetrie -PREFERENCES_INTENT_SATURATION;Saturace -PREFERENCES_LIVETHUMBNAILS;Živé náhledy (pomalejší) -PREFERENCES_MONITORICC;Profil monitoru -PREFERENCES_OUTDIRFOLDERHINT;Uloží obrázky do vybraného adresáře -PREFERENCES_OUTDIRFOLDER;Ulož do souboru -PREFERENCES_OUTDIRHINT;Lze použít následující formátovací řetězce:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nTyto formátovací řetězce reprezentují adresáře a části cesty, kde je uložen raw soubor.\n\nNapříklad pokud je otevřen soubor /home/tom/image/02-09-2006/dsc0012.nef, mají jednotlivé formátovací řetězce tento význam:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nPokud si přejete uložit výstupní obrázek vedle originálu, napiště:\n%p1/%f\n\nJestliže si jej ale přejete uložit do adresáře 'converted' ve stejném adresáři jako originál, napiště:\n%p1/converted/%f\n\nPro uložení výstupního obrázku do adresáře '/home/tom/converted' se zachováním adresáře s datem, použijte:\n%p2/converted/%d1/%f -PREFERENCES_OUTDIRTEMPLATEHINT;Lze použít následující formátovací řetězce:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nTyto formátovací řetězce reprezentují adresáře a části cesty, kde je uložen raw soubor.\n\nNapříklad pokud je otevřen soubor /home/tom/image/02-09-2006/dsc0012.nef, mají jednotlivé formátovací řetězce tento význam:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nPokud si přejete uložit výstupní obrázek vedle originálu, napiště:\n%p1/%f\n\nJestliže si jej ale přejete uložit do adresáře 'converted' ve stejném adresáři jako originál, napiště:\n%p1/converted/%f\n\nPro uložení výstupního obrázku do adresáře '/home/tom/converted' se zachováním adresáře s datem, použijte:\n%p2/converted/%d1/%f -PREFERENCES_OUTDIRTEMPLATE;Použij šablonu -PREFERENCES_OUTDIR;Výstupní složka -PREFERENCES_PARSEDEXTADDHINT;Vložte příponu a stiskněte toto tlačítko pro přidání do seznamu -PREFERENCES_PARSEDEXTADD;Přidej příponu -PREFERENCES_PARSEDEXTDELHINT;Vymaže označenou příponu ze seznamu -PREFERENCES_PARSEDEXT;Zobrazované přípony -PREFERENCES_PROFILEHANDLING;Profily zpracování -PREFERENCES_PROFILELOADPR;Priorita nahrávání profilu -PREFERENCES_PROFILEPRCACHE;Profil v cache -PREFERENCES_PROFILEPRFILE;Profil uložený se zdrojovým souborem -PREFERENCES_PROFILESAVECACHE;Ukládat parametry zpracování do cache -PREFERENCES_PROFILESAVEINPUT;Ukládat parametry zpracování se zdrojovým souborem -PREFERENCES_PSPATH;Adobe Photoshop instalační adresář -PREFERENCES_SELECTICCDIRDLG;Zvolte složky s ICC profily... -PREFERENCES_SELECTLANG;Volba jazyka -PREFERENCES_SELECTMONITORPROFDLG;Zvolte ICC profil obrazovky... -PREFERENCES_SELECTTHEME;Vybraný vzhled -PREFERENCES_SHOWBASICEXIF;Zobrazovat základní informace z EXIF -PREFERENCES_SHOWDATETIME;Zobrazovat datum a čas -PREFERENCES_SHOWONLYRAW;Zobrazovat pouze soubory RAW -PREFERENCES_SHTHRESHOLD;Práh pro oříznuté stíny -PREFERENCES_STARTUPIMDIR;Složka s obrázky při spuštění -PREFERENCES_TAB_BROWSER;Prohlížeč souborů -PREFERENCES_TAB_COLORMGR;Správa barev -PREFERENCES_TAB_GENERAL;Obecné -PREFERENCES_TAB_IMPROC;Zpracování obrázku -PREFERENCES_TAB_OUTPUT;Volby výstupu -PREFERENCES_THUMBSIZE;Velikost náhledu -PROFILEPANEL_FILEDLGFILTERANY;Jakékoliv souboru -PROFILEPANEL_FILEDLGFILTERPP;Profily zpracování -PROFILEPANEL_LABEL;Profily zpracování -PROFILEPANEL_LOADDLGLABEL;Načíst parametry zpracování... -PROFILEPANEL_PCUSTOM;Vlastní -PROFILEPANEL_PFILE;Ze souboru -PROFILEPANEL_PLASTPHOTO;Poslední obrázek -PROFILEPANEL_PLASTSAVED;Poslední uschovaný -PROFILEPANEL_PROFILE;Profil -PROFILEPANEL_SAVEDLGLABEL;Uschovat parametry zpracování... -PROFILEPANEL_TOOLTIPCOPY;Uložit aktuální profil do schránky -PROFILEPANEL_TOOLTIPLOAD;Načíst profil ze souboru -PROFILEPANEL_TOOLTIPPASTE;Vložit profil ze schránky -PROFILEPANEL_TOOLTIPSAVE;Uschovat současný profil -PROGRESSBAR_DECODING;Dekódování RAW... -PROGRESSBAR_DEMOSAICING;Demozajkování... -PROGRESSBAR_LOADING;Načítám obrázek... -PROGRESSBAR_LOADJPEG;Načítám JPEG... -PROGRESSBAR_LOADPNG;Načítám PNG... -PROGRESSBAR_LOADTIFF;Načítám TIFF... -PROGRESSBAR_PROCESSING;Zpracovávám obrázek... -PROGRESSBAR_READY;Připraven. -PROGRESSBAR_SAVEJPEG;Ukládám jako JPEG... -PROGRESSBAR_SAVEPNG;Ukládám jako PNG... -PROGRESSBAR_SAVETIFF;Ukládám jako TIFF... -PROGRESSDLG_LOADING;Loading file... -PROGRESSDLG_PROCESSING;Processing image... -PROGRESSDLG_SAVING;Saving file... -QINFO_FOCALLENGTH;Ohnisková vzdálenost -QINFO_ISO;ISO -QINFO_LENS;Lens -QINFO_NOEXIF;Exif údaje nejsou k dispozici. -SAVEDLG_FILEFORMAT;Formát souboru -SAVEDLG_JPEGQUAL;JPEG Kvalita -SAVEDLG_JPGFILTER;Soubory JPEG -SAVEDLG_PNGCOMPR;PNG Komprese -SAVEDLG_PNGFILTER;Soubory PNG -SAVEDLG_PUTTOQUEUEHEAD;Put to the head of the processing queue -SAVEDLG_PUTTOQUEUETAIL;Put to the end of the processing queue -SAVEDLG_PUTTOQUEUE;Vložit soubor do fronty -SAVEDLG_SAVEIMMEDIATELY;Okamžitě uložit -SAVEDLG_SAVESPP;Uschovat s obrazem i parametry zpracování -SAVEDLG_TIFFFILTER;Soubory TIFF -TOOLBAR_TOOLTIP_CROP;Označení výřezu (shortcut key: C) -TOOLBAR_TOOLTIP_HAND;Nástroj ruka (shortcut key: N) -TOOLBAR_TOOLTIP_STRAIGHTEN;Vyznačení roviny (shortcut key: S) -TOOLBAR_TOOLTIP_WB;Bodové vyvážení bílé (shortcut key: W) -TP_CACORRECTION_BLUE;Modrá -TP_CACORRECTION_LABEL;Oprava chromatické vady -TP_CACORRECTION_RED;Červená -TP_CHMIXER_BLUE;Modrá -TP_CHMIXER_GREEN;Zelená -TP_CHMIXER_LABEL;Míchání kanálů -TP_CHMIXER_RED;Červená -TP_COARSETRAF_DEGREE;Stupeň: -TP_COARSETRAF_TOOLTIP_HFLIP;Překlopit horizontálně -TP_COARSETRAF_TOOLTIP_ROTLEFT;Otočit doleva -TP_COARSETRAF_TOOLTIP_ROTRIGHT;Otočit doprava -TP_COARSETRAF_TOOLTIP_VFLIP;Překlopit vertikálně -TP_COLORBOOST_ACHANNEL;kanál "a" -TP_COLORBOOST_AMOUNT;Míra -TP_COLORBOOST_AVOIDCOLORCLIP;Zabránit oříznutí barvy -TP_COLORBOOST_BCHANNEL;kanál "b" -TP_COLORBOOST_CHAB;a & b -TP_COLORBOOST_CHANNEL;Kanál -TP_COLORBOOST_CHSEPARATE;zvlášť -TP_COLORBOOST_ENABLESATLIMITER;Omezovat sytost -TP_COLORBOOST_LABEL;Sytost barev -TP_COLORBOOST_SATLIMIT;Limit sytosti -TP_COLORDENOISE_EDGESENSITIVE;Citlivost k okrajům -TP_COLORDENOISE_EDGETOLERANCE;Tolerance okrajům -TP_COLORDENOISE_LABEL;Redukce barevného šumu -TP_COLORDENOISE_RADIUS;Poloměr -TP_COLORSHIFT_BLUEYELLOW;Modrá-Žlutá -TP_COLORSHIFT_GREENMAGENTA;Modrá-Purpurová -TP_COLORSHIFT_LABEL;Barevný posun -TP_CROP_DPI;DPI= -TP_CROP_FIXRATIO;Poměr stran: -TP_CROP_GTDIAGONALS;Pravidlo diagonál -TP_CROP_GTHARMMEANS1;Zlatý řez 1 -TP_CROP_GTHARMMEANS2;Zlatý řez 2 -TP_CROP_GTHARMMEANS3;Zlatý řez 3 -TP_CROP_GTHARMMEANS4;Zlatý řez 4 -TP_CROP_GTNONE;Žádné -TP_CROP_GTRULETHIRDS;Pravidlo třetin -TP_CROP_GUIDETYPE;Druh vodítek: -TP_CROP_H;V -TP_CROP_LABEL;Výřez -TP_CROP_SELECTCROP; Označení výřezu -TP_CROP_W;Š -TP_CROP_X;x -TP_CROP_Y;y -TP_DISTORTION_AMOUNT;Míra -TP_DISTORTION_LABEL;Oprava zkreslení objektivu -TP_EXPOSURE_AUTOLEVELS;Úrovně automaticky -TP_EXPOSURE_BLACKLEVEL;Černá -TP_EXPOSURE_BRIGHTNESS;Jas -TP_EXPOSURE_CLIP;Oříznutí -TP_EXPOSURE_COMPRHIGHLIGHTS;Komprese světel -TP_EXPOSURE_COMPRSHADOWS;Komprese stínů -TP_EXPOSURE_CONTRAST;Kontrast -TP_EXPOSURE_CURVEEDITOR;Tonální křivka -TP_EXPOSURE_EXPCOMP;Korekce expozice -TP_EXPOSURE_LABEL;Expozice -TP_HLREC_CIELAB;Mísení CIELAB -TP_HLREC_COLOR;Propagace barev -TP_HLREC_LABEL;Obnovení jasů -TP_HLREC_LUMINANCE;Obnovení jasů -TP_HLREC_METHOD;Metoda: -TP_ICM_FILEDLGFILTERANY;Jakékoliv soubory -TP_ICM_FILEDLGFILTERICM;Soubory ICC profilů -TP_ICM_GAMMABEFOREINPUT;Profil provádí Gama korekci -TP_ICM_INPUTCAMERA;Výchozí profil fotoaparátu -TP_ICM_INPUTCUSTOM;Vlastní -TP_ICM_INPUTDLGLABEL;Vyber vstupní ICC profil... -TP_ICM_INPUTEMBEDDED;Použít vložený profil, pokud je k dispozici -TP_ICM_INPUTPROFILE;Vstupní profil -TP_ICM_LABEL;ICM -TP_ICM_NOICM;Bez správy barev: sRGB výstup -TP_ICM_OUTPUTDLGLABEL;Vyber výstupní ICC profil... -TP_ICM_OUTPUTPROFILE;Výstupní barevný prostor -TP_ICM_SAVEREFERENCE;Uložit referenční obrázek pro profilování -TP_ICM_WORKINGPROFILE;Pracovní barevný prostor -TP_LUMACURVE_BLACKLEVEL;Černá -TP_LUMACURVE_BRIGHTNESS;Jas -TP_LUMACURVE_COMPRHIGHLIGHTS;Komprese světel -TP_LUMACURVE_COMPRSHADOWS;Komprese stínů -TP_LUMACURVE_CONTRAST;Kontrast -TP_LUMACURVE_CURVEEDITOR;Křivka -TP_LUMACURVE_LABEL;Křivka jasu v CIELAB -TP_LUMADENOISE_EDGETOLERANCE;Tolerance okrajů -TP_LUMADENOISE_LABEL;Redukce šumu v jasech -TP_LUMADENOISE_RADIUS;Poloměr -TP_RESIZE_BICUBIC;Bikubická -TP_RESIZE_BICUBICSF;Bikubická (Měkčí) -TP_RESIZE_BICUBICSH;Bikubická (Ostřejší) -TP_RESIZE_BILINEAR;Bilineární -TP_RESIZE_FULLSIZE;Plná velikost obrázku: -TP_RESIZE_H;V: -TP_RESIZE_LABEL;Změnit rozměry -TP_RESIZE_METHOD;Metoda: -TP_RESIZE_NEAREST;Nejbližší -TP_RESIZE_SCALE;Měřítko -TP_RESIZE_W;Š: -TP_ROTATE_AUTOCROP;Automatický ořez -TP_ROTATE_DEGREE;Stupně -TP_ROTATE_FILL;Vyplnit -TP_ROTATE_LABEL;Otáčení -TP_ROTATE_SELECTLINE; Vyznač rovinu -TP_SHADOWSHLIGHTS_HIGHLIGHTS;Světla -TP_SHADOWSHLIGHTS_HLTONALW;Tonální rozsah -TP_SHADOWSHLIGHTS_LABEL;Stíny/Světla -TP_SHADOWSHLIGHTS_LOCALCONTR;Místní kontrast -TP_SHADOWSHLIGHTS_RADIUS;Poloměr -TP_SHADOWSHLIGHTS_SHADOWS;Stíny -TP_SHADOWSHLIGHTS_SHTONALW;Tonální rozsah -TP_SHARPENING_AMOUNT;Míra -TP_SHARPENING_EDRADIUS;Poloměr -TP_SHARPENING_EDTOLERANCE;Tolerance okrajů -TP_SHARPENING_HALOCONTROL;Omezení haló artefatů -TP_SHARPENING_HCAMOUNT;Míra -TP_SHARPENING_LABEL;Doostření -TP_SHARPENING_METHOD;Metoda -TP_SHARPENING_ONLYEDGES;Doostřit pouze okraje -TP_SHARPENING_RADIUS;Poloměr -TP_SHARPENING_RLD_AMOUNT;Míra -TP_SHARPENING_RLD_DAMPING;Útlum -TP_SHARPENING_RLD_ITERATIONS;Počet opakování -TP_SHARPENING_RLD;RL Dekonvoluce -TP_SHARPENING_THRESHOLD;Práh -TP_SHARPENING_USM;Maskovat rozostření -TP_VIGNETTING_AMOUNT;Míra -TP_VIGNETTING_LABEL;Oprava vinětace -TP_VIGNETTING_RADIUS;Poloměr -TP_WBALANCE_AUTO;Automaticky -TP_WBALANCE_CAMERA;Fotoaparát -TP_WBALANCE_CUSTOM;Vlastní -TP_WBALANCE_GREEN;Odstín -TP_WBALANCE_LABEL;Vyvážení bílé -TP_WBALANCE_METHOD;Metoda -TP_WBALANCE_SIZE;Rozměr: -TP_WBALANCE_SPOTWB;Bodové vyvážení -TP_WBALANCE_TEMPERATURE;Teplota -ZOOMBAR_DETAIL;Detail -ZOOMBAR_HUGE;Veliký -ZOOMBAR_LARGE;Větší -ZOOMBAR_NORMAL;Normální -ZOOMBAR_PREVIEW;Náhled -ZOOMBAR_SCALE;Měřítko -ZOOMBAR_SMALL;Malý - -GENERAL_HIGH_QUALITY;High Quality -GENERAL_UNCHANGED;(Unchanged) -MAIN_MSG_PLACES;Places -GENERAL_BEFORE;Before -GENERAL_AFTER;After -MAIN_TOOLTIP_TOGGLE;Toggle before/after view -MAIN_BUTTON_PUTTOQUEUE;Put to queue -MAIN_MSG_NAVIGATOR;Navigator -FILEBROWSER_TOOLTIP_STOPPROCESSING;Start processing automatically when a new job arrives -BATCHQUEUE_AUTOSTART;Auto start -TP_DETAIL_AMOUNT;Amount -TP_RESIZE_SPECIFY;Specify: -TP_RESIZE_SCALE;Scale -TP_RESIZE_WIDTH;Width -TP_RESIZE_HEIGHT;Height -MAIN_TOGGLE_BEFORE_AFTER;B|A - +# +# This file is part of RawTherapee. +# +# Copyright (c) 2004-2010 Gabor Horvath +# +# RawTherapee is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# RawTherapee is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with RawTherapee. If not, see . +# +# czech +# ---------------------------------------- +# 20.1.2008: translated by absolution +# 21.2.2008: updated by mkyral (typos and some missing strings) +# 24.4.2008: updated by mkyral (for version 2.4m1) +# 28.10.2008: updated by mkyral (for version 2.4 beta1) +# +ADJUSTER_RESET_TO_DEFAULT;Vrátit se k původnímu +CURVEEDITOR_FILEDLGFILTERANY;Jakékoliv soubory +CURVEEDITOR_FILEDLGFILTERCURVE;Soubory křivek +CURVEEDITOR_LINEAR;Lineární +CURVEEDITOR_LOADDLGLABEL;Načíst křivku... +CURVEEDITOR_SAVEDLGLABEL;Uložit křivku... +CURVEEDITOR_TOOLTIPLINEAR;Vrátit se k lineární křivce +CURVEEDITOR_TOOLTIPLOAD;Načíst křivku ze souboru +CURVEEDITOR_TOOLTIPSAVE;Uložit současnou křivku +EXIFFILTER_APERTURE;Clona +EXIFFILTER_CAMERA;Aparát +EXIFFILTER_DIALOGLABEL;Filtruj dle Exif +EXIFFILTER_FOCALLEN;Ohnisková vzdálenost +EXIFFILTER_ISO;ISO +EXIFFILTER_LENS;Objektiv +EXIFFILTER_SHUTTER;Rychlost závěrky +EXIFPANEL_ADDEDITHINT;Přidej/Oprav štítek +EXIFPANEL_ADDEDIT;Přidej/Změň +EXIFPANEL_ADDTAGDLG_ENTERVALUE;Vlož hodnotu +EXIFPANEL_ADDTAGDLG_SELECTTAG;Vyber štítek +EXIFPANEL_ADDTAGDLG_TITLE;Přidej/Změň štítek +EXIFPANEL_KEEPHINT;Ulož vybrané štítky při zápisu do souboru +EXIFPANEL_KEEP;Zachovej +EXIFPANEL_REMOVEHINT;Neulož vybrané štítky při zápisu do souboru +EXIFPANEL_REMOVE;Zahoď +EXIFPANEL_RESETALLHINT;Obnov původní hodnoty u všech štítků +EXIFPANEL_RESETALL;Obnov vše +EXIFPANEL_RESETHINT;Obnov původní hodnoty u vybraných štítků +EXIFPANEL_RESET;Obnov +EXIFPANEL_SUBDIRECTORY;Podadresář +FILEBROWSER_APPLYPROFILE;Aplikuj profil +FILEBROWSER_ARRANGEMENTHINT;Přepnutí mezi vertikálním/horizontálním zarovnáním náhledů +FILEBROWSER_CLEARPROFILE;Vymaž profil +FILEBROWSER_COPYPROFILE;Kopíruj profil +FILEBROWSER_DELETEDLGLABEL;Potvrzení smazání souboru +FILEBROWSER_DELETEDLGMSG;Opravdu chcete vymazat %1 souborů? +FILEBROWSER_EMPTYTRASHHINT;Navždy vymaže soubory v koši +FILEBROWSER_EMPTYTRASH;Vysypat koš +FILEBROWSER_EXIFFILTERAPPLYHINT;Zapne/Vypne filtrování dle exif v prohlížeči souborů +FILEBROWSER_EXIFFILTERAPPLY;Použij +FILEBROWSER_EXIFFILTERLABEL;Exif Filtr +FILEBROWSER_EXIFFILTERSETTINGSHINT;Změna nastavení exif filtru +FILEBROWSER_EXIFFILTERSETTINGS;Nastavení +FILEBROWSER_PARTIALPASTEPROFILE;Vlož částečně +FILEBROWSER_PASTEPROFILE;Vlož profil +FILEBROWSER_POPUPCANCELJOB;Zruš úlohu +FILEBROWSER_POPUPMOVEEND;Přesuň na konec fronty +FILEBROWSER_POPUPMOVEHEAD;Přesuň na začátek fronty +FILEBROWSER_POPUPOPEN;Otevři +FILEBROWSER_POPUPPROCESS;Vlož do fronty +FILEBROWSER_POPUPRANK1;Hodnocení 1 +FILEBROWSER_POPUPRANK2;Hodnocení 2 +FILEBROWSER_POPUPRANK3;Hodnocení 3 +FILEBROWSER_POPUPRANK4;Hodnocení 4 +FILEBROWSER_POPUPRANK5;Hodnocení 5 +FILEBROWSER_POPUPREMOVE;Odstraň ze systému souborů +FILEBROWSER_POPUPRENAME;Přejmenuj +FILEBROWSER_POPUPSELECTALL;Vyber vše +FILEBROWSER_POPUPTRASH;Přesuň do koše +FILEBROWSER_POPUPUNRANK;Odstraň hodnocení +FILEBROWSER_POPUPUNTRASH;Vymaž z koše +FILEBROWSER_PROCESSINGSETTINGSHINT;Nastavení formátu souboru a výstupního adresáře +FILEBROWSER_PROCESSINGSETTINGS;Nastavení +FILEBROWSER_RENAMEDLGLABEL;Přejmenování souboru +FILEBROWSER_RENAMEDLGMSG;Přejmenovat soubor "%1" na: +FILEBROWSER_SHOWDIRHINT;Ukaž všechny obrázky v adresáři +FILEBROWSER_SHOWQUEUEHINT;Ukaž obsah fronty +FILEBROWSER_SHOWRANK1HINT;Ukaž obrázky hodnocené 1 hvězdičkou +FILEBROWSER_SHOWRANK2HINT;Ukaž obrázky hodnocené 2 hvězdičkama +FILEBROWSER_SHOWRANK3HINT;Ukaž obrázky hodnocené 3 hvězdičkama +FILEBROWSER_SHOWRANK4HINT;Ukaž obrázky hodnocené 4 hvězdičkama +FILEBROWSER_SHOWRANK5HINT;Ukaž obrázky hodnocené 5 hvězdičkama +FILEBROWSER_SHOWTRASHHINT;Ukaž obsah koše +FILEBROWSER_SHOWUNRANKHINT;Ukaž nehodnocené obrázky +FILEBROWSER_STARTPROCESSINGHINT;Spustí zpracování nebo ukládání obrázků ve frontě +FILEBROWSER_STARTPROCESSING;Spusť zpracování +FILEBROWSER_STOPPROCESSINGHINT;Zastaví zpracovávaní obrázků +FILEBROWSER_STOPPROCESSING;Zastav zpracovávaní +FILEBROWSER_THUMBSIZE;Velikost náhledů +FILEBROWSER_ZOOMINHINT;Zvětší velikost náhledů +FILEBROWSER_ZOOMOUTHINT;Zmenší velikost náhledů +GENERAL_ABOUT;O programu +GENERAL_CANCEL;Storno +GENERAL_DISABLED;Vypnuto +GENERAL_DISABLE;Vypnout +GENERAL_ENABLED;Zapnuto +GENERAL_ENABLE;Zapnout +GENERAL_LANDSCAPE;Na šířku +GENERAL_LOAD;Načíst +GENERAL_NA;n/a +GENERAL_NO;Ne +GENERAL_OK;OK +GENERAL_PORTRAIT;Na výšku +GENERAL_SAVE;Uschovat +GENERAL_YES;Ano +HISTOGRAM_LABEL;Histogram +HISTOGRAM_TOOLTIP_B;Schovej či zobraz histogram pro MODROU +HISTOGRAM_TOOLTIP_G;Schovej či zobraz histogram pro ZELENOU +HISTOGRAM_TOOLTIP_L;Schovej či zobraz histogram pro JAS v CIELAB +HISTOGRAM_TOOLTIP_R;Schovej či zobraz histogram pro ČERVENOU +HISTORY_CHANGED;Změněno +HISTORY_CUSTOMCURVE;Vlastní křivka +HISTORY_DELSNAPSHOT;Odstranit snímek +HISTORY_FROMCLIPBOARD;Ze schránky +HISTORY_LABEL;Historie +HISTORY_MSG_10;Komprese stínů +HISTORY_MSG_11;Tónová křivka +HISTORY_MSG_12;Automatická expozice +HISTORY_MSG_13;Oříznutí exozice +HISTORY_MSG_14;Jas (CIELAB) +HISTORY_MSG_15;Kontrast (CIELAB) +HISTORY_MSG_16;Černá (CIELAB) +HISTORY_MSG_17;Komprese světel (CIELAB) +HISTORY_MSG_18;Komprese stínů (CIELAB) +HISTORY_MSG_19;Tónová křivka (CIELAB) +HISTORY_MSG_1;Obrázek načten +HISTORY_MSG_20;Doostření +HISTORY_MSG_21;Poloměr doostření +HISTORY_MSG_22;Míra doostření +HISTORY_MSG_23;Práh doostření +HISTORY_MSG_24;Doostření pouze v okrajích +HISTORY_MSG_25;Poloměr detekce okrajů při doostření +HISTORY_MSG_26;Tolerance okrajů při doostření +HISTORY_MSG_27;Omezení haló artefatů při doostření +HISTORY_MSG_28;Míra omezení haló artefatů +HISTORY_MSG_29;Metoda doostření +HISTORY_MSG_2;Profil načten +HISTORY_MSG_30;Poloměr dekonvoluce +HISTORY_MSG_31;Míra dekonvoluce +HISTORY_MSG_32;Útlum dekonvoluce +HISTORY_MSG_33;Počet opakování dekonvoluce +HISTORY_MSG_34;Zabránit oříznutí barev +HISTORY_MSG_35;Omezování sytosti +HISTORY_MSG_36;Omezení sytosti +HISTORY_MSG_37;Sytost barev +HISTORY_MSG_38;Metoda vyvážení bílé +HISTORY_MSG_39;Barevná teplota +HISTORY_MSG_3;Profil změněn +HISTORY_MSG_40;Odstín vyvážení bílé +HISTORY_MSG_41;Posun barev "A" +HISTORY_MSG_42;Posun barev "B" +HISTORY_MSG_43;Redukce šumu v jasech +HISTORY_MSG_44;Poloměr redukce šumu v jasech +HISTORY_MSG_45;Okrajová telorence v redukce šumu v jasech +HISTORY_MSG_46;Redukce barevného šumu +HISTORY_MSG_47;Poloměr redukce barevného šumu +HISTORY_MSG_48;Okrajová toleranve v redukci barevného šumu +HISTORY_MSG_49;Redukce barevného šumu s ohledem na okraje +HISTORY_MSG_4;Prohlížení historie +HISTORY_MSG_50;Nástroj Stíny/světla +HISTORY_MSG_51;Zvýraznění světel +HISTORY_MSG_52;Zvýraznění stínů +HISTORY_MSG_53;Tónová rozsah jasů +HISTORY_MSG_54;Tónový rozsah stínů +HISTORY_MSG_55;Místní kontrast +HISTORY_MSG_56;Poloměr světel a stínů +HISTORY_MSG_57;Hrubé otáčení +HISTORY_MSG_58;Horizontální překlopení +HISTORY_MSG_59;Vertikální překlopení +HISTORY_MSG_5;Jas +HISTORY_MSG_60;Otáčení +HISTORY_MSG_61;Otočení +HISTORY_MSG_62;Úprava zkreslení objektivu +HISTORY_MSG_63;Záložka zvolena +HISTORY_MSG_64;Oříznout obrázek +HISTORY_MSG_65;Úprava chromatické vady +HISTORY_MSG_66;Obnovení jasů +HISTORY_MSG_67;Míra obnovení jasů +HISTORY_MSG_68;Metoda obnovení jasů +HISTORY_MSG_69;Pracovní barevný prostor +HISTORY_MSG_6;Kontrast +HISTORY_MSG_70;Výstupní barevný prostor +HISTORY_MSG_71;Vstupní barevný prostor +HISTORY_MSG_72;Úprave vinětace +HISTORY_MSG_73;Míchání kanálů +HISTORY_MSG_74;Míra změny rozměrů +HISTORY_MSG_75;Metoda změny rozměru +HISTORY_MSG_76;Exif Metadata +HISTORY_MSG_77;IPTC Metadata +HISTORY_MSG_78;Data specified for resize +HISTORY_MSG_79;Resize width +HISTORY_MSG_7;Černá +HISTORY_MSG_80;Resize height +HISTORY_MSG_81;Resize enabled +HISTORY_MSG_8;Expoziční korekce +HISTORY_MSG_9;Komprese světel +HISTORY_NEWSNAPSHOTAS;Jako... +HISTORY_NEWSNAPSHOT;Nový snímek +HISTORY_NEWSSDIALOGLABEL;Titulek snímku: +HISTORY_NEWSSDIALOGTITLE;Přidat nový snímek +HISTORY_SETTO;Nastavit na +HISTORY_SNAPSHOT;Snímek +HISTORY_SNAPSHOTS;Snímky +ICMPANEL_FILEDLGFILTERANY;Jakékoliv soubory +ICMPANEL_FILEDLGFILTERICM;Soubory ICC profilů +ICMPANEL_GAMMABEFOREINPUT;Profil provádí Gama korekci +ICMPANEL_INPUTCAMERA;Výchozí profil fotoaparátu +ICMPANEL_INPUTCUSTOM;Vlastní +ICMPANEL_INPUTDLGLABEL;Vyber vstupní ICC profil... +ICMPANEL_INPUTEMBEDDED;Použít vložený profil, pokud je k dispozici +ICMPANEL_INPUTPROFILE;Vstupní profil +ICMPANEL_NOICM;Bez správy barev: sRGB výstup +ICMPANEL_OUTPUTDLGLABEL;Vyber výstupní ICC profil... +ICMPANEL_OUTPUTPROFILE;Výstupní barevný prostor +ICMPANEL_SAVEREFERENCE;Uložit referenční obrázek pro profilování +ICMPANEL_WORKINGPROFILE;Pracovní barevný prostor +IMAGEAREA_DETAILVIEW;Detailní pohled +IPTCPANEL_AUTHOR;Autor +IPTCPANEL_AUTHORHINT;Jméno autora, například spisovatele, fotografa nebo grafika (By-line). +IPTCPANEL_AUTHORSPOSITION;Autorova pozice +IPTCPANEL_AUTHORSPOSITIONHINT;Titul/pozice autora nebo autorů obrázku (By-line Title). +IPTCPANEL_CAPTIONHINT;Textový popis dat (Popis - Shrnutí) +IPTCPANEL_CAPTION;Popis +IPTCPANEL_CAPTIONWRITERHINT;Jméno osoby, která vložila, změnila nebo opravila obrázek nebo popis/shrnutí (Autor - Editor) +IPTCPANEL_CAPTIONWRITER;Popisovač +IPTCPANEL_CATEGORYHINT;Obsah obrázku dle názoru dodavatele (Kategorie). +IPTCPANEL_CATEGORY;Kategorie +IPTCPANEL_CITYHINT;Místo vzniku obrázku (Město). +IPTCPANEL_CITY;Město +IPTCPANEL_COPYHINT;Zkopíruj IPTC nastavení do schránky +IPTCPANEL_COPYRIGHT;Copyright +IPTCPANEL_COPYRIGHTHINT;Autorská práva (Copyright Notice). +IPTCPANEL_COUNTRYHINT;Jméno země/lokace kde byl obrázek vytvořen (Země - Lokace). +IPTCPANEL_COUNTRY;Země +IPTCPANEL_CREDITHINT;Dodavatel obrázku, ne nutně vlastník/autor (Credit). +IPTCPANEL_CREDIT;Zásluhy +IPTCPANEL_DATECREATED;Datum vytvoření +IPTCPANEL_DATECREATEDHINT;Kdy byl obrázek vytvořen; Formát: RRRRMMDD (Datum vytvoření). +IPTCPANEL_EMBEDDEDHINT;Obnov IPTC data z obrázku +IPTCPANEL_EMBEDDED;Uložené +IPTCPANEL_HEADLINEHINT;Uveřejnitelný krátký popis obrázku (Nadpis). +IPTCPANEL_HEADLINE;Nadpis +IPTCPANEL_INSTRUCTIONSHINT;Další instrukce vztahující se k obrázku (Speciální instrukce). +IPTCPANEL_INSTRUCTIONS;Instrukce +IPTCPANEL_KEYWORDSHINT;Jednoslovná hesla popisující obrázek (Klíčová slova). +IPTCPANEL_KEYWORDS;Klíčová slova +IPTCPANEL_PASTEHINT;Vlož IPTC nastavení ze schránky +IPTCPANEL_PROVINCEHINT;Kraj/stát kde byl obrázek vytvořen (Kraj-Stát). +IPTCPANEL_PROVINCE;Kraj +IPTCPANEL_RESETHINT;Obnov výchozí profil +IPTCPANEL_RESET;Obnov +IPTCPANEL_SOURCEHINT;Původní vlastník intelektuálního obsahu obrázku (Zdroj). +IPTCPANEL_SOURCE;Zdroj +IPTCPANEL_SUPPCATEGORIES;Dodat. kategorie +IPTCPANEL_SUPPCATEGORIESHINT;Upřesňující popis obsahu obrázku (Dodatečné kategorie). +IPTCPANEL_TITLEHINT;Zkrácený popis obrázku (Jméno obrázku). +IPTCPANEL_TITLE;Titulek +IPTCPANEL_TRANSREFERENCEHINT;Kód místa, odkud byl převzat originální obrázek (Original Transmission Reference). +IPTCPANEL_TRANSREFERENCE;Trans. Reference +MAIN_BUTTON_EXIT;Exit +MAIN_BUTTON_PREFERENCES;Volby +MAIN_BUTTON_QUEUE;Put to queue +MAIN_BUTTON_SAVEAS;jako... +MAIN_BUTTON_SAVE;Uložit +MAIN_BUTTON_SENDTOEDITOR;Odeslat do editoru +MAIN_FRAME_BATCHQUEUE;Batch Queue +MAIN_FRAME_FILEBROWSER;File Browser +MAIN_FRAME_PLACES_ADD;Add +MAIN_FRAME_PLACES_DEL;Del +MAIN_FRAME_PLACES;Places +MAIN_FRAME_RECENT;Recent Folders +MAIN_MSG_ALREADYEXISTS;Soubor již existuje. +MAIN_MSG_CANNOTLOAD;Nepodařilo se načíst obrázek +MAIN_MSG_CANNOTSAVE;Chyba při ukládání souboru. +MAIN_MSG_CANNOTSTARTEDITOR;Can not start editor. +MAIN_MSG_CANNOTSTARTEDITOR_SECONDARY;Please set the correct path in the "Preferences" dialog. +MAIN_MSG_EXITJOBSINQUEUEINFO;Nezpracované obrázky ve frontě budou ztraceny! +MAIN_MSG_EXITJOBSINQUEUEQUEST;OPravdu chcete skončit? Ve frontě jsou nezpracované obrázky. +MAIN_MSG_JOBSINQUEUE;Úlohy ve frontě +MAIN_MSG_QOVERWRITE;Chcete jej přepsat? +MAIN_TAB_BASIC;Základní +MAIN_TAB_COLOR;Barvy +MAIN_TAB_DETAIL;Detaily +MAIN_TAB_DEVELOP;Develop +MAIN_TAB_EXIF;Exif +MAIN_TAB_EXPOSURE;Expozice +MAIN_TAB_FILTER;Filter +MAIN_TAB_ICM;ICM +MAIN_TAB_IPTC;IPTC +MAIN_TAB_METADATA;Metadata +MAIN_TAB_TAGGING;Tagging +MAIN_TAB_TRANSFORM;Transformace +MAIN_TOOLTIP_HIDEFP;Zobrazit či schovat dolní panel (složky a prohlížeč souborů, shortcut key: F)) +MAIN_TOOLTIP_HIDEHP;Zobrazit či schovat levý panel (obsahující historii, shortcut key: H) +MAIN_TOOLTIP_INDCLIPPEDH;Zvýraznit oříznuté jasy +MAIN_TOOLTIP_INDCLIPPEDS;Zvýraznit oříznuté stíny +MAIN_TOOLTIP_PREFERENCES;Změnit volby +MAIN_TOOLTIP_QINFO;Stručné informace o obrázku +MAIN_TOOLTIP_SAVEAS;Uložit obrázek do vybrané složky +MAIN_TOOLTIP_SAVE;Uložit obrázek do výchozí složky +PARTIALPASTE_BASICGROUP;Základní nastavení +PARTIALPASTE_CACORRECTION;Korekce C/A +PARTIALPASTE_COARSETRANS;Orientace / převrácení +PARTIALPASTE_COLORBOOST;Posílení barev +PARTIALPASTE_COLORDENOISE;Odstranění barevného šumu +PARTIALPASTE_COLORGROUP;Nastavení barev +PARTIALPASTE_COLORMIXER;Mixér barev +PARTIALPASTE_COLORSHIFT;Posun barev +PARTIALPASTE_COMPOSITIONGROUP;Nastavení kompozice +PARTIALPASTE_CROP;Ořez +PARTIALPASTE_DIALOGLABEL;Nastavení profilu částečného vložení +PARTIALPASTE_DISTORTION;Korekce zkreslení +PARTIALPASTE_EXIFCHANGES;Upravené exif data +PARTIALPASTE_EXPOSURE;Expozice +PARTIALPASTE_HLRECOVERY;Obnovení světel +PARTIALPASTE_ICMSETTINGS;Nastavení ICM +PARTIALPASTE_IPTCINFO;IPTC info +PARTIALPASTE_LENSGROUP;Nastavení objektivu +PARTIALPASTE_LUMACURVE;Křivka jasu +PARTIALPASTE_LUMADENOISE;Redukce šumu v jasech +PARTIALPASTE_LUMINANCEGROUP;Nastavení světel +PARTIALPASTE_METAICMGROUP;Nastavení metadat a ICM +PARTIALPASTE_RESIZE;Změna velikosti +PARTIALPASTE_ROTATION;Rotace +PARTIALPASTE_SHADOWSHIGHLIGHTS;Stíny/Světla +PARTIALPASTE_SHARPENING;Doostření +PARTIALPASTE_VIGNETTING;Korekce vinětace +PARTIALPASTE_WHITEBALANCE;Nastavení bílé +PREFERENCES_APPLNEXTSTARTUP;Projeví se při dalším spuštění +PREFERENCES_BLINKCLIPPED;Blikání v oříznutých oblastech +PREFERENCES_CACHECLEARALL;Vymaž vše +PREFERENCES_CACHECLEARPROFILES;Vymaž profily +PREFERENCES_CACHECLEARTHUMBS;Vymaž náhledy +PREFERENCES_CACHEFORMAT1;Vlastní (rychlejší a kvalitnější) +PREFERENCES_CACHEFORMAT2;JPEG (Menší velikost) +PREFERENCES_CACHEMAXENTRIES;Maximální počet záznamů v cache. +PREFERENCES_CACHEOPTS;Vlastnosti cache +PREFERENCES_CACHESTRAT1;Upřednostnit rychlost před spotřebou paměti +PREFERENCES_CACHESTRAT2;Upřednostnit menší spotřebu paměti před rychlostí +PREFERENCES_CACHESTRAT;Strategie cache +PREFERENCES_CACHETHUMBFORM;Formát náhledů v cache +PREFERENCES_CACHETHUMBHEIGHT;Maximální velikost náhledu +PREFERENCES_CLEARDLG_LINE1;Čištění cache +PREFERENCES_CLEARDLG_LINE2;může trvat několik sekund. +PREFERENCES_CLEARDLG_TITLE;Prosím počkejte. +PREFERENCES_CLIPPINGIND;Zvýraznění oříznutých jasů či stínů +PREFERENCES_CMETRICINTENT;Kolorimetrická metoda +PREFERENCES_DATEFORMAT;Formát data +PREFERENCES_DATEFORMATHINT;Lze použít následující formátovací řetězce:\n%y : rok (year)\n%m : měsíc (month)\n%d : den (day)\n\nNapříklad český formát data:\n%d. %m. %y +PREFERENCES_DEFAULTLANG;Výchozí jazyk +PREFERENCES_DEFAULTTHEME;Výchozí vzhled +PREFERENCES_DEMOSAICINGALGO;Demozajkovací algoritmus +PREFERENCES_DIRHOME;Domovská složka +PREFERENCES_DIRLAST;Poslední navštívená složka +PREFERENCES_DIROTHER;Jiná +PREFERENCES_DIRSELECTDLG;Zvolte složku s obrázky pro spuštění... +PREFERENCES_DIRSOFTWARE;Instalační složka +PREFERENCES_DMETHOD;Metoda +PREFERENCES_EDITORCMDLINE;Jiný příkaz +PREFERENCES_EXTERNALEDITOR;Externí editor +PREFERENCES_FALSECOLOR;Počet kroků při potlačování chybných barev +PREFERENCES_FBROWSEROPTS;Volby prohlížeče souborů +PREFERENCES_FILEFORMAT;Formát souboru +PREFERENCES_FORIMAGE;Pro obrázkové soubory +PREFERENCES_FORRAW;Pro RAW soubory +PREFERENCES_GIMPPATH;GIMP instalační adresář +PREFERENCES_GTKTHEME;GTK výchozí +PREFERENCES_HINT;Nápověda +PREFERENCES_HLTHRESHOLD;Práh pro oříznutá světla +PREFERENCES_ICCDIR;Složka ICC profilů +PREFERENCES_IMPROCPARAMS;Výchozí profily pro zpracování obrázku +PREFERENCES_INTENT_ABSOLUTE;Absolutní kolorimetrie +PREFERENCES_INTENT_PERCEPTUAL;Vnímání +PREFERENCES_INTENT_RELATIVE;Relativní kolorimetrie +PREFERENCES_INTENT_SATURATION;Saturace +PREFERENCES_LIVETHUMBNAILS;Živé náhledy (pomalejší) +PREFERENCES_MONITORICC;Profil monitoru +PREFERENCES_OUTDIRFOLDERHINT;Uloží obrázky do vybraného adresáře +PREFERENCES_OUTDIRFOLDER;Ulož do souboru +PREFERENCES_OUTDIRHINT;Lze použít následující formátovací řetězce:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nTyto formátovací řetězce reprezentují adresáře a části cesty, kde je uložen raw soubor.\n\nNapříklad pokud je otevřen soubor /home/tom/image/02-09-2006/dsc0012.nef, mají jednotlivé formátovací řetězce tento význam:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nPokud si přejete uložit výstupní obrázek vedle originálu, napiště:\n%p1/%f\n\nJestliže si jej ale přejete uložit do adresáře 'converted' ve stejném adresáři jako originál, napiště:\n%p1/converted/%f\n\nPro uložení výstupního obrázku do adresáře '/home/tom/converted' se zachováním adresáře s datem, použijte:\n%p2/converted/%d1/%f +PREFERENCES_OUTDIRTEMPLATEHINT;Lze použít následující formátovací řetězce:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nTyto formátovací řetězce reprezentují adresáře a části cesty, kde je uložen raw soubor.\n\nNapříklad pokud je otevřen soubor /home/tom/image/02-09-2006/dsc0012.nef, mají jednotlivé formátovací řetězce tento význam:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nPokud si přejete uložit výstupní obrázek vedle originálu, napiště:\n%p1/%f\n\nJestliže si jej ale přejete uložit do adresáře 'converted' ve stejném adresáři jako originál, napiště:\n%p1/converted/%f\n\nPro uložení výstupního obrázku do adresáře '/home/tom/converted' se zachováním adresáře s datem, použijte:\n%p2/converted/%d1/%f +PREFERENCES_OUTDIRTEMPLATE;Použij šablonu +PREFERENCES_OUTDIR;Výstupní složka +PREFERENCES_PARSEDEXTADDHINT;Vložte příponu a stiskněte toto tlačítko pro přidání do seznamu +PREFERENCES_PARSEDEXTADD;Přidej příponu +PREFERENCES_PARSEDEXTDELHINT;Vymaže označenou příponu ze seznamu +PREFERENCES_PARSEDEXT;Zobrazované přípony +PREFERENCES_PROFILEHANDLING;Profily zpracování +PREFERENCES_PROFILELOADPR;Priorita nahrávání profilu +PREFERENCES_PROFILEPRCACHE;Profil v cache +PREFERENCES_PROFILEPRFILE;Profil uložený se zdrojovým souborem +PREFERENCES_PROFILESAVECACHE;Ukládat parametry zpracování do cache +PREFERENCES_PROFILESAVEINPUT;Ukládat parametry zpracování se zdrojovým souborem +PREFERENCES_PSPATH;Adobe Photoshop instalační adresář +PREFERENCES_SELECTICCDIRDLG;Zvolte složky s ICC profily... +PREFERENCES_SELECTLANG;Volba jazyka +PREFERENCES_SELECTMONITORPROFDLG;Zvolte ICC profil obrazovky... +PREFERENCES_SELECTTHEME;Vybraný vzhled +PREFERENCES_SHOWBASICEXIF;Zobrazovat základní informace z EXIF +PREFERENCES_SHOWDATETIME;Zobrazovat datum a čas +PREFERENCES_SHOWONLYRAW;Zobrazovat pouze soubory RAW +PREFERENCES_SHTHRESHOLD;Práh pro oříznuté stíny +PREFERENCES_STARTUPIMDIR;Složka s obrázky při spuštění +PREFERENCES_TAB_BROWSER;Prohlížeč souborů +PREFERENCES_TAB_COLORMGR;Správa barev +PREFERENCES_TAB_GENERAL;Obecné +PREFERENCES_TAB_IMPROC;Zpracování obrázku +PREFERENCES_TAB_OUTPUT;Volby výstupu +PREFERENCES_THUMBSIZE;Velikost náhledu +PROFILEPANEL_FILEDLGFILTERANY;Jakékoliv souboru +PROFILEPANEL_FILEDLGFILTERPP;Profily zpracování +PROFILEPANEL_LABEL;Profily zpracování +PROFILEPANEL_LOADDLGLABEL;Načíst parametry zpracování... +PROFILEPANEL_PCUSTOM;Vlastní +PROFILEPANEL_PFILE;Ze souboru +PROFILEPANEL_PLASTPHOTO;Poslední obrázek +PROFILEPANEL_PLASTSAVED;Poslední uschovaný +PROFILEPANEL_PROFILE;Profil +PROFILEPANEL_SAVEDLGLABEL;Uschovat parametry zpracování... +PROFILEPANEL_TOOLTIPCOPY;Uložit aktuální profil do schránky +PROFILEPANEL_TOOLTIPLOAD;Načíst profil ze souboru +PROFILEPANEL_TOOLTIPPASTE;Vložit profil ze schránky +PROFILEPANEL_TOOLTIPSAVE;Uschovat současný profil +PROGRESSBAR_DECODING;Dekódování RAW... +PROGRESSBAR_DEMOSAICING;Demozajkování... +PROGRESSBAR_LOADING;Načítám obrázek... +PROGRESSBAR_LOADJPEG;Načítám JPEG... +PROGRESSBAR_LOADPNG;Načítám PNG... +PROGRESSBAR_LOADTIFF;Načítám TIFF... +PROGRESSBAR_PROCESSING;Zpracovávám obrázek... +PROGRESSBAR_READY;Připraven. +PROGRESSBAR_SAVEJPEG;Ukládám jako JPEG... +PROGRESSBAR_SAVEPNG;Ukládám jako PNG... +PROGRESSBAR_SAVETIFF;Ukládám jako TIFF... +PROGRESSDLG_LOADING;Loading file... +PROGRESSDLG_PROCESSING;Processing image... +PROGRESSDLG_SAVING;Saving file... +QINFO_FOCALLENGTH;Ohnisková vzdálenost +QINFO_ISO;ISO +QINFO_LENS;Lens +QINFO_NOEXIF;Exif údaje nejsou k dispozici. +SAVEDLG_FILEFORMAT;Formát souboru +SAVEDLG_JPEGQUAL;JPEG Kvalita +SAVEDLG_JPGFILTER;Soubory JPEG +SAVEDLG_PNGCOMPR;PNG Komprese +SAVEDLG_PNGFILTER;Soubory PNG +SAVEDLG_PUTTOQUEUEHEAD;Put to the head of the processing queue +SAVEDLG_PUTTOQUEUETAIL;Put to the end of the processing queue +SAVEDLG_PUTTOQUEUE;Vložit soubor do fronty +SAVEDLG_SAVEIMMEDIATELY;Okamžitě uložit +SAVEDLG_SAVESPP;Uschovat s obrazem i parametry zpracování +SAVEDLG_TIFFFILTER;Soubory TIFF +TOOLBAR_TOOLTIP_CROP;Označení výřezu (shortcut key: C) +TOOLBAR_TOOLTIP_HAND;Nástroj ruka (shortcut key: N) +TOOLBAR_TOOLTIP_STRAIGHTEN;Vyznačení roviny (shortcut key: S) +TOOLBAR_TOOLTIP_WB;Bodové vyvážení bílé (shortcut key: W) +TP_CACORRECTION_BLUE;Modrá +TP_CACORRECTION_LABEL;Oprava chromatické vady +TP_CACORRECTION_RED;Červená +TP_CHMIXER_BLUE;Modrá +TP_CHMIXER_GREEN;Zelená +TP_CHMIXER_LABEL;Míchání kanálů +TP_CHMIXER_RED;Červená +TP_COARSETRAF_DEGREE;Stupeň: +TP_COARSETRAF_TOOLTIP_HFLIP;Překlopit horizontálně +TP_COARSETRAF_TOOLTIP_ROTLEFT;Otočit doleva +TP_COARSETRAF_TOOLTIP_ROTRIGHT;Otočit doprava +TP_COARSETRAF_TOOLTIP_VFLIP;Překlopit vertikálně +TP_COLORBOOST_ACHANNEL;kanál "a" +TP_COLORBOOST_AMOUNT;Míra +TP_COLORBOOST_AVOIDCOLORCLIP;Zabránit oříznutí barvy +TP_COLORBOOST_BCHANNEL;kanál "b" +TP_COLORBOOST_CHAB;a & b +TP_COLORBOOST_CHANNEL;Kanál +TP_COLORBOOST_CHSEPARATE;zvlášť +TP_COLORBOOST_ENABLESATLIMITER;Omezovat sytost +TP_COLORBOOST_LABEL;Sytost barev +TP_COLORBOOST_SATLIMIT;Limit sytosti +TP_COLORDENOISE_EDGESENSITIVE;Citlivost k okrajům +TP_COLORDENOISE_EDGETOLERANCE;Tolerance okrajům +TP_COLORDENOISE_LABEL;Redukce barevného šumu +TP_COLORDENOISE_RADIUS;Poloměr +TP_COLORSHIFT_BLUEYELLOW;Modrá-Žlutá +TP_COLORSHIFT_GREENMAGENTA;Modrá-Purpurová +TP_COLORSHIFT_LABEL;Barevný posun +TP_CROP_DPI;DPI= +TP_CROP_FIXRATIO;Poměr stran: +TP_CROP_GTDIAGONALS;Pravidlo diagonál +TP_CROP_GTHARMMEANS1;Zlatý řez 1 +TP_CROP_GTHARMMEANS2;Zlatý řez 2 +TP_CROP_GTHARMMEANS3;Zlatý řez 3 +TP_CROP_GTHARMMEANS4;Zlatý řez 4 +TP_CROP_GTNONE;Žádné +TP_CROP_GTRULETHIRDS;Pravidlo třetin +TP_CROP_GUIDETYPE;Druh vodítek: +TP_CROP_H;V +TP_CROP_LABEL;Výřez +TP_CROP_SELECTCROP; Označení výřezu +TP_CROP_W;Š +TP_CROP_X;x +TP_CROP_Y;y +TP_DISTORTION_AMOUNT;Míra +TP_DISTORTION_LABEL;Oprava zkreslení objektivu +TP_EXPOSURE_AUTOLEVELS;Úrovně automaticky +TP_EXPOSURE_BLACKLEVEL;Černá +TP_EXPOSURE_BRIGHTNESS;Jas +TP_EXPOSURE_CLIP;Oříznutí +TP_EXPOSURE_COMPRHIGHLIGHTS;Komprese světel +TP_EXPOSURE_COMPRSHADOWS;Komprese stínů +TP_EXPOSURE_CONTRAST;Kontrast +TP_EXPOSURE_CURVEEDITOR;Tonální křivka +TP_EXPOSURE_EXPCOMP;Korekce expozice +TP_EXPOSURE_LABEL;Expozice +TP_HLREC_CIELAB;Mísení CIELAB +TP_HLREC_COLOR;Propagace barev +TP_HLREC_LABEL;Obnovení jasů +TP_HLREC_LUMINANCE;Obnovení jasů +TP_HLREC_METHOD;Metoda: +TP_ICM_FILEDLGFILTERANY;Jakékoliv soubory +TP_ICM_FILEDLGFILTERICM;Soubory ICC profilů +TP_ICM_GAMMABEFOREINPUT;Profil provádí Gama korekci +TP_ICM_INPUTCAMERA;Výchozí profil fotoaparátu +TP_ICM_INPUTCUSTOM;Vlastní +TP_ICM_INPUTDLGLABEL;Vyber vstupní ICC profil... +TP_ICM_INPUTEMBEDDED;Použít vložený profil, pokud je k dispozici +TP_ICM_INPUTPROFILE;Vstupní profil +TP_ICM_LABEL;ICM +TP_ICM_NOICM;Bez správy barev: sRGB výstup +TP_ICM_OUTPUTDLGLABEL;Vyber výstupní ICC profil... +TP_ICM_OUTPUTPROFILE;Výstupní barevný prostor +TP_ICM_SAVEREFERENCE;Uložit referenční obrázek pro profilování +TP_ICM_WORKINGPROFILE;Pracovní barevný prostor +TP_LUMACURVE_BLACKLEVEL;Černá +TP_LUMACURVE_BRIGHTNESS;Jas +TP_LUMACURVE_COMPRHIGHLIGHTS;Komprese světel +TP_LUMACURVE_COMPRSHADOWS;Komprese stínů +TP_LUMACURVE_CONTRAST;Kontrast +TP_LUMACURVE_CURVEEDITOR;Křivka +TP_LUMACURVE_LABEL;Křivka jasu v CIELAB +TP_LUMADENOISE_EDGETOLERANCE;Tolerance okrajů +TP_LUMADENOISE_LABEL;Redukce šumu v jasech +TP_LUMADENOISE_RADIUS;Poloměr +TP_RESIZE_BICUBIC;Bikubická +TP_RESIZE_BICUBICSF;Bikubická (Měkčí) +TP_RESIZE_BICUBICSH;Bikubická (Ostřejší) +TP_RESIZE_BILINEAR;Bilineární +TP_RESIZE_FULLSIZE;Plná velikost obrázku: +TP_RESIZE_H;V: +TP_RESIZE_LABEL;Změnit rozměry +TP_RESIZE_METHOD;Metoda: +TP_RESIZE_NEAREST;Nejbližší +TP_RESIZE_SCALE;Měřítko +TP_RESIZE_W;Š: +TP_ROTATE_AUTOCROP;Automatický ořez +TP_ROTATE_DEGREE;Stupně +TP_ROTATE_FILL;Vyplnit +TP_ROTATE_LABEL;Otáčení +TP_ROTATE_SELECTLINE; Vyznač rovinu +TP_SHADOWSHLIGHTS_HIGHLIGHTS;Světla +TP_SHADOWSHLIGHTS_HLTONALW;Tonální rozsah +TP_SHADOWSHLIGHTS_LABEL;Stíny/Světla +TP_SHADOWSHLIGHTS_LOCALCONTR;Místní kontrast +TP_SHADOWSHLIGHTS_RADIUS;Poloměr +TP_SHADOWSHLIGHTS_SHADOWS;Stíny +TP_SHADOWSHLIGHTS_SHTONALW;Tonální rozsah +TP_SHARPENING_AMOUNT;Míra +TP_SHARPENING_EDRADIUS;Poloměr +TP_SHARPENING_EDTOLERANCE;Tolerance okrajů +TP_SHARPENING_HALOCONTROL;Omezení haló artefatů +TP_SHARPENING_HCAMOUNT;Míra +TP_SHARPENING_LABEL;Doostření +TP_SHARPENING_METHOD;Metoda +TP_SHARPENING_ONLYEDGES;Doostřit pouze okraje +TP_SHARPENING_RADIUS;Poloměr +TP_SHARPENING_RLD_AMOUNT;Míra +TP_SHARPENING_RLD_DAMPING;Útlum +TP_SHARPENING_RLD_ITERATIONS;Počet opakování +TP_SHARPENING_RLD;RL Dekonvoluce +TP_SHARPENING_THRESHOLD;Práh +TP_SHARPENING_USM;Maskovat rozostření +TP_VIGNETTING_AMOUNT;Míra +TP_VIGNETTING_LABEL;Oprava vinětace +TP_VIGNETTING_RADIUS;Poloměr +TP_WBALANCE_AUTO;Automaticky +TP_WBALANCE_CAMERA;Fotoaparát +TP_WBALANCE_CUSTOM;Vlastní +TP_WBALANCE_GREEN;Odstín +TP_WBALANCE_LABEL;Vyvážení bílé +TP_WBALANCE_METHOD;Metoda +TP_WBALANCE_SIZE;Rozměr: +TP_WBALANCE_SPOTWB;Bodové vyvážení +TP_WBALANCE_TEMPERATURE;Teplota +ZOOMBAR_DETAIL;Detail +ZOOMBAR_HUGE;Veliký +ZOOMBAR_LARGE;Větší +ZOOMBAR_NORMAL;Normální +ZOOMBAR_PREVIEW;Náhled +ZOOMBAR_SCALE;Měřítko +ZOOMBAR_SMALL;Malý + +GENERAL_HIGH_QUALITY;High Quality +GENERAL_UNCHANGED;(Unchanged) +MAIN_MSG_PLACES;Places +GENERAL_BEFORE;Before +GENERAL_AFTER;After +MAIN_TOOLTIP_TOGGLE;Toggle before/after view +MAIN_BUTTON_PUTTOQUEUE;Put to queue +MAIN_MSG_NAVIGATOR;Navigator +FILEBROWSER_TOOLTIP_STOPPROCESSING;Start processing automatically when a new job arrives +BATCHQUEUE_AUTOSTART;Auto start +TP_DETAIL_AMOUNT;Amount +TP_RESIZE_SPECIFY;Specify: +TP_RESIZE_SCALE;Scale +TP_RESIZE_WIDTH;Width +TP_RESIZE_HEIGHT;Height +MAIN_TOGGLE_BEFORE_AFTER;B|A + ### diff --git a/rtdata/languages/Deutsch b/rtdata/languages/Deutsch index a432bcbb2..91106cda9 100644 --- a/rtdata/languages/Deutsch +++ b/rtdata/languages/Deutsch @@ -1,641 +1,641 @@ -# -# This file is part of RawTherapee. -# -# Copyright (c) 2004-2010 Gabor Horvath -# -# RawTherapee is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# RawTherapee is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with RawTherapee. If not, see . -# -# Deutsch: Deutschland -# (keenonkites; Aktualisierte Version für 2.3 beta2) -# (phberlin; basiert auf keenonkites' Erstübersetzung) -# 08.01.2008/15.01.2008/20.02.2008 -# 19.12.2008: keenonkites, Anpassungen für 2.4beta4 -# 20.12.2007 -# 20.9.2008: keenonkites, Anpassungen für 2.4m2 -# 22.12.2007 -# 4.4.2008: Anpassungen für 2.4 -# Leichte Anpassungen (keenonkites/klonk) -ADJUSTER_RESET_TO_DEFAULT;Zurück zum Standard -CURVEEDITOR_FILEDLGFILTERANY;Alle Dateien -CURVEEDITOR_FILEDLGFILTERCURVE;Kurvendateien -CURVEEDITOR_LINEAR;Linear -CURVEEDITOR_LOADDLGLABEL;Kurve Laden... -CURVEEDITOR_SAVEDLGLABEL;Kurve Speichern... -CURVEEDITOR_TOOLTIPLINEAR;Zurücksetzen der Kurve (linear) -CURVEEDITOR_TOOLTIPLOAD;Laden einer Kurve -CURVEEDITOR_TOOLTIPSAVE;Speichern der aktuellen Kurve -EXIFFILTER_APERTURE;Blende -EXIFFILTER_CAMERA;Kamera -EXIFFILTER_DIALOGLABEL;Exif Filter -EXIFFILTER_FOCALLEN;Brennweite -EXIFFILTER_ISO;ISO -EXIFFILTER_LENS;Objektiv -EXIFFILTER_SHUTTER;Verschlusszeit -EXIFPANEL_ADDEDIT;Neu/Ändern -EXIFPANEL_ADDEDITHINT;Hinzufügen eines neuen oder Ändern eines bestehenden Attributs -EXIFPANEL_ADDTAGDLG_ENTERVALUE;Wert eingeben -EXIFPANEL_ADDTAGDLG_SELECTTAG;Attribut wählen -EXIFPANEL_ADDTAGDLG_TITLE;Attribut hinzufügen/ändern -EXIFPANEL_KEEP;Behalten -EXIFPANEL_KEEPHINT;Behalten der gewählten Attribute beim Erzeugen des Bildes -EXIFPANEL_REMOVE;Entfernen -EXIFPANEL_REMOVEHINT;Entfernen der gewählten Attributen beim Erzeugen des Bildes -EXIFPANEL_RESET;Zurücksetzen -EXIFPANEL_RESETALL;Alle zurücksetzen -EXIFPANEL_RESETALLHINT;Alle Attribute zu den ursrpünglichen Werten zurücksetzen -EXIFPANEL_RESETHINT;Gewählte Attribute zu den ursprünglich Werten zurücksetzen -EXIFPANEL_SUBDIRECTORY;Unterverzeichnis -FILEBROWSER_APPLYPROFILE;Profil anwenden -FILEBROWSER_ARRANGEMENTHINT;Wechseln zwischen vertikaler und horizontaler Ausrichtung der Voransichten -FILEBROWSER_CLEARPROFILE;Profil löschen -FILEBROWSER_COPYPROFILE;Profil kopieren -FILEBROWSER_DELETEDLGLABEL;Bestätige Löschen von Dateien -FILEBROWSER_DELETEDLGMSG;Wollen sie wirklich %1 Dateien löschen? -FILEBROWSER_EMPTYTRASH;Papierkorb leeren -FILEBROWSER_EMPTYTRASHHINT;Endgültiges Löschen der Dateien im Papierkorb -FILEBROWSER_EXIFFILTERAPPLY;Anwenden -FILEBROWSER_EXIFFILTERAPPLYHINT;Ein-/Ausschalten des Exif Filters im Datei-Browser -FILEBROWSER_EXIFFILTERLABEL;Exif Filter -FILEBROWSER_EXIFFILTERSETTINGS;Einstellungen -FILEBROWSER_EXIFFILTERSETTINGSHINT;Ändern der Einstellungen des Exif Filters -FILEBROWSER_PARTIALPASTEPROFILE;Profil selektiv einfügen -FILEBROWSER_PASTEPROFILE;Profil einfügen -FILEBROWSER_POPUPCANCELJOB;Job abbrechen -FILEBROWSER_POPUPMOVEEND;Ans Ende der Warteschlange verschieben -FILEBROWSER_POPUPMOVEHEAD;An den Anfang der Warteschlange verschieben -FILEBROWSER_POPUPOPEN;Öffnen -FILEBROWSER_POPUPPROCESS;Bild zur Warteschlange hinzufügen -FILEBROWSER_POPUPRANK1;Mit 1 Stern bewerten -FILEBROWSER_POPUPRANK2;Mit 2 Sternen bewerten -FILEBROWSER_POPUPRANK3;Mit 3 Sternen bewerten -FILEBROWSER_POPUPRANK4;Mit 4 Sternen bewerten -FILEBROWSER_POPUPRANK5;Mit 5 Sternen bewerten -FILEBROWSER_POPUPREMOVE;Aus dem Verzeichnis Löschen -FILEBROWSER_POPUPRENAME;Umbenennen -FILEBROWSER_POPUPSELECTALL;Alle auswählen -FILEBROWSER_POPUPTRASH;In den Papierkorb verschieben -FILEBROWSER_POPUPUNRANK;Entfernen der Bewertung -FILEBROWSER_POPUPUNTRASH;Aus dem Papierkorb retten -FILEBROWSER_PROCESSINGSETTINGS;Einstellungen -FILEBROWSER_PROCESSINGSETTINGSHINT;Einstellen von Ausgabeformat und Ausgabeverzeichnis -FILEBROWSER_RENAMEDLGLABEL;Datei umbenennen -FILEBROWSER_RENAMEDLGMSG;Umbenennen der Datei "%1" nach: -FILEBROWSER_SHOWDIRHINT;Alle Bilder im Verzeichnis zeigen -FILEBROWSER_SHOWQUEUEHINT;Inhalt der Warteschlange zeigen -FILEBROWSER_SHOWRANK1HINT;Bilder 1 Stern zeigen -FILEBROWSER_SHOWRANK2HINT;Bilder 2 Stern zeigen -FILEBROWSER_SHOWRANK3HINT;Bilder 3 Stern zeigen -FILEBROWSER_SHOWRANK4HINT;Bilder 4 Stern zeigen -FILEBROWSER_SHOWRANK5HINT;Bilder 5 Stern zeigen -FILEBROWSER_SHOWTRASHHINT;Bilder im Papierkorb zeigen -FILEBROWSER_SHOWUNRANKHINT;Unbewertete Bilder zeigen -FILEBROWSER_STARTPROCESSING;Verarbeitung starten -FILEBROWSER_STARTPROCESSINGHINT;Verarbeitung/Speichern der Bilder in der Warteschlange starten -FILEBROWSER_STOPPROCESSING;Verarbeitung stoppen -FILEBROWSER_STOPPROCESSINGHINT;Verarbeitung der Bilder stoppen -FILEBROWSER_THUMBSIZE;Grösse d. Vorschau -FILEBROWSER_ZOOMINHINT;Vergrössern der Vorschau -FILEBROWSER_ZOOMOUTHINT;Verkleinern der Vorschau -GENERAL_ABOUT;Über -GENERAL_CANCEL;Abbruch -GENERAL_DISABLE;ausschalten -GENERAL_DISABLED;ausgeschaltet -GENERAL_ENABLE;einschalten -GENERAL_ENABLED;eingeschaltet -GENERAL_LANDSCAPE;Quer -GENERAL_LOAD;Laden -GENERAL_NA;n/a -GENERAL_NO;Nein -GENERAL_OK;OK -GENERAL_PORTRAIT;Hoch -GENERAL_SAVE;Speichern -GENERAL_YES;Ja -HISTOGRAM_LABEL;Histogram -HISTOGRAM_TOOLTIP_B;Zeigen/Verstecke BLAU-Histogramm -HISTOGRAM_TOOLTIP_G;Zeigen/Verstecke GRÜN-Histogramm -HISTOGRAM_TOOLTIP_L;Zeigen/Verstecke CIELAB-Luminanz-Histogramm -HISTOGRAM_TOOLTIP_R;Zeigen/Verstecke ROT-Histogramm -HISTORY_CHANGED;Verändert -HISTORY_CUSTOMCURVE;Benutzerdefinierte Kurve -HISTORY_DELSNAPSHOT;Variante löschen -HISTORY_FROMCLIPBOARD;Aus der Zwischenablage -HISTORY_LABEL;Abfolge der Änderungen -HISTORY_MSG_10;Schatten-Kompression -HISTORY_MSG_11;Tonwertkurve -HISTORY_MSG_12;Automatische Belichtung -HISTORY_MSG_13;Belichtungsbeschneidung -HISTORY_MSG_14;Luminanz Helligkeit -HISTORY_MSG_15;Luminanz Kontrast -HISTORY_MSG_16;Luminanz Schwarz -HISTORY_MSG_17;Luminanz Lichter-Kompression -HISTORY_MSG_18;Luminanz Schatten-Kompression -HISTORY_MSG_19;Luminanz Kurve -HISTORY_MSG_1;Bild geladen -HISTORY_MSG_20;Schärfen -HISTORY_MSG_21;Schärfen Radius -HISTORY_MSG_22;Schärfen Menge -HISTORY_MSG_23;Schärfen Schwellwert -HISTORY_MSG_24;Schärfen nur Kanten -HISTORY_MSG_25;Schärfen Kantensuche Radius -HISTORY_MSG_26;Schärfen Kanten-Toleranz -HISTORY_MSG_27;Schärfen Halo-Kontrolle -HISTORY_MSG_28;Schärfen Halo-Kontrolle Menge -HISTORY_MSG_29;Schärfen Methode -HISTORY_MSG_2;Profil geladen -HISTORY_MSG_30;Dekonvolution Radius -HISTORY_MSG_31;Dekonvolution Menge -HISTORY_MSG_32;Dekonvolution Dämpfung -HISTORY_MSG_33;Dekonvolution Iterationen -HISTORY_MSG_34;Verhindere Farbbeschneidungen -HISTORY_MSG_35;Begrenzung der Sättigung -HISTORY_MSG_36;Sättigungsgrenzwert -HISTORY_MSG_37;Farbverstärkung -HISTORY_MSG_38;Weißabgleich Methode -HISTORY_MSG_39;Farbtemperatur -HISTORY_MSG_3;Profil geändert -HISTORY_MSG_40;Weißabgleich Farbton -HISTORY_MSG_41;Farbkorrektur "A" -HISTORY_MSG_42;Farbkorrektur "B" -HISTORY_MSG_43;Luminanz-Rauschfilter -HISTORY_MSG_44;Luminanz-Rauschfilter Radius -HISTORY_MSG_45;Luminanz-Rauschfilter Kantentoleranz -HISTORY_MSG_46;Farb-Rauschfilter -HISTORY_MSG_47;Farb-Rauschfilter Radius -HISTORY_MSG_48;Farb-Rauschfilter Kantentoleranz -HISTORY_MSG_49;Farb-Rauschfilter Kantensuche -HISTORY_MSG_4;Abfolge der Änderungen durchsehen -HISTORY_MSG_50;Schatten/Lichter-Werkzeug -HISTORY_MSG_51;Abschwächen der Lichter -HISTORY_MSG_52;Verstärken der Schatten -HISTORY_MSG_53;Tonweite Lichter -HISTORY_MSG_54;Tonweite Schatten -HISTORY_MSG_55;Lokaler Kontrast -HISTORY_MSG_56;Schatten/Lichter-Radius -HISTORY_MSG_57;grobe Drehung -HISTORY_MSG_58;Horizontal spiegeln -HISTORY_MSG_59;Vertikal spiegeln -HISTORY_MSG_5;Helligkeit -HISTORY_MSG_60;Drehung -HISTORY_MSG_61;Drehung -HISTORY_MSG_62;Objektiv-Verzerrungskorrektur -HISTORY_MSG_63;Variante gewählt -HISTORY_MSG_64;Bild beschneiden -HISTORY_MSG_65;Farbsaum-Entfernung -HISTORY_MSG_66;Lichter wiederherstellen -HISTORY_MSG_67;Lichter wiederherstellen Menge -HISTORY_MSG_68;Lichter wiederherstellen Methode -HISTORY_MSG_69;Aktueller Farbraum -HISTORY_MSG_6;Kontrast -HISTORY_MSG_70;Farbraum für Ausgabe -HISTORY_MSG_71;Farbraum für Eingabe -HISTORY_MSG_72;Korrektur Randlichtabfall -HISTORY_MSG_73;Kanal-Mixer -HISTORY_MSG_74;Änderung Größe - Maßstab -HISTORY_MSG_75;Änderung Größe - Methode -HISTORY_MSG_76;Exif Metadaten -HISTORY_MSG_77;IPTC Metadaten -HISTORY_MSG_78;Angaben für Änderung Größe -HISTORY_MSG_79;Änderung Größe - Breite -HISTORY_MSG_7;Schwarz -HISTORY_MSG_80;Änderung Größe - Höhe -HISTORY_MSG_81;Änderung Größe - eingeschaltet -HISTORY_MSG_8;Belichtungskorrektur -HISTORY_MSG_9;Lichter-Kompression -HISTORY_NEWSNAPSHOT;Neue Variante -HISTORY_NEWSNAPSHOTAS;als... -HISTORY_NEWSSDIALOGLABEL;Name der Variante: -HISTORY_NEWSSDIALOGTITLE;Variante hinzufügen -HISTORY_SETTO;Setzen auf -HISTORY_SNAPSHOT;Variante -HISTORY_SNAPSHOTS;Varianten -ICMPANEL_FILEDLGFILTERANY;Alle Dateien -ICMPANEL_FILEDLGFILTERICM;ICC-Profildatei -ICMPANEL_GAMMABEFOREINPUT;Profil enthält Gammaanpassung -ICMPANEL_INPUTCAMERA;Kamera-Standard -ICMPANEL_INPUTCUSTOM;Benutzerdefiniert -ICMPANEL_INPUTDLGLABEL;Wähle Eingabe-ICC-Profil... -ICMPANEL_INPUTEMBEDDED;Verwende eingebettetes, wenn möglich -ICMPANEL_INPUTPROFILE;Eingabeprofil -ICMPANEL_NOICM;Kein ICM: sRGB-Ausgabe -ICMPANEL_OUTPUTDLGLABEL;Wähle Ausgabe-ICC-Profil... -ICMPANEL_OUTPUTPROFILE;Ausgabeprofil -ICMPANEL_SAVEREFERENCE;Speichere Referenzbild für die Profilierung -ICMPANEL_WORKINGPROFILE;Arbeitsfarbraum -IMAGEAREA_DETAILVIEW;Detailansicht -IPTCPANEL_AUTHOR;Autor -IPTCPANEL_AUTHORHINT;Name des Autors, z.B. Name des Fotografen oder des Künstlers (By-line). -IPTCPANEL_AUTHORSPOSITION;Position des Autors -IPTCPANEL_AUTHORSPOSITIONHINT;Titel des Autors oder der Autoren (By-line Title). -IPTCPANEL_CAPTION;Bildbeschreibung -IPTCPANEL_CAPTIONHINT;Beschreibung des Bildinhaltes (Caption - Abstract) -IPTCPANEL_CAPTIONWRITER;Autor der Bildbeschreibung -IPTCPANEL_CAPTIONWRITERHINT;Name der beim Schreiben, Editieren oder Korrigieren des Bildes oder der Bildbeschreibung beteiligten Person (Writer - Editor). -IPTCPANEL_CATEGORY;Kategorie -IPTCPANEL_CATEGORYHINT;3-stelliger Code, der die Kategorie des Bildes beschreibt (Category). -IPTCPANEL_CITY;Stadt -IPTCPANEL_CITYHINT;Aufnahmeort: Stadt (City). -IPTCPANEL_COPYHINT;IPTC Werte in die Zwischenablage kopieren -IPTCPANEL_COPYRIGHT;Copyright -IPTCPANEL_COPYRIGHTHINT;Alle nötigen Hinweise über Urheberrechte (Copyright Notice). -IPTCPANEL_COUNTRY;Land -IPTCPANEL_COUNTRYHINT;Aufnahmeort: Land (Country - Primary Location Name). -IPTCPANEL_CREDIT;Bildrechte -IPTCPANEL_CREDITHINT;Identifiziert den Anbieter des Bildes, es muss nicht der Eigentümer sein (Credit). -IPTCPANEL_DATECREATED;Erstellt am -IPTCPANEL_DATECREATEDHINT;Das Datum an dem der Inhalt des Bildes kreiert wurde; Format: JJJJMMTT (Date Created). -IPTCPANEL_EMBEDDED;Eingebettete -IPTCPANEL_EMBEDDEDHINT;Zu den im Bild eingebetteten Werten zurücksetzen. -IPTCPANEL_HEADLINE;Bildtitel -IPTCPANEL_HEADLINEHINT;Kurzform der Bildbeschreibung, könnte als Überschrift an das Bild geklebt werden (Headline). -IPTCPANEL_INSTRUCTIONS;Hinweise -IPTCPANEL_INSTRUCTIONSHINT;Besondere Hinweise bezüglich der Verwendung des Bildes (Special Instructions). -IPTCPANEL_KEYWORDS;Schlagwörter -IPTCPANEL_KEYWORDSHINT;Stichwörter für das spätere Wiederfinden der Bilder (Keywords). -IPTCPANEL_PASTEHINT;Einfügen der IPTC Werte aus der Zwischenablage -IPTCPANEL_PROVINCE;Provinz -IPTCPANEL_PROVINCEHINT;Aufnahmeort: Provinz (Province-State). -IPTCPANEL_RESET;Zurücksetzen -IPTCPANEL_RESETHINT;Zu den im Profil gesetzten Werten zurücksetzen. -IPTCPANEL_SOURCE;Quelle -IPTCPANEL_SOURCEHINT;Der ursprüngliche Eigentümer des Werkes auf dem Bild (Source). -IPTCPANEL_SUPPCATEGORIES;Zusätz. Kategorien -IPTCPANEL_SUPPCATEGORIESHINT;Frei wählbare zusätzliche Kategorien (Supplemental Categories). -IPTCPANEL_TITLE;Titel -IPTCPANEL_TITLEHINT;Kurztitel des Bildes (Object Name). -IPTCPANEL_TRANSREFERENCE;Übertragungs Referenz -IPTCPANEL_TRANSREFERENCEHINT;Ein Code, der den ursprünglichen Ort der Übertragung definiert (Original Transmission Reference). -MAIN_BUTTON_EXIT;Verlassen -MAIN_BUTTON_EXIT;Verlassen -MAIN_BUTTON_PREFERENCES;Einstellungen -MAIN_BUTTON_QUEUE;Auf die Warteschlange -MAIN_BUTTON_SAVE;Bild speichern -MAIN_BUTTON_SAVEAS;unter... -MAIN_BUTTON_SENDTOEDITOR;Im Editor laden -MAIN_FRAME_BATCHQUEUE;Warteschlange -MAIN_FRAME_FILEBROWSER;Dateiverwaltung -MAIN_FRAME_PLACES;Orte -MAIN_FRAME_PLACES_ADD;Hinzu -MAIN_FRAME_PLACES_DEL;Löschen -MAIN_FRAME_RECENT;Verwendete Ordner -MAIN_MSG_ALREADYEXISTS;Diese Datei existiert schon. -MAIN_MSG_CANNOTLOAD;Bild kann nicht geladen werden -MAIN_MSG_CANNOTSAVE;Fehler beim Speichern -MAIN_MSG_CANNOTSTARTEDITOR;Der Editor kann nicht gestartet werden. -MAIN_MSG_CANNOTSTARTEDITOR_SECONDARY;Setzen Sie bitte den richtigen Pfad in den Einstellungen. -MAIN_MSG_EXITJOBSINQUEUEINFO;Unverarbeitete Bilder in der Warteschlange gehen beim Verlassen der Anwendung verloren. -MAIN_MSG_EXITJOBSINQUEUEQUEST;Wollen Sie die Anwendung wirklich schliessen ? Es hat noch unverarbeitete Bilder in der Warteschlange. -MAIN_MSG_JOBSINQUEUE;Job in Bearbeitung -MAIN_MSG_QOVERWRITE;Wollen sie die Datei überschreiben ? -MAIN_TAB_BASIC;Basis -MAIN_TAB_COLOR;Farbe -MAIN_TAB_DETAIL;Detail -MAIN_TAB_DEVELOP;Entwickeln -MAIN_TAB_EXIF;Exif -MAIN_TAB_EXPOSURE;Belichtung -MAIN_TAB_FILTER;Metadaten-Filter -MAIN_TAB_ICM;ICM -MAIN_TAB_IPTC;IPTC -MAIN_TAB_METADATA;Metadata -MAIN_TAB_TAGGING;Tagging -MAIN_TAB_TRANSFORM;Verändern -MAIN_TOOLTIP_HIDEFP;Zeigen/Verstecken von Verzeichnis- und Datei-Browser (Taste F) -MAIN_TOOLTIP_HIDEHP;Zeigen/Verstecken linke Seite (Abfolge der Änderungen, Taste H) -MAIN_TOOLTIP_INDCLIPPEDH;zu helle Bereiche blinken -MAIN_TOOLTIP_INDCLIPPEDS;zu dunkle Bereiche blinken -MAIN_TOOLTIP_PREFERENCES;Einstellungen ändern -MAIN_TOOLTIP_QINFO;Kurze Info über das Bild -MAIN_TOOLTIP_SAVE;Speichere Bild im Standard-Verzeichnis -MAIN_TOOLTIP_SAVEAS;Speichere Bild in anderem Verzeichnis -PARTIALPASTE_BASICGROUP;Gruppe Basiseinstellungen -PARTIALPASTE_CACORRECTION;Farbsaum-Entfernung -PARTIALPASTE_COARSETRANS;90 Grad Rotieren / Spiegeln -PARTIALPASTE_COLORBOOST;Farbverstärkung -PARTIALPASTE_COLORDENOISE;Farb-Rauschfilter -PARTIALPASTE_COLORGROUP;Gruppe Farbeinstellungen -PARTIALPASTE_COLORMIXER;Kanal-Mixer -PARTIALPASTE_COLORSHIFT;Farbverschiebung -PARTIALPASTE_COMPOSITIONGROUP;Gruppe Gestaltungseinstellungen -PARTIALPASTE_CROP;Ausschnitt -PARTIALPASTE_DIALOGLABEL;Selektives Einfügen des Bearbeitungsprofiles -PARTIALPASTE_DISTORTION;Entzerrung -PARTIALPASTE_EXIFCHANGES;Exifdaten Änderungen -PARTIALPASTE_EXPOSURE;Belichtung -PARTIALPASTE_HLRECOVERY;Lichter wiederherstellen -PARTIALPASTE_ICMSETTINGS;Einstellungen ICM -PARTIALPASTE_IPTCINFO;IPTC Informationen -PARTIALPASTE_LENSGROUP;Gruppe Farbeinstellungen -PARTIALPASTE_LUMACURVE;Luminanzkurve -PARTIALPASTE_LUMADENOISE;Luminanz-Rauschfilter -PARTIALPASTE_LUMINANCEGROUP;Gruppe Luminanzeinstellungen -PARTIALPASTE_METAICMGROUP;Gruppe Einstellungen Metadaten/ICM -PARTIALPASTE_RESIZE;Grösse ändern -PARTIALPASTE_ROTATION;Drehen -PARTIALPASTE_SHADOWSHIGHLIGHTS;Schatten/Lichter -PARTIALPASTE_SHARPENING;Schärfen -PARTIALPASTE_VIGNETTING;Korrektur Randlichtabfall -PARTIALPASTE_WHITEBALANCE;Weissabgleich -PREFERENCES_APPLNEXTSTARTUP;beim nächsten Programmstart aktiv -PREFERENCES_BLINKCLIPPED;Zu helle/zu dunkle Bereiche blinken -PREFERENCES_CACHECLEARALL;Alles Löschen -PREFERENCES_CACHECLEARPROFILES;Löschen der Profile -PREFERENCES_CACHECLEARTHUMBS;Löschen der Voransichten -PREFERENCES_CACHEFORMAT1;Proprietär (schneller und höhere Qualität) -PREFERENCES_CACHEFORMAT2;JPEG (geringerer Diskplatz) -PREFERENCES_CACHEMAXENTRIES;Maximale Anzahl der Einträge im Zwischenspeicher -PREFERENCES_CACHEOPTS;Einstellungen des Zwischenspeichers für die Voransichten (Cache) -PREFERENCES_CACHESTRAT1;Priorität auf Geschwindigkeit (erhöhter Speicherverbrauch) -PREFERENCES_CACHESTRAT2;Priorität auf minimierten Speicherverbrauch (geringere Geschwindigkeit) -PREFERENCES_CACHESTRAT;Strategie des Zwischenspeichers -PREFERENCES_CACHETHUMBFORM;Format des Zwischenspeichers -PREFERENCES_CACHETHUMBHEIGHT;Maximale Höhe der Voransichten -PREFERENCES_CLEARDLG_LINE1;Löschen des Zwischenspeichers -PREFERENCES_CLEARDLG_LINE2;Das kann einige Sekunden dauern. -PREFERENCES_CLEARDLG_TITLE;Bitte warten -PREFERENCES_CLIPPINGIND;Anzeige zu helle/zu dunkle Bereiche -PREFERENCES_CMETRICINTENT;Farbraumtransformation -PREFERENCES_DATEFORMAT;Datumsformat -PREFERENCES_DATEFORMATHINT;Die folgenden Variablen können verwendet werden:\n%y : Jahr\n%m : Monat\n%d : Tag\n\nDas Deutsche Datumsformat zum Beispiel ist:\n%d/%m/%y -PREFERENCES_DCBENHANCE;DCB Verfeinerungsschritt durchführen -PREFERENCES_DCBITERATIONS;Anzahl der DCB Iterationen -PREFERENCES_DEFAULTLANG;Sprache für die Menüs und Dialoge -PREFERENCES_DEFAULTTHEME;Standard Oberflächendesign -PREFERENCES_DEMOSAICINGALGO;Algorithmus zur Entrasterung -PREFERENCES_DIRHOME;Benutzer-Verzeichnis -PREFERENCES_DIRLAST;Zuletzt geöffnetes Verzeichnis -PREFERENCES_DIROTHER;Anderes -PREFERENCES_DIRSELECTDLG;Wähle das Bild-Verzeichnis beim Programmstart... -PREFERENCES_DIRSOFTWARE;Installationsverzeichnis -PREFERENCES_DMETHOD;Methode -PREFERENCES_EDITORCMDLINE;Andere Befehlszeile -PREFERENCES_EXTERNALEDITOR;Externer Editor -PREFERENCES_FALSECOLOR;Stufen zur Unterdrückung von Falschfarben -PREFERENCES_FBROWSEROPTS;Datei-Browser-Einstellungen -PREFERENCES_FILEFORMAT;Datei-Format -PREFERENCES_FORIMAGE;Für Bild-Dateien -PREFERENCES_FORRAW;Für RAW-Dateien -PREFERENCES_GIMPPATH;GIMP Installations Verzeichnis -PREFERENCES_GTKTHEME;Standard GTK -PREFERENCES_HINT;Erklärungen -PREFERENCES_HLTHRESHOLD;Schwellwert - zu hell -PREFERENCES_ICCDIR;ICC-Profile-Verzeichnis -PREFERENCES_IMPROCPARAMS;Standard-Bildbearbeitungsparameter -PREFERENCES_INTENT_ABSOLUTE;Absolut farbmetrisch -PREFERENCES_INTENT_PERCEPTUAL;Wahrnehmungsabhängig -PREFERENCES_INTENT_RELATIVE;Relative farbmetrisch -PREFERENCES_INTENT_SATURATION;Sättigung -PREFERENCES_LIVETHUMBNAILS;Live Voransichten (langsamer) -PREFERENCES_MONITORICC;Monitor-Profil -PREFERENCES_OUTDIR;Ausgabe-Verzeichnis -PREFERENCES_OUTDIRFOLDER;Speichern in Verzeichnis -PREFERENCES_OUTDIRFOLDERHINT;Ablegen der gespeicherten Bilder in ein ausgewähltes Verzeichnis -PREFERENCES_OUTDIRHINT;Die folgenden Variablen können verwendet werden:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nDiese Variablen referenzieren die Verzeichnisse und Unterverzeichnisse des Pfades in dem das RAW liegt.\n\nWenn zum Beispiele /home/tom/image/02-09-2006/dsc0012.nefgeöffnet wurde, dann haben die Variablen den folgenden Inhalt:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nWenn Sie die Ausgabedatei in das selbe Verzeichnis wie das RAW speichern wollen, dann wählen Sie:\n%p1/%f\n\nWenn sie die Ausgabedatei in ein Unterverzeichnis mit dem Namen 'konvertiert' schreiben wollen, wählen sie:\n%p1/konvertiert/%f\n\nWenn Sie die Ausgabedatei im Verzeichnis '/home/tom/converted' unter beibehaltung des letzen Verzeichnisses wo das RAW lag, dann wählen sie:\n%p2/converted/%d1/%f -PREFERENCES_OUTDIRTEMPLATE;Verwenden einer Vorlage -PREFERENCES_OUTDIRTEMPLATEHINT;Die folgenden Variablen können verwendet werden:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nDiese Variablen referenzieren die Verzeichnisse und Unterverzeichnisse des Pfades in dem das RAW liegt.\n\nWenn zum Beispiele /home/tom/image/02-09-2006/dsc0012.nefgeöffnet wurde, dann haben die Variablen den folgenden Inhalt:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nWenn Sie die Ausgabedatei in das selbe Verzeichnis wie das RAW speichern wollen, dann wählen Sie:\n%p1/%f\n\nWenn sie die Ausgabedatei in ein Unterverzeichnis mit dem Namen 'konvertiert' schreiben wollen, wählen sie:\n%p1/konvertiert/%f\n\nWenn Sie die Ausgabedatei im Verzeichnis '/home/tom/converted' unter beibehaltung des letzen Verzeichnisses wo das RAW lag, dann wählen sie:\n%p2/converted/%d1/%f -PREFERENCES_PARSEDEXT;Im Datei-Browser angezeigte Datei-Typen -PREFERENCES_PARSEDEXTADD;Datei-Typ hinzufügen -PREFERENCES_PARSEDEXTADDHINT;Gebe einen Datei-Typ (Extension) ein und drücke diesen Knopf um diesen Typ hinzuzufügen -PREFERENCES_PARSEDEXTDELHINT;Lösche den ausgewählten Datei-Typ von der Liste -PREFERENCES_PROFILEHANDLING;Behandlung der Bearbeitungsprofile -PREFERENCES_PROFILELOADPR;Priorität der Profile beim Laden -PREFERENCES_PROFILEPRCACHE;Bearbeitungsprofil im Zwischenspeicher (Cache) -PREFERENCES_PROFILEPRFILE;Bearbeitungsprofile bei der urpsrünglich geladenen Datei -PREFERENCES_PROFILESAVECACHE;Speichern der Verarbeitungsparameter im Zwischenspeicher (Cache) -PREFERENCES_PROFILESAVEINPUT;Speichern der Verarbeitungsparameter zusammen mit der ursprünglich geladenen Datei -PREFERENCES_PSPATH;Adobe Photoshop Installations Verzeichnis -PREFERENCES_SELECTICCDIRDLG;Wähle ICC-Profile-Verzeichnis... -PREFERENCES_SELECTLANG;Sprache -PREFERENCES_SELECTMONITORPROFDLG;Wähle ICC-Profil für den Monitor... -PREFERENCES_SELECTTHEME;Wähle Oberflächendesign -PREFERENCES_SHOWBASICEXIF;Zeige grundlegende Exif-Informationen -PREFERENCES_SHOWDATETIME;Zeige Datum und Zeit -PREFERENCES_SHOWONLYRAW;Zeige nur Rohdateien (RAW) -PREFERENCES_SHTHRESHOLD;Schwellwert - zu dunkel -PREFERENCES_STARTUPIMDIR;Bild-Verzeichnis beim Programmstart -PREFERENCES_TAB_BROWSER;Datei-Browser -PREFERENCES_TAB_COLORMGR;Farbmanagement -PREFERENCES_TAB_GENERAL;Allgemein -PREFERENCES_TAB_IMPROC;Bildbearbeitung -PREFERENCES_TAB_OUTPUT;Ausgabe -PREFERENCES_THUMBSIZE;Größe der Vorschau -PROFILEPANEL_FILEDLGFILTERANY;Alle Dateien -PROFILEPANEL_FILEDLGFILTERPP;Bearbeitungsprofile -PROFILEPANEL_LABEL;Bearbeitungsprofile -PROFILEPANEL_LOADDLGLABEL;Lade Bearbeitungsprofil... -PROFILEPANEL_PCUSTOM;Benutzerdefiniert -PROFILEPANEL_PFILE;Aus Datei -PROFILEPANEL_PLASTPHOTO;Letztes Bild -PROFILEPANEL_PLASTSAVED;Zuletzt gespeichert -PROFILEPANEL_PROFILE;Profil -PROFILEPANEL_SAVEDLGLABEL;Speichere Bearbeitungsprofil... -PROFILEPANEL_TOOLTIPCOPY;Kopiere aktuelles Profil in Zwischenablage -PROFILEPANEL_TOOLTIPLOAD;Lade Profil aus Datei -PROFILEPANEL_TOOLTIPPASTE; Einfügen von Profil aus Zwischenablage -PROFILEPANEL_TOOLTIPSAVE;Speichere aktuelles Profil -PROGRESSBAR_DECODING;Dekodierung der Rohdatei (RAW)... -PROGRESSBAR_DEMOSAICING;Entrasterung... -PROGRESSBAR_LOADING;Laden des Bildes... -PROGRESSBAR_LOADJPEG;Laden der JPEG Datei... -PROGRESSBAR_LOADPNG;Laden der PNG Datei... -PROGRESSBAR_LOADTIFF;Laden der TIFF Datei... -PROGRESSBAR_PROCESSING;Berechnen des Bildes... -PROGRESSBAR_READY;Bereit. -PROGRESSBAR_SAVEJPEG;Speichern der JPEG Datei... -PROGRESSBAR_SAVEPNG;Speichern der PNG Datei... -PROGRESSBAR_SAVETIFF;Speichern der TIFF Datei... -PROGRESSDLG_LOADING;Laden der Datei... -PROGRESSDLG_PROCESSING;Berechnen des Bildes... -PROGRESSDLG_SAVING;Speichern der Datei... -QINFO_FOCALLENGTH;Brennweite -QINFO_ISO;ISO -QINFO_LENS;Objektiv -QINFO_NOEXIF;Keine Exif-Daten vorhanden. -SAVEDLG_FILEFORMAT;Dateiformat -SAVEDLG_JPEGQUAL;JPEG-Qualität -SAVEDLG_JPGFILTER;JPEG-Datei -SAVEDLG_PNGCOMPR;PNG-Kompression -SAVEDLG_PNGFILTER;PNG-Datei -SAVEDLG_PUTTOQUEUE;In Warteschlange für Verarbeitung legen -SAVEDLG_PUTTOQUEUEHEAD;An Anfang der Warteschlange für Verarbeitung legen -SAVEDLG_PUTTOQUEUETAIL;Ans Ende der Warteschlange für Verarbeitung legen -SAVEDLG_SAVEIMMEDIATELY;Sofort Speichern -SAVEDLG_SAVESPP;Speichere die Prozessparameter mit dem Bild -SAVEDLG_TIFFFILTER;TIFF-Datei -TOOLBAR_TOOLTIP_CROP;Auswahl des Ausschnitts (Taste C) -TOOLBAR_TOOLTIP_HAND;Hand-Werkzeug (Taste N) -TOOLBAR_TOOLTIP_STRAIGHTEN;Auswahl einer Leitlinie (Taste S) -TOOLBAR_TOOLTIP_WB;Weißabgleich manuel setzen (Taste W) -TP_CACORRECTION_BLUE;Blau -TP_CACORRECTION_LABEL;Farbsaum-Entfernung -TP_CACORRECTION_RED;Rot -TP_CHMIXER_BLUE;Blau -TP_CHMIXER_GREEN;Grün -TP_CHMIXER_LABEL;Kanal-Mixer -TP_CHMIXER_RED;Rot -TP_COARSETRAF_DEGREE;Grad: -TP_COARSETRAF_TOOLTIP_HFLIP;horizontal spiegeln -TP_COARSETRAF_TOOLTIP_ROTLEFT;nach links drehen -TP_COARSETRAF_TOOLTIP_ROTRIGHT;nach rechts drehen -TP_COARSETRAF_TOOLTIP_VFLIP;vertikal spiegeln -TP_COLORBOOST_ACHANNEL;Kanal "a" -TP_COLORBOOST_AMOUNT;Menge -TP_COLORBOOST_AVOIDCOLORCLIP;Verhindere Übersättigung -TP_COLORBOOST_BCHANNEL;Kanal "b" -TP_COLORBOOST_CHAB;a & b -TP_COLORBOOST_CHANNEL;Kanal -TP_COLORBOOST_CHSEPARATE;separat -TP_COLORBOOST_ENABLESATLIMITER;Sättigungsbegrenzung aktivieren -TP_COLORBOOST_LABEL;Farbverstärkung -TP_COLORBOOST_SATLIMIT;Sättigungsgrenze -TP_COLORDENOISE_EDGESENSITIVE;Kanten-Empfindlichkeit -TP_COLORDENOISE_EDGETOLERANCE;Kanten-Toleranz -TP_COLORDENOISE_LABEL;Farb-Rauschfilter -TP_COLORDENOISE_RADIUS;Radius -TP_COLORSHIFT_BLUEYELLOW;Blau-Gelb -TP_COLORSHIFT_GREENMAGENTA;Grün-Magenta -TP_COLORSHIFT_LABEL;Farbverschiebung -TP_CROP_DPI;DPI= -TP_CROP_FIXRATIO;Festes Format: -TP_CROP_GTDIAGONALS;Diagonale -TP_CROP_GTHARMMEANS1;Harmonischer Schnitt 1 -TP_CROP_GTHARMMEANS2;Harmonischer Schnitt 2 -TP_CROP_GTHARMMEANS3;Harmonischer Schnitt 3 -TP_CROP_GTHARMMEANS4;Harmonischer Schnitt 4 -TP_CROP_GTNONE;Keine -TP_CROP_GTRULETHIRDS;Goldener Schnitt -TP_CROP_GUIDETYPE;Hilfslinien: -TP_CROP_H;H -TP_CROP_LABEL;Ausschnitt -TP_CROP_SELECTCROP; Wähle Ausschnitt -TP_CROP_W;W -TP_CROP_X;x -TP_CROP_Y;y -TP_DISTORTION_AMOUNT;Menge -TP_DISTORTION_LABEL;Entzerrung -TP_EXPOSURE_AUTOLEVELS;autom. -TP_EXPOSURE_BLACKLEVEL;schwarz -TP_EXPOSURE_BRIGHTNESS;Helligkeit -TP_EXPOSURE_CLIP;beschneiden -TP_EXPOSURE_COMPRHIGHLIGHTS;Lichter-Kompression -TP_EXPOSURE_COMPRSHADOWS;Schatten-Kompression -TP_EXPOSURE_CONTRAST;Kontrast -TP_EXPOSURE_CURVEEDITOR;Tonwertkurve -TP_EXPOSURE_EXPCOMP;Bel.Korrektur -TP_EXPOSURE_LABEL;Belichtung -TP_HLREC_CIELAB;CIELab Überlagerung -TP_HLREC_COLOR;Farbübertragung -TP_HLREC_LABEL;Lichter wiederherstellen -TP_HLREC_LUMINANCE;Luminanz herstellen -TP_HLREC_METHOD;Methode: -TP_ICM_FILEDLGFILTERANY;Alle Dateien -TP_ICM_FILEDLGFILTERICM;ICC-Profildateien -TP_ICM_GAMMABEFOREINPUT;Profil enthält Gammaanpassung -TP_ICM_INPUTCAMERA;Kamera-Standard -TP_ICM_INPUTCUSTOM;Benutzerdefiniert -TP_ICM_INPUTDLGLABEL;Wähle Eingabe-ICC-Profil... -TP_ICM_INPUTEMBEDDED;Verwende eingebettetes, wenn möglich -TP_ICM_INPUTPROFILE;Eingabeprofil -TP_ICM_LABEL;ICM -TP_ICM_NOICM;Kein ICM: sRGB-Ausgabe -TP_ICM_OUTPUTDLGLABEL;Wähle Ausgabe-ICC-Profil... -TP_ICM_OUTPUTPROFILE;Ausgabeprofil -TP_ICM_SAVEREFERENCE;Speichere Referenzbild für die Profilierung -TP_ICM_WORKINGPROFILE;Arbeitsfarbraum -TP_LUMACURVE_BLACKLEVEL;schwarz -TP_LUMACURVE_BRIGHTNESS;Helligkeit -TP_LUMACURVE_COMPRHIGHLIGHTS;Lichter-Kompression -TP_LUMACURVE_COMPRSHADOWS;Schatten-Kompression -TP_LUMACURVE_CONTRAST;Kontrast -TP_LUMACURVE_CURVEEDITOR;Luminanzkurve -TP_LUMACURVE_LABEL;Luminanzkurve -TP_LUMADENOISE_EDGETOLERANCE;Kanten-Toleranz -TP_LUMADENOISE_LABEL;Luminanz-Rauschfilter -TP_LUMADENOISE_RADIUS;Radius -TP_RESIZE_BICUBIC;Bikubisch -TP_RESIZE_BICUBICSF;Bikubisch (Weicher) -TP_RESIZE_BICUBICSH;Bikubisch (Schärfer) -TP_RESIZE_BILINEAR;Bilinear -TP_RESIZE_FULLSIZE;Volle Bildgröße: -TP_RESIZE_H;H: -TP_RESIZE_LABEL;Größe ändern -TP_RESIZE_METHOD;Methode: -TP_RESIZE_NEAREST;Nächste -TP_RESIZE_SCALE;Maßstab -TP_RESIZE_W;W: -TP_ROTATE_AUTOCROP;Auto Ausschnitt -TP_ROTATE_DEGREE;Grad -TP_ROTATE_FILL;Füllen -TP_ROTATE_LABEL;Drehen -TP_ROTATE_SELECTLINE;Wähle Leitlinie -TP_SHADOWSHLIGHTS_HIGHLIGHTS;Lichter -TP_SHADOWSHLIGHTS_HLTONALW;Farbtonbereich -TP_SHADOWSHLIGHTS_LABEL;Schatten/Lichter -TP_SHADOWSHLIGHTS_LOCALCONTR;Lokaler Kontrast -TP_SHADOWSHLIGHTS_RADIUS;Radius -TP_SHADOWSHLIGHTS_SHADOWS;Schatten -TP_SHADOWSHLIGHTS_SHTONALW;Farbtonbereich -TP_SHARPENING_AMOUNT;Menge -TP_SHARPENING_EDRADIUS;Radius -TP_SHARPENING_EDTOLERANCE;Kanten-Toleranz -TP_SHARPENING_HALOCONTROL;Halo-Kontrolle -TP_SHARPENING_HCAMOUNT;Menge -TP_SHARPENING_LABEL;Schärfen -TP_SHARPENING_METHOD;Methode -TP_SHARPENING_ONLYEDGES;nur Kanten schärfen -TP_SHARPENING_RADIUS;Radius -TP_SHARPENING_RLD;R-L Bildrestaurierung -TP_SHARPENING_RLD_AMOUNT;Menge -TP_SHARPENING_RLD_DAMPING;Dämpfung -TP_SHARPENING_RLD_ITERATIONS;Iterationen -TP_SHARPENING_THRESHOLD;Schwellwert -TP_SHARPENING_USM;Unscharf maskieren -TP_VIGNETTING_AMOUNT;Menge -TP_VIGNETTING_LABEL;Korrektur Randlichtabfall -TP_VIGNETTING_RADIUS;Radius -TP_WBALANCE_AUTO;Automatisch -TP_WBALANCE_CAMERA;Kamera -TP_WBALANCE_CUSTOM;Benutzerdefiniert -TP_WBALANCE_GREEN;Farbton -TP_WBALANCE_LABEL;Weißabgleich -TP_WBALANCE_METHOD;Methode -TP_WBALANCE_SIZE;Größe: -TP_WBALANCE_SPOTWB;manuel setzen -TP_WBALANCE_TEMPERATURE;Farbtemperatur -ZOOMBAR_DETAIL;Detail -ZOOMBAR_HUGE;riesig -ZOOMBAR_LARGE;groß -ZOOMBAR_NORMAL;normal -ZOOMBAR_PREVIEW;Voransicht -ZOOMBAR_SCALE;Vergrößerung -ZOOMBAR_SMALL;klein - -GENERAL_HIGH_QUALITY;High Quality -GENERAL_UNCHANGED;(Unchanged) -MAIN_MSG_PLACES;Places -GENERAL_BEFORE;Before -GENERAL_AFTER;After -MAIN_TOOLTIP_TOGGLE;Toggle before/after view -MAIN_BUTTON_PUTTOQUEUE;Put to queue -MAIN_MSG_NAVIGATOR;Navigator -FILEBROWSER_TOOLTIP_STOPPROCESSING;Start processing automatically when a new job arrives -BATCHQUEUE_AUTOSTART;Auto start -TP_DETAIL_AMOUNT;Amount -TP_RESIZE_SPECIFY;Specify: -TP_RESIZE_SCALE;Scale -TP_RESIZE_WIDTH;Width -TP_RESIZE_HEIGHT;Height -MAIN_TOGGLE_BEFORE_AFTER;B|A - +# +# This file is part of RawTherapee. +# +# Copyright (c) 2004-2010 Gabor Horvath +# +# RawTherapee is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# RawTherapee is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with RawTherapee. If not, see . +# +# Deutsch: Deutschland +# (keenonkites; Aktualisierte Version für 2.3 beta2) +# (phberlin; basiert auf keenonkites' Erstübersetzung) +# 08.01.2008/15.01.2008/20.02.2008 +# 19.12.2008: keenonkites, Anpassungen für 2.4beta4 +# 20.12.2007 +# 20.9.2008: keenonkites, Anpassungen für 2.4m2 +# 22.12.2007 +# 4.4.2008: Anpassungen für 2.4 +# Leichte Anpassungen (keenonkites/klonk) +ADJUSTER_RESET_TO_DEFAULT;Zurück zum Standard +CURVEEDITOR_FILEDLGFILTERANY;Alle Dateien +CURVEEDITOR_FILEDLGFILTERCURVE;Kurvendateien +CURVEEDITOR_LINEAR;Linear +CURVEEDITOR_LOADDLGLABEL;Kurve Laden... +CURVEEDITOR_SAVEDLGLABEL;Kurve Speichern... +CURVEEDITOR_TOOLTIPLINEAR;Zurücksetzen der Kurve (linear) +CURVEEDITOR_TOOLTIPLOAD;Laden einer Kurve +CURVEEDITOR_TOOLTIPSAVE;Speichern der aktuellen Kurve +EXIFFILTER_APERTURE;Blende +EXIFFILTER_CAMERA;Kamera +EXIFFILTER_DIALOGLABEL;Exif Filter +EXIFFILTER_FOCALLEN;Brennweite +EXIFFILTER_ISO;ISO +EXIFFILTER_LENS;Objektiv +EXIFFILTER_SHUTTER;Verschlusszeit +EXIFPANEL_ADDEDIT;Neu/Ändern +EXIFPANEL_ADDEDITHINT;Hinzufügen eines neuen oder Ändern eines bestehenden Attributs +EXIFPANEL_ADDTAGDLG_ENTERVALUE;Wert eingeben +EXIFPANEL_ADDTAGDLG_SELECTTAG;Attribut wählen +EXIFPANEL_ADDTAGDLG_TITLE;Attribut hinzufügen/ändern +EXIFPANEL_KEEP;Behalten +EXIFPANEL_KEEPHINT;Behalten der gewählten Attribute beim Erzeugen des Bildes +EXIFPANEL_REMOVE;Entfernen +EXIFPANEL_REMOVEHINT;Entfernen der gewählten Attributen beim Erzeugen des Bildes +EXIFPANEL_RESET;Zurücksetzen +EXIFPANEL_RESETALL;Alle zurücksetzen +EXIFPANEL_RESETALLHINT;Alle Attribute zu den ursrpünglichen Werten zurücksetzen +EXIFPANEL_RESETHINT;Gewählte Attribute zu den ursprünglich Werten zurücksetzen +EXIFPANEL_SUBDIRECTORY;Unterverzeichnis +FILEBROWSER_APPLYPROFILE;Profil anwenden +FILEBROWSER_ARRANGEMENTHINT;Wechseln zwischen vertikaler und horizontaler Ausrichtung der Voransichten +FILEBROWSER_CLEARPROFILE;Profil löschen +FILEBROWSER_COPYPROFILE;Profil kopieren +FILEBROWSER_DELETEDLGLABEL;Bestätige Löschen von Dateien +FILEBROWSER_DELETEDLGMSG;Wollen sie wirklich %1 Dateien löschen? +FILEBROWSER_EMPTYTRASH;Papierkorb leeren +FILEBROWSER_EMPTYTRASHHINT;Endgültiges Löschen der Dateien im Papierkorb +FILEBROWSER_EXIFFILTERAPPLY;Anwenden +FILEBROWSER_EXIFFILTERAPPLYHINT;Ein-/Ausschalten des Exif Filters im Datei-Browser +FILEBROWSER_EXIFFILTERLABEL;Exif Filter +FILEBROWSER_EXIFFILTERSETTINGS;Einstellungen +FILEBROWSER_EXIFFILTERSETTINGSHINT;Ändern der Einstellungen des Exif Filters +FILEBROWSER_PARTIALPASTEPROFILE;Profil selektiv einfügen +FILEBROWSER_PASTEPROFILE;Profil einfügen +FILEBROWSER_POPUPCANCELJOB;Job abbrechen +FILEBROWSER_POPUPMOVEEND;Ans Ende der Warteschlange verschieben +FILEBROWSER_POPUPMOVEHEAD;An den Anfang der Warteschlange verschieben +FILEBROWSER_POPUPOPEN;Öffnen +FILEBROWSER_POPUPPROCESS;Bild zur Warteschlange hinzufügen +FILEBROWSER_POPUPRANK1;Mit 1 Stern bewerten +FILEBROWSER_POPUPRANK2;Mit 2 Sternen bewerten +FILEBROWSER_POPUPRANK3;Mit 3 Sternen bewerten +FILEBROWSER_POPUPRANK4;Mit 4 Sternen bewerten +FILEBROWSER_POPUPRANK5;Mit 5 Sternen bewerten +FILEBROWSER_POPUPREMOVE;Aus dem Verzeichnis Löschen +FILEBROWSER_POPUPRENAME;Umbenennen +FILEBROWSER_POPUPSELECTALL;Alle auswählen +FILEBROWSER_POPUPTRASH;In den Papierkorb verschieben +FILEBROWSER_POPUPUNRANK;Entfernen der Bewertung +FILEBROWSER_POPUPUNTRASH;Aus dem Papierkorb retten +FILEBROWSER_PROCESSINGSETTINGS;Einstellungen +FILEBROWSER_PROCESSINGSETTINGSHINT;Einstellen von Ausgabeformat und Ausgabeverzeichnis +FILEBROWSER_RENAMEDLGLABEL;Datei umbenennen +FILEBROWSER_RENAMEDLGMSG;Umbenennen der Datei "%1" nach: +FILEBROWSER_SHOWDIRHINT;Alle Bilder im Verzeichnis zeigen +FILEBROWSER_SHOWQUEUEHINT;Inhalt der Warteschlange zeigen +FILEBROWSER_SHOWRANK1HINT;Bilder 1 Stern zeigen +FILEBROWSER_SHOWRANK2HINT;Bilder 2 Stern zeigen +FILEBROWSER_SHOWRANK3HINT;Bilder 3 Stern zeigen +FILEBROWSER_SHOWRANK4HINT;Bilder 4 Stern zeigen +FILEBROWSER_SHOWRANK5HINT;Bilder 5 Stern zeigen +FILEBROWSER_SHOWTRASHHINT;Bilder im Papierkorb zeigen +FILEBROWSER_SHOWUNRANKHINT;Unbewertete Bilder zeigen +FILEBROWSER_STARTPROCESSING;Verarbeitung starten +FILEBROWSER_STARTPROCESSINGHINT;Verarbeitung/Speichern der Bilder in der Warteschlange starten +FILEBROWSER_STOPPROCESSING;Verarbeitung stoppen +FILEBROWSER_STOPPROCESSINGHINT;Verarbeitung der Bilder stoppen +FILEBROWSER_THUMBSIZE;Grösse d. Vorschau +FILEBROWSER_ZOOMINHINT;Vergrössern der Vorschau +FILEBROWSER_ZOOMOUTHINT;Verkleinern der Vorschau +GENERAL_ABOUT;Über +GENERAL_CANCEL;Abbruch +GENERAL_DISABLE;ausschalten +GENERAL_DISABLED;ausgeschaltet +GENERAL_ENABLE;einschalten +GENERAL_ENABLED;eingeschaltet +GENERAL_LANDSCAPE;Quer +GENERAL_LOAD;Laden +GENERAL_NA;n/a +GENERAL_NO;Nein +GENERAL_OK;OK +GENERAL_PORTRAIT;Hoch +GENERAL_SAVE;Speichern +GENERAL_YES;Ja +HISTOGRAM_LABEL;Histogram +HISTOGRAM_TOOLTIP_B;Zeigen/Verstecke BLAU-Histogramm +HISTOGRAM_TOOLTIP_G;Zeigen/Verstecke GRÜN-Histogramm +HISTOGRAM_TOOLTIP_L;Zeigen/Verstecke CIELAB-Luminanz-Histogramm +HISTOGRAM_TOOLTIP_R;Zeigen/Verstecke ROT-Histogramm +HISTORY_CHANGED;Verändert +HISTORY_CUSTOMCURVE;Benutzerdefinierte Kurve +HISTORY_DELSNAPSHOT;Variante löschen +HISTORY_FROMCLIPBOARD;Aus der Zwischenablage +HISTORY_LABEL;Abfolge der Änderungen +HISTORY_MSG_10;Schatten-Kompression +HISTORY_MSG_11;Tonwertkurve +HISTORY_MSG_12;Automatische Belichtung +HISTORY_MSG_13;Belichtungsbeschneidung +HISTORY_MSG_14;Luminanz Helligkeit +HISTORY_MSG_15;Luminanz Kontrast +HISTORY_MSG_16;Luminanz Schwarz +HISTORY_MSG_17;Luminanz Lichter-Kompression +HISTORY_MSG_18;Luminanz Schatten-Kompression +HISTORY_MSG_19;Luminanz Kurve +HISTORY_MSG_1;Bild geladen +HISTORY_MSG_20;Schärfen +HISTORY_MSG_21;Schärfen Radius +HISTORY_MSG_22;Schärfen Menge +HISTORY_MSG_23;Schärfen Schwellwert +HISTORY_MSG_24;Schärfen nur Kanten +HISTORY_MSG_25;Schärfen Kantensuche Radius +HISTORY_MSG_26;Schärfen Kanten-Toleranz +HISTORY_MSG_27;Schärfen Halo-Kontrolle +HISTORY_MSG_28;Schärfen Halo-Kontrolle Menge +HISTORY_MSG_29;Schärfen Methode +HISTORY_MSG_2;Profil geladen +HISTORY_MSG_30;Dekonvolution Radius +HISTORY_MSG_31;Dekonvolution Menge +HISTORY_MSG_32;Dekonvolution Dämpfung +HISTORY_MSG_33;Dekonvolution Iterationen +HISTORY_MSG_34;Verhindere Farbbeschneidungen +HISTORY_MSG_35;Begrenzung der Sättigung +HISTORY_MSG_36;Sättigungsgrenzwert +HISTORY_MSG_37;Farbverstärkung +HISTORY_MSG_38;Weißabgleich Methode +HISTORY_MSG_39;Farbtemperatur +HISTORY_MSG_3;Profil geändert +HISTORY_MSG_40;Weißabgleich Farbton +HISTORY_MSG_41;Farbkorrektur "A" +HISTORY_MSG_42;Farbkorrektur "B" +HISTORY_MSG_43;Luminanz-Rauschfilter +HISTORY_MSG_44;Luminanz-Rauschfilter Radius +HISTORY_MSG_45;Luminanz-Rauschfilter Kantentoleranz +HISTORY_MSG_46;Farb-Rauschfilter +HISTORY_MSG_47;Farb-Rauschfilter Radius +HISTORY_MSG_48;Farb-Rauschfilter Kantentoleranz +HISTORY_MSG_49;Farb-Rauschfilter Kantensuche +HISTORY_MSG_4;Abfolge der Änderungen durchsehen +HISTORY_MSG_50;Schatten/Lichter-Werkzeug +HISTORY_MSG_51;Abschwächen der Lichter +HISTORY_MSG_52;Verstärken der Schatten +HISTORY_MSG_53;Tonweite Lichter +HISTORY_MSG_54;Tonweite Schatten +HISTORY_MSG_55;Lokaler Kontrast +HISTORY_MSG_56;Schatten/Lichter-Radius +HISTORY_MSG_57;grobe Drehung +HISTORY_MSG_58;Horizontal spiegeln +HISTORY_MSG_59;Vertikal spiegeln +HISTORY_MSG_5;Helligkeit +HISTORY_MSG_60;Drehung +HISTORY_MSG_61;Drehung +HISTORY_MSG_62;Objektiv-Verzerrungskorrektur +HISTORY_MSG_63;Variante gewählt +HISTORY_MSG_64;Bild beschneiden +HISTORY_MSG_65;Farbsaum-Entfernung +HISTORY_MSG_66;Lichter wiederherstellen +HISTORY_MSG_67;Lichter wiederherstellen Menge +HISTORY_MSG_68;Lichter wiederherstellen Methode +HISTORY_MSG_69;Aktueller Farbraum +HISTORY_MSG_6;Kontrast +HISTORY_MSG_70;Farbraum für Ausgabe +HISTORY_MSG_71;Farbraum für Eingabe +HISTORY_MSG_72;Korrektur Randlichtabfall +HISTORY_MSG_73;Kanal-Mixer +HISTORY_MSG_74;Änderung Größe - Maßstab +HISTORY_MSG_75;Änderung Größe - Methode +HISTORY_MSG_76;Exif Metadaten +HISTORY_MSG_77;IPTC Metadaten +HISTORY_MSG_78;Angaben für Änderung Größe +HISTORY_MSG_79;Änderung Größe - Breite +HISTORY_MSG_7;Schwarz +HISTORY_MSG_80;Änderung Größe - Höhe +HISTORY_MSG_81;Änderung Größe - eingeschaltet +HISTORY_MSG_8;Belichtungskorrektur +HISTORY_MSG_9;Lichter-Kompression +HISTORY_NEWSNAPSHOT;Neue Variante +HISTORY_NEWSNAPSHOTAS;als... +HISTORY_NEWSSDIALOGLABEL;Name der Variante: +HISTORY_NEWSSDIALOGTITLE;Variante hinzufügen +HISTORY_SETTO;Setzen auf +HISTORY_SNAPSHOT;Variante +HISTORY_SNAPSHOTS;Varianten +ICMPANEL_FILEDLGFILTERANY;Alle Dateien +ICMPANEL_FILEDLGFILTERICM;ICC-Profildatei +ICMPANEL_GAMMABEFOREINPUT;Profil enthält Gammaanpassung +ICMPANEL_INPUTCAMERA;Kamera-Standard +ICMPANEL_INPUTCUSTOM;Benutzerdefiniert +ICMPANEL_INPUTDLGLABEL;Wähle Eingabe-ICC-Profil... +ICMPANEL_INPUTEMBEDDED;Verwende eingebettetes, wenn möglich +ICMPANEL_INPUTPROFILE;Eingabeprofil +ICMPANEL_NOICM;Kein ICM: sRGB-Ausgabe +ICMPANEL_OUTPUTDLGLABEL;Wähle Ausgabe-ICC-Profil... +ICMPANEL_OUTPUTPROFILE;Ausgabeprofil +ICMPANEL_SAVEREFERENCE;Speichere Referenzbild für die Profilierung +ICMPANEL_WORKINGPROFILE;Arbeitsfarbraum +IMAGEAREA_DETAILVIEW;Detailansicht +IPTCPANEL_AUTHOR;Autor +IPTCPANEL_AUTHORHINT;Name des Autors, z.B. Name des Fotografen oder des Künstlers (By-line). +IPTCPANEL_AUTHORSPOSITION;Position des Autors +IPTCPANEL_AUTHORSPOSITIONHINT;Titel des Autors oder der Autoren (By-line Title). +IPTCPANEL_CAPTION;Bildbeschreibung +IPTCPANEL_CAPTIONHINT;Beschreibung des Bildinhaltes (Caption - Abstract) +IPTCPANEL_CAPTIONWRITER;Autor der Bildbeschreibung +IPTCPANEL_CAPTIONWRITERHINT;Name der beim Schreiben, Editieren oder Korrigieren des Bildes oder der Bildbeschreibung beteiligten Person (Writer - Editor). +IPTCPANEL_CATEGORY;Kategorie +IPTCPANEL_CATEGORYHINT;3-stelliger Code, der die Kategorie des Bildes beschreibt (Category). +IPTCPANEL_CITY;Stadt +IPTCPANEL_CITYHINT;Aufnahmeort: Stadt (City). +IPTCPANEL_COPYHINT;IPTC Werte in die Zwischenablage kopieren +IPTCPANEL_COPYRIGHT;Copyright +IPTCPANEL_COPYRIGHTHINT;Alle nötigen Hinweise über Urheberrechte (Copyright Notice). +IPTCPANEL_COUNTRY;Land +IPTCPANEL_COUNTRYHINT;Aufnahmeort: Land (Country - Primary Location Name). +IPTCPANEL_CREDIT;Bildrechte +IPTCPANEL_CREDITHINT;Identifiziert den Anbieter des Bildes, es muss nicht der Eigentümer sein (Credit). +IPTCPANEL_DATECREATED;Erstellt am +IPTCPANEL_DATECREATEDHINT;Das Datum an dem der Inhalt des Bildes kreiert wurde; Format: JJJJMMTT (Date Created). +IPTCPANEL_EMBEDDED;Eingebettete +IPTCPANEL_EMBEDDEDHINT;Zu den im Bild eingebetteten Werten zurücksetzen. +IPTCPANEL_HEADLINE;Bildtitel +IPTCPANEL_HEADLINEHINT;Kurzform der Bildbeschreibung, könnte als Überschrift an das Bild geklebt werden (Headline). +IPTCPANEL_INSTRUCTIONS;Hinweise +IPTCPANEL_INSTRUCTIONSHINT;Besondere Hinweise bezüglich der Verwendung des Bildes (Special Instructions). +IPTCPANEL_KEYWORDS;Schlagwörter +IPTCPANEL_KEYWORDSHINT;Stichwörter für das spätere Wiederfinden der Bilder (Keywords). +IPTCPANEL_PASTEHINT;Einfügen der IPTC Werte aus der Zwischenablage +IPTCPANEL_PROVINCE;Provinz +IPTCPANEL_PROVINCEHINT;Aufnahmeort: Provinz (Province-State). +IPTCPANEL_RESET;Zurücksetzen +IPTCPANEL_RESETHINT;Zu den im Profil gesetzten Werten zurücksetzen. +IPTCPANEL_SOURCE;Quelle +IPTCPANEL_SOURCEHINT;Der ursprüngliche Eigentümer des Werkes auf dem Bild (Source). +IPTCPANEL_SUPPCATEGORIES;Zusätz. Kategorien +IPTCPANEL_SUPPCATEGORIESHINT;Frei wählbare zusätzliche Kategorien (Supplemental Categories). +IPTCPANEL_TITLE;Titel +IPTCPANEL_TITLEHINT;Kurztitel des Bildes (Object Name). +IPTCPANEL_TRANSREFERENCE;Übertragungs Referenz +IPTCPANEL_TRANSREFERENCEHINT;Ein Code, der den ursprünglichen Ort der Übertragung definiert (Original Transmission Reference). +MAIN_BUTTON_EXIT;Verlassen +MAIN_BUTTON_EXIT;Verlassen +MAIN_BUTTON_PREFERENCES;Einstellungen +MAIN_BUTTON_QUEUE;Auf die Warteschlange +MAIN_BUTTON_SAVE;Bild speichern +MAIN_BUTTON_SAVEAS;unter... +MAIN_BUTTON_SENDTOEDITOR;Im Editor laden +MAIN_FRAME_BATCHQUEUE;Warteschlange +MAIN_FRAME_FILEBROWSER;Dateiverwaltung +MAIN_FRAME_PLACES;Orte +MAIN_FRAME_PLACES_ADD;Hinzu +MAIN_FRAME_PLACES_DEL;Löschen +MAIN_FRAME_RECENT;Verwendete Ordner +MAIN_MSG_ALREADYEXISTS;Diese Datei existiert schon. +MAIN_MSG_CANNOTLOAD;Bild kann nicht geladen werden +MAIN_MSG_CANNOTSAVE;Fehler beim Speichern +MAIN_MSG_CANNOTSTARTEDITOR;Der Editor kann nicht gestartet werden. +MAIN_MSG_CANNOTSTARTEDITOR_SECONDARY;Setzen Sie bitte den richtigen Pfad in den Einstellungen. +MAIN_MSG_EXITJOBSINQUEUEINFO;Unverarbeitete Bilder in der Warteschlange gehen beim Verlassen der Anwendung verloren. +MAIN_MSG_EXITJOBSINQUEUEQUEST;Wollen Sie die Anwendung wirklich schliessen ? Es hat noch unverarbeitete Bilder in der Warteschlange. +MAIN_MSG_JOBSINQUEUE;Job in Bearbeitung +MAIN_MSG_QOVERWRITE;Wollen sie die Datei überschreiben ? +MAIN_TAB_BASIC;Basis +MAIN_TAB_COLOR;Farbe +MAIN_TAB_DETAIL;Detail +MAIN_TAB_DEVELOP;Entwickeln +MAIN_TAB_EXIF;Exif +MAIN_TAB_EXPOSURE;Belichtung +MAIN_TAB_FILTER;Metadaten-Filter +MAIN_TAB_ICM;ICM +MAIN_TAB_IPTC;IPTC +MAIN_TAB_METADATA;Metadata +MAIN_TAB_TAGGING;Tagging +MAIN_TAB_TRANSFORM;Verändern +MAIN_TOOLTIP_HIDEFP;Zeigen/Verstecken von Verzeichnis- und Datei-Browser (Taste F) +MAIN_TOOLTIP_HIDEHP;Zeigen/Verstecken linke Seite (Abfolge der Änderungen, Taste H) +MAIN_TOOLTIP_INDCLIPPEDH;zu helle Bereiche blinken +MAIN_TOOLTIP_INDCLIPPEDS;zu dunkle Bereiche blinken +MAIN_TOOLTIP_PREFERENCES;Einstellungen ändern +MAIN_TOOLTIP_QINFO;Kurze Info über das Bild +MAIN_TOOLTIP_SAVE;Speichere Bild im Standard-Verzeichnis +MAIN_TOOLTIP_SAVEAS;Speichere Bild in anderem Verzeichnis +PARTIALPASTE_BASICGROUP;Gruppe Basiseinstellungen +PARTIALPASTE_CACORRECTION;Farbsaum-Entfernung +PARTIALPASTE_COARSETRANS;90 Grad Rotieren / Spiegeln +PARTIALPASTE_COLORBOOST;Farbverstärkung +PARTIALPASTE_COLORDENOISE;Farb-Rauschfilter +PARTIALPASTE_COLORGROUP;Gruppe Farbeinstellungen +PARTIALPASTE_COLORMIXER;Kanal-Mixer +PARTIALPASTE_COLORSHIFT;Farbverschiebung +PARTIALPASTE_COMPOSITIONGROUP;Gruppe Gestaltungseinstellungen +PARTIALPASTE_CROP;Ausschnitt +PARTIALPASTE_DIALOGLABEL;Selektives Einfügen des Bearbeitungsprofiles +PARTIALPASTE_DISTORTION;Entzerrung +PARTIALPASTE_EXIFCHANGES;Exifdaten Änderungen +PARTIALPASTE_EXPOSURE;Belichtung +PARTIALPASTE_HLRECOVERY;Lichter wiederherstellen +PARTIALPASTE_ICMSETTINGS;Einstellungen ICM +PARTIALPASTE_IPTCINFO;IPTC Informationen +PARTIALPASTE_LENSGROUP;Gruppe Farbeinstellungen +PARTIALPASTE_LUMACURVE;Luminanzkurve +PARTIALPASTE_LUMADENOISE;Luminanz-Rauschfilter +PARTIALPASTE_LUMINANCEGROUP;Gruppe Luminanzeinstellungen +PARTIALPASTE_METAICMGROUP;Gruppe Einstellungen Metadaten/ICM +PARTIALPASTE_RESIZE;Grösse ändern +PARTIALPASTE_ROTATION;Drehen +PARTIALPASTE_SHADOWSHIGHLIGHTS;Schatten/Lichter +PARTIALPASTE_SHARPENING;Schärfen +PARTIALPASTE_VIGNETTING;Korrektur Randlichtabfall +PARTIALPASTE_WHITEBALANCE;Weissabgleich +PREFERENCES_APPLNEXTSTARTUP;beim nächsten Programmstart aktiv +PREFERENCES_BLINKCLIPPED;Zu helle/zu dunkle Bereiche blinken +PREFERENCES_CACHECLEARALL;Alles Löschen +PREFERENCES_CACHECLEARPROFILES;Löschen der Profile +PREFERENCES_CACHECLEARTHUMBS;Löschen der Voransichten +PREFERENCES_CACHEFORMAT1;Proprietär (schneller und höhere Qualität) +PREFERENCES_CACHEFORMAT2;JPEG (geringerer Diskplatz) +PREFERENCES_CACHEMAXENTRIES;Maximale Anzahl der Einträge im Zwischenspeicher +PREFERENCES_CACHEOPTS;Einstellungen des Zwischenspeichers für die Voransichten (Cache) +PREFERENCES_CACHESTRAT1;Priorität auf Geschwindigkeit (erhöhter Speicherverbrauch) +PREFERENCES_CACHESTRAT2;Priorität auf minimierten Speicherverbrauch (geringere Geschwindigkeit) +PREFERENCES_CACHESTRAT;Strategie des Zwischenspeichers +PREFERENCES_CACHETHUMBFORM;Format des Zwischenspeichers +PREFERENCES_CACHETHUMBHEIGHT;Maximale Höhe der Voransichten +PREFERENCES_CLEARDLG_LINE1;Löschen des Zwischenspeichers +PREFERENCES_CLEARDLG_LINE2;Das kann einige Sekunden dauern. +PREFERENCES_CLEARDLG_TITLE;Bitte warten +PREFERENCES_CLIPPINGIND;Anzeige zu helle/zu dunkle Bereiche +PREFERENCES_CMETRICINTENT;Farbraumtransformation +PREFERENCES_DATEFORMAT;Datumsformat +PREFERENCES_DATEFORMATHINT;Die folgenden Variablen können verwendet werden:\n%y : Jahr\n%m : Monat\n%d : Tag\n\nDas Deutsche Datumsformat zum Beispiel ist:\n%d/%m/%y +PREFERENCES_DCBENHANCE;DCB Verfeinerungsschritt durchführen +PREFERENCES_DCBITERATIONS;Anzahl der DCB Iterationen +PREFERENCES_DEFAULTLANG;Sprache für die Menüs und Dialoge +PREFERENCES_DEFAULTTHEME;Standard Oberflächendesign +PREFERENCES_DEMOSAICINGALGO;Algorithmus zur Entrasterung +PREFERENCES_DIRHOME;Benutzer-Verzeichnis +PREFERENCES_DIRLAST;Zuletzt geöffnetes Verzeichnis +PREFERENCES_DIROTHER;Anderes +PREFERENCES_DIRSELECTDLG;Wähle das Bild-Verzeichnis beim Programmstart... +PREFERENCES_DIRSOFTWARE;Installationsverzeichnis +PREFERENCES_DMETHOD;Methode +PREFERENCES_EDITORCMDLINE;Andere Befehlszeile +PREFERENCES_EXTERNALEDITOR;Externer Editor +PREFERENCES_FALSECOLOR;Stufen zur Unterdrückung von Falschfarben +PREFERENCES_FBROWSEROPTS;Datei-Browser-Einstellungen +PREFERENCES_FILEFORMAT;Datei-Format +PREFERENCES_FORIMAGE;Für Bild-Dateien +PREFERENCES_FORRAW;Für RAW-Dateien +PREFERENCES_GIMPPATH;GIMP Installations Verzeichnis +PREFERENCES_GTKTHEME;Standard GTK +PREFERENCES_HINT;Erklärungen +PREFERENCES_HLTHRESHOLD;Schwellwert - zu hell +PREFERENCES_ICCDIR;ICC-Profile-Verzeichnis +PREFERENCES_IMPROCPARAMS;Standard-Bildbearbeitungsparameter +PREFERENCES_INTENT_ABSOLUTE;Absolut farbmetrisch +PREFERENCES_INTENT_PERCEPTUAL;Wahrnehmungsabhängig +PREFERENCES_INTENT_RELATIVE;Relative farbmetrisch +PREFERENCES_INTENT_SATURATION;Sättigung +PREFERENCES_LIVETHUMBNAILS;Live Voransichten (langsamer) +PREFERENCES_MONITORICC;Monitor-Profil +PREFERENCES_OUTDIR;Ausgabe-Verzeichnis +PREFERENCES_OUTDIRFOLDER;Speichern in Verzeichnis +PREFERENCES_OUTDIRFOLDERHINT;Ablegen der gespeicherten Bilder in ein ausgewähltes Verzeichnis +PREFERENCES_OUTDIRHINT;Die folgenden Variablen können verwendet werden:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nDiese Variablen referenzieren die Verzeichnisse und Unterverzeichnisse des Pfades in dem das RAW liegt.\n\nWenn zum Beispiele /home/tom/image/02-09-2006/dsc0012.nefgeöffnet wurde, dann haben die Variablen den folgenden Inhalt:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nWenn Sie die Ausgabedatei in das selbe Verzeichnis wie das RAW speichern wollen, dann wählen Sie:\n%p1/%f\n\nWenn sie die Ausgabedatei in ein Unterverzeichnis mit dem Namen 'konvertiert' schreiben wollen, wählen sie:\n%p1/konvertiert/%f\n\nWenn Sie die Ausgabedatei im Verzeichnis '/home/tom/converted' unter beibehaltung des letzen Verzeichnisses wo das RAW lag, dann wählen sie:\n%p2/converted/%d1/%f +PREFERENCES_OUTDIRTEMPLATE;Verwenden einer Vorlage +PREFERENCES_OUTDIRTEMPLATEHINT;Die folgenden Variablen können verwendet werden:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nDiese Variablen referenzieren die Verzeichnisse und Unterverzeichnisse des Pfades in dem das RAW liegt.\n\nWenn zum Beispiele /home/tom/image/02-09-2006/dsc0012.nefgeöffnet wurde, dann haben die Variablen den folgenden Inhalt:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nWenn Sie die Ausgabedatei in das selbe Verzeichnis wie das RAW speichern wollen, dann wählen Sie:\n%p1/%f\n\nWenn sie die Ausgabedatei in ein Unterverzeichnis mit dem Namen 'konvertiert' schreiben wollen, wählen sie:\n%p1/konvertiert/%f\n\nWenn Sie die Ausgabedatei im Verzeichnis '/home/tom/converted' unter beibehaltung des letzen Verzeichnisses wo das RAW lag, dann wählen sie:\n%p2/converted/%d1/%f +PREFERENCES_PARSEDEXT;Im Datei-Browser angezeigte Datei-Typen +PREFERENCES_PARSEDEXTADD;Datei-Typ hinzufügen +PREFERENCES_PARSEDEXTADDHINT;Gebe einen Datei-Typ (Extension) ein und drücke diesen Knopf um diesen Typ hinzuzufügen +PREFERENCES_PARSEDEXTDELHINT;Lösche den ausgewählten Datei-Typ von der Liste +PREFERENCES_PROFILEHANDLING;Behandlung der Bearbeitungsprofile +PREFERENCES_PROFILELOADPR;Priorität der Profile beim Laden +PREFERENCES_PROFILEPRCACHE;Bearbeitungsprofil im Zwischenspeicher (Cache) +PREFERENCES_PROFILEPRFILE;Bearbeitungsprofile bei der urpsrünglich geladenen Datei +PREFERENCES_PROFILESAVECACHE;Speichern der Verarbeitungsparameter im Zwischenspeicher (Cache) +PREFERENCES_PROFILESAVEINPUT;Speichern der Verarbeitungsparameter zusammen mit der ursprünglich geladenen Datei +PREFERENCES_PSPATH;Adobe Photoshop Installations Verzeichnis +PREFERENCES_SELECTICCDIRDLG;Wähle ICC-Profile-Verzeichnis... +PREFERENCES_SELECTLANG;Sprache +PREFERENCES_SELECTMONITORPROFDLG;Wähle ICC-Profil für den Monitor... +PREFERENCES_SELECTTHEME;Wähle Oberflächendesign +PREFERENCES_SHOWBASICEXIF;Zeige grundlegende Exif-Informationen +PREFERENCES_SHOWDATETIME;Zeige Datum und Zeit +PREFERENCES_SHOWONLYRAW;Zeige nur Rohdateien (RAW) +PREFERENCES_SHTHRESHOLD;Schwellwert - zu dunkel +PREFERENCES_STARTUPIMDIR;Bild-Verzeichnis beim Programmstart +PREFERENCES_TAB_BROWSER;Datei-Browser +PREFERENCES_TAB_COLORMGR;Farbmanagement +PREFERENCES_TAB_GENERAL;Allgemein +PREFERENCES_TAB_IMPROC;Bildbearbeitung +PREFERENCES_TAB_OUTPUT;Ausgabe +PREFERENCES_THUMBSIZE;Größe der Vorschau +PROFILEPANEL_FILEDLGFILTERANY;Alle Dateien +PROFILEPANEL_FILEDLGFILTERPP;Bearbeitungsprofile +PROFILEPANEL_LABEL;Bearbeitungsprofile +PROFILEPANEL_LOADDLGLABEL;Lade Bearbeitungsprofil... +PROFILEPANEL_PCUSTOM;Benutzerdefiniert +PROFILEPANEL_PFILE;Aus Datei +PROFILEPANEL_PLASTPHOTO;Letztes Bild +PROFILEPANEL_PLASTSAVED;Zuletzt gespeichert +PROFILEPANEL_PROFILE;Profil +PROFILEPANEL_SAVEDLGLABEL;Speichere Bearbeitungsprofil... +PROFILEPANEL_TOOLTIPCOPY;Kopiere aktuelles Profil in Zwischenablage +PROFILEPANEL_TOOLTIPLOAD;Lade Profil aus Datei +PROFILEPANEL_TOOLTIPPASTE; Einfügen von Profil aus Zwischenablage +PROFILEPANEL_TOOLTIPSAVE;Speichere aktuelles Profil +PROGRESSBAR_DECODING;Dekodierung der Rohdatei (RAW)... +PROGRESSBAR_DEMOSAICING;Entrasterung... +PROGRESSBAR_LOADING;Laden des Bildes... +PROGRESSBAR_LOADJPEG;Laden der JPEG Datei... +PROGRESSBAR_LOADPNG;Laden der PNG Datei... +PROGRESSBAR_LOADTIFF;Laden der TIFF Datei... +PROGRESSBAR_PROCESSING;Berechnen des Bildes... +PROGRESSBAR_READY;Bereit. +PROGRESSBAR_SAVEJPEG;Speichern der JPEG Datei... +PROGRESSBAR_SAVEPNG;Speichern der PNG Datei... +PROGRESSBAR_SAVETIFF;Speichern der TIFF Datei... +PROGRESSDLG_LOADING;Laden der Datei... +PROGRESSDLG_PROCESSING;Berechnen des Bildes... +PROGRESSDLG_SAVING;Speichern der Datei... +QINFO_FOCALLENGTH;Brennweite +QINFO_ISO;ISO +QINFO_LENS;Objektiv +QINFO_NOEXIF;Keine Exif-Daten vorhanden. +SAVEDLG_FILEFORMAT;Dateiformat +SAVEDLG_JPEGQUAL;JPEG-Qualität +SAVEDLG_JPGFILTER;JPEG-Datei +SAVEDLG_PNGCOMPR;PNG-Kompression +SAVEDLG_PNGFILTER;PNG-Datei +SAVEDLG_PUTTOQUEUE;In Warteschlange für Verarbeitung legen +SAVEDLG_PUTTOQUEUEHEAD;An Anfang der Warteschlange für Verarbeitung legen +SAVEDLG_PUTTOQUEUETAIL;Ans Ende der Warteschlange für Verarbeitung legen +SAVEDLG_SAVEIMMEDIATELY;Sofort Speichern +SAVEDLG_SAVESPP;Speichere die Prozessparameter mit dem Bild +SAVEDLG_TIFFFILTER;TIFF-Datei +TOOLBAR_TOOLTIP_CROP;Auswahl des Ausschnitts (Taste C) +TOOLBAR_TOOLTIP_HAND;Hand-Werkzeug (Taste N) +TOOLBAR_TOOLTIP_STRAIGHTEN;Auswahl einer Leitlinie (Taste S) +TOOLBAR_TOOLTIP_WB;Weißabgleich manuel setzen (Taste W) +TP_CACORRECTION_BLUE;Blau +TP_CACORRECTION_LABEL;Farbsaum-Entfernung +TP_CACORRECTION_RED;Rot +TP_CHMIXER_BLUE;Blau +TP_CHMIXER_GREEN;Grün +TP_CHMIXER_LABEL;Kanal-Mixer +TP_CHMIXER_RED;Rot +TP_COARSETRAF_DEGREE;Grad: +TP_COARSETRAF_TOOLTIP_HFLIP;horizontal spiegeln +TP_COARSETRAF_TOOLTIP_ROTLEFT;nach links drehen +TP_COARSETRAF_TOOLTIP_ROTRIGHT;nach rechts drehen +TP_COARSETRAF_TOOLTIP_VFLIP;vertikal spiegeln +TP_COLORBOOST_ACHANNEL;Kanal "a" +TP_COLORBOOST_AMOUNT;Menge +TP_COLORBOOST_AVOIDCOLORCLIP;Verhindere Übersättigung +TP_COLORBOOST_BCHANNEL;Kanal "b" +TP_COLORBOOST_CHAB;a & b +TP_COLORBOOST_CHANNEL;Kanal +TP_COLORBOOST_CHSEPARATE;separat +TP_COLORBOOST_ENABLESATLIMITER;Sättigungsbegrenzung aktivieren +TP_COLORBOOST_LABEL;Farbverstärkung +TP_COLORBOOST_SATLIMIT;Sättigungsgrenze +TP_COLORDENOISE_EDGESENSITIVE;Kanten-Empfindlichkeit +TP_COLORDENOISE_EDGETOLERANCE;Kanten-Toleranz +TP_COLORDENOISE_LABEL;Farb-Rauschfilter +TP_COLORDENOISE_RADIUS;Radius +TP_COLORSHIFT_BLUEYELLOW;Blau-Gelb +TP_COLORSHIFT_GREENMAGENTA;Grün-Magenta +TP_COLORSHIFT_LABEL;Farbverschiebung +TP_CROP_DPI;DPI= +TP_CROP_FIXRATIO;Festes Format: +TP_CROP_GTDIAGONALS;Diagonale +TP_CROP_GTHARMMEANS1;Harmonischer Schnitt 1 +TP_CROP_GTHARMMEANS2;Harmonischer Schnitt 2 +TP_CROP_GTHARMMEANS3;Harmonischer Schnitt 3 +TP_CROP_GTHARMMEANS4;Harmonischer Schnitt 4 +TP_CROP_GTNONE;Keine +TP_CROP_GTRULETHIRDS;Goldener Schnitt +TP_CROP_GUIDETYPE;Hilfslinien: +TP_CROP_H;H +TP_CROP_LABEL;Ausschnitt +TP_CROP_SELECTCROP; Wähle Ausschnitt +TP_CROP_W;W +TP_CROP_X;x +TP_CROP_Y;y +TP_DISTORTION_AMOUNT;Menge +TP_DISTORTION_LABEL;Entzerrung +TP_EXPOSURE_AUTOLEVELS;autom. +TP_EXPOSURE_BLACKLEVEL;schwarz +TP_EXPOSURE_BRIGHTNESS;Helligkeit +TP_EXPOSURE_CLIP;beschneiden +TP_EXPOSURE_COMPRHIGHLIGHTS;Lichter-Kompression +TP_EXPOSURE_COMPRSHADOWS;Schatten-Kompression +TP_EXPOSURE_CONTRAST;Kontrast +TP_EXPOSURE_CURVEEDITOR;Tonwertkurve +TP_EXPOSURE_EXPCOMP;Bel.Korrektur +TP_EXPOSURE_LABEL;Belichtung +TP_HLREC_CIELAB;CIELab Überlagerung +TP_HLREC_COLOR;Farbübertragung +TP_HLREC_LABEL;Lichter wiederherstellen +TP_HLREC_LUMINANCE;Luminanz herstellen +TP_HLREC_METHOD;Methode: +TP_ICM_FILEDLGFILTERANY;Alle Dateien +TP_ICM_FILEDLGFILTERICM;ICC-Profildateien +TP_ICM_GAMMABEFOREINPUT;Profil enthält Gammaanpassung +TP_ICM_INPUTCAMERA;Kamera-Standard +TP_ICM_INPUTCUSTOM;Benutzerdefiniert +TP_ICM_INPUTDLGLABEL;Wähle Eingabe-ICC-Profil... +TP_ICM_INPUTEMBEDDED;Verwende eingebettetes, wenn möglich +TP_ICM_INPUTPROFILE;Eingabeprofil +TP_ICM_LABEL;ICM +TP_ICM_NOICM;Kein ICM: sRGB-Ausgabe +TP_ICM_OUTPUTDLGLABEL;Wähle Ausgabe-ICC-Profil... +TP_ICM_OUTPUTPROFILE;Ausgabeprofil +TP_ICM_SAVEREFERENCE;Speichere Referenzbild für die Profilierung +TP_ICM_WORKINGPROFILE;Arbeitsfarbraum +TP_LUMACURVE_BLACKLEVEL;schwarz +TP_LUMACURVE_BRIGHTNESS;Helligkeit +TP_LUMACURVE_COMPRHIGHLIGHTS;Lichter-Kompression +TP_LUMACURVE_COMPRSHADOWS;Schatten-Kompression +TP_LUMACURVE_CONTRAST;Kontrast +TP_LUMACURVE_CURVEEDITOR;Luminanzkurve +TP_LUMACURVE_LABEL;Luminanzkurve +TP_LUMADENOISE_EDGETOLERANCE;Kanten-Toleranz +TP_LUMADENOISE_LABEL;Luminanz-Rauschfilter +TP_LUMADENOISE_RADIUS;Radius +TP_RESIZE_BICUBIC;Bikubisch +TP_RESIZE_BICUBICSF;Bikubisch (Weicher) +TP_RESIZE_BICUBICSH;Bikubisch (Schärfer) +TP_RESIZE_BILINEAR;Bilinear +TP_RESIZE_FULLSIZE;Volle Bildgröße: +TP_RESIZE_H;H: +TP_RESIZE_LABEL;Größe ändern +TP_RESIZE_METHOD;Methode: +TP_RESIZE_NEAREST;Nächste +TP_RESIZE_SCALE;Maßstab +TP_RESIZE_W;W: +TP_ROTATE_AUTOCROP;Auto Ausschnitt +TP_ROTATE_DEGREE;Grad +TP_ROTATE_FILL;Füllen +TP_ROTATE_LABEL;Drehen +TP_ROTATE_SELECTLINE;Wähle Leitlinie +TP_SHADOWSHLIGHTS_HIGHLIGHTS;Lichter +TP_SHADOWSHLIGHTS_HLTONALW;Farbtonbereich +TP_SHADOWSHLIGHTS_LABEL;Schatten/Lichter +TP_SHADOWSHLIGHTS_LOCALCONTR;Lokaler Kontrast +TP_SHADOWSHLIGHTS_RADIUS;Radius +TP_SHADOWSHLIGHTS_SHADOWS;Schatten +TP_SHADOWSHLIGHTS_SHTONALW;Farbtonbereich +TP_SHARPENING_AMOUNT;Menge +TP_SHARPENING_EDRADIUS;Radius +TP_SHARPENING_EDTOLERANCE;Kanten-Toleranz +TP_SHARPENING_HALOCONTROL;Halo-Kontrolle +TP_SHARPENING_HCAMOUNT;Menge +TP_SHARPENING_LABEL;Schärfen +TP_SHARPENING_METHOD;Methode +TP_SHARPENING_ONLYEDGES;nur Kanten schärfen +TP_SHARPENING_RADIUS;Radius +TP_SHARPENING_RLD;R-L Bildrestaurierung +TP_SHARPENING_RLD_AMOUNT;Menge +TP_SHARPENING_RLD_DAMPING;Dämpfung +TP_SHARPENING_RLD_ITERATIONS;Iterationen +TP_SHARPENING_THRESHOLD;Schwellwert +TP_SHARPENING_USM;Unscharf maskieren +TP_VIGNETTING_AMOUNT;Menge +TP_VIGNETTING_LABEL;Korrektur Randlichtabfall +TP_VIGNETTING_RADIUS;Radius +TP_WBALANCE_AUTO;Automatisch +TP_WBALANCE_CAMERA;Kamera +TP_WBALANCE_CUSTOM;Benutzerdefiniert +TP_WBALANCE_GREEN;Farbton +TP_WBALANCE_LABEL;Weißabgleich +TP_WBALANCE_METHOD;Methode +TP_WBALANCE_SIZE;Größe: +TP_WBALANCE_SPOTWB;manuel setzen +TP_WBALANCE_TEMPERATURE;Farbtemperatur +ZOOMBAR_DETAIL;Detail +ZOOMBAR_HUGE;riesig +ZOOMBAR_LARGE;groß +ZOOMBAR_NORMAL;normal +ZOOMBAR_PREVIEW;Voransicht +ZOOMBAR_SCALE;Vergrößerung +ZOOMBAR_SMALL;klein + +GENERAL_HIGH_QUALITY;High Quality +GENERAL_UNCHANGED;(Unchanged) +MAIN_MSG_PLACES;Places +GENERAL_BEFORE;Before +GENERAL_AFTER;After +MAIN_TOOLTIP_TOGGLE;Toggle before/after view +MAIN_BUTTON_PUTTOQUEUE;Put to queue +MAIN_MSG_NAVIGATOR;Navigator +FILEBROWSER_TOOLTIP_STOPPROCESSING;Start processing automatically when a new job arrives +BATCHQUEUE_AUTOSTART;Auto start +TP_DETAIL_AMOUNT;Amount +TP_RESIZE_SPECIFY;Specify: +TP_RESIZE_SCALE;Scale +TP_RESIZE_WIDTH;Width +TP_RESIZE_HEIGHT;Height +MAIN_TOGGLE_BEFORE_AFTER;B|A + ### diff --git a/rtdata/languages/Polish b/rtdata/languages/Polish index 086a3356e..5993a2606 100644 --- a/rtdata/languages/Polish +++ b/rtdata/languages/Polish @@ -1,636 +1,636 @@ -# -# This file is part of RawTherapee. -# -# Copyright (c) 2004-2010 Gabor Horvath -# -# RawTherapee is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# RawTherapee is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with RawTherapee. If not, see . -# -# polish version -# 24.12.2007 -# Mateusz Ludwin -# ----------------------------- -# 08.01.2010 -# Initial update for 3.0 release -# Bartosz "Simek" Kaszubowski -# -ADJUSTER_RESET_TO_DEFAULT;Przywróć domyślne -CURVEEDITOR_FILEDLGFILTERANY;Wszystkie pliki -CURVEEDITOR_FILEDLGFILTERCURVE;Pliki z krzywymi -CURVEEDITOR_LINEAR;Liniowa -CURVEEDITOR_LOADDLGLABEL;Wczytaj krzywą... -CURVEEDITOR_SAVEDLGLABEL;Zapisz krzywą... -CURVEEDITOR_TOOLTIPLINEAR;Zresetuj krzywą do liniowej -CURVEEDITOR_TOOLTIPLOAD;Wczytaj krzywą z pliku -CURVEEDITOR_TOOLTIPSAVE;Zapisz aktualną krzywą -EXIFFILTER_APERTURE;Przesłona -EXIFFILTER_CAMERA;Aparat -EXIFFILTER_DIALOGLABEL;Filrt Exif -EXIFFILTER_FOCALLEN;Wartość ogniskowej -EXIFFILTER_ISO;ISO -EXIFFILTER_LENS;Obiektyw -EXIFFILTER_SHUTTER;Migawka -EXIFPANEL_ADDEDIT;Dodaj/Edytuj -EXIFPANEL_ADDEDITHINT;Dodaj nową etykietę lub edytuj etykietę -EXIFPANEL_ADDTAGDLG_ENTERVALUE;Wpisz wartość -EXIFPANEL_ADDTAGDLG_SELECTTAG;Wybierz etykietę -EXIFPANEL_ADDTAGDLG_TITLE;Dodaj/Edytuj etykietę -EXIFPANEL_KEEPHINT;Zapamiętaj wybrane etykiety podczas zapisywania pliku wyjściowego -EXIFPANEL_KEEP;Zapamiętaj -EXIFPANEL_REMOVEHINT;Usuń wybrane etykiety podczas zapisywania pliku wyjściowego -EXIFPANEL_REMOVE;Usuń -EXIFPANEL_RESETALLHINT;Przywróć wszystkie etykiety do ich oryginalnych wartości -EXIFPANEL_RESETALL;Przywróć wszystkie -EXIFPANEL_RESETHINT;Przywróć wybrane etykiety do ich oryginalnych wartości -EXIFPANEL_RESET;Przywróć -EXIFPANEL_SUBDIRECTORY;Podkatalog -FILEBROWSER_APPLYPROFILE;Zastosuj profil -FILEBROWSER_ARRANGEMENTHINT;Przełącz pomiędzy poziomym/pionowym wyrównaniem miniaturek -FILEBROWSER_CLEARPROFILE;Wyczyść profil -FILEBROWSER_COPYPROFILE;Kopiuj profil -FILEBROWSER_DELETEDLGLABEL;Potwierdzenie usunięcia pliku -FILEBROWSER_DELETEDLGMSG;Jesteś pewień, że chcesz usunąć zaznaczone %1 pliki? -FILEBROWSER_EMPTYTRASHHINT;Permanentnie usuń pliki z kosza -FILEBROWSER_EMPTYTRASH;Wyczyść kosz -FILEBROWSER_EXIFFILTERAPPLYHINT;Włącz/wyłącz filtr Exif w przeglądarce plików -FILEBROWSER_EXIFFILTERAPPLY;Zastosuj -FILEBROWSER_EXIFFILTERLABEL;Filrt Exif -FILEBROWSER_EXIFFILTERSETTINGSHINT;Zmień ustawienia filtru Exif -FILEBROWSER_EXIFFILTERSETTINGS;Ustawienia -FILEBROWSER_PARTIALPASTEPROFILE;Wklej częściowo -FILEBROWSER_PASTEPROFILE;Wklej profil -FILEBROWSER_POPUPCANCELJOB;Anuluj zadanie -FILEBROWSER_POPUPMOVEEND;Przenieś na koniec kolejki -FILEBROWSER_POPUPMOVEHEAD;Przenieś na początek kolejki -FILEBROWSER_POPUPOPEN;Otrórz -FILEBROWSER_POPUPPROCESS;Umieść w kolejce do przetwarzania -FILEBROWSER_POPUPRANK1;Ocena 1 -FILEBROWSER_POPUPRANK2;Ocena 2 -FILEBROWSER_POPUPRANK3;Ocena 3 -FILEBROWSER_POPUPRANK4;Ocena 4 -FILEBROWSER_POPUPRANK5;Ocena 5 -FILEBROWSER_POPUPREMOVE;Usuń z systemu plików -FILEBROWSER_POPUPRENAME;Zmień nazwę -FILEBROWSER_POPUPSELECTALL;Zaznacz wszystkie -FILEBROWSER_POPUPTRASH;Przenieś do kosza -FILEBROWSER_POPUPUNRANK;Usuń ocenę -FILEBROWSER_POPUPUNTRASH;Usuń z kosza -FILEBROWSER_PROCESSINGSETTINGSHINT;Ustaw format pliku i katalog wyjściowy -FILEBROWSER_PROCESSINGSETTINGS;Ustawienia -FILEBROWSER_RENAMEDLGLABEL;Zmień nazwę pliku -FILEBROWSER_RENAMEDLGMSG;Zmień nazwę plki "%1" na: -FILEBROWSER_SHOWDIRHINT;Pokaż wszystkie zdjęcia w katalogu -FILEBROWSER_SHOWQUEUEHINT;Pokaz zawartość kolejki przetwarzania -FILEBROWSER_SHOWRANK1HINT;Pokaż zdjęcia ocenione na 1 gwiazdkę -FILEBROWSER_SHOWRANK2HINT;Pokaż zdjęcia ocenione na 2 gwiazdki -FILEBROWSER_SHOWRANK3HINT;Pokaż zdjęcia ocenione na 3 gwiazdki -FILEBROWSER_SHOWRANK4HINT;Pokaż zdjęcia ocenione na 4 gwiazdki -FILEBROWSER_SHOWRANK5HINT;Pokaż zdjęcia ocenione na 5 gwiazdek -FILEBROWSER_SHOWTRASHHINT;Pokaż zawartość kosza -FILEBROWSER_SHOWUNRANKHINT;Pokaz nieocenione zdjęcia -FILEBROWSER_STARTPROCESSINGHINT;Rozpocznij przetwarzanie/zapisywanie plików w kolejce -FILEBROWSER_STARTPROCESSING;Rozpocznij przetwarzanie -FILEBROWSER_STOPPROCESSINGHINT;Zatrzymaj przetwarzanie zdjęć -FILEBROWSER_STOPPROCESSING;Zatrzymaj przetwarzanie -FILEBROWSER_THUMBSIZE;Rozmiar minaturek -FILEBROWSER_ZOOMINHINT;Zwiększ rozmiar miniaturek -FILEBROWSER_ZOOMOUTHINT;Zmniejsz rozmiar miniaturek -GENERAL_ABOUT;O programie -GENERAL_CANCEL;Anuluj -GENERAL_DISABLED;Wyłączone -GENERAL_DISABLE;Wyłącz -GENERAL_ENABLED;Włączone -GENERAL_ENABLE;Włącz -GENERAL_LANDSCAPE;Poziomo -GENERAL_LOAD;Ładuj -GENERAL_NA;nd. -GENERAL_NO;Nie -GENERAL_OK;OK -GENERAL_PORTRAIT;Pionowo -GENERAL_SAVE;Zapisz -GENERAL_YES;Tak -HISTOGRAM_LABEL;Histogram -HISTOGRAM_TOOLTIP_B;Pokaż/Ukryj histogram błękitów -HISTOGRAM_TOOLTIP_G;Pokaż/Ukryj histogram zieleni -HISTOGRAM_TOOLTIP_L;Pokaż/Ukryj histogram luminancji CIELAB -HISTOGRAM_TOOLTIP_R;Pokaż/Ukryj histogram czerwieni -HISTORY_CHANGED;Zmieniono -HISTORY_CUSTOMCURVE;Dowolna krzywa -HISTORY_DELSNAPSHOT;Usuń migawkę -HISTORY_FROMCLIPBOARD;Ze schowka -HISTORY_LABEL;Historia -HISTORY_MSG_10;Kompresja cieni -HISTORY_MSG_11;Krzywa tonalna -HISTORY_MSG_12;Automatyczna ekspozycja -HISTORY_MSG_13;Przycinanie ekspozycji -HISTORY_MSG_14;Jasność luminancji -HISTORY_MSG_15;Kontrast luminancji -HISTORY_MSG_16;Czerń luminancji -HISTORY_MSG_17;Kompr. świateł luminancji -HISTORY_MSG_18;Kompr. cieni luminancji -HISTORY_MSG_19;Krzywa luminancji -HISTORY_MSG_1;Zdjęcie załadowane -HISTORY_MSG_20;Wyostrzanie -HISTORY_MSG_21;Promień wyostrzania -HISTORY_MSG_22;Siła wyostrzania -HISTORY_MSG_23;Próg wyostrzania -HISTORY_MSG_24;Wyostrz tylko krawędzie -HISTORY_MSG_25;Promień detekcji krawędzi wyostrzania -HISTORY_MSG_26;Tolerancja wyostrzania krawędzi -HISTORY_MSG_27;Kontrola poświaty wyostrzania -HISTORY_MSG_28;Stopień kontroli poświaty -HISTORY_MSG_29;Metoda wyostrzania -HISTORY_MSG_2;Profil załadowany -HISTORY_MSG_30;Promień dekonwolucji -HISTORY_MSG_31;Siła dekonwolucji -HISTORY_MSG_32;Tłumienie dekonwolucji -HISTORY_MSG_33;Iteracje dekonwolucji -HISTORY_MSG_34;Zapobiegaj przycinaniu kolorów -HISTORY_MSG_35;Limit saturacji -HISTORY_MSG_36;Limit saturacji -HISTORY_MSG_37;Wzmocnienie koloru -HISTORY_MSG_38;Metoda balansu bieli -HISTORY_MSG_39;Temperatura koloru -HISTORY_MSG_3;Profil zmieniony -HISTORY_MSG_40;Odcień balansu bieli -HISTORY_MSG_41;Przesunięcie koloru "A" -HISTORY_MSG_42;Przesunięcie koloru "B" -HISTORY_MSG_43;Odszumianie luminancji -HISTORY_MSG_44;Promień odszumiania lum. -HISTORY_MSG_45;Tol. krawędzi odszumiania lum. -HISTORY_MSG_46;Odszumianie koloru -HISTORY_MSG_47;Promień odszumiania kolorowego -HISTORY_MSG_48;Tol. krawędzi odszumiania kol. -HISTORY_MSG_49;Odszumianie koloru z czuł. kraw. -HISTORY_MSG_4;Przeglądanie historii -HISTORY_MSG_50;Narzędzie światła/cienie -HISTORY_MSG_51;Wzmocnienie świateł -HISTORY_MSG_52;Wzmocnienie cieni -HISTORY_MSG_53;Szerokość tonalna świateł -HISTORY_MSG_54;Szerokość tonalna cieni -HISTORY_MSG_55;Kontrast lokalny -HISTORY_MSG_56;Promień świateł/cieni -HISTORY_MSG_57;Surowy obrót -HISTORY_MSG_58;Odbicie w poziomie -HISTORY_MSG_59;Odbicie w pionie -HISTORY_MSG_5;Jasność -HISTORY_MSG_60;Obrót -HISTORY_MSG_61;Obrót -HISTORY_MSG_62;Korekcja dystorsji obiektywu -HISTORY_MSG_63;Zapamiętaj wybrany -HISTORY_MSG_64;Kadrowanie zdjęcia -HISTORY_MSG_65;Korekcja AC -HISTORY_MSG_66;Odzyskiwanie prześwietleń -HISTORY_MSG_67;Siła odzyskiwania prześwietleń -HISTORY_MSG_68;Metoda odzyskiwania Prześwietleń -HISTORY_MSG_69;Robocza przestrzeń kolorów -HISTORY_MSG_6;Kontrast -HISTORY_MSG_70;Wyjściowa przestrzeń kolorów -HISTORY_MSG_71;Wejściowa przestrzeń kolorów -HISTORY_MSG_72;Korekcja winietowania -HISTORY_MSG_73;Mikser kanałów -HISTORY_MSG_74;Skala zmiany rozmiaru -HISTORY_MSG_75;Metoda zmiany rozmiaru -HISTORY_MSG_76;Metadane Exif -HISTORY_MSG_77;Metadane IPTC -HISTORY_MSG_78;Data specified for resize -HISTORY_MSG_79;Resize width -HISTORY_MSG_7;Czerń -HISTORY_MSG_80;Resize height -HISTORY_MSG_81;Resize enabled -HISTORY_MSG_8;Kompensacja ekspozycji -HISTORY_MSG_9;Kompresja świateł -HISTORY_NEWSNAPSHOTAS;Jako... -HISTORY_NEWSNAPSHOT;Nowa migawka -HISTORY_NEWSSDIALOGLABEL;Nazwa migawki: -HISTORY_NEWSSDIALOGTITLE;Dodaj nową migawkę -HISTORY_SETTO;Wybrano -HISTORY_SNAPSHOT;Migawka -HISTORY_SNAPSHOTS;Migawki -ICMPANEL_FILEDLGFILTERANY;Wszystkie pliki -ICMPANEL_FILEDLGFILTERICM;Pliki z profilami ICC -ICMPANEL_GAMMABEFOREINPUT;Profile applies Gamma -ICMPANEL_INPUTCAMERA;Domyślny aparatu -ICMPANEL_INPUTCUSTOM;Ręczny -ICMPANEL_INPUTDLGLABEL;Wybierz wejściowy profil ICC... -ICMPANEL_INPUTEMBEDDED;Jeśli to możliwe, użyj osadzonego -ICMPANEL_INPUTPROFILE;Profil wejściowy -ICMPANEL_NOICM;No ICM: Wyjście sRGB -ICMPANEL_OUTPUTDLGLABEL;Wybierz wyjściowy profil ICC... -ICMPANEL_OUTPUTPROFILE;Profil wyjściowy -ICMPANEL_SAVEREFERENCE;Save reference image for profiling -ICMPANEL_WORKINGPROFILE;Profil roboczy -IMAGEAREA_DETAILVIEW;Lupa -IPTCPANEL_AUTHOR;Autor -IPTCPANEL_AUTHORHINT;Imię lub nazwa twórcy obiektu np. pisarza, fotografa lub grafika (w linii). -IPTCPANEL_AUTHORSPOSITION;Author's position -IPTCPANEL_AUTHORSPOSITIONHINT;Title of the creator or creators of the object (By-line Title). -IPTCPANEL_CAPTIONHINT;A textual description of the data (Caption - Abstract). -IPTCPANEL_CAPTION;Tytuł -IPTCPANEL_CAPTIONWRITER;Caption Writer -IPTCPANEL_CAPTIONWRITERHINT;The name of the person involved in the writing, editing or correcting the image or caption/abstract (Writer - Editor). -IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider (Category). -IPTCPANEL_CATEGORY;Kategoria -IPTCPANEL_CITYHINT;City of image origin (City). -IPTCPANEL_CITY;Miasto -IPTCPANEL_COPYHINT;Copy IPTC settings to clipboard -IPTCPANEL_COPYRIGHT;Copyright -IPTCPANEL_COPYRIGHTHINT;Any necessary copyright notice (Copyright Notice). -IPTCPANEL_COUNTRYHINT;The name of the country/primary location where the image was created (Country - Primary Location Name). -IPTCPANEL_COUNTRY;Kraj -IPTCPANEL_CREDIT;Credit -IPTCPANEL_CREDITHINT;Identifies the provider of the image, not necessarily the owner/creator (Credit). -IPTCPANEL_DATECREATED;Data utworzenia -IPTCPANEL_DATECREATEDHINT;The date the intellectual content of the image was created; Format: JJJJMMTT (Date Created). -IPTCPANEL_EMBEDDED;Embedded -IPTCPANEL_EMBEDDEDHINT;Reset to IPTC data embedded in the image file -IPTCPANEL_HEADLINEHINT;A publishable entry providing a synopsis of the contents of the image (Headline). -IPTCPANEL_HEADLINE;Nagłówek -IPTCPANEL_INSTRUCTIONSHINT;Other editorial instructions concerning the use of the image (Special Instructions). -IPTCPANEL_INSTRUCTIONS;Instrukcje -IPTCPANEL_KEYWORDSHINT;Used to indicate specific information retrieval words (Keywords). -IPTCPANEL_KEYWORDS;Słowa kluczowe -IPTCPANEL_PASTEHINT;Paste IPTC settings from clipboard -IPTCPANEL_PROVINCEHINT;The Province/State where the image originates (Province-State). -IPTCPANEL_PROVINCE;Stan, województwo, dystrykt itd. -IPTCPANEL_RESETHINT;Reset to profile default -IPTCPANEL_RESET;Reset -IPTCPANEL_SOURCEHINT;The original owner of the intellectual content of the image (Source). -IPTCPANEL_SOURCE;Źródło -IPTCPANEL_SUPPCATEGORIESHINT;Further refines the subject of the image (Supplemental Categories). -IPTCPANEL_SUPPCATEGORIES;Suppl. Categories -IPTCPANEL_TITLEHINT;A shorthand reference for the image (Object Name). -IPTCPANEL_TITLE;Tytuł -IPTCPANEL_TRANSREFERENCEHINT;A code representing the location of original transmission (Original Transmission Reference). -IPTCPANEL_TRANSREFERENCE;Trans. Reference -MAIN_BUTTON_EXIT;Exit -MAIN_BUTTON_PREFERENCES;Preferencje -MAIN_BUTTON_QUEUE;Put to queue -MAIN_BUTTON_SAVEAS;Jako... -MAIN_BUTTON_SAVE;Zapisz obraz -MAIN_BUTTON_SENDTOEDITOR;Wyślij do edytora -MAIN_FRAME_BATCHQUEUE;Batch Queue -MAIN_FRAME_FILEBROWSER;File Browser -MAIN_FRAME_PLACES_ADD;Add -MAIN_FRAME_PLACES_DEL;Del -MAIN_FRAME_PLACES;Places -MAIN_FRAME_RECENT;Recent Folders -MAIN_MSG_ALREADYEXISTS;Plik już istnieje. -MAIN_MSG_CANNOTLOAD;Nie można wczytać obrazu -MAIN_MSG_CANNOTSAVE;Błąd zapisu pliku -MAIN_MSG_CANNOTSTARTEDITOR;Nie mozna uruchomic edytora. -MAIN_MSG_CANNOTSTARTEDITOR_SECONDARY;Musisz wspisać prawidłową ścieżkę w oknie "Preferencji". -MAIN_MSG_EXITJOBSINQUEUEINFO;Nieprzetworzone zdjęcia w kolejce będą utracone po zamknięciu. -MAIN_MSG_EXITJOBSINQUEUEQUEST;Jesteś pewien, że chcesz zamknąć alpikację? W kolejce znajdują się nieprzetworzone zdjęcia. -MAIN_MSG_JOBSINQUEUE;zadań w kolejce -MAIN_MSG_QOVERWRITE;Czy chcesz go zastąpić? -MAIN_TAB_BASIC;Podstawowe -MAIN_TAB_COLOR;Kolor -MAIN_TAB_DETAIL;Szczegóły -MAIN_TAB_DEVELOP;Develop -MAIN_TAB_EXIF;Exif -MAIN_TAB_EXPOSURE;Ekspozycja -MAIN_TAB_FILTER;Filter -MAIN_TAB_ICM;ICM -MAIN_TAB_IPTC;IPTC -MAIN_TAB_METADATA;Metadane -MAIN_TAB_TAGGING;Tagging -MAIN_TAB_TRANSFORM;Transformacje -MAIN_TOOLTIP_HIDEFP;Pokaż/ukryj dolny panel (przeglądarka plików i katalogów, shortcut key: F) -MAIN_TOOLTIP_HIDEHP;Pokaż/ukryj lewy panel (razem z historią, shortcut key: H) -MAIN_TOOLTIP_INDCLIPPEDH;Pokaż prześwietlenia -MAIN_TOOLTIP_INDCLIPPEDS;Pokaż niedoświetlenia -MAIN_TOOLTIP_PREFERENCES;Ustaw preferencje -MAIN_TOOLTIP_QINFO;Informacje o pliku -MAIN_TOOLTIP_SAVEAS;Zapisz obraz we wskazanym katalogu -MAIN_TOOLTIP_SAVE;Zapisz obraz w katalogu domyślnym -PARTIALPASTE_BASICGROUP;Podstawowe ustawienia -PARTIALPASTE_CACORRECTION;Korekcja C/A -PARTIALPASTE_COARSETRANS;Rotacja/odwrócenie o 90 stopni -PARTIALPASTE_COLORBOOST;Uwydatnienie koloru -PARTIALPASTE_COLORDENOISE;Odszumienie koloru -PARTIALPASTE_COLORGROUP;Ustawienia związane z kolorem -PARTIALPASTE_COLORMIXER;Mikser koloru -PARTIALPASTE_COLORSHIFT;Przesunięcie koloru -PARTIALPASTE_COMPOSITIONGROUP;Ustawienia kompozycji -PARTIALPASTE_CROP;Przytnij -PARTIALPASTE_DIALOGLABEL;Partial paste processing profile -PARTIALPASTE_DISTORTION;Korekcja zniekształcenia -PARTIALPASTE_EXIFCHANGES;Zmień dane Exif -PARTIALPASTE_EXPOSURE;Ekspozycja -PARTIALPASTE_HLRECOVERY;Highlight recovery -PARTIALPASTE_ICMSETTINGS;Ustawienia ICM -PARTIALPASTE_IPTCINFO;Informacje IPTC -PARTIALPASTE_LENSGROUP;Ustawienia związane z obiektywem -PARTIALPASTE_LUMACURVE;Krzywa obiektywu -PARTIALPASTE_LUMADENOISE;Redukcja zaszumienia jaskrawości -PARTIALPASTE_LUMINANCEGROUP;Ustawienia związane z jaskrawością -PARTIALPASTE_METAICMGROUP;Metadanea/Ustawienia ICM -PARTIALPASTE_RESIZE;Zmień rozmiar -PARTIALPASTE_ROTATION;Rotacja -PARTIALPASTE_SHADOWSHIGHLIGHTS;Cienie/Podświetlenia -PARTIALPASTE_SHARPENING;Wyostrzanie -PARTIALPASTE_VIGNETTING;Korekcja winiety -PARTIALPASTE_WHITEBALANCE;Balans bieli -PREFERENCES_APPLNEXTSTARTUP;wymaga ponownego uruchomienia -PREFERENCES_BLINKCLIPPED;Mrugające prześwietlenia -PREFERENCES_CACHECLEARALL;Wyczyść wszystko -PREFERENCES_CACHECLEARPROFILES;Wyczyść profile -PREFERENCES_CACHECLEARTHUMBS;Wyczyść miniaturki -PREFERENCES_CACHEFORMAT1;Proprietary (faster and better quality) -PREFERENCES_CACHEFORMAT2;JPEG (smaller disk footprint) -PREFERENCES_CACHEMAXENTRIES;Maksymalna liczba wpisów w pamięci podręcznej -PREFERENCES_CACHEOPTS;Opcje pamięci podręcznej -PREFERENCES_CACHESTRAT1;Prefer Speed to Low Memory Consumption -PREFERENCES_CACHESTRAT2;Prefer Low Memory Consumption to Speed -PREFERENCES_CACHESTRAT;Cache Strategy -PREFERENCES_CACHETHUMBFORM;Cache Thumbnail Format -PREFERENCES_CACHETHUMBHEIGHT;Maximal Thumbnail Height -PREFERENCES_CLEARDLG_LINE1;Czyszczenie pamięci podręcznej -PREFERENCES_CLEARDLG_LINE2;Może to potrwać kilka sekund. -PREFERENCES_CLEARDLG_TITLE;Prosze czekać -PREFERENCES_CLIPPINGIND;Pokazywanie prześwietleń -PREFERENCES_CMETRICINTENT;Sposób odwzorowania barw -PREFERENCES_DATEFORMAT;Format daty -PREFERENCES_DATEFORMATHINT;You can use the following formatting strings:\n%y : year\n%m : month\n%d : day\n\nFor example, the hungarian date format is:\n%y/%m/%d -PREFERENCES_DEFAULTLANG;Język domyślny -PREFERENCES_DEFAULTTHEME;Default theme -PREFERENCES_DEMOSAICINGALGO;Algorytm demozaikowania -PREFERENCES_DIRHOME;Katalog domowy -PREFERENCES_DIRLAST;Ostatnio odwiedzony katalog -PREFERENCES_DIROTHER;Inny -PREFERENCES_DIRSELECTDLG;Wybierz katalog z obrazami po uruchomieniu... -PREFERENCES_DIRSOFTWARE;Katalog instalacyjny -PREFERENCES_DMETHOD;Metoda -PREFERENCES_EDITORCMDLINE;Other command line -PREFERENCES_EXTERNALEDITOR;Zewnętrzny edytor -PREFERENCES_FALSECOLOR;Kroki zapobiegania zafałszowaniom kolorów -PREFERENCES_FBROWSEROPTS;Opcje przeglądarki plików -PREFERENCES_FILEFORMAT;Format pliku -PREFERENCES_FORIMAGE;Dla plików z obrazami -PREFERENCES_FORRAW;Dla plików RAW -PREFERENCES_GIMPPATH;Katalog, w którym zainstalowany jest GIMP -PREFERENCES_GTKTHEME;GTK default -PREFERENCES_HINT;Porada -PREFERENCES_HLTHRESHOLD;Próg dla prześwietleñ -PREFERENCES_ICCDIR;Katalog z profilami ICC -PREFERENCES_IMPROCPARAMS;Domyślne parametry przetwarzania obrazu -PREFERENCES_INTENT_ABSOLUTE;Absolutnie kolorymetryczny -PREFERENCES_INTENT_PERCEPTUAL;Percepcyjny -PREFERENCES_INTENT_RELATIVE;Względnie kolorymetryczny -PREFERENCES_INTENT_SATURATION;Nasyceniowy -PREFERENCES_LIVETHUMBNAILS;Miniaturki na żywo (wojniej) -PREFERENCES_MONITORICC;Profil monitora -PREFERENCES_OUTDIRFOLDERHINT;Umieść zapisane zdjęcia w wybranym katalogu -PREFERENCES_OUTDIRFOLDER;Zapisz do katalogu -PREFERENCES_OUTDIRHINT;You can use the following formatting strings:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nThese formatting strings refer to the directories and sub-paths of the path of the raw file.\n\nFor example, if /home/tom/image/02-09-2006/dsc0012.nefhas been opened, the meaning of the formatting strings are:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nIf you want to save the output image where the original is, write:\n%p1/%f\n\nIf you want to save the output image in a directory 'converted' located the directory of the original, write:\n%p1/converted/%f\n\nIf you want to save the output image in directory '/home/tom/converted' with keeping the same subdirectory of dates, write:\n%p2/converted/%d1/%f -PREFERENCES_OUTDIR;Katalog wyjściowy -PREFERENCES_OUTDIRTEMPLATEHINT;You can use the following formatting strings:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nThese formatting strings refer to the directories and sub-paths of the path of the raw file.\n\nFor example, if /home/tom/image/02-09-2006/dsc0012.nefhas been opened, the meaning of the formatting strings are:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nIf you want to save the output image where the original is, write:\n%p1/%f\n\nIf you want to save the output image in a directory 'converted' located the directory of the original, write:\n%p1/converted/%f\n\nIf you want to save the output image in directory '/home/tom/converted' with keeping the same subdirectory of dates, write:\n%p2/converted/%d1/%f -PREFERENCES_OUTDIRTEMPLATE;Użyj schemat -PREFERENCES_PARSEDEXTADD;Dodaj rozszerzenie -PREFERENCES_PARSEDEXTADDHINT;Type an extension and press this button to append list -PREFERENCES_PARSEDEXTDELHINT;Delete selected extension from the list -PREFERENCES_PARSEDEXT;Parsed Extensions -PREFERENCES_PROFILEHANDLING;Processing Profile Handling -PREFERENCES_PROFILELOADPR;Profile Loading Priority -PREFERENCES_PROFILEPRCACHE;Profile in Cache -PREFERENCES_PROFILEPRFILE;Profile Next to the Input File -PREFERENCES_PROFILESAVECACHE;Save Processing Parameters to the Cache -PREFERENCES_PROFILESAVEINPUT;Save Processing Parameters Next to the Input File -PREFERENCES_PSPATH;Katalog w którym zainstalowany jest Adobe Photoshop -PREFERENCES_SELECTICCDIRDLG;Wybierz katalog z profilami ICC... -PREFERENCES_SELECTLANG;Wybierz język -PREFERENCES_SELECTMONITORPROFDLG;Wybierz profil ICC do wyświetlenia... -PREFERENCES_SELECTTHEME;Select theme -PREFERENCES_SHOWBASICEXIF;Pokaż podstawowe dane Exif -PREFERENCES_SHOWDATETIME;Pokaż datę i czas -PREFERENCES_SHOWONLYRAW;Pokaż tylko pliki RAW -PREFERENCES_SHTHRESHOLD;Próg dla niedoświetleñ -PREFERENCES_STARTUPIMDIR;Katalog startowy -PREFERENCES_TAB_BROWSER;Przeglądarka plików -PREFERENCES_TAB_COLORMGR;Zarządzanie kolorami -PREFERENCES_TAB_GENERAL;Ogólne -PREFERENCES_TAB_IMPROC;Przetwarzanie obrazu -PREFERENCES_TAB_OUTPUT;Opcje wyjściowe -PREFERENCES_THUMBSIZE;Wielkość miniaturki -PROFILEPANEL_FILEDLGFILTERANY;Wszystkie pliki -PROFILEPANEL_FILEDLGFILTERPP;Profile postprocessingu -PROFILEPANEL_LABEL;Profil postprocessingu -PROFILEPANEL_LOADDLGLABEL;Ładuj parametry postprocessingu... -PROFILEPANEL_PCUSTOM;Ręczny -PROFILEPANEL_PFILE;Z pliku -PROFILEPANEL_PLASTPHOTO;Ostatnie Zdjęcie -PROFILEPANEL_PLASTSAVED;Ostatnio zapisany -PROFILEPANEL_PROFILE;Profil -PROFILEPANEL_SAVEDLGLABEL;Zapisz parametry postprocessingu... -PROFILEPANEL_TOOLTIPCOPY;Skopiuj aktualny profil do schowka -PROFILEPANEL_TOOLTIPLOAD;Ładuj profil z pliku -PROFILEPANEL_TOOLTIPPASTE;Wklej profil ze schowka -PROFILEPANEL_TOOLTIPSAVE;Zapisz aktualny profil -PROGRESSBAR_DECODING;Dekodowanie pliku raw... -PROGRESSBAR_DEMOSAICING;Demozaikowanie... -PROGRESSBAR_LOADING;Wczytywanie obrazu... -PROGRESSBAR_LOADJPEG;Ładowanie pliku JPEG... -PROGRESSBAR_LOADPNG;Ładowanie pliku PNG... -PROGRESSBAR_LOADTIFF;Ładowanie pliku TIFF... -PROGRESSBAR_PROCESSING;Przetwarzanie obrazu... -PROGRESSBAR_READY;Gotowe. -PROGRESSBAR_SAVEJPEG;Zapisywanie pliku JPEG... -PROGRESSBAR_SAVEPNG;Zapisywanie pliku PNG... -PROGRESSBAR_SAVETIFF;Zapisywanie pliku TIFF... -PROGRESSDLG_LOADING;Wczytywanie pliku... -PROGRESSDLG_PROCESSING;Przetwarzanie zdjęcia... -PROGRESSDLG_SAVING;Zapisywanie pliku... -QINFO_FOCALLENGTH;Ogniskowa -QINFO_ISO;ISO -QINFO_LENS;Obiektyw -QINFO_NOEXIF;Dane exif niedostępne. -SAVEDLG_FILEFORMAT;Format pliku -SAVEDLG_JPEGQUAL;Jakość JPEG -SAVEDLG_JPGFILTER;Pliki JPEG -SAVEDLG_PNGCOMPR;Kompresja PNG -SAVEDLG_PNGFILTER;Pliki PNG -SAVEDLG_PUTTOQUEUEHEAD;Put to the head of the processing queue -SAVEDLG_PUTTOQUEUE;Put into processing queue -SAVEDLG_PUTTOQUEUETAIL;Put to the end of the processing queue -SAVEDLG_SAVEIMMEDIATELY;Save immediately -SAVEDLG_SAVESPP;Zapisz parametry przetwarzania wraz z obrazem -SAVEDLG_TIFFFILTER;Pliki TIFF -TOOLBAR_TOOLTIP_CROP;Kadruj (shortcut key: C) -TOOLBAR_TOOLTIP_HAND;Przesuń (shortcut key: N) -TOOLBAR_TOOLTIP_STRAIGHTEN;Wyprostuj obraz (shortcut key: S) -TOOLBAR_TOOLTIP_WB;Wskaż balans bieli (shortcut key: W) -TP_CACORRECTION_BLUE;Niebieski -TP_CACORRECTION_LABEL;Korekcja AC -TP_CACORRECTION_RED;Czerwony -TP_CHMIXER_BLUE;Niebieski -TP_CHMIXER_GREEN;Zielony -TP_CHMIXER_LABEL;Mikser kanałów -TP_CHMIXER_RED;Czerwony -TP_COARSETRAF_DEGREE;stopnie: -TP_COARSETRAF_TOOLTIP_HFLIP;Odbij w poziomie -TP_COARSETRAF_TOOLTIP_ROTLEFT;Obróć w lewo -TP_COARSETRAF_TOOLTIP_ROTRIGHT;Obróć w prawo -TP_COARSETRAF_TOOLTIP_VFLIP;Odbij w pionie -TP_COLORBOOST_ACHANNEL;kanał "a" -TP_COLORBOOST_AMOUNT;Stopień -TP_COLORBOOST_AVOIDCOLORCLIP;Unikaj przycinania kolorów -TP_COLORBOOST_BCHANNEL;kanał "b" -TP_COLORBOOST_CHAB;a i b -TP_COLORBOOST_CHANNEL;Kanał -TP_COLORBOOST_CHSEPARATE;oddzielnie -TP_COLORBOOST_ENABLESATLIMITER;Włącz limit saturacji -TP_COLORBOOST_LABEL;Wzmocnienie koloru -TP_COLORBOOST_SATLIMIT;Limit saturacji -TP_COLORDENOISE_EDGESENSITIVE;Czułość krawędzi -TP_COLORDENOISE_EDGETOLERANCE;Tolerancja krawędzi -TP_COLORDENOISE_LABEL;Odszumianie koloru -TP_COLORDENOISE_RADIUS;Promień -TP_COLORSHIFT_BLUEYELLOW;Błękit-żółty -TP_COLORSHIFT_GREENMAGENTA;Zieleń-magenta -TP_COLORSHIFT_LABEL;Przesunięcie koloru -TP_CROP_DPI;DPI= -TP_CROP_FIXRATIO;Zablokuj proporcje: -TP_CROP_GTDIAGONALS;Przekątna -TP_CROP_GTHARMMEANS1;Złoty podział 1 -TP_CROP_GTHARMMEANS2;Złoty podział 2 -TP_CROP_GTHARMMEANS3;Złoty podział 3 -TP_CROP_GTHARMMEANS4;Złoty podział 4 -TP_CROP_GTNONE;Nic -TP_CROP_GTRULETHIRDS;Trójpodział -TP_CROP_GUIDETYPE;Typ pomocy: -TP_CROP_H;W -TP_CROP_LABEL;Kadrowanie -TP_CROP_SELECTCROP;Wybierz kadr -TP_CROP_W;S -TP_CROP_X;x -TP_CROP_Y;y -TP_DISTORTION_AMOUNT;Siła -TP_DISTORTION_LABEL;Dystorsja -TP_EXPOSURE_AUTOLEVELS;Wyrównaj poziomy -TP_EXPOSURE_BLACKLEVEL;Czerń -TP_EXPOSURE_BRIGHTNESS;Jasność -TP_EXPOSURE_CLIP;Przytnij -TP_EXPOSURE_COMPRHIGHLIGHTS;Kompresja świateł -TP_EXPOSURE_COMPRSHADOWS;Kompresja cieni -TP_EXPOSURE_CONTRAST;Kontrast -TP_EXPOSURE_CURVEEDITOR;Krzywa tonalna -TP_EXPOSURE_EXPCOMP;EV -TP_EXPOSURE_LABEL;Ekspozycja -TP_HLREC_CIELAB;Mieszanie koloru CIELab -TP_HLREC_COLOR;Propagacja koloru -TP_HLREC_LABEL;Odzyskiwanie prześwietleń -TP_HLREC_LUMINANCE;Odzyskiwanie luminancji -TP_HLREC_METHOD;Metoda: -TP_ICM_FILEDLGFILTERANY;Wszystkie pliki -TP_ICM_FILEDLGFILTERICM;Pliki z profilami ICC -TP_ICM_GAMMABEFOREINPUT;Profile applies Gamma -TP_ICM_INPUTCAMERA;Domyślny aparatu -TP_ICM_INPUTCUSTOM;Ręczny -TP_ICM_INPUTDLGLABEL;Wybierz wejściowy profil ICC... -TP_ICM_INPUTEMBEDDED;Jeśli to możliwe, użyj osadzonego -TP_ICM_INPUTPROFILE;Profil wejściowy -TP_ICM_LABEL;ICM -TP_ICM_NOICM;No ICM: Wyjście sRGB -TP_ICM_OUTPUTDLGLABEL;Wybierz wyjściowy profil ICC... -TP_ICM_OUTPUTPROFILE;Profil wyjściowy -TP_ICM_SAVEREFERENCE;Save reference image for profiling -TP_ICM_WORKINGPROFILE;Profil roboczy -TP_LUMACURVE_BLACKLEVEL;Czerń -TP_LUMACURVE_BRIGHTNESS;Jasność -TP_LUMACURVE_COMPRHIGHLIGHTS;Kompresja świateł -TP_LUMACURVE_COMPRSHADOWS;Kompresja cieni -TP_LUMACURVE_CONTRAST;Kontrast -TP_LUMACURVE_CURVEEDITOR;Krzywa luminancji -TP_LUMACURVE_LABEL;Krzywa luminancji -TP_LUMADENOISE_EDGETOLERANCE;Tolerancja krawędzi -TP_LUMADENOISE_LABEL;Odszumianie luminancji -TP_LUMADENOISE_RADIUS;Promień -TP_RESIZE_BICUBIC;Bicubic -TP_RESIZE_BICUBICSF;Bicubic (Miękko) -TP_RESIZE_BICUBICSH;Bicubic (Ostro) -TP_RESIZE_BILINEAR;Bilinear -TP_RESIZE_FULLSIZE;Pełny rozmiar obrazu: -TP_RESIZE_H;W: -TP_RESIZE_LABEL;Skalowanie -TP_RESIZE_METHOD;Metoda: -TP_RESIZE_NEAREST;Najbliższa -TP_RESIZE_SCALE;Skala -TP_RESIZE_W;S: -TP_ROTATE_AUTOCROP;Auto przycinanie -TP_ROTATE_DEGREE;Stopnie -TP_ROTATE_FILL;Wypełnij -TP_ROTATE_LABEL;Obrót -TP_ROTATE_SELECTLINE;Wyprostuj obraz -TP_SHADOWSHLIGHTS_HIGHLIGHTS;Światła -TP_SHADOWSHLIGHTS_HLTONALW;Szerokość tonalna -TP_SHADOWSHLIGHTS_LABEL;Cienie/Światła -TP_SHADOWSHLIGHTS_LOCALCONTR;Kontrast lokalny -TP_SHADOWSHLIGHTS_RADIUS;Promień -TP_SHADOWSHLIGHTS_SHADOWS;Cienie -TP_SHADOWSHLIGHTS_SHTONALW;Szerokość tonalna -TP_SHARPENING_AMOUNT;Siła -TP_SHARPENING_EDRADIUS;Promień -TP_SHARPENING_EDTOLERANCE;Tolerancja -TP_SHARPENING_HALOCONTROL;Kontrola poświaty -TP_SHARPENING_HCAMOUNT;Siła -TP_SHARPENING_LABEL;Wyostrzanie -TP_SHARPENING_METHOD;Metoda -TP_SHARPENING_ONLYEDGES;Wyostrz tylko krawędzie -TP_SHARPENING_RADIUS;Promień -TP_SHARPENING_RLD_AMOUNT;Siła -TP_SHARPENING_RLD_DAMPING;Tłumienie -TP_SHARPENING_RLD;Dekonwolucja RL -TP_SHARPENING_RLD_ITERATIONS;Iteracje -TP_SHARPENING_THRESHOLD;Próg -TP_SHARPENING_USM;Maska wyostrzająca -TP_VIGNETTING_AMOUNT;Siła -TP_VIGNETTING_LABEL;Korekcja winietowania -TP_VIGNETTING_RADIUS;Promień -TP_WBALANCE_AUTO;Auto -TP_WBALANCE_CAMERA;Z aparatu -TP_WBALANCE_CUSTOM;Ręczny -TP_WBALANCE_GREEN;Odcień -TP_WBALANCE_LABEL;Balans bieli -TP_WBALANCE_METHOD;Metoda -TP_WBALANCE_SIZE;Wielkość: -TP_WBALANCE_SPOTWB;Punktowy -TP_WBALANCE_TEMPERATURE;Temperatura -ZOOMBAR_DETAIL;Lupa -ZOOMBAR_HUGE;Olbrzymia -ZOOMBAR_LARGE;Duża -ZOOMBAR_NORMAL;Normalna -ZOOMBAR_PREVIEW;Widok -ZOOMBAR_SCALE;Skala -ZOOMBAR_SMALL;Mała - -GENERAL_HIGH_QUALITY;High Quality -GENERAL_UNCHANGED;(Unchanged) -MAIN_MSG_PLACES;Places -GENERAL_BEFORE;Before -GENERAL_AFTER;After -MAIN_TOOLTIP_TOGGLE;Toggle before/after view -MAIN_BUTTON_PUTTOQUEUE;Put to queue -MAIN_MSG_NAVIGATOR;Navigator -FILEBROWSER_TOOLTIP_STOPPROCESSING;Start processing automatically when a new job arrives -BATCHQUEUE_AUTOSTART;Auto start -TP_DETAIL_AMOUNT;Amount -TP_RESIZE_SPECIFY;Specify: -TP_RESIZE_SCALE;Scale -TP_RESIZE_WIDTH;Width -TP_RESIZE_HEIGHT;Height -MAIN_TOGGLE_BEFORE_AFTER;B|A - +# +# This file is part of RawTherapee. +# +# Copyright (c) 2004-2010 Gabor Horvath +# +# RawTherapee is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# RawTherapee is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with RawTherapee. If not, see . +# +# polish version +# 24.12.2007 +# Mateusz Ludwin +# ----------------------------- +# 08.01.2010 +# Initial update for 3.0 release +# Bartosz "Simek" Kaszubowski +# +ADJUSTER_RESET_TO_DEFAULT;Przywróć domyślne +CURVEEDITOR_FILEDLGFILTERANY;Wszystkie pliki +CURVEEDITOR_FILEDLGFILTERCURVE;Pliki z krzywymi +CURVEEDITOR_LINEAR;Liniowa +CURVEEDITOR_LOADDLGLABEL;Wczytaj krzywą... +CURVEEDITOR_SAVEDLGLABEL;Zapisz krzywą... +CURVEEDITOR_TOOLTIPLINEAR;Zresetuj krzywą do liniowej +CURVEEDITOR_TOOLTIPLOAD;Wczytaj krzywą z pliku +CURVEEDITOR_TOOLTIPSAVE;Zapisz aktualną krzywą +EXIFFILTER_APERTURE;Przesłona +EXIFFILTER_CAMERA;Aparat +EXIFFILTER_DIALOGLABEL;Filrt Exif +EXIFFILTER_FOCALLEN;Wartość ogniskowej +EXIFFILTER_ISO;ISO +EXIFFILTER_LENS;Obiektyw +EXIFFILTER_SHUTTER;Migawka +EXIFPANEL_ADDEDIT;Dodaj/Edytuj +EXIFPANEL_ADDEDITHINT;Dodaj nową etykietę lub edytuj etykietę +EXIFPANEL_ADDTAGDLG_ENTERVALUE;Wpisz wartość +EXIFPANEL_ADDTAGDLG_SELECTTAG;Wybierz etykietę +EXIFPANEL_ADDTAGDLG_TITLE;Dodaj/Edytuj etykietę +EXIFPANEL_KEEPHINT;Zapamiętaj wybrane etykiety podczas zapisywania pliku wyjściowego +EXIFPANEL_KEEP;Zapamiętaj +EXIFPANEL_REMOVEHINT;Usuń wybrane etykiety podczas zapisywania pliku wyjściowego +EXIFPANEL_REMOVE;Usuń +EXIFPANEL_RESETALLHINT;Przywróć wszystkie etykiety do ich oryginalnych wartości +EXIFPANEL_RESETALL;Przywróć wszystkie +EXIFPANEL_RESETHINT;Przywróć wybrane etykiety do ich oryginalnych wartości +EXIFPANEL_RESET;Przywróć +EXIFPANEL_SUBDIRECTORY;Podkatalog +FILEBROWSER_APPLYPROFILE;Zastosuj profil +FILEBROWSER_ARRANGEMENTHINT;Przełącz pomiędzy poziomym/pionowym wyrównaniem miniaturek +FILEBROWSER_CLEARPROFILE;Wyczyść profil +FILEBROWSER_COPYPROFILE;Kopiuj profil +FILEBROWSER_DELETEDLGLABEL;Potwierdzenie usunięcia pliku +FILEBROWSER_DELETEDLGMSG;Jesteś pewień, że chcesz usunąć zaznaczone %1 pliki? +FILEBROWSER_EMPTYTRASHHINT;Permanentnie usuń pliki z kosza +FILEBROWSER_EMPTYTRASH;Wyczyść kosz +FILEBROWSER_EXIFFILTERAPPLYHINT;Włącz/wyłącz filtr Exif w przeglądarce plików +FILEBROWSER_EXIFFILTERAPPLY;Zastosuj +FILEBROWSER_EXIFFILTERLABEL;Filrt Exif +FILEBROWSER_EXIFFILTERSETTINGSHINT;Zmień ustawienia filtru Exif +FILEBROWSER_EXIFFILTERSETTINGS;Ustawienia +FILEBROWSER_PARTIALPASTEPROFILE;Wklej częściowo +FILEBROWSER_PASTEPROFILE;Wklej profil +FILEBROWSER_POPUPCANCELJOB;Anuluj zadanie +FILEBROWSER_POPUPMOVEEND;Przenieś na koniec kolejki +FILEBROWSER_POPUPMOVEHEAD;Przenieś na początek kolejki +FILEBROWSER_POPUPOPEN;Otrórz +FILEBROWSER_POPUPPROCESS;Umieść w kolejce do przetwarzania +FILEBROWSER_POPUPRANK1;Ocena 1 +FILEBROWSER_POPUPRANK2;Ocena 2 +FILEBROWSER_POPUPRANK3;Ocena 3 +FILEBROWSER_POPUPRANK4;Ocena 4 +FILEBROWSER_POPUPRANK5;Ocena 5 +FILEBROWSER_POPUPREMOVE;Usuń z systemu plików +FILEBROWSER_POPUPRENAME;Zmień nazwę +FILEBROWSER_POPUPSELECTALL;Zaznacz wszystkie +FILEBROWSER_POPUPTRASH;Przenieś do kosza +FILEBROWSER_POPUPUNRANK;Usuń ocenę +FILEBROWSER_POPUPUNTRASH;Usuń z kosza +FILEBROWSER_PROCESSINGSETTINGSHINT;Ustaw format pliku i katalog wyjściowy +FILEBROWSER_PROCESSINGSETTINGS;Ustawienia +FILEBROWSER_RENAMEDLGLABEL;Zmień nazwę pliku +FILEBROWSER_RENAMEDLGMSG;Zmień nazwę plki "%1" na: +FILEBROWSER_SHOWDIRHINT;Pokaż wszystkie zdjęcia w katalogu +FILEBROWSER_SHOWQUEUEHINT;Pokaz zawartość kolejki przetwarzania +FILEBROWSER_SHOWRANK1HINT;Pokaż zdjęcia ocenione na 1 gwiazdkę +FILEBROWSER_SHOWRANK2HINT;Pokaż zdjęcia ocenione na 2 gwiazdki +FILEBROWSER_SHOWRANK3HINT;Pokaż zdjęcia ocenione na 3 gwiazdki +FILEBROWSER_SHOWRANK4HINT;Pokaż zdjęcia ocenione na 4 gwiazdki +FILEBROWSER_SHOWRANK5HINT;Pokaż zdjęcia ocenione na 5 gwiazdek +FILEBROWSER_SHOWTRASHHINT;Pokaż zawartość kosza +FILEBROWSER_SHOWUNRANKHINT;Pokaz nieocenione zdjęcia +FILEBROWSER_STARTPROCESSINGHINT;Rozpocznij przetwarzanie/zapisywanie plików w kolejce +FILEBROWSER_STARTPROCESSING;Rozpocznij przetwarzanie +FILEBROWSER_STOPPROCESSINGHINT;Zatrzymaj przetwarzanie zdjęć +FILEBROWSER_STOPPROCESSING;Zatrzymaj przetwarzanie +FILEBROWSER_THUMBSIZE;Rozmiar minaturek +FILEBROWSER_ZOOMINHINT;Zwiększ rozmiar miniaturek +FILEBROWSER_ZOOMOUTHINT;Zmniejsz rozmiar miniaturek +GENERAL_ABOUT;O programie +GENERAL_CANCEL;Anuluj +GENERAL_DISABLED;Wyłączone +GENERAL_DISABLE;Wyłącz +GENERAL_ENABLED;Włączone +GENERAL_ENABLE;Włącz +GENERAL_LANDSCAPE;Poziomo +GENERAL_LOAD;Ładuj +GENERAL_NA;nd. +GENERAL_NO;Nie +GENERAL_OK;OK +GENERAL_PORTRAIT;Pionowo +GENERAL_SAVE;Zapisz +GENERAL_YES;Tak +HISTOGRAM_LABEL;Histogram +HISTOGRAM_TOOLTIP_B;Pokaż/Ukryj histogram błękitów +HISTOGRAM_TOOLTIP_G;Pokaż/Ukryj histogram zieleni +HISTOGRAM_TOOLTIP_L;Pokaż/Ukryj histogram luminancji CIELAB +HISTOGRAM_TOOLTIP_R;Pokaż/Ukryj histogram czerwieni +HISTORY_CHANGED;Zmieniono +HISTORY_CUSTOMCURVE;Dowolna krzywa +HISTORY_DELSNAPSHOT;Usuń migawkę +HISTORY_FROMCLIPBOARD;Ze schowka +HISTORY_LABEL;Historia +HISTORY_MSG_10;Kompresja cieni +HISTORY_MSG_11;Krzywa tonalna +HISTORY_MSG_12;Automatyczna ekspozycja +HISTORY_MSG_13;Przycinanie ekspozycji +HISTORY_MSG_14;Jasność luminancji +HISTORY_MSG_15;Kontrast luminancji +HISTORY_MSG_16;Czerń luminancji +HISTORY_MSG_17;Kompr. świateł luminancji +HISTORY_MSG_18;Kompr. cieni luminancji +HISTORY_MSG_19;Krzywa luminancji +HISTORY_MSG_1;Zdjęcie załadowane +HISTORY_MSG_20;Wyostrzanie +HISTORY_MSG_21;Promień wyostrzania +HISTORY_MSG_22;Siła wyostrzania +HISTORY_MSG_23;Próg wyostrzania +HISTORY_MSG_24;Wyostrz tylko krawędzie +HISTORY_MSG_25;Promień detekcji krawędzi wyostrzania +HISTORY_MSG_26;Tolerancja wyostrzania krawędzi +HISTORY_MSG_27;Kontrola poświaty wyostrzania +HISTORY_MSG_28;Stopień kontroli poświaty +HISTORY_MSG_29;Metoda wyostrzania +HISTORY_MSG_2;Profil załadowany +HISTORY_MSG_30;Promień dekonwolucji +HISTORY_MSG_31;Siła dekonwolucji +HISTORY_MSG_32;Tłumienie dekonwolucji +HISTORY_MSG_33;Iteracje dekonwolucji +HISTORY_MSG_34;Zapobiegaj przycinaniu kolorów +HISTORY_MSG_35;Limit saturacji +HISTORY_MSG_36;Limit saturacji +HISTORY_MSG_37;Wzmocnienie koloru +HISTORY_MSG_38;Metoda balansu bieli +HISTORY_MSG_39;Temperatura koloru +HISTORY_MSG_3;Profil zmieniony +HISTORY_MSG_40;Odcień balansu bieli +HISTORY_MSG_41;Przesunięcie koloru "A" +HISTORY_MSG_42;Przesunięcie koloru "B" +HISTORY_MSG_43;Odszumianie luminancji +HISTORY_MSG_44;Promień odszumiania lum. +HISTORY_MSG_45;Tol. krawędzi odszumiania lum. +HISTORY_MSG_46;Odszumianie koloru +HISTORY_MSG_47;Promień odszumiania kolorowego +HISTORY_MSG_48;Tol. krawędzi odszumiania kol. +HISTORY_MSG_49;Odszumianie koloru z czuł. kraw. +HISTORY_MSG_4;Przeglądanie historii +HISTORY_MSG_50;Narzędzie światła/cienie +HISTORY_MSG_51;Wzmocnienie świateł +HISTORY_MSG_52;Wzmocnienie cieni +HISTORY_MSG_53;Szerokość tonalna świateł +HISTORY_MSG_54;Szerokość tonalna cieni +HISTORY_MSG_55;Kontrast lokalny +HISTORY_MSG_56;Promień świateł/cieni +HISTORY_MSG_57;Surowy obrót +HISTORY_MSG_58;Odbicie w poziomie +HISTORY_MSG_59;Odbicie w pionie +HISTORY_MSG_5;Jasność +HISTORY_MSG_60;Obrót +HISTORY_MSG_61;Obrót +HISTORY_MSG_62;Korekcja dystorsji obiektywu +HISTORY_MSG_63;Zapamiętaj wybrany +HISTORY_MSG_64;Kadrowanie zdjęcia +HISTORY_MSG_65;Korekcja AC +HISTORY_MSG_66;Odzyskiwanie prześwietleń +HISTORY_MSG_67;Siła odzyskiwania prześwietleń +HISTORY_MSG_68;Metoda odzyskiwania Prześwietleń +HISTORY_MSG_69;Robocza przestrzeń kolorów +HISTORY_MSG_6;Kontrast +HISTORY_MSG_70;Wyjściowa przestrzeń kolorów +HISTORY_MSG_71;Wejściowa przestrzeń kolorów +HISTORY_MSG_72;Korekcja winietowania +HISTORY_MSG_73;Mikser kanałów +HISTORY_MSG_74;Skala zmiany rozmiaru +HISTORY_MSG_75;Metoda zmiany rozmiaru +HISTORY_MSG_76;Metadane Exif +HISTORY_MSG_77;Metadane IPTC +HISTORY_MSG_78;Data specified for resize +HISTORY_MSG_79;Resize width +HISTORY_MSG_7;Czerń +HISTORY_MSG_80;Resize height +HISTORY_MSG_81;Resize enabled +HISTORY_MSG_8;Kompensacja ekspozycji +HISTORY_MSG_9;Kompresja świateł +HISTORY_NEWSNAPSHOTAS;Jako... +HISTORY_NEWSNAPSHOT;Nowa migawka +HISTORY_NEWSSDIALOGLABEL;Nazwa migawki: +HISTORY_NEWSSDIALOGTITLE;Dodaj nową migawkę +HISTORY_SETTO;Wybrano +HISTORY_SNAPSHOT;Migawka +HISTORY_SNAPSHOTS;Migawki +ICMPANEL_FILEDLGFILTERANY;Wszystkie pliki +ICMPANEL_FILEDLGFILTERICM;Pliki z profilami ICC +ICMPANEL_GAMMABEFOREINPUT;Profile applies Gamma +ICMPANEL_INPUTCAMERA;Domyślny aparatu +ICMPANEL_INPUTCUSTOM;Ręczny +ICMPANEL_INPUTDLGLABEL;Wybierz wejściowy profil ICC... +ICMPANEL_INPUTEMBEDDED;Jeśli to możliwe, użyj osadzonego +ICMPANEL_INPUTPROFILE;Profil wejściowy +ICMPANEL_NOICM;No ICM: Wyjście sRGB +ICMPANEL_OUTPUTDLGLABEL;Wybierz wyjściowy profil ICC... +ICMPANEL_OUTPUTPROFILE;Profil wyjściowy +ICMPANEL_SAVEREFERENCE;Save reference image for profiling +ICMPANEL_WORKINGPROFILE;Profil roboczy +IMAGEAREA_DETAILVIEW;Lupa +IPTCPANEL_AUTHOR;Autor +IPTCPANEL_AUTHORHINT;Imię lub nazwa twórcy obiektu np. pisarza, fotografa lub grafika (w linii). +IPTCPANEL_AUTHORSPOSITION;Author's position +IPTCPANEL_AUTHORSPOSITIONHINT;Title of the creator or creators of the object (By-line Title). +IPTCPANEL_CAPTIONHINT;A textual description of the data (Caption - Abstract). +IPTCPANEL_CAPTION;Tytuł +IPTCPANEL_CAPTIONWRITER;Caption Writer +IPTCPANEL_CAPTIONWRITERHINT;The name of the person involved in the writing, editing or correcting the image or caption/abstract (Writer - Editor). +IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider (Category). +IPTCPANEL_CATEGORY;Kategoria +IPTCPANEL_CITYHINT;City of image origin (City). +IPTCPANEL_CITY;Miasto +IPTCPANEL_COPYHINT;Copy IPTC settings to clipboard +IPTCPANEL_COPYRIGHT;Copyright +IPTCPANEL_COPYRIGHTHINT;Any necessary copyright notice (Copyright Notice). +IPTCPANEL_COUNTRYHINT;The name of the country/primary location where the image was created (Country - Primary Location Name). +IPTCPANEL_COUNTRY;Kraj +IPTCPANEL_CREDIT;Credit +IPTCPANEL_CREDITHINT;Identifies the provider of the image, not necessarily the owner/creator (Credit). +IPTCPANEL_DATECREATED;Data utworzenia +IPTCPANEL_DATECREATEDHINT;The date the intellectual content of the image was created; Format: JJJJMMTT (Date Created). +IPTCPANEL_EMBEDDED;Embedded +IPTCPANEL_EMBEDDEDHINT;Reset to IPTC data embedded in the image file +IPTCPANEL_HEADLINEHINT;A publishable entry providing a synopsis of the contents of the image (Headline). +IPTCPANEL_HEADLINE;Nagłówek +IPTCPANEL_INSTRUCTIONSHINT;Other editorial instructions concerning the use of the image (Special Instructions). +IPTCPANEL_INSTRUCTIONS;Instrukcje +IPTCPANEL_KEYWORDSHINT;Used to indicate specific information retrieval words (Keywords). +IPTCPANEL_KEYWORDS;Słowa kluczowe +IPTCPANEL_PASTEHINT;Paste IPTC settings from clipboard +IPTCPANEL_PROVINCEHINT;The Province/State where the image originates (Province-State). +IPTCPANEL_PROVINCE;Stan, województwo, dystrykt itd. +IPTCPANEL_RESETHINT;Reset to profile default +IPTCPANEL_RESET;Reset +IPTCPANEL_SOURCEHINT;The original owner of the intellectual content of the image (Source). +IPTCPANEL_SOURCE;Źródło +IPTCPANEL_SUPPCATEGORIESHINT;Further refines the subject of the image (Supplemental Categories). +IPTCPANEL_SUPPCATEGORIES;Suppl. Categories +IPTCPANEL_TITLEHINT;A shorthand reference for the image (Object Name). +IPTCPANEL_TITLE;Tytuł +IPTCPANEL_TRANSREFERENCEHINT;A code representing the location of original transmission (Original Transmission Reference). +IPTCPANEL_TRANSREFERENCE;Trans. Reference +MAIN_BUTTON_EXIT;Exit +MAIN_BUTTON_PREFERENCES;Preferencje +MAIN_BUTTON_QUEUE;Put to queue +MAIN_BUTTON_SAVEAS;Jako... +MAIN_BUTTON_SAVE;Zapisz obraz +MAIN_BUTTON_SENDTOEDITOR;Wyślij do edytora +MAIN_FRAME_BATCHQUEUE;Batch Queue +MAIN_FRAME_FILEBROWSER;File Browser +MAIN_FRAME_PLACES_ADD;Add +MAIN_FRAME_PLACES_DEL;Del +MAIN_FRAME_PLACES;Places +MAIN_FRAME_RECENT;Recent Folders +MAIN_MSG_ALREADYEXISTS;Plik już istnieje. +MAIN_MSG_CANNOTLOAD;Nie można wczytać obrazu +MAIN_MSG_CANNOTSAVE;Błąd zapisu pliku +MAIN_MSG_CANNOTSTARTEDITOR;Nie mozna uruchomic edytora. +MAIN_MSG_CANNOTSTARTEDITOR_SECONDARY;Musisz wspisać prawidłową ścieżkę w oknie "Preferencji". +MAIN_MSG_EXITJOBSINQUEUEINFO;Nieprzetworzone zdjęcia w kolejce będą utracone po zamknięciu. +MAIN_MSG_EXITJOBSINQUEUEQUEST;Jesteś pewien, że chcesz zamknąć alpikację? W kolejce znajdują się nieprzetworzone zdjęcia. +MAIN_MSG_JOBSINQUEUE;zadań w kolejce +MAIN_MSG_QOVERWRITE;Czy chcesz go zastąpić? +MAIN_TAB_BASIC;Podstawowe +MAIN_TAB_COLOR;Kolor +MAIN_TAB_DETAIL;Szczegóły +MAIN_TAB_DEVELOP;Develop +MAIN_TAB_EXIF;Exif +MAIN_TAB_EXPOSURE;Ekspozycja +MAIN_TAB_FILTER;Filter +MAIN_TAB_ICM;ICM +MAIN_TAB_IPTC;IPTC +MAIN_TAB_METADATA;Metadane +MAIN_TAB_TAGGING;Tagging +MAIN_TAB_TRANSFORM;Transformacje +MAIN_TOOLTIP_HIDEFP;Pokaż/ukryj dolny panel (przeglądarka plików i katalogów, shortcut key: F) +MAIN_TOOLTIP_HIDEHP;Pokaż/ukryj lewy panel (razem z historią, shortcut key: H) +MAIN_TOOLTIP_INDCLIPPEDH;Pokaż prześwietlenia +MAIN_TOOLTIP_INDCLIPPEDS;Pokaż niedoświetlenia +MAIN_TOOLTIP_PREFERENCES;Ustaw preferencje +MAIN_TOOLTIP_QINFO;Informacje o pliku +MAIN_TOOLTIP_SAVEAS;Zapisz obraz we wskazanym katalogu +MAIN_TOOLTIP_SAVE;Zapisz obraz w katalogu domyślnym +PARTIALPASTE_BASICGROUP;Podstawowe ustawienia +PARTIALPASTE_CACORRECTION;Korekcja C/A +PARTIALPASTE_COARSETRANS;Rotacja/odwrócenie o 90 stopni +PARTIALPASTE_COLORBOOST;Uwydatnienie koloru +PARTIALPASTE_COLORDENOISE;Odszumienie koloru +PARTIALPASTE_COLORGROUP;Ustawienia związane z kolorem +PARTIALPASTE_COLORMIXER;Mikser koloru +PARTIALPASTE_COLORSHIFT;Przesunięcie koloru +PARTIALPASTE_COMPOSITIONGROUP;Ustawienia kompozycji +PARTIALPASTE_CROP;Przytnij +PARTIALPASTE_DIALOGLABEL;Partial paste processing profile +PARTIALPASTE_DISTORTION;Korekcja zniekształcenia +PARTIALPASTE_EXIFCHANGES;Zmień dane Exif +PARTIALPASTE_EXPOSURE;Ekspozycja +PARTIALPASTE_HLRECOVERY;Highlight recovery +PARTIALPASTE_ICMSETTINGS;Ustawienia ICM +PARTIALPASTE_IPTCINFO;Informacje IPTC +PARTIALPASTE_LENSGROUP;Ustawienia związane z obiektywem +PARTIALPASTE_LUMACURVE;Krzywa obiektywu +PARTIALPASTE_LUMADENOISE;Redukcja zaszumienia jaskrawości +PARTIALPASTE_LUMINANCEGROUP;Ustawienia związane z jaskrawością +PARTIALPASTE_METAICMGROUP;Metadanea/Ustawienia ICM +PARTIALPASTE_RESIZE;Zmień rozmiar +PARTIALPASTE_ROTATION;Rotacja +PARTIALPASTE_SHADOWSHIGHLIGHTS;Cienie/Podświetlenia +PARTIALPASTE_SHARPENING;Wyostrzanie +PARTIALPASTE_VIGNETTING;Korekcja winiety +PARTIALPASTE_WHITEBALANCE;Balans bieli +PREFERENCES_APPLNEXTSTARTUP;wymaga ponownego uruchomienia +PREFERENCES_BLINKCLIPPED;Mrugające prześwietlenia +PREFERENCES_CACHECLEARALL;Wyczyść wszystko +PREFERENCES_CACHECLEARPROFILES;Wyczyść profile +PREFERENCES_CACHECLEARTHUMBS;Wyczyść miniaturki +PREFERENCES_CACHEFORMAT1;Proprietary (faster and better quality) +PREFERENCES_CACHEFORMAT2;JPEG (smaller disk footprint) +PREFERENCES_CACHEMAXENTRIES;Maksymalna liczba wpisów w pamięci podręcznej +PREFERENCES_CACHEOPTS;Opcje pamięci podręcznej +PREFERENCES_CACHESTRAT1;Prefer Speed to Low Memory Consumption +PREFERENCES_CACHESTRAT2;Prefer Low Memory Consumption to Speed +PREFERENCES_CACHESTRAT;Cache Strategy +PREFERENCES_CACHETHUMBFORM;Cache Thumbnail Format +PREFERENCES_CACHETHUMBHEIGHT;Maximal Thumbnail Height +PREFERENCES_CLEARDLG_LINE1;Czyszczenie pamięci podręcznej +PREFERENCES_CLEARDLG_LINE2;Może to potrwać kilka sekund. +PREFERENCES_CLEARDLG_TITLE;Prosze czekać +PREFERENCES_CLIPPINGIND;Pokazywanie prześwietleń +PREFERENCES_CMETRICINTENT;Sposób odwzorowania barw +PREFERENCES_DATEFORMAT;Format daty +PREFERENCES_DATEFORMATHINT;You can use the following formatting strings:\n%y : year\n%m : month\n%d : day\n\nFor example, the hungarian date format is:\n%y/%m/%d +PREFERENCES_DEFAULTLANG;Język domyślny +PREFERENCES_DEFAULTTHEME;Default theme +PREFERENCES_DEMOSAICINGALGO;Algorytm demozaikowania +PREFERENCES_DIRHOME;Katalog domowy +PREFERENCES_DIRLAST;Ostatnio odwiedzony katalog +PREFERENCES_DIROTHER;Inny +PREFERENCES_DIRSELECTDLG;Wybierz katalog z obrazami po uruchomieniu... +PREFERENCES_DIRSOFTWARE;Katalog instalacyjny +PREFERENCES_DMETHOD;Metoda +PREFERENCES_EDITORCMDLINE;Other command line +PREFERENCES_EXTERNALEDITOR;Zewnętrzny edytor +PREFERENCES_FALSECOLOR;Kroki zapobiegania zafałszowaniom kolorów +PREFERENCES_FBROWSEROPTS;Opcje przeglądarki plików +PREFERENCES_FILEFORMAT;Format pliku +PREFERENCES_FORIMAGE;Dla plików z obrazami +PREFERENCES_FORRAW;Dla plików RAW +PREFERENCES_GIMPPATH;Katalog, w którym zainstalowany jest GIMP +PREFERENCES_GTKTHEME;GTK default +PREFERENCES_HINT;Porada +PREFERENCES_HLTHRESHOLD;Próg dla prześwietleñ +PREFERENCES_ICCDIR;Katalog z profilami ICC +PREFERENCES_IMPROCPARAMS;Domyślne parametry przetwarzania obrazu +PREFERENCES_INTENT_ABSOLUTE;Absolutnie kolorymetryczny +PREFERENCES_INTENT_PERCEPTUAL;Percepcyjny +PREFERENCES_INTENT_RELATIVE;Względnie kolorymetryczny +PREFERENCES_INTENT_SATURATION;Nasyceniowy +PREFERENCES_LIVETHUMBNAILS;Miniaturki na żywo (wojniej) +PREFERENCES_MONITORICC;Profil monitora +PREFERENCES_OUTDIRFOLDERHINT;Umieść zapisane zdjęcia w wybranym katalogu +PREFERENCES_OUTDIRFOLDER;Zapisz do katalogu +PREFERENCES_OUTDIRHINT;You can use the following formatting strings:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nThese formatting strings refer to the directories and sub-paths of the path of the raw file.\n\nFor example, if /home/tom/image/02-09-2006/dsc0012.nefhas been opened, the meaning of the formatting strings are:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nIf you want to save the output image where the original is, write:\n%p1/%f\n\nIf you want to save the output image in a directory 'converted' located the directory of the original, write:\n%p1/converted/%f\n\nIf you want to save the output image in directory '/home/tom/converted' with keeping the same subdirectory of dates, write:\n%p2/converted/%d1/%f +PREFERENCES_OUTDIR;Katalog wyjściowy +PREFERENCES_OUTDIRTEMPLATEHINT;You can use the following formatting strings:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nThese formatting strings refer to the directories and sub-paths of the path of the raw file.\n\nFor example, if /home/tom/image/02-09-2006/dsc0012.nefhas been opened, the meaning of the formatting strings are:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nIf you want to save the output image where the original is, write:\n%p1/%f\n\nIf you want to save the output image in a directory 'converted' located the directory of the original, write:\n%p1/converted/%f\n\nIf you want to save the output image in directory '/home/tom/converted' with keeping the same subdirectory of dates, write:\n%p2/converted/%d1/%f +PREFERENCES_OUTDIRTEMPLATE;Użyj schemat +PREFERENCES_PARSEDEXTADD;Dodaj rozszerzenie +PREFERENCES_PARSEDEXTADDHINT;Type an extension and press this button to append list +PREFERENCES_PARSEDEXTDELHINT;Delete selected extension from the list +PREFERENCES_PARSEDEXT;Parsed Extensions +PREFERENCES_PROFILEHANDLING;Processing Profile Handling +PREFERENCES_PROFILELOADPR;Profile Loading Priority +PREFERENCES_PROFILEPRCACHE;Profile in Cache +PREFERENCES_PROFILEPRFILE;Profile Next to the Input File +PREFERENCES_PROFILESAVECACHE;Save Processing Parameters to the Cache +PREFERENCES_PROFILESAVEINPUT;Save Processing Parameters Next to the Input File +PREFERENCES_PSPATH;Katalog w którym zainstalowany jest Adobe Photoshop +PREFERENCES_SELECTICCDIRDLG;Wybierz katalog z profilami ICC... +PREFERENCES_SELECTLANG;Wybierz język +PREFERENCES_SELECTMONITORPROFDLG;Wybierz profil ICC do wyświetlenia... +PREFERENCES_SELECTTHEME;Select theme +PREFERENCES_SHOWBASICEXIF;Pokaż podstawowe dane Exif +PREFERENCES_SHOWDATETIME;Pokaż datę i czas +PREFERENCES_SHOWONLYRAW;Pokaż tylko pliki RAW +PREFERENCES_SHTHRESHOLD;Próg dla niedoświetleñ +PREFERENCES_STARTUPIMDIR;Katalog startowy +PREFERENCES_TAB_BROWSER;Przeglądarka plików +PREFERENCES_TAB_COLORMGR;Zarządzanie kolorami +PREFERENCES_TAB_GENERAL;Ogólne +PREFERENCES_TAB_IMPROC;Przetwarzanie obrazu +PREFERENCES_TAB_OUTPUT;Opcje wyjściowe +PREFERENCES_THUMBSIZE;Wielkość miniaturki +PROFILEPANEL_FILEDLGFILTERANY;Wszystkie pliki +PROFILEPANEL_FILEDLGFILTERPP;Profile postprocessingu +PROFILEPANEL_LABEL;Profil postprocessingu +PROFILEPANEL_LOADDLGLABEL;Ładuj parametry postprocessingu... +PROFILEPANEL_PCUSTOM;Ręczny +PROFILEPANEL_PFILE;Z pliku +PROFILEPANEL_PLASTPHOTO;Ostatnie Zdjęcie +PROFILEPANEL_PLASTSAVED;Ostatnio zapisany +PROFILEPANEL_PROFILE;Profil +PROFILEPANEL_SAVEDLGLABEL;Zapisz parametry postprocessingu... +PROFILEPANEL_TOOLTIPCOPY;Skopiuj aktualny profil do schowka +PROFILEPANEL_TOOLTIPLOAD;Ładuj profil z pliku +PROFILEPANEL_TOOLTIPPASTE;Wklej profil ze schowka +PROFILEPANEL_TOOLTIPSAVE;Zapisz aktualny profil +PROGRESSBAR_DECODING;Dekodowanie pliku raw... +PROGRESSBAR_DEMOSAICING;Demozaikowanie... +PROGRESSBAR_LOADING;Wczytywanie obrazu... +PROGRESSBAR_LOADJPEG;Ładowanie pliku JPEG... +PROGRESSBAR_LOADPNG;Ładowanie pliku PNG... +PROGRESSBAR_LOADTIFF;Ładowanie pliku TIFF... +PROGRESSBAR_PROCESSING;Przetwarzanie obrazu... +PROGRESSBAR_READY;Gotowe. +PROGRESSBAR_SAVEJPEG;Zapisywanie pliku JPEG... +PROGRESSBAR_SAVEPNG;Zapisywanie pliku PNG... +PROGRESSBAR_SAVETIFF;Zapisywanie pliku TIFF... +PROGRESSDLG_LOADING;Wczytywanie pliku... +PROGRESSDLG_PROCESSING;Przetwarzanie zdjęcia... +PROGRESSDLG_SAVING;Zapisywanie pliku... +QINFO_FOCALLENGTH;Ogniskowa +QINFO_ISO;ISO +QINFO_LENS;Obiektyw +QINFO_NOEXIF;Dane exif niedostępne. +SAVEDLG_FILEFORMAT;Format pliku +SAVEDLG_JPEGQUAL;Jakość JPEG +SAVEDLG_JPGFILTER;Pliki JPEG +SAVEDLG_PNGCOMPR;Kompresja PNG +SAVEDLG_PNGFILTER;Pliki PNG +SAVEDLG_PUTTOQUEUEHEAD;Put to the head of the processing queue +SAVEDLG_PUTTOQUEUE;Put into processing queue +SAVEDLG_PUTTOQUEUETAIL;Put to the end of the processing queue +SAVEDLG_SAVEIMMEDIATELY;Save immediately +SAVEDLG_SAVESPP;Zapisz parametry przetwarzania wraz z obrazem +SAVEDLG_TIFFFILTER;Pliki TIFF +TOOLBAR_TOOLTIP_CROP;Kadruj (shortcut key: C) +TOOLBAR_TOOLTIP_HAND;Przesuń (shortcut key: N) +TOOLBAR_TOOLTIP_STRAIGHTEN;Wyprostuj obraz (shortcut key: S) +TOOLBAR_TOOLTIP_WB;Wskaż balans bieli (shortcut key: W) +TP_CACORRECTION_BLUE;Niebieski +TP_CACORRECTION_LABEL;Korekcja AC +TP_CACORRECTION_RED;Czerwony +TP_CHMIXER_BLUE;Niebieski +TP_CHMIXER_GREEN;Zielony +TP_CHMIXER_LABEL;Mikser kanałów +TP_CHMIXER_RED;Czerwony +TP_COARSETRAF_DEGREE;stopnie: +TP_COARSETRAF_TOOLTIP_HFLIP;Odbij w poziomie +TP_COARSETRAF_TOOLTIP_ROTLEFT;Obróć w lewo +TP_COARSETRAF_TOOLTIP_ROTRIGHT;Obróć w prawo +TP_COARSETRAF_TOOLTIP_VFLIP;Odbij w pionie +TP_COLORBOOST_ACHANNEL;kanał "a" +TP_COLORBOOST_AMOUNT;Stopień +TP_COLORBOOST_AVOIDCOLORCLIP;Unikaj przycinania kolorów +TP_COLORBOOST_BCHANNEL;kanał "b" +TP_COLORBOOST_CHAB;a i b +TP_COLORBOOST_CHANNEL;Kanał +TP_COLORBOOST_CHSEPARATE;oddzielnie +TP_COLORBOOST_ENABLESATLIMITER;Włącz limit saturacji +TP_COLORBOOST_LABEL;Wzmocnienie koloru +TP_COLORBOOST_SATLIMIT;Limit saturacji +TP_COLORDENOISE_EDGESENSITIVE;Czułość krawędzi +TP_COLORDENOISE_EDGETOLERANCE;Tolerancja krawędzi +TP_COLORDENOISE_LABEL;Odszumianie koloru +TP_COLORDENOISE_RADIUS;Promień +TP_COLORSHIFT_BLUEYELLOW;Błękit-żółty +TP_COLORSHIFT_GREENMAGENTA;Zieleń-magenta +TP_COLORSHIFT_LABEL;Przesunięcie koloru +TP_CROP_DPI;DPI= +TP_CROP_FIXRATIO;Zablokuj proporcje: +TP_CROP_GTDIAGONALS;Przekątna +TP_CROP_GTHARMMEANS1;Złoty podział 1 +TP_CROP_GTHARMMEANS2;Złoty podział 2 +TP_CROP_GTHARMMEANS3;Złoty podział 3 +TP_CROP_GTHARMMEANS4;Złoty podział 4 +TP_CROP_GTNONE;Nic +TP_CROP_GTRULETHIRDS;Trójpodział +TP_CROP_GUIDETYPE;Typ pomocy: +TP_CROP_H;W +TP_CROP_LABEL;Kadrowanie +TP_CROP_SELECTCROP;Wybierz kadr +TP_CROP_W;S +TP_CROP_X;x +TP_CROP_Y;y +TP_DISTORTION_AMOUNT;Siła +TP_DISTORTION_LABEL;Dystorsja +TP_EXPOSURE_AUTOLEVELS;Wyrównaj poziomy +TP_EXPOSURE_BLACKLEVEL;Czerń +TP_EXPOSURE_BRIGHTNESS;Jasność +TP_EXPOSURE_CLIP;Przytnij +TP_EXPOSURE_COMPRHIGHLIGHTS;Kompresja świateł +TP_EXPOSURE_COMPRSHADOWS;Kompresja cieni +TP_EXPOSURE_CONTRAST;Kontrast +TP_EXPOSURE_CURVEEDITOR;Krzywa tonalna +TP_EXPOSURE_EXPCOMP;EV +TP_EXPOSURE_LABEL;Ekspozycja +TP_HLREC_CIELAB;Mieszanie koloru CIELab +TP_HLREC_COLOR;Propagacja koloru +TP_HLREC_LABEL;Odzyskiwanie prześwietleń +TP_HLREC_LUMINANCE;Odzyskiwanie luminancji +TP_HLREC_METHOD;Metoda: +TP_ICM_FILEDLGFILTERANY;Wszystkie pliki +TP_ICM_FILEDLGFILTERICM;Pliki z profilami ICC +TP_ICM_GAMMABEFOREINPUT;Profile applies Gamma +TP_ICM_INPUTCAMERA;Domyślny aparatu +TP_ICM_INPUTCUSTOM;Ręczny +TP_ICM_INPUTDLGLABEL;Wybierz wejściowy profil ICC... +TP_ICM_INPUTEMBEDDED;Jeśli to możliwe, użyj osadzonego +TP_ICM_INPUTPROFILE;Profil wejściowy +TP_ICM_LABEL;ICM +TP_ICM_NOICM;No ICM: Wyjście sRGB +TP_ICM_OUTPUTDLGLABEL;Wybierz wyjściowy profil ICC... +TP_ICM_OUTPUTPROFILE;Profil wyjściowy +TP_ICM_SAVEREFERENCE;Save reference image for profiling +TP_ICM_WORKINGPROFILE;Profil roboczy +TP_LUMACURVE_BLACKLEVEL;Czerń +TP_LUMACURVE_BRIGHTNESS;Jasność +TP_LUMACURVE_COMPRHIGHLIGHTS;Kompresja świateł +TP_LUMACURVE_COMPRSHADOWS;Kompresja cieni +TP_LUMACURVE_CONTRAST;Kontrast +TP_LUMACURVE_CURVEEDITOR;Krzywa luminancji +TP_LUMACURVE_LABEL;Krzywa luminancji +TP_LUMADENOISE_EDGETOLERANCE;Tolerancja krawędzi +TP_LUMADENOISE_LABEL;Odszumianie luminancji +TP_LUMADENOISE_RADIUS;Promień +TP_RESIZE_BICUBIC;Bicubic +TP_RESIZE_BICUBICSF;Bicubic (Miękko) +TP_RESIZE_BICUBICSH;Bicubic (Ostro) +TP_RESIZE_BILINEAR;Bilinear +TP_RESIZE_FULLSIZE;Pełny rozmiar obrazu: +TP_RESIZE_H;W: +TP_RESIZE_LABEL;Skalowanie +TP_RESIZE_METHOD;Metoda: +TP_RESIZE_NEAREST;Najbliższa +TP_RESIZE_SCALE;Skala +TP_RESIZE_W;S: +TP_ROTATE_AUTOCROP;Auto przycinanie +TP_ROTATE_DEGREE;Stopnie +TP_ROTATE_FILL;Wypełnij +TP_ROTATE_LABEL;Obrót +TP_ROTATE_SELECTLINE;Wyprostuj obraz +TP_SHADOWSHLIGHTS_HIGHLIGHTS;Światła +TP_SHADOWSHLIGHTS_HLTONALW;Szerokość tonalna +TP_SHADOWSHLIGHTS_LABEL;Cienie/Światła +TP_SHADOWSHLIGHTS_LOCALCONTR;Kontrast lokalny +TP_SHADOWSHLIGHTS_RADIUS;Promień +TP_SHADOWSHLIGHTS_SHADOWS;Cienie +TP_SHADOWSHLIGHTS_SHTONALW;Szerokość tonalna +TP_SHARPENING_AMOUNT;Siła +TP_SHARPENING_EDRADIUS;Promień +TP_SHARPENING_EDTOLERANCE;Tolerancja +TP_SHARPENING_HALOCONTROL;Kontrola poświaty +TP_SHARPENING_HCAMOUNT;Siła +TP_SHARPENING_LABEL;Wyostrzanie +TP_SHARPENING_METHOD;Metoda +TP_SHARPENING_ONLYEDGES;Wyostrz tylko krawędzie +TP_SHARPENING_RADIUS;Promień +TP_SHARPENING_RLD_AMOUNT;Siła +TP_SHARPENING_RLD_DAMPING;Tłumienie +TP_SHARPENING_RLD;Dekonwolucja RL +TP_SHARPENING_RLD_ITERATIONS;Iteracje +TP_SHARPENING_THRESHOLD;Próg +TP_SHARPENING_USM;Maska wyostrzająca +TP_VIGNETTING_AMOUNT;Siła +TP_VIGNETTING_LABEL;Korekcja winietowania +TP_VIGNETTING_RADIUS;Promień +TP_WBALANCE_AUTO;Auto +TP_WBALANCE_CAMERA;Z aparatu +TP_WBALANCE_CUSTOM;Ręczny +TP_WBALANCE_GREEN;Odcień +TP_WBALANCE_LABEL;Balans bieli +TP_WBALANCE_METHOD;Metoda +TP_WBALANCE_SIZE;Wielkość: +TP_WBALANCE_SPOTWB;Punktowy +TP_WBALANCE_TEMPERATURE;Temperatura +ZOOMBAR_DETAIL;Lupa +ZOOMBAR_HUGE;Olbrzymia +ZOOMBAR_LARGE;Duża +ZOOMBAR_NORMAL;Normalna +ZOOMBAR_PREVIEW;Widok +ZOOMBAR_SCALE;Skala +ZOOMBAR_SMALL;Mała + +GENERAL_HIGH_QUALITY;High Quality +GENERAL_UNCHANGED;(Unchanged) +MAIN_MSG_PLACES;Places +GENERAL_BEFORE;Before +GENERAL_AFTER;After +MAIN_TOOLTIP_TOGGLE;Toggle before/after view +MAIN_BUTTON_PUTTOQUEUE;Put to queue +MAIN_MSG_NAVIGATOR;Navigator +FILEBROWSER_TOOLTIP_STOPPROCESSING;Start processing automatically when a new job arrives +BATCHQUEUE_AUTOSTART;Auto start +TP_DETAIL_AMOUNT;Amount +TP_RESIZE_SPECIFY;Specify: +TP_RESIZE_SCALE;Scale +TP_RESIZE_WIDTH;Width +TP_RESIZE_HEIGHT;Height +MAIN_TOGGLE_BEFORE_AFTER;B|A + ### diff --git a/rtdata/languages/Swedish b/rtdata/languages/Swedish index 2265209b7..d007de027 100644 --- a/rtdata/languages/Swedish +++ b/rtdata/languages/Swedish @@ -1,631 +1,631 @@ -# -# This file is part of RawTherapee. -# -# Copyright (c) 2004-2010 Gabor Horvath -# -# RawTherapee is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# RawTherapee is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with RawTherapee. If not, see . -# -# Swedish translation of RawTherapee -# Translated by Emil Ericsson -# 2008-01-22 -ADJUSTER_RESET_TO_DEFAULT;Återställ till standard -CURVEEDITOR_FILEDLGFILTERANY;Vilka filer som helst -CURVEEDITOR_FILEDLGFILTERCURVE;Kurvfiler -CURVEEDITOR_LINEAR;Linjär -CURVEEDITOR_LOADDLGLABEL;Ladda kurva... -CURVEEDITOR_SAVEDLGLABEL;Spara kurva... -CURVEEDITOR_TOOLTIPLINEAR;Återställ kurva till linjär -CURVEEDITOR_TOOLTIPLOAD;Ladda kurva från fil -CURVEEDITOR_TOOLTIPSAVE;Spara nuvarande kurva -EXIFFILTER_APERTURE;Aperture -EXIFFILTER_CAMERA;Camera -EXIFFILTER_DIALOGLABEL;Exif Filter -EXIFFILTER_FOCALLEN;Focal Length -EXIFFILTER_ISO;ISO -EXIFFILTER_LENS;Lens -EXIFFILTER_SHUTTER;Shutter -EXIFPANEL_ADDEDIT;Add/Edit -EXIFPANEL_ADDEDITHINT;Add new tag or edit tag -EXIFPANEL_ADDTAGDLG_ENTERVALUE;Enter value -EXIFPANEL_ADDTAGDLG_SELECTTAG;Select tag -EXIFPANEL_ADDTAGDLG_TITLE;Add/Edit Tag -EXIFPANEL_KEEPHINT;Keep the selected tags when writing output file -EXIFPANEL_KEEP;Keep -EXIFPANEL_REMOVEHINT;Remove the selected tags when writing output file -EXIFPANEL_REMOVE;Remove -EXIFPANEL_RESETALLHINT;Reset all tags to their original values -EXIFPANEL_RESETALL;Reset All -EXIFPANEL_RESETHINT;Reset the selected tags to their original values -EXIFPANEL_RESET;Reset -EXIFPANEL_SUBDIRECTORY;Subdirectory -FILEBROWSER_APPLYPROFILE;Apply profile -FILEBROWSER_ARRANGEMENTHINT;Change between vertical/horizontal alignment of thumbnails -FILEBROWSER_CLEARPROFILE;Clear profile -FILEBROWSER_COPYPROFILE;Copy profile -FILEBROWSER_DELETEDLGLABEL;File delete confirmation -FILEBROWSER_DELETEDLGMSG;Are you sure you want to delete the selected %1 files? -FILEBROWSER_EMPTYTRASH;Empty Trash -FILEBROWSER_EMPTYTRASHHINT;Permanently delete the files of the trash -FILEBROWSER_EXIFFILTERAPPLY;Apply -FILEBROWSER_EXIFFILTERAPPLYHINT;Switch on/off exif filter of the file browser -FILEBROWSER_EXIFFILTERLABEL;Exif Filter -FILEBROWSER_EXIFFILTERSETTINGSHINT;Change settings of the exif filter -FILEBROWSER_EXIFFILTERSETTINGS;Setup -FILEBROWSER_PARTIALPASTEPROFILE;Partial paste -FILEBROWSER_PASTEPROFILE;Paste profile -FILEBROWSER_POPUPCANCELJOB;Cancel job -FILEBROWSER_POPUPMOVEEND;Move to end of queue -FILEBROWSER_POPUPMOVEHEAD;Move to head of queue -FILEBROWSER_POPUPOPEN;Open -FILEBROWSER_POPUPPROCESS;Put to processing queue -FILEBROWSER_POPUPRANK1;Rank 1 -FILEBROWSER_POPUPRANK2;Rank 2 -FILEBROWSER_POPUPRANK3;Rank 3 -FILEBROWSER_POPUPRANK4;Rank 4 -FILEBROWSER_POPUPRANK5;Rank 5 -FILEBROWSER_POPUPREMOVE;Remove from filesystem -FILEBROWSER_POPUPRENAME;Rename -FILEBROWSER_POPUPSELECTALL;Select all -FILEBROWSER_POPUPTRASH;Move to trash -FILEBROWSER_POPUPUNRANK;Unrank -FILEBROWSER_POPUPUNTRASH;Remove from trash -FILEBROWSER_PROCESSINGSETTINGSHINT;Set the file format and output directory -FILEBROWSER_PROCESSINGSETTINGS;Settings -FILEBROWSER_RENAMEDLGLABEL;Rename file -FILEBROWSER_RENAMEDLGMSG;Rename file "%1" to: -FILEBROWSER_SHOWDIRHINT;Show all images of the directory -FILEBROWSER_SHOWQUEUEHINT;Show content of the processing queue -FILEBROWSER_SHOWRANK1HINT;Show images ranked as 1 star -FILEBROWSER_SHOWRANK2HINT;Show images ranked as 2 star -FILEBROWSER_SHOWRANK3HINT;Show images ranked as 3 star -FILEBROWSER_SHOWRANK4HINT;Show images ranked as 4 star -FILEBROWSER_SHOWRANK5HINT;Show images ranked as 5 star -FILEBROWSER_SHOWTRASHHINT;Show content of the trash -FILEBROWSER_SHOWUNRANKHINT;Show unranked images -FILEBROWSER_STARTPROCESSINGHINT;Start processing/saving of images in the queue -FILEBROWSER_STARTPROCESSING;Start Processing -FILEBROWSER_STOPPROCESSINGHINT;Stop processing of images -FILEBROWSER_STOPPROCESSING;Stop processing -FILEBROWSER_THUMBSIZE;Thumb. size -FILEBROWSER_ZOOMINHINT;Increase thumbnail size -FILEBROWSER_ZOOMOUTHINT;Decrease thumbnail size -GENERAL_ABOUT;Om -GENERAL_CANCEL;Avbryt -GENERAL_DISABLE;Avaktivera -GENERAL_DISABLED;Avaktivera -GENERAL_ENABLED;Verkställ -GENERAL_ENABLE;Verkställ -GENERAL_LANDSCAPE;Landskap -GENERAL_LOAD;Ladda -GENERAL_NA;n/a -GENERAL_NO;Nej -GENERAL_OK;Ok -GENERAL_PORTRAIT;Porträtt -GENERAL_SAVE;Spara -GENERAL_YES;Ja -HISTOGRAM_LABEL;Histogram -HISTOGRAM_TOOLTIP_B;Visa/göm blått histogram -HISTOGRAM_TOOLTIP_G;Visa/göm grönt histogram -HISTOGRAM_TOOLTIP_L;Visa/göm CIELAB Luminans histogram -HISTOGRAM_TOOLTIP_R;Visa/göm rött histogram -HISTORY_CHANGED;Changed -HISTORY_CUSTOMCURVE;Egen kurva -HISTORY_DELSNAPSHOT;Ta bort bokmärke -HISTORY_FROMCLIPBOARD;From clipboard -HISTORY_LABEL;Historia -HISTORY_MSG_10;Skuggkomprimering -HISTORY_MSG_11;Tonkurva -HISTORY_MSG_12;Autoexponering -HISTORY_MSG_13;Exponeringsmarkering -HISTORY_MSG_14;Luminansljusstyrka -HISTORY_MSG_15;Luminanskontrast -HISTORY_MSG_16;Svart luminans -HISTORY_MSG_17;Luminans högdager kompr. -HISTORY_MSG_18;Luminans skugg kompr. -HISTORY_MSG_19;Luminanskurva -HISTORY_MSG_1;Foto laddat -HISTORY_MSG_20;Skärpning -HISTORY_MSG_21;Skärpningsradie -HISTORY_MSG_22;Skärpningsmängd -HISTORY_MSG_23;Skärpningströskelvärde -HISTORY_MSG_24;Skärp bara kanter -HISTORY_MSG_25;Kantupptäckningsradie-skärpning -HISTORY_MSG_26;Kantskärpningstolerans -HISTORY_MSG_27;Halo-skärpningskontroll -HISTORY_MSG_28;Halo-kontrollstorlek -HISTORY_MSG_29;Skärpningsmetod -HISTORY_MSG_2;Profil laddad -HISTORY_MSG_30;Deconvolution-radie -HISTORY_MSG_31;Deconvolution-storlek -HISTORY_MSG_32;Deconvolution-dämpning -HISTORY_MSG_33;Deconvolution-upprepning -HISTORY_MSG_34;Undvik färgmarkeringar -HISTORY_MSG_35;Mättnadsbegränsning -HISTORY_MSG_36;Mättnadsgräns -HISTORY_MSG_37;Färgförstärkning -HISTORY_MSG_38;Vitbalansmetod -HISTORY_MSG_39;Färgtemperatur -HISTORY_MSG_3;Profil ändrad -HISTORY_MSG_40;Vitbalansnyans -HISTORY_MSG_41;Färgskiftning "A" -HISTORY_MSG_42;Färgskiftning "B" -HISTORY_MSG_43;Luminans brusborttagning -HISTORY_MSG_44;Lum. brusborttagnings-radie -HISTORY_MSG_45;Lum. brusborttagnings kanttolerans -HISTORY_MSG_46;Färgbrusborttagning -HISTORY_MSG_47;Färgbrusborttagnings-radie -HISTORY_MSG_48;Färgbrusborttagnings-kanttolerans -HISTORY_MSG_49;Kantkänslig färgbrusborttagning -HISTORY_MSG_4;Historia-bläddrande -HISTORY_MSG_50;Skugg/högdager verktyg -HISTORY_MSG_51;Högdager-förstärkning -HISTORY_MSG_52;Skuggförstärkning -HISTORY_MSG_53;Högdager-tonvidd -HISTORY_MSG_54;Skugg-tonvidd -HISTORY_MSG_55;Lokal kontrast -HISTORY_MSG_56;Skugg/högdager -radie -HISTORY_MSG_57;Enkel rotation -HISTORY_MSG_58;Vänd horisontellt -HISTORY_MSG_59;Vänd vertikalt -HISTORY_MSG_5;Ljusstyrka -HISTORY_MSG_60;Rotation -HISTORY_MSG_61;Rotation -HISTORY_MSG_62;Objektivdistorsions-korrigering -HISTORY_MSG_63;Valt bokmärke -HISTORY_MSG_64;Beskär foto -HISTORY_MSG_65;C/A korrigering -HISTORY_MSG_66;Högdager-förbättring -HISTORY_MSG_67;Högdager-förbättringsstorlek -HISTORY_MSG_68;Högdager-förbättringsmetod -HISTORY_MSG_69;Arbetsfärgrymd -HISTORY_MSG_6;Kontrast -HISTORY_MSG_70;Utmatningsfärgrymd -HISTORY_MSG_71;Inmatningsfärgrymd -HISTORY_MSG_72;Vinjettering-korrigering -HISTORY_MSG_73;Kanalmixer -HISTORY_MSG_74;Ändra storleksskala -HISTORY_MSG_75;Ändra storleks metod -HISTORY_MSG_76;Exif Metadata -HISTORY_MSG_77;IPTC Metadata -HISTORY_MSG_78;Data specified for resize -HISTORY_MSG_79;Resize width -HISTORY_MSG_7;Svart -HISTORY_MSG_80;Resize height -HISTORY_MSG_81;Resize enabled -HISTORY_MSG_8;Exponerings-komprimering -HISTORY_MSG_9;Högdager-komprimering -HISTORY_NEWSNAPSHOTAS;Som... -HISTORY_NEWSNAPSHOT;Nytt bokmärke -HISTORY_NEWSSDIALOGLABEL;Namn på bokmärket: -HISTORY_NEWSSDIALOGTITLE;Lägg till nytt bokmärke -HISTORY_SETTO;Ställ in till -HISTORY_SNAPSHOT;Bokmärke -HISTORY_SNAPSHOTS;Bokmärken -ICMPANEL_FILEDLGFILTERANY;Vilka filer som helst -ICMPANEL_FILEDLGFILTERICM;ICC profilfiler -ICMPANEL_GAMMABEFOREINPUT;Profile applies Gamma -ICMPANEL_INPUTCAMERA;Kameraval -ICMPANEL_INPUTCUSTOM;Egen -ICMPANEL_INPUTDLGLABEL;Välj inmatnings ICC-profil... -ICMPANEL_INPUTEMBEDDED;Använd inbäddad, om möjligt -ICMPANEL_INPUTPROFILE;Inmatningsprofil -ICMPANEL_NOICM;Ingen ICM: sRGB-utmatning -ICMPANEL_OUTPUTDLGLABEL;Välj utmatnings ICC-profil... -ICMPANEL_OUTPUTPROFILE;Utmatningsprofil -ICMPANEL_SAVEREFERENCE;Save reference image for profiling -ICMPANEL_WORKINGPROFILE;Arbetsprofil -IMAGEAREA_DETAILVIEW;Detalj -IPTCPANEL_AUTHOR;Author -IPTCPANEL_AUTHORHINT;Name of the creator of the object, e.g. writer, photographer or graphic artist (By-line). -IPTCPANEL_AUTHORSPOSITION;Author's position -IPTCPANEL_AUTHORSPOSITIONHINT;Title of the creator or creators of the object (By-line Title). -IPTCPANEL_CAPTION;Caption -IPTCPANEL_CAPTIONHINT;A textual description of the data (Caption - Abstract). -IPTCPANEL_CAPTIONWRITER;Caption Writer -IPTCPANEL_CAPTIONWRITERHINT;The name of the person involved in the writing, editing or correcting the image or caption/abstract (Writer - Editor). -IPTCPANEL_CATEGORY;Category -IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider (Category). -IPTCPANEL_CITY;City -IPTCPANEL_CITYHINT;City of image origin (City). -IPTCPANEL_COPYHINT;Copy IPTC settings to clipboard -IPTCPANEL_COPYRIGHT;Copyright -IPTCPANEL_COPYRIGHTHINT;Any necessary copyright notice (Copyright Notice). -IPTCPANEL_COUNTRY;Country -IPTCPANEL_COUNTRYHINT;The name of the country/primary location where the image was created (Country - Primary Location Name). -IPTCPANEL_CREDIT;Credit -IPTCPANEL_CREDITHINT;Identifies the provider of the image, not necessarily the owner/creator (Credit). -IPTCPANEL_DATECREATED;Date Created -IPTCPANEL_DATECREATEDHINT;The date the intellectual content of the image was created; Format: JJJJMMTT (Date Created). -IPTCPANEL_EMBEDDED;Embedded -IPTCPANEL_EMBEDDEDHINT;Reset to IPTC data embedded in the image file -IPTCPANEL_HEADLINE;Headline -IPTCPANEL_HEADLINEHINT;A publishable entry providing a synopsis of the contents of the image (Headline). -IPTCPANEL_INSTRUCTIONSHINT;Other editorial instructions concerning the use of the image (Special Instructions). -IPTCPANEL_INSTRUCTIONS;Instructions -IPTCPANEL_KEYWORDSHINT;Used to indicate specific information retrieval words (Keywords). -IPTCPANEL_KEYWORDS;Keywords -IPTCPANEL_PASTEHINT;Paste IPTC settings from clipboard -IPTCPANEL_PROVINCEHINT;The Province/State where the image originates (Province-State). -IPTCPANEL_PROVINCE;Province -IPTCPANEL_RESETHINT;Reset to profile default -IPTCPANEL_RESET;Reset -IPTCPANEL_SOURCEHINT;The original owner of the intellectual content of the image (Source). -IPTCPANEL_SOURCE;Source -IPTCPANEL_SUPPCATEGORIESHINT;Further refines the subject of the image (Supplemental Categories). -IPTCPANEL_SUPPCATEGORIES;Suppl. Categories -IPTCPANEL_TITLEHINT;A shorthand reference for the image (Object Name). -IPTCPANEL_TITLE;Title -IPTCPANEL_TRANSREFERENCEHINT;A code representing the location of original transmission (Original Transmission Reference). -IPTCPANEL_TRANSREFERENCE;Trans. Reference -MAIN_BUTTON_EXIT;Exit -MAIN_BUTTON_PREFERENCES;Inställningar -MAIN_BUTTON_QUEUE;Put to queue -MAIN_BUTTON_SAVEAS;Som... -MAIN_BUTTON_SAVE;Spara bild -MAIN_BUTTON_SENDTOEDITOR;Send to editor -MAIN_FRAME_BATCHQUEUE;Batch Queue -MAIN_FRAME_FILEBROWSER;File Browser -MAIN_FRAME_PLACES_ADD;Add -MAIN_FRAME_PLACES_DEL;Del -MAIN_FRAME_PLACES;Places -MAIN_FRAME_RECENT;Recent Folders -MAIN_MSG_ALREADYEXISTS;Filen existerar redan. -MAIN_MSG_CANNOTLOAD;Kan inte ladda bilden -MAIN_MSG_CANNOTSAVE;Filsparningsfel -MAIN_MSG_CANNOTSTARTEDITOR;Can not start editor. -MAIN_MSG_CANNOTSTARTEDITOR_SECONDARY;Please set the correct path in the "Preferences" dialog. -MAIN_MSG_EXITJOBSINQUEUEINFO;Unprocessed images in the queue will be lost on exit. -MAIN_MSG_EXITJOBSINQUEUEQUEST;Are you sure you want to exit? There are unprocessed images waiting in the queue. -MAIN_MSG_JOBSINQUEUE;Arbete(n) i kö -MAIN_MSG_QOVERWRITE;Vill du skriva över den? -MAIN_TAB_BASIC;Grund -MAIN_TAB_COLOR;Color -MAIN_TAB_DETAIL;Detail -MAIN_TAB_DEVELOP;Develop -MAIN_TAB_EXIF;Exif -MAIN_TAB_EXPOSURE;Exposure -MAIN_TAB_FILTER;Filter -MAIN_TAB_ICM;ICM -MAIN_TAB_IPTC;IPTC -MAIN_TAB_METADATA;Metadata -MAIN_TAB_TAGGING;Tagging -MAIN_TAB_TRANSFORM;Omvandla -MAIN_TOOLTIP_HIDEFP;Visa/göm den nedre panelen (katalog och filbläddrare, shortcut key: F) -MAIN_TOOLTIP_HIDEHP;Visa/göm den vänstra panelen (innehåller historiken, shortcut key: H) -MAIN_TOOLTIP_INDCLIPPEDH;Markerad högdager-indikation -MAIN_TOOLTIP_INDCLIPPEDS;Markerad skugg-indikation -MAIN_TOOLTIP_PREFERENCES;Ställ in inställningar -MAIN_TOOLTIP_QINFO;Snabb info om bilden -MAIN_TOOLTIP_SAVEAS;Spara bilden till en vald mapp -MAIN_TOOLTIP_SAVE;Spara bilden till standardmappen -PARTIALPASTE_BASICGROUP;Basic settings -PARTIALPASTE_CACORRECTION;C/A correction -PARTIALPASTE_COARSETRANS;90 deg rotation / flipping -PARTIALPASTE_COLORBOOST;Color boost -PARTIALPASTE_COLORDENOISE;Color denoise -PARTIALPASTE_COLORGROUP;Color related settings -PARTIALPASTE_COLORMIXER;Color mixer -PARTIALPASTE_COLORSHIFT;Color shift -PARTIALPASTE_COMPOSITIONGROUP;Composition settings -PARTIALPASTE_CROP;Crop -PARTIALPASTE_DIALOGLABEL;Partial paste processing profile -PARTIALPASTE_DISTORTION;Distortion correction -PARTIALPASTE_EXIFCHANGES;Changes to exif data -PARTIALPASTE_EXPOSURE;Exposure -PARTIALPASTE_HLRECOVERY;Highlight recovery -PARTIALPASTE_ICMSETTINGS;ICM settings -PARTIALPASTE_IPTCINFO;IPTC info -PARTIALPASTE_LENSGROUP;Lens related settings -PARTIALPASTE_LUMACURVE;Luminance curve -PARTIALPASTE_LUMADENOISE;Luminance noise reduction -PARTIALPASTE_LUMINANCEGROUP;Luminance related settings -PARTIALPASTE_METAICMGROUP;Metadata/ICM settings -PARTIALPASTE_RESIZE;Resize -PARTIALPASTE_ROTATION;Rotation -PARTIALPASTE_SHADOWSHIGHLIGHTS;Shadows/Highlights -PARTIALPASTE_SHARPENING;Sharpening -PARTIALPASTE_VIGNETTING;Vignetting correction -PARTIALPASTE_WHITEBALANCE;White balance -PREFERENCES_APPLNEXTSTARTUP;ändras vid nästa uppstart -PREFERENCES_BLINKCLIPPED;Blinka markerade områden -PREFERENCES_CACHECLEARALL;Clear All -PREFERENCES_CACHECLEARPROFILES;Clear Profiles -PREFERENCES_CACHECLEARTHUMBS;Clear Thumbnails -PREFERENCES_CACHEFORMAT1;Proprietary (faster and better quality) -PREFERENCES_CACHEFORMAT2;JPEG (smaller disk footprint) -PREFERENCES_CACHEMAXENTRIES;Maximal Number of Cache Entries -PREFERENCES_CACHEOPTS;Cache Options -PREFERENCES_CACHESTRAT1;Prefer Speed to Low Memory Consumption -PREFERENCES_CACHESTRAT2;Prefer Low Memory Consumption to Speed -PREFERENCES_CACHESTRAT;Cache Strategy -PREFERENCES_CACHETHUMBFORM;Cache Thumbnail Format -PREFERENCES_CACHETHUMBHEIGHT;Maximal Thumbnail Height -PREFERENCES_CLEARDLG_LINE1;Clearing cache -PREFERENCES_CLEARDLG_LINE2;This may take a few seconds. -PREFERENCES_CLEARDLG_TITLE;Please wait -PREFERENCES_CLIPPINGIND;Markerings-indikation -PREFERENCES_CMETRICINTENT;Colorimetric Intent -PREFERENCES_DATEFORMAT;Datumformat -PREFERENCES_DATEFORMATHINT;You can use the following formatting strings:\n%y : year\n%m : month\n%d : day\n\nFor example, the hungarian date format is:\n%y/%m/%d -PREFERENCES_DEFAULTLANG;Förvalt språk -PREFERENCES_DEFAULTTHEME;Default theme -PREFERENCES_DEMOSAICINGALGO;Demosaicing Algorithm -PREFERENCES_DIRHOME;Hemkatalog -PREFERENCES_DIRLAST;Senaste besökta katalog -PREFERENCES_DIROTHER;Annan -PREFERENCES_DIRSELECTDLG;Välj Bildkatalog vid uppstart... -PREFERENCES_DIRSOFTWARE;Installations-katalog -PREFERENCES_DMETHOD;Metod -PREFERENCES_EDITORCMDLINE;Other command line -PREFERENCES_EXTERNALEDITOR;External editor -PREFERENCES_FALSECOLOR;Falskt färgbortträngningssteg -PREFERENCES_FBROWSEROPTS;Filbläddrar-inställningar -PREFERENCES_FILEFORMAT;Filformat -PREFERENCES_FORIMAGE;För bildfiler -PREFERENCES_FORRAW;För RAW-filer -PREFERENCES_GIMPPATH;GIMP installation directory -PREFERENCES_GTKTHEME;GTK default -PREFERENCES_HINT;Tips -PREFERENCES_HLTHRESHOLD;Tröskelvärde för markerade högdager -PREFERENCES_ICCDIR;Katalog för ICC-profiler -PREFERENCES_IMPROCPARAMS;Standard-bildbehandlingsparametrar -PREFERENCES_INTENT_ABSOLUTE;Total colorimetric -PREFERENCES_INTENT_PERCEPTUAL;Perceptual -PREFERENCES_INTENT_RELATIVE;Relativ colorimetric -PREFERENCES_INTENT_SATURATION;Mättnad -PREFERENCES_LIVETHUMBNAILS;Live Thumbnails (slower) -PREFERENCES_MONITORICC;Skärmprofil -PREFERENCES_OUTDIRFOLDERHINT;Put the saved images to the seledted folder -PREFERENCES_OUTDIRFOLDER;Save to folder -PREFERENCES_OUTDIRHINT;You can use the following formatting strings:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nThese formatting strings refer to the directories and sub-paths of the path of the raw file.\n\nFor example, if /home/tom/image/02-09-2006/dsc0012.nefhas been opened, the meaning of the formatting strings are:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nIf you want to save the output image where the original is, write:\n%p1/%f\n\nIf you want to save the output image in a directory 'converted' located the directory of the original, write:\n%p1/converted/%f\n\nIf you want to save the output image in directory '/home/tom/converted' with keeping the same subdirectory of dates, write:\n%p2/converted/%d1/%f -PREFERENCES_OUTDIRTEMPLATEHINT;You can use the following formatting strings:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nThese formatting strings refer to the directories and sub-paths of the path of the raw file.\n\nFor example, if /home/tom/image/02-09-2006/dsc0012.nefhas been opened, the meaning of the formatting strings are:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nIf you want to save the output image where the original is, write:\n%p1/%f\n\nIf you want to save the output image in a directory 'converted' located the directory of the original, write:\n%p1/converted/%f\n\nIf you want to save the output image in directory '/home/tom/converted' with keeping the same subdirectory of dates, write:\n%p2/converted/%d1/%f -PREFERENCES_OUTDIRTEMPLATE;Use Template -PREFERENCES_OUTDIR;Utmatningskatalog -PREFERENCES_PARSEDEXTADD;Add Extension -PREFERENCES_PARSEDEXTADDHINT;Type an extension and press this button to append list -PREFERENCES_PARSEDEXTDELHINT;Delete selected extension from the list -PREFERENCES_PARSEDEXT;Parsed Extensions -PREFERENCES_PROFILEHANDLING;Processing Profile Handling -PREFERENCES_PROFILELOADPR;Profile Loading Priority -PREFERENCES_PROFILEPRCACHE;Profile in Cache -PREFERENCES_PROFILEPRFILE;Profile Next to the Input File -PREFERENCES_PROFILESAVECACHE;Save Processing Parameters to the Cache -PREFERENCES_PROFILESAVEINPUT;Save Processing Parameters Next to the Input File -PREFERENCES_PSPATH;Adobe Photoshop installation directory -PREFERENCES_SELECTICCDIRDLG;Välj ICC-profil katalog... -PREFERENCES_SELECTLANG;Välj språk -PREFERENCES_SELECTMONITORPROFDLG;Välj ICC-profil för skärmen... -PREFERENCES_SELECTTHEME;Select theme -PREFERENCES_SHOWBASICEXIF;Visa grundlig Exif-information -PREFERENCES_SHOWDATETIME;Visa datum och tid -PREFERENCES_SHOWONLYRAW;Visa bara RAW-filer -PREFERENCES_SHTHRESHOLD;Tröskelvärde för markerade skuggor -PREFERENCES_STARTUPIMDIR;Bildkatalog som visas vid uppstart -PREFERENCES_TAB_BROWSER;Filbläddrare -PREFERENCES_TAB_COLORMGR;Färghantering -PREFERENCES_TAB_GENERAL;Allmän -PREFERENCES_TAB_IMPROC;Bildbehandling -PREFERENCES_TAB_OUTPUT;Utmatnings-inställningar -PREFERENCES_THUMBSIZE;Miniatyrbildstorlek -PROFILEPANEL_FILEDLGFILTERANY;Vilka filer som helst -PROFILEPANEL_FILEDLGFILTERPP;Postbehandlar profiler -PROFILEPANEL_LABEL;Postbehandlar profiler -PROFILEPANEL_LOADDLGLABEL;Ladda Postbehandlingsparametrar... -PROFILEPANEL_PCUSTOM;Egen -PROFILEPANEL_PFILE;Från fil -PROFILEPANEL_PLASTPHOTO;Senaste foto -PROFILEPANEL_PLASTSAVED;Senast sparad -PROFILEPANEL_PROFILE;Profil -PROFILEPANEL_SAVEDLGLABEL;Spara Postbehandlingsparametrar... -PROFILEPANEL_TOOLTIPCOPY;Copy current profile to clipboard -PROFILEPANEL_TOOLTIPLOAD;Ladda profil från fil -PROFILEPANEL_TOOLTIPPASTE; Paste profile from clipboard -PROFILEPANEL_TOOLTIPSAVE;Spara nuvarande profil -PROGRESSBAR_DECODING;Avkodar Raw-fil... -PROGRESSBAR_DEMOSAICING;Demosaicing... -PROGRESSBAR_LOADING;Laddar bild... -PROGRESSBAR_LOADJPEG;Laddar JPEG-fil... -PROGRESSBAR_LOADPNG;Laddar PNG-fil... -PROGRESSBAR_LOADTIFF;Laddar TIFF-fil... -PROGRESSBAR_PROCESSING;Bearbetar Bild... -PROGRESSBAR_READY;Klar. -PROGRESSBAR_SAVEJPEG;Sparar JPEG-fil... -PROGRESSBAR_SAVEPNG;Sparar PNG-fil... -PROGRESSBAR_SAVETIFF;Sparar TIFF-fil... -PROGRESSDLG_LOADING;Loading file... -PROGRESSDLG_PROCESSING;Processing image... -PROGRESSDLG_SAVING;Saving file... -QINFO_FOCALLENGTH;Brännvidd -QINFO_ISO;ISO -QINFO_LENS;Lens -QINFO_NOEXIF;Exifdata otillgänglig. -SAVEDLG_FILEFORMAT;Filformat -SAVEDLG_JPEGQUAL;JPEG-kvalitet -SAVEDLG_JPGFILTER;JPEG-filer -SAVEDLG_PNGCOMPR;PNG-komprimering -SAVEDLG_PNGFILTER;PNG-filer -SAVEDLG_PUTTOQUEUEHEAD;Put to the head of the processing queue -SAVEDLG_PUTTOQUEUE;Put into processing queue -SAVEDLG_PUTTOQUEUETAIL;Put to the end of the processing queue -SAVEDLG_SAVEIMMEDIATELY;Save immediately -SAVEDLG_SAVESPP;Spara behandlingsparametrarna med bilderna -SAVEDLG_TIFFFILTER;TIFF-filer -TOOLBAR_TOOLTIP_CROP;Välj beskärningsområde (shortcut key: C) -TOOLBAR_TOOLTIP_HAND;Handverktyg (shortcut key: N) -TOOLBAR_TOOLTIP_STRAIGHTEN;Räta ut (shortcut key: S) -TOOLBAR_TOOLTIP_WB;Punkt-vitbalans (shortcut key: W) -TP_CACORRECTION_BLUE;Blå -TP_CACORRECTION_LABEL;C/A justering -TP_CACORRECTION_RED;Röd -TP_CHMIXER_BLUE;Blå -TP_CHMIXER_GREEN;Grön -TP_CHMIXER_LABEL;Kanalmixer -TP_CHMIXER_RED;Röd -TP_COARSETRAF_DEGREE;grad: -TP_COARSETRAF_TOOLTIP_HFLIP;Vänd horisontellt -TP_COARSETRAF_TOOLTIP_ROTLEFT;Rotera åt vänster -TP_COARSETRAF_TOOLTIP_ROTRIGHT;Rotera åt höger -TP_COARSETRAF_TOOLTIP_VFLIP;Vänd vertikalt -TP_COLORBOOST_ACHANNEL;kanal "a" -TP_COLORBOOST_AMOUNT;Mängd -TP_COLORBOOST_AVOIDCOLORCLIP;Undvik färgclipping -TP_COLORBOOST_BCHANNEL;kanal "b" -TP_COLORBOOST_CHAB;a & b -TP_COLORBOOST_CHANNEL;Kanal -TP_COLORBOOST_CHSEPARATE;separat -TP_COLORBOOST_ENABLESATLIMITER;Verkställ mättnadsgräns -TP_COLORBOOST_LABEL;Färgförstärkning -TP_COLORBOOST_SATLIMIT;Mättnadsgräns -TP_COLORDENOISE_EDGESENSITIVE;Kantkänslighet -TP_COLORDENOISE_EDGETOLERANCE;Kanttolerans -TP_COLORDENOISE_LABEL;Färgbrus-reducering -TP_COLORDENOISE_RADIUS;Radie -TP_COLORSHIFT_BLUEYELLOW;Blå-Gul -TP_COLORSHIFT_GREENMAGENTA;Grön-Magenta -TP_COLORSHIFT_LABEL;Färgskiftningar -TP_CROP_DPI;DPI= -TP_CROP_FIXRATIO;Fixa proportion -TP_CROP_GTDIAGONALS;Diagonalregeln -TP_CROP_GTHARMMEANS1;Harmonic means 1 -TP_CROP_GTHARMMEANS2;Harmonic means 2 -TP_CROP_GTHARMMEANS3;Harmonic means 3 -TP_CROP_GTHARMMEANS4;Harmonic means 4 -TP_CROP_GTNONE;Ingen -TP_CROP_GTRULETHIRDS;Tredjedelsregeln -TP_CROP_GUIDETYPE;Guidetyp: -TP_CROP_H;H -TP_CROP_LABEL;Beskär -TP_CROP_SELECTCROP; Välj beskärningsområde -TP_CROP_W;B -TP_CROP_X;x -TP_CROP_Y;y -TP_DISTORTION_AMOUNT;Mängd -TP_DISTORTION_LABEL;Distorsion -TP_EXPOSURE_AUTOLEVELS;Autonivåer -TP_EXPOSURE_BLACKLEVEL;Svart -TP_EXPOSURE_BRIGHTNESS;Ljusstyrka -TP_EXPOSURE_CLIP;Clip -TP_EXPOSURE_COMPRHIGHLIGHTS;Högdagerkomprimering -TP_EXPOSURE_COMPRSHADOWS;Skuggkomprimering -TP_EXPOSURE_CONTRAST;Kontrast -TP_EXPOSURE_CURVEEDITOR;Tonkurva -TP_EXPOSURE_EXPCOMP;Exp. Comp. -TP_EXPOSURE_LABEL;Exponering -TP_HLREC_CIELAB;CIELab Blending -TP_HLREC_COLOR;Färgspridning -TP_HLREC_LABEL;Högdager-förbättring -TP_HLREC_LUMINANCE;Bättring av luminans -TP_HLREC_METHOD;Metod: -TP_ICM_FILEDLGFILTERANY;Vilka filer som helst -TP_ICM_FILEDLGFILTERICM;ICC profilfiler -TP_ICM_GAMMABEFOREINPUT;Profile applies Gamma -TP_ICM_INPUTCAMERA;Kameraval -TP_ICM_INPUTCUSTOM;Egen -TP_ICM_INPUTDLGLABEL;Välj inmatnings ICC-profil... -TP_ICM_INPUTEMBEDDED;Använd inbäddad, om möjligt -TP_ICM_INPUTPROFILE;Inmatningsprofil -TP_ICM_LABEL;ICM -TP_ICM_NOICM;Ingen ICM: sRGB-utmatning -TP_ICM_OUTPUTDLGLABEL;Välj utmatnings ICC-profil... -TP_ICM_OUTPUTPROFILE;Utmatningsprofil -TP_ICM_SAVEREFERENCE;Save reference image for profiling -TP_ICM_WORKINGPROFILE;Arbetsprofil -TP_LUMACURVE_BLACKLEVEL;Svart -TP_LUMACURVE_BRIGHTNESS;Ljusstyrka -TP_LUMACURVE_COMPRHIGHLIGHTS;Högdagerkomprimering -TP_LUMACURVE_COMPRSHADOWS;Skuggkomprimering -TP_LUMACURVE_CONTRAST;Kontrast -TP_LUMACURVE_CURVEEDITOR;Luminanskurva -TP_LUMACURVE_LABEL;Luminanskurva -TP_LUMADENOISE_EDGETOLERANCE;Kanttolerans -TP_LUMADENOISE_LABEL;Luminans-brusreducering -TP_LUMADENOISE_RADIUS;Radie -TP_RESIZE_BICUBIC;Bicubic -TP_RESIZE_BICUBICSF;Bicubic (Mjukare) -TP_RESIZE_BICUBICSH;Bicubic (Skarpare) -TP_RESIZE_BILINEAR;Bilinjär -TP_RESIZE_FULLSIZE;Full bildstorlek: -TP_RESIZE_H;H: -TP_RESIZE_LABEL;Ändra storlek -TP_RESIZE_METHOD;Metod: -TP_RESIZE_NEAREST;Närmast -TP_RESIZE_SCALE;Skala -TP_RESIZE_W;B: -TP_ROTATE_AUTOCROP;Autobeskär -TP_ROTATE_DEGREE;Antal grader -TP_ROTATE_FILL;Fyll -TP_ROTATE_LABEL;Räta ut -TP_ROTATE_SELECTLINE; Välj rak linje -TP_SHADOWSHLIGHTS_HIGHLIGHTS;Högdager -TP_SHADOWSHLIGHTS_HLTONALW;Tonvidd -TP_SHADOWSHLIGHTS_LABEL;Skuggor/högdager -TP_SHADOWSHLIGHTS_LOCALCONTR;Lokal konstrast -TP_SHADOWSHLIGHTS_RADIUS;Radie -TP_SHADOWSHLIGHTS_SHADOWS;Skuggor -TP_SHADOWSHLIGHTS_SHTONALW;Tonvidd -TP_SHARPENING_AMOUNT;Mängd -TP_SHARPENING_EDRADIUS;Radie -TP_SHARPENING_EDTOLERANCE;Kanttolerans -TP_SHARPENING_HALOCONTROL;Halo-kontrol -TP_SHARPENING_HCAMOUNT;Mängd -TP_SHARPENING_LABEL;Skärpa -TP_SHARPENING_METHOD;Metod -TP_SHARPENING_ONLYEDGES;Skärp bara kanter -TP_SHARPENING_RADIUS;Radie -TP_SHARPENING_RLD_AMOUNT;Mängd -TP_SHARPENING_RLD_DAMPING;Dämpning -TP_SHARPENING_RLD_ITERATIONS;Upprepningar -TP_SHARPENING_RLD;RL Deconvolution -TP_SHARPENING_THRESHOLD;Tröskelvärde -TP_SHARPENING_USM;Oskarp mask -TP_VIGNETTING_AMOUNT;Mängd -TP_VIGNETTING_LABEL;Vinjettering-korrigering -TP_VIGNETTING_RADIUS;Radie -TP_WBALANCE_AUTO;Auto -TP_WBALANCE_CAMERA;Kamera -TP_WBALANCE_CUSTOM;Egen -TP_WBALANCE_GREEN;Nyans -TP_WBALANCE_LABEL;Vitbalans -TP_WBALANCE_METHOD;Metod -TP_WBALANCE_SIZE;Storlek: -TP_WBALANCE_SPOTWB;Punkt VB -TP_WBALANCE_TEMPERATURE;Temperatur -ZOOMBAR_DETAIL;Lupp -ZOOMBAR_HUGE;Enorm -ZOOMBAR_LARGE;Stor -ZOOMBAR_NORMAL;Normal -ZOOMBAR_PREVIEW;Förhandsvisning -ZOOMBAR_SCALE;Skala -ZOOMBAR_SMALL;Liten - -GENERAL_HIGH_QUALITY;High Quality -GENERAL_UNCHANGED;(Unchanged) -MAIN_MSG_PLACES;Places -GENERAL_BEFORE;Before -GENERAL_AFTER;After -MAIN_TOOLTIP_TOGGLE;Toggle before/after view -MAIN_BUTTON_PUTTOQUEUE;Put to queue -MAIN_MSG_NAVIGATOR;Navigator -FILEBROWSER_TOOLTIP_STOPPROCESSING;Start processing automatically when a new job arrives -BATCHQUEUE_AUTOSTART;Auto start -TP_DETAIL_AMOUNT;Amount -TP_RESIZE_SPECIFY;Specify: -TP_RESIZE_SCALE;Scale -TP_RESIZE_WIDTH;Width -TP_RESIZE_HEIGHT;Height -MAIN_TOGGLE_BEFORE_AFTER;B|A - +# +# This file is part of RawTherapee. +# +# Copyright (c) 2004-2010 Gabor Horvath +# +# RawTherapee is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# RawTherapee is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with RawTherapee. If not, see . +# +# Swedish translation of RawTherapee +# Translated by Emil Ericsson +# 2008-01-22 +ADJUSTER_RESET_TO_DEFAULT;Återställ till standard +CURVEEDITOR_FILEDLGFILTERANY;Vilka filer som helst +CURVEEDITOR_FILEDLGFILTERCURVE;Kurvfiler +CURVEEDITOR_LINEAR;Linjär +CURVEEDITOR_LOADDLGLABEL;Ladda kurva... +CURVEEDITOR_SAVEDLGLABEL;Spara kurva... +CURVEEDITOR_TOOLTIPLINEAR;Återställ kurva till linjär +CURVEEDITOR_TOOLTIPLOAD;Ladda kurva från fil +CURVEEDITOR_TOOLTIPSAVE;Spara nuvarande kurva +EXIFFILTER_APERTURE;Aperture +EXIFFILTER_CAMERA;Camera +EXIFFILTER_DIALOGLABEL;Exif Filter +EXIFFILTER_FOCALLEN;Focal Length +EXIFFILTER_ISO;ISO +EXIFFILTER_LENS;Lens +EXIFFILTER_SHUTTER;Shutter +EXIFPANEL_ADDEDIT;Add/Edit +EXIFPANEL_ADDEDITHINT;Add new tag or edit tag +EXIFPANEL_ADDTAGDLG_ENTERVALUE;Enter value +EXIFPANEL_ADDTAGDLG_SELECTTAG;Select tag +EXIFPANEL_ADDTAGDLG_TITLE;Add/Edit Tag +EXIFPANEL_KEEPHINT;Keep the selected tags when writing output file +EXIFPANEL_KEEP;Keep +EXIFPANEL_REMOVEHINT;Remove the selected tags when writing output file +EXIFPANEL_REMOVE;Remove +EXIFPANEL_RESETALLHINT;Reset all tags to their original values +EXIFPANEL_RESETALL;Reset All +EXIFPANEL_RESETHINT;Reset the selected tags to their original values +EXIFPANEL_RESET;Reset +EXIFPANEL_SUBDIRECTORY;Subdirectory +FILEBROWSER_APPLYPROFILE;Apply profile +FILEBROWSER_ARRANGEMENTHINT;Change between vertical/horizontal alignment of thumbnails +FILEBROWSER_CLEARPROFILE;Clear profile +FILEBROWSER_COPYPROFILE;Copy profile +FILEBROWSER_DELETEDLGLABEL;File delete confirmation +FILEBROWSER_DELETEDLGMSG;Are you sure you want to delete the selected %1 files? +FILEBROWSER_EMPTYTRASH;Empty Trash +FILEBROWSER_EMPTYTRASHHINT;Permanently delete the files of the trash +FILEBROWSER_EXIFFILTERAPPLY;Apply +FILEBROWSER_EXIFFILTERAPPLYHINT;Switch on/off exif filter of the file browser +FILEBROWSER_EXIFFILTERLABEL;Exif Filter +FILEBROWSER_EXIFFILTERSETTINGSHINT;Change settings of the exif filter +FILEBROWSER_EXIFFILTERSETTINGS;Setup +FILEBROWSER_PARTIALPASTEPROFILE;Partial paste +FILEBROWSER_PASTEPROFILE;Paste profile +FILEBROWSER_POPUPCANCELJOB;Cancel job +FILEBROWSER_POPUPMOVEEND;Move to end of queue +FILEBROWSER_POPUPMOVEHEAD;Move to head of queue +FILEBROWSER_POPUPOPEN;Open +FILEBROWSER_POPUPPROCESS;Put to processing queue +FILEBROWSER_POPUPRANK1;Rank 1 +FILEBROWSER_POPUPRANK2;Rank 2 +FILEBROWSER_POPUPRANK3;Rank 3 +FILEBROWSER_POPUPRANK4;Rank 4 +FILEBROWSER_POPUPRANK5;Rank 5 +FILEBROWSER_POPUPREMOVE;Remove from filesystem +FILEBROWSER_POPUPRENAME;Rename +FILEBROWSER_POPUPSELECTALL;Select all +FILEBROWSER_POPUPTRASH;Move to trash +FILEBROWSER_POPUPUNRANK;Unrank +FILEBROWSER_POPUPUNTRASH;Remove from trash +FILEBROWSER_PROCESSINGSETTINGSHINT;Set the file format and output directory +FILEBROWSER_PROCESSINGSETTINGS;Settings +FILEBROWSER_RENAMEDLGLABEL;Rename file +FILEBROWSER_RENAMEDLGMSG;Rename file "%1" to: +FILEBROWSER_SHOWDIRHINT;Show all images of the directory +FILEBROWSER_SHOWQUEUEHINT;Show content of the processing queue +FILEBROWSER_SHOWRANK1HINT;Show images ranked as 1 star +FILEBROWSER_SHOWRANK2HINT;Show images ranked as 2 star +FILEBROWSER_SHOWRANK3HINT;Show images ranked as 3 star +FILEBROWSER_SHOWRANK4HINT;Show images ranked as 4 star +FILEBROWSER_SHOWRANK5HINT;Show images ranked as 5 star +FILEBROWSER_SHOWTRASHHINT;Show content of the trash +FILEBROWSER_SHOWUNRANKHINT;Show unranked images +FILEBROWSER_STARTPROCESSINGHINT;Start processing/saving of images in the queue +FILEBROWSER_STARTPROCESSING;Start Processing +FILEBROWSER_STOPPROCESSINGHINT;Stop processing of images +FILEBROWSER_STOPPROCESSING;Stop processing +FILEBROWSER_THUMBSIZE;Thumb. size +FILEBROWSER_ZOOMINHINT;Increase thumbnail size +FILEBROWSER_ZOOMOUTHINT;Decrease thumbnail size +GENERAL_ABOUT;Om +GENERAL_CANCEL;Avbryt +GENERAL_DISABLE;Avaktivera +GENERAL_DISABLED;Avaktivera +GENERAL_ENABLED;Verkställ +GENERAL_ENABLE;Verkställ +GENERAL_LANDSCAPE;Landskap +GENERAL_LOAD;Ladda +GENERAL_NA;n/a +GENERAL_NO;Nej +GENERAL_OK;Ok +GENERAL_PORTRAIT;Porträtt +GENERAL_SAVE;Spara +GENERAL_YES;Ja +HISTOGRAM_LABEL;Histogram +HISTOGRAM_TOOLTIP_B;Visa/göm blått histogram +HISTOGRAM_TOOLTIP_G;Visa/göm grönt histogram +HISTOGRAM_TOOLTIP_L;Visa/göm CIELAB Luminans histogram +HISTOGRAM_TOOLTIP_R;Visa/göm rött histogram +HISTORY_CHANGED;Changed +HISTORY_CUSTOMCURVE;Egen kurva +HISTORY_DELSNAPSHOT;Ta bort bokmärke +HISTORY_FROMCLIPBOARD;From clipboard +HISTORY_LABEL;Historia +HISTORY_MSG_10;Skuggkomprimering +HISTORY_MSG_11;Tonkurva +HISTORY_MSG_12;Autoexponering +HISTORY_MSG_13;Exponeringsmarkering +HISTORY_MSG_14;Luminansljusstyrka +HISTORY_MSG_15;Luminanskontrast +HISTORY_MSG_16;Svart luminans +HISTORY_MSG_17;Luminans högdager kompr. +HISTORY_MSG_18;Luminans skugg kompr. +HISTORY_MSG_19;Luminanskurva +HISTORY_MSG_1;Foto laddat +HISTORY_MSG_20;Skärpning +HISTORY_MSG_21;Skärpningsradie +HISTORY_MSG_22;Skärpningsmängd +HISTORY_MSG_23;Skärpningströskelvärde +HISTORY_MSG_24;Skärp bara kanter +HISTORY_MSG_25;Kantupptäckningsradie-skärpning +HISTORY_MSG_26;Kantskärpningstolerans +HISTORY_MSG_27;Halo-skärpningskontroll +HISTORY_MSG_28;Halo-kontrollstorlek +HISTORY_MSG_29;Skärpningsmetod +HISTORY_MSG_2;Profil laddad +HISTORY_MSG_30;Deconvolution-radie +HISTORY_MSG_31;Deconvolution-storlek +HISTORY_MSG_32;Deconvolution-dämpning +HISTORY_MSG_33;Deconvolution-upprepning +HISTORY_MSG_34;Undvik färgmarkeringar +HISTORY_MSG_35;Mättnadsbegränsning +HISTORY_MSG_36;Mättnadsgräns +HISTORY_MSG_37;Färgförstärkning +HISTORY_MSG_38;Vitbalansmetod +HISTORY_MSG_39;Färgtemperatur +HISTORY_MSG_3;Profil ändrad +HISTORY_MSG_40;Vitbalansnyans +HISTORY_MSG_41;Färgskiftning "A" +HISTORY_MSG_42;Färgskiftning "B" +HISTORY_MSG_43;Luminans brusborttagning +HISTORY_MSG_44;Lum. brusborttagnings-radie +HISTORY_MSG_45;Lum. brusborttagnings kanttolerans +HISTORY_MSG_46;Färgbrusborttagning +HISTORY_MSG_47;Färgbrusborttagnings-radie +HISTORY_MSG_48;Färgbrusborttagnings-kanttolerans +HISTORY_MSG_49;Kantkänslig färgbrusborttagning +HISTORY_MSG_4;Historia-bläddrande +HISTORY_MSG_50;Skugg/högdager verktyg +HISTORY_MSG_51;Högdager-förstärkning +HISTORY_MSG_52;Skuggförstärkning +HISTORY_MSG_53;Högdager-tonvidd +HISTORY_MSG_54;Skugg-tonvidd +HISTORY_MSG_55;Lokal kontrast +HISTORY_MSG_56;Skugg/högdager -radie +HISTORY_MSG_57;Enkel rotation +HISTORY_MSG_58;Vänd horisontellt +HISTORY_MSG_59;Vänd vertikalt +HISTORY_MSG_5;Ljusstyrka +HISTORY_MSG_60;Rotation +HISTORY_MSG_61;Rotation +HISTORY_MSG_62;Objektivdistorsions-korrigering +HISTORY_MSG_63;Valt bokmärke +HISTORY_MSG_64;Beskär foto +HISTORY_MSG_65;C/A korrigering +HISTORY_MSG_66;Högdager-förbättring +HISTORY_MSG_67;Högdager-förbättringsstorlek +HISTORY_MSG_68;Högdager-förbättringsmetod +HISTORY_MSG_69;Arbetsfärgrymd +HISTORY_MSG_6;Kontrast +HISTORY_MSG_70;Utmatningsfärgrymd +HISTORY_MSG_71;Inmatningsfärgrymd +HISTORY_MSG_72;Vinjettering-korrigering +HISTORY_MSG_73;Kanalmixer +HISTORY_MSG_74;Ändra storleksskala +HISTORY_MSG_75;Ändra storleks metod +HISTORY_MSG_76;Exif Metadata +HISTORY_MSG_77;IPTC Metadata +HISTORY_MSG_78;Data specified for resize +HISTORY_MSG_79;Resize width +HISTORY_MSG_7;Svart +HISTORY_MSG_80;Resize height +HISTORY_MSG_81;Resize enabled +HISTORY_MSG_8;Exponerings-komprimering +HISTORY_MSG_9;Högdager-komprimering +HISTORY_NEWSNAPSHOTAS;Som... +HISTORY_NEWSNAPSHOT;Nytt bokmärke +HISTORY_NEWSSDIALOGLABEL;Namn på bokmärket: +HISTORY_NEWSSDIALOGTITLE;Lägg till nytt bokmärke +HISTORY_SETTO;Ställ in till +HISTORY_SNAPSHOT;Bokmärke +HISTORY_SNAPSHOTS;Bokmärken +ICMPANEL_FILEDLGFILTERANY;Vilka filer som helst +ICMPANEL_FILEDLGFILTERICM;ICC profilfiler +ICMPANEL_GAMMABEFOREINPUT;Profile applies Gamma +ICMPANEL_INPUTCAMERA;Kameraval +ICMPANEL_INPUTCUSTOM;Egen +ICMPANEL_INPUTDLGLABEL;Välj inmatnings ICC-profil... +ICMPANEL_INPUTEMBEDDED;Använd inbäddad, om möjligt +ICMPANEL_INPUTPROFILE;Inmatningsprofil +ICMPANEL_NOICM;Ingen ICM: sRGB-utmatning +ICMPANEL_OUTPUTDLGLABEL;Välj utmatnings ICC-profil... +ICMPANEL_OUTPUTPROFILE;Utmatningsprofil +ICMPANEL_SAVEREFERENCE;Save reference image for profiling +ICMPANEL_WORKINGPROFILE;Arbetsprofil +IMAGEAREA_DETAILVIEW;Detalj +IPTCPANEL_AUTHOR;Author +IPTCPANEL_AUTHORHINT;Name of the creator of the object, e.g. writer, photographer or graphic artist (By-line). +IPTCPANEL_AUTHORSPOSITION;Author's position +IPTCPANEL_AUTHORSPOSITIONHINT;Title of the creator or creators of the object (By-line Title). +IPTCPANEL_CAPTION;Caption +IPTCPANEL_CAPTIONHINT;A textual description of the data (Caption - Abstract). +IPTCPANEL_CAPTIONWRITER;Caption Writer +IPTCPANEL_CAPTIONWRITERHINT;The name of the person involved in the writing, editing or correcting the image or caption/abstract (Writer - Editor). +IPTCPANEL_CATEGORY;Category +IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider (Category). +IPTCPANEL_CITY;City +IPTCPANEL_CITYHINT;City of image origin (City). +IPTCPANEL_COPYHINT;Copy IPTC settings to clipboard +IPTCPANEL_COPYRIGHT;Copyright +IPTCPANEL_COPYRIGHTHINT;Any necessary copyright notice (Copyright Notice). +IPTCPANEL_COUNTRY;Country +IPTCPANEL_COUNTRYHINT;The name of the country/primary location where the image was created (Country - Primary Location Name). +IPTCPANEL_CREDIT;Credit +IPTCPANEL_CREDITHINT;Identifies the provider of the image, not necessarily the owner/creator (Credit). +IPTCPANEL_DATECREATED;Date Created +IPTCPANEL_DATECREATEDHINT;The date the intellectual content of the image was created; Format: JJJJMMTT (Date Created). +IPTCPANEL_EMBEDDED;Embedded +IPTCPANEL_EMBEDDEDHINT;Reset to IPTC data embedded in the image file +IPTCPANEL_HEADLINE;Headline +IPTCPANEL_HEADLINEHINT;A publishable entry providing a synopsis of the contents of the image (Headline). +IPTCPANEL_INSTRUCTIONSHINT;Other editorial instructions concerning the use of the image (Special Instructions). +IPTCPANEL_INSTRUCTIONS;Instructions +IPTCPANEL_KEYWORDSHINT;Used to indicate specific information retrieval words (Keywords). +IPTCPANEL_KEYWORDS;Keywords +IPTCPANEL_PASTEHINT;Paste IPTC settings from clipboard +IPTCPANEL_PROVINCEHINT;The Province/State where the image originates (Province-State). +IPTCPANEL_PROVINCE;Province +IPTCPANEL_RESETHINT;Reset to profile default +IPTCPANEL_RESET;Reset +IPTCPANEL_SOURCEHINT;The original owner of the intellectual content of the image (Source). +IPTCPANEL_SOURCE;Source +IPTCPANEL_SUPPCATEGORIESHINT;Further refines the subject of the image (Supplemental Categories). +IPTCPANEL_SUPPCATEGORIES;Suppl. Categories +IPTCPANEL_TITLEHINT;A shorthand reference for the image (Object Name). +IPTCPANEL_TITLE;Title +IPTCPANEL_TRANSREFERENCEHINT;A code representing the location of original transmission (Original Transmission Reference). +IPTCPANEL_TRANSREFERENCE;Trans. Reference +MAIN_BUTTON_EXIT;Exit +MAIN_BUTTON_PREFERENCES;Inställningar +MAIN_BUTTON_QUEUE;Put to queue +MAIN_BUTTON_SAVEAS;Som... +MAIN_BUTTON_SAVE;Spara bild +MAIN_BUTTON_SENDTOEDITOR;Send to editor +MAIN_FRAME_BATCHQUEUE;Batch Queue +MAIN_FRAME_FILEBROWSER;File Browser +MAIN_FRAME_PLACES_ADD;Add +MAIN_FRAME_PLACES_DEL;Del +MAIN_FRAME_PLACES;Places +MAIN_FRAME_RECENT;Recent Folders +MAIN_MSG_ALREADYEXISTS;Filen existerar redan. +MAIN_MSG_CANNOTLOAD;Kan inte ladda bilden +MAIN_MSG_CANNOTSAVE;Filsparningsfel +MAIN_MSG_CANNOTSTARTEDITOR;Can not start editor. +MAIN_MSG_CANNOTSTARTEDITOR_SECONDARY;Please set the correct path in the "Preferences" dialog. +MAIN_MSG_EXITJOBSINQUEUEINFO;Unprocessed images in the queue will be lost on exit. +MAIN_MSG_EXITJOBSINQUEUEQUEST;Are you sure you want to exit? There are unprocessed images waiting in the queue. +MAIN_MSG_JOBSINQUEUE;Arbete(n) i kö +MAIN_MSG_QOVERWRITE;Vill du skriva över den? +MAIN_TAB_BASIC;Grund +MAIN_TAB_COLOR;Color +MAIN_TAB_DETAIL;Detail +MAIN_TAB_DEVELOP;Develop +MAIN_TAB_EXIF;Exif +MAIN_TAB_EXPOSURE;Exposure +MAIN_TAB_FILTER;Filter +MAIN_TAB_ICM;ICM +MAIN_TAB_IPTC;IPTC +MAIN_TAB_METADATA;Metadata +MAIN_TAB_TAGGING;Tagging +MAIN_TAB_TRANSFORM;Omvandla +MAIN_TOOLTIP_HIDEFP;Visa/göm den nedre panelen (katalog och filbläddrare, shortcut key: F) +MAIN_TOOLTIP_HIDEHP;Visa/göm den vänstra panelen (innehåller historiken, shortcut key: H) +MAIN_TOOLTIP_INDCLIPPEDH;Markerad högdager-indikation +MAIN_TOOLTIP_INDCLIPPEDS;Markerad skugg-indikation +MAIN_TOOLTIP_PREFERENCES;Ställ in inställningar +MAIN_TOOLTIP_QINFO;Snabb info om bilden +MAIN_TOOLTIP_SAVEAS;Spara bilden till en vald mapp +MAIN_TOOLTIP_SAVE;Spara bilden till standardmappen +PARTIALPASTE_BASICGROUP;Basic settings +PARTIALPASTE_CACORRECTION;C/A correction +PARTIALPASTE_COARSETRANS;90 deg rotation / flipping +PARTIALPASTE_COLORBOOST;Color boost +PARTIALPASTE_COLORDENOISE;Color denoise +PARTIALPASTE_COLORGROUP;Color related settings +PARTIALPASTE_COLORMIXER;Color mixer +PARTIALPASTE_COLORSHIFT;Color shift +PARTIALPASTE_COMPOSITIONGROUP;Composition settings +PARTIALPASTE_CROP;Crop +PARTIALPASTE_DIALOGLABEL;Partial paste processing profile +PARTIALPASTE_DISTORTION;Distortion correction +PARTIALPASTE_EXIFCHANGES;Changes to exif data +PARTIALPASTE_EXPOSURE;Exposure +PARTIALPASTE_HLRECOVERY;Highlight recovery +PARTIALPASTE_ICMSETTINGS;ICM settings +PARTIALPASTE_IPTCINFO;IPTC info +PARTIALPASTE_LENSGROUP;Lens related settings +PARTIALPASTE_LUMACURVE;Luminance curve +PARTIALPASTE_LUMADENOISE;Luminance noise reduction +PARTIALPASTE_LUMINANCEGROUP;Luminance related settings +PARTIALPASTE_METAICMGROUP;Metadata/ICM settings +PARTIALPASTE_RESIZE;Resize +PARTIALPASTE_ROTATION;Rotation +PARTIALPASTE_SHADOWSHIGHLIGHTS;Shadows/Highlights +PARTIALPASTE_SHARPENING;Sharpening +PARTIALPASTE_VIGNETTING;Vignetting correction +PARTIALPASTE_WHITEBALANCE;White balance +PREFERENCES_APPLNEXTSTARTUP;ändras vid nästa uppstart +PREFERENCES_BLINKCLIPPED;Blinka markerade områden +PREFERENCES_CACHECLEARALL;Clear All +PREFERENCES_CACHECLEARPROFILES;Clear Profiles +PREFERENCES_CACHECLEARTHUMBS;Clear Thumbnails +PREFERENCES_CACHEFORMAT1;Proprietary (faster and better quality) +PREFERENCES_CACHEFORMAT2;JPEG (smaller disk footprint) +PREFERENCES_CACHEMAXENTRIES;Maximal Number of Cache Entries +PREFERENCES_CACHEOPTS;Cache Options +PREFERENCES_CACHESTRAT1;Prefer Speed to Low Memory Consumption +PREFERENCES_CACHESTRAT2;Prefer Low Memory Consumption to Speed +PREFERENCES_CACHESTRAT;Cache Strategy +PREFERENCES_CACHETHUMBFORM;Cache Thumbnail Format +PREFERENCES_CACHETHUMBHEIGHT;Maximal Thumbnail Height +PREFERENCES_CLEARDLG_LINE1;Clearing cache +PREFERENCES_CLEARDLG_LINE2;This may take a few seconds. +PREFERENCES_CLEARDLG_TITLE;Please wait +PREFERENCES_CLIPPINGIND;Markerings-indikation +PREFERENCES_CMETRICINTENT;Colorimetric Intent +PREFERENCES_DATEFORMAT;Datumformat +PREFERENCES_DATEFORMATHINT;You can use the following formatting strings:\n%y : year\n%m : month\n%d : day\n\nFor example, the hungarian date format is:\n%y/%m/%d +PREFERENCES_DEFAULTLANG;Förvalt språk +PREFERENCES_DEFAULTTHEME;Default theme +PREFERENCES_DEMOSAICINGALGO;Demosaicing Algorithm +PREFERENCES_DIRHOME;Hemkatalog +PREFERENCES_DIRLAST;Senaste besökta katalog +PREFERENCES_DIROTHER;Annan +PREFERENCES_DIRSELECTDLG;Välj Bildkatalog vid uppstart... +PREFERENCES_DIRSOFTWARE;Installations-katalog +PREFERENCES_DMETHOD;Metod +PREFERENCES_EDITORCMDLINE;Other command line +PREFERENCES_EXTERNALEDITOR;External editor +PREFERENCES_FALSECOLOR;Falskt färgbortträngningssteg +PREFERENCES_FBROWSEROPTS;Filbläddrar-inställningar +PREFERENCES_FILEFORMAT;Filformat +PREFERENCES_FORIMAGE;För bildfiler +PREFERENCES_FORRAW;För RAW-filer +PREFERENCES_GIMPPATH;GIMP installation directory +PREFERENCES_GTKTHEME;GTK default +PREFERENCES_HINT;Tips +PREFERENCES_HLTHRESHOLD;Tröskelvärde för markerade högdager +PREFERENCES_ICCDIR;Katalog för ICC-profiler +PREFERENCES_IMPROCPARAMS;Standard-bildbehandlingsparametrar +PREFERENCES_INTENT_ABSOLUTE;Total colorimetric +PREFERENCES_INTENT_PERCEPTUAL;Perceptual +PREFERENCES_INTENT_RELATIVE;Relativ colorimetric +PREFERENCES_INTENT_SATURATION;Mättnad +PREFERENCES_LIVETHUMBNAILS;Live Thumbnails (slower) +PREFERENCES_MONITORICC;Skärmprofil +PREFERENCES_OUTDIRFOLDERHINT;Put the saved images to the seledted folder +PREFERENCES_OUTDIRFOLDER;Save to folder +PREFERENCES_OUTDIRHINT;You can use the following formatting strings:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nThese formatting strings refer to the directories and sub-paths of the path of the raw file.\n\nFor example, if /home/tom/image/02-09-2006/dsc0012.nefhas been opened, the meaning of the formatting strings are:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nIf you want to save the output image where the original is, write:\n%p1/%f\n\nIf you want to save the output image in a directory 'converted' located the directory of the original, write:\n%p1/converted/%f\n\nIf you want to save the output image in directory '/home/tom/converted' with keeping the same subdirectory of dates, write:\n%p2/converted/%d1/%f +PREFERENCES_OUTDIRTEMPLATEHINT;You can use the following formatting strings:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nThese formatting strings refer to the directories and sub-paths of the path of the raw file.\n\nFor example, if /home/tom/image/02-09-2006/dsc0012.nefhas been opened, the meaning of the formatting strings are:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nIf you want to save the output image where the original is, write:\n%p1/%f\n\nIf you want to save the output image in a directory 'converted' located the directory of the original, write:\n%p1/converted/%f\n\nIf you want to save the output image in directory '/home/tom/converted' with keeping the same subdirectory of dates, write:\n%p2/converted/%d1/%f +PREFERENCES_OUTDIRTEMPLATE;Use Template +PREFERENCES_OUTDIR;Utmatningskatalog +PREFERENCES_PARSEDEXTADD;Add Extension +PREFERENCES_PARSEDEXTADDHINT;Type an extension and press this button to append list +PREFERENCES_PARSEDEXTDELHINT;Delete selected extension from the list +PREFERENCES_PARSEDEXT;Parsed Extensions +PREFERENCES_PROFILEHANDLING;Processing Profile Handling +PREFERENCES_PROFILELOADPR;Profile Loading Priority +PREFERENCES_PROFILEPRCACHE;Profile in Cache +PREFERENCES_PROFILEPRFILE;Profile Next to the Input File +PREFERENCES_PROFILESAVECACHE;Save Processing Parameters to the Cache +PREFERENCES_PROFILESAVEINPUT;Save Processing Parameters Next to the Input File +PREFERENCES_PSPATH;Adobe Photoshop installation directory +PREFERENCES_SELECTICCDIRDLG;Välj ICC-profil katalog... +PREFERENCES_SELECTLANG;Välj språk +PREFERENCES_SELECTMONITORPROFDLG;Välj ICC-profil för skärmen... +PREFERENCES_SELECTTHEME;Select theme +PREFERENCES_SHOWBASICEXIF;Visa grundlig Exif-information +PREFERENCES_SHOWDATETIME;Visa datum och tid +PREFERENCES_SHOWONLYRAW;Visa bara RAW-filer +PREFERENCES_SHTHRESHOLD;Tröskelvärde för markerade skuggor +PREFERENCES_STARTUPIMDIR;Bildkatalog som visas vid uppstart +PREFERENCES_TAB_BROWSER;Filbläddrare +PREFERENCES_TAB_COLORMGR;Färghantering +PREFERENCES_TAB_GENERAL;Allmän +PREFERENCES_TAB_IMPROC;Bildbehandling +PREFERENCES_TAB_OUTPUT;Utmatnings-inställningar +PREFERENCES_THUMBSIZE;Miniatyrbildstorlek +PROFILEPANEL_FILEDLGFILTERANY;Vilka filer som helst +PROFILEPANEL_FILEDLGFILTERPP;Postbehandlar profiler +PROFILEPANEL_LABEL;Postbehandlar profiler +PROFILEPANEL_LOADDLGLABEL;Ladda Postbehandlingsparametrar... +PROFILEPANEL_PCUSTOM;Egen +PROFILEPANEL_PFILE;Från fil +PROFILEPANEL_PLASTPHOTO;Senaste foto +PROFILEPANEL_PLASTSAVED;Senast sparad +PROFILEPANEL_PROFILE;Profil +PROFILEPANEL_SAVEDLGLABEL;Spara Postbehandlingsparametrar... +PROFILEPANEL_TOOLTIPCOPY;Copy current profile to clipboard +PROFILEPANEL_TOOLTIPLOAD;Ladda profil från fil +PROFILEPANEL_TOOLTIPPASTE; Paste profile from clipboard +PROFILEPANEL_TOOLTIPSAVE;Spara nuvarande profil +PROGRESSBAR_DECODING;Avkodar Raw-fil... +PROGRESSBAR_DEMOSAICING;Demosaicing... +PROGRESSBAR_LOADING;Laddar bild... +PROGRESSBAR_LOADJPEG;Laddar JPEG-fil... +PROGRESSBAR_LOADPNG;Laddar PNG-fil... +PROGRESSBAR_LOADTIFF;Laddar TIFF-fil... +PROGRESSBAR_PROCESSING;Bearbetar Bild... +PROGRESSBAR_READY;Klar. +PROGRESSBAR_SAVEJPEG;Sparar JPEG-fil... +PROGRESSBAR_SAVEPNG;Sparar PNG-fil... +PROGRESSBAR_SAVETIFF;Sparar TIFF-fil... +PROGRESSDLG_LOADING;Loading file... +PROGRESSDLG_PROCESSING;Processing image... +PROGRESSDLG_SAVING;Saving file... +QINFO_FOCALLENGTH;Brännvidd +QINFO_ISO;ISO +QINFO_LENS;Lens +QINFO_NOEXIF;Exifdata otillgänglig. +SAVEDLG_FILEFORMAT;Filformat +SAVEDLG_JPEGQUAL;JPEG-kvalitet +SAVEDLG_JPGFILTER;JPEG-filer +SAVEDLG_PNGCOMPR;PNG-komprimering +SAVEDLG_PNGFILTER;PNG-filer +SAVEDLG_PUTTOQUEUEHEAD;Put to the head of the processing queue +SAVEDLG_PUTTOQUEUE;Put into processing queue +SAVEDLG_PUTTOQUEUETAIL;Put to the end of the processing queue +SAVEDLG_SAVEIMMEDIATELY;Save immediately +SAVEDLG_SAVESPP;Spara behandlingsparametrarna med bilderna +SAVEDLG_TIFFFILTER;TIFF-filer +TOOLBAR_TOOLTIP_CROP;Välj beskärningsområde (shortcut key: C) +TOOLBAR_TOOLTIP_HAND;Handverktyg (shortcut key: N) +TOOLBAR_TOOLTIP_STRAIGHTEN;Räta ut (shortcut key: S) +TOOLBAR_TOOLTIP_WB;Punkt-vitbalans (shortcut key: W) +TP_CACORRECTION_BLUE;Blå +TP_CACORRECTION_LABEL;C/A justering +TP_CACORRECTION_RED;Röd +TP_CHMIXER_BLUE;Blå +TP_CHMIXER_GREEN;Grön +TP_CHMIXER_LABEL;Kanalmixer +TP_CHMIXER_RED;Röd +TP_COARSETRAF_DEGREE;grad: +TP_COARSETRAF_TOOLTIP_HFLIP;Vänd horisontellt +TP_COARSETRAF_TOOLTIP_ROTLEFT;Rotera åt vänster +TP_COARSETRAF_TOOLTIP_ROTRIGHT;Rotera åt höger +TP_COARSETRAF_TOOLTIP_VFLIP;Vänd vertikalt +TP_COLORBOOST_ACHANNEL;kanal "a" +TP_COLORBOOST_AMOUNT;Mängd +TP_COLORBOOST_AVOIDCOLORCLIP;Undvik färgclipping +TP_COLORBOOST_BCHANNEL;kanal "b" +TP_COLORBOOST_CHAB;a & b +TP_COLORBOOST_CHANNEL;Kanal +TP_COLORBOOST_CHSEPARATE;separat +TP_COLORBOOST_ENABLESATLIMITER;Verkställ mättnadsgräns +TP_COLORBOOST_LABEL;Färgförstärkning +TP_COLORBOOST_SATLIMIT;Mättnadsgräns +TP_COLORDENOISE_EDGESENSITIVE;Kantkänslighet +TP_COLORDENOISE_EDGETOLERANCE;Kanttolerans +TP_COLORDENOISE_LABEL;Färgbrus-reducering +TP_COLORDENOISE_RADIUS;Radie +TP_COLORSHIFT_BLUEYELLOW;Blå-Gul +TP_COLORSHIFT_GREENMAGENTA;Grön-Magenta +TP_COLORSHIFT_LABEL;Färgskiftningar +TP_CROP_DPI;DPI= +TP_CROP_FIXRATIO;Fixa proportion +TP_CROP_GTDIAGONALS;Diagonalregeln +TP_CROP_GTHARMMEANS1;Harmonic means 1 +TP_CROP_GTHARMMEANS2;Harmonic means 2 +TP_CROP_GTHARMMEANS3;Harmonic means 3 +TP_CROP_GTHARMMEANS4;Harmonic means 4 +TP_CROP_GTNONE;Ingen +TP_CROP_GTRULETHIRDS;Tredjedelsregeln +TP_CROP_GUIDETYPE;Guidetyp: +TP_CROP_H;H +TP_CROP_LABEL;Beskär +TP_CROP_SELECTCROP; Välj beskärningsområde +TP_CROP_W;B +TP_CROP_X;x +TP_CROP_Y;y +TP_DISTORTION_AMOUNT;Mängd +TP_DISTORTION_LABEL;Distorsion +TP_EXPOSURE_AUTOLEVELS;Autonivåer +TP_EXPOSURE_BLACKLEVEL;Svart +TP_EXPOSURE_BRIGHTNESS;Ljusstyrka +TP_EXPOSURE_CLIP;Clip +TP_EXPOSURE_COMPRHIGHLIGHTS;Högdagerkomprimering +TP_EXPOSURE_COMPRSHADOWS;Skuggkomprimering +TP_EXPOSURE_CONTRAST;Kontrast +TP_EXPOSURE_CURVEEDITOR;Tonkurva +TP_EXPOSURE_EXPCOMP;Exp. Comp. +TP_EXPOSURE_LABEL;Exponering +TP_HLREC_CIELAB;CIELab Blending +TP_HLREC_COLOR;Färgspridning +TP_HLREC_LABEL;Högdager-förbättring +TP_HLREC_LUMINANCE;Bättring av luminans +TP_HLREC_METHOD;Metod: +TP_ICM_FILEDLGFILTERANY;Vilka filer som helst +TP_ICM_FILEDLGFILTERICM;ICC profilfiler +TP_ICM_GAMMABEFOREINPUT;Profile applies Gamma +TP_ICM_INPUTCAMERA;Kameraval +TP_ICM_INPUTCUSTOM;Egen +TP_ICM_INPUTDLGLABEL;Välj inmatnings ICC-profil... +TP_ICM_INPUTEMBEDDED;Använd inbäddad, om möjligt +TP_ICM_INPUTPROFILE;Inmatningsprofil +TP_ICM_LABEL;ICM +TP_ICM_NOICM;Ingen ICM: sRGB-utmatning +TP_ICM_OUTPUTDLGLABEL;Välj utmatnings ICC-profil... +TP_ICM_OUTPUTPROFILE;Utmatningsprofil +TP_ICM_SAVEREFERENCE;Save reference image for profiling +TP_ICM_WORKINGPROFILE;Arbetsprofil +TP_LUMACURVE_BLACKLEVEL;Svart +TP_LUMACURVE_BRIGHTNESS;Ljusstyrka +TP_LUMACURVE_COMPRHIGHLIGHTS;Högdagerkomprimering +TP_LUMACURVE_COMPRSHADOWS;Skuggkomprimering +TP_LUMACURVE_CONTRAST;Kontrast +TP_LUMACURVE_CURVEEDITOR;Luminanskurva +TP_LUMACURVE_LABEL;Luminanskurva +TP_LUMADENOISE_EDGETOLERANCE;Kanttolerans +TP_LUMADENOISE_LABEL;Luminans-brusreducering +TP_LUMADENOISE_RADIUS;Radie +TP_RESIZE_BICUBIC;Bicubic +TP_RESIZE_BICUBICSF;Bicubic (Mjukare) +TP_RESIZE_BICUBICSH;Bicubic (Skarpare) +TP_RESIZE_BILINEAR;Bilinjär +TP_RESIZE_FULLSIZE;Full bildstorlek: +TP_RESIZE_H;H: +TP_RESIZE_LABEL;Ändra storlek +TP_RESIZE_METHOD;Metod: +TP_RESIZE_NEAREST;Närmast +TP_RESIZE_SCALE;Skala +TP_RESIZE_W;B: +TP_ROTATE_AUTOCROP;Autobeskär +TP_ROTATE_DEGREE;Antal grader +TP_ROTATE_FILL;Fyll +TP_ROTATE_LABEL;Räta ut +TP_ROTATE_SELECTLINE; Välj rak linje +TP_SHADOWSHLIGHTS_HIGHLIGHTS;Högdager +TP_SHADOWSHLIGHTS_HLTONALW;Tonvidd +TP_SHADOWSHLIGHTS_LABEL;Skuggor/högdager +TP_SHADOWSHLIGHTS_LOCALCONTR;Lokal konstrast +TP_SHADOWSHLIGHTS_RADIUS;Radie +TP_SHADOWSHLIGHTS_SHADOWS;Skuggor +TP_SHADOWSHLIGHTS_SHTONALW;Tonvidd +TP_SHARPENING_AMOUNT;Mängd +TP_SHARPENING_EDRADIUS;Radie +TP_SHARPENING_EDTOLERANCE;Kanttolerans +TP_SHARPENING_HALOCONTROL;Halo-kontrol +TP_SHARPENING_HCAMOUNT;Mängd +TP_SHARPENING_LABEL;Skärpa +TP_SHARPENING_METHOD;Metod +TP_SHARPENING_ONLYEDGES;Skärp bara kanter +TP_SHARPENING_RADIUS;Radie +TP_SHARPENING_RLD_AMOUNT;Mängd +TP_SHARPENING_RLD_DAMPING;Dämpning +TP_SHARPENING_RLD_ITERATIONS;Upprepningar +TP_SHARPENING_RLD;RL Deconvolution +TP_SHARPENING_THRESHOLD;Tröskelvärde +TP_SHARPENING_USM;Oskarp mask +TP_VIGNETTING_AMOUNT;Mängd +TP_VIGNETTING_LABEL;Vinjettering-korrigering +TP_VIGNETTING_RADIUS;Radie +TP_WBALANCE_AUTO;Auto +TP_WBALANCE_CAMERA;Kamera +TP_WBALANCE_CUSTOM;Egen +TP_WBALANCE_GREEN;Nyans +TP_WBALANCE_LABEL;Vitbalans +TP_WBALANCE_METHOD;Metod +TP_WBALANCE_SIZE;Storlek: +TP_WBALANCE_SPOTWB;Punkt VB +TP_WBALANCE_TEMPERATURE;Temperatur +ZOOMBAR_DETAIL;Lupp +ZOOMBAR_HUGE;Enorm +ZOOMBAR_LARGE;Stor +ZOOMBAR_NORMAL;Normal +ZOOMBAR_PREVIEW;Förhandsvisning +ZOOMBAR_SCALE;Skala +ZOOMBAR_SMALL;Liten + +GENERAL_HIGH_QUALITY;High Quality +GENERAL_UNCHANGED;(Unchanged) +MAIN_MSG_PLACES;Places +GENERAL_BEFORE;Before +GENERAL_AFTER;After +MAIN_TOOLTIP_TOGGLE;Toggle before/after view +MAIN_BUTTON_PUTTOQUEUE;Put to queue +MAIN_MSG_NAVIGATOR;Navigator +FILEBROWSER_TOOLTIP_STOPPROCESSING;Start processing automatically when a new job arrives +BATCHQUEUE_AUTOSTART;Auto start +TP_DETAIL_AMOUNT;Amount +TP_RESIZE_SPECIFY;Specify: +TP_RESIZE_SCALE;Scale +TP_RESIZE_WIDTH;Width +TP_RESIZE_HEIGHT;Height +MAIN_TOGGLE_BEFORE_AFTER;B|A + ### diff --git a/rtdata/languages/Turkish b/rtdata/languages/Turkish index 55b5839fe..8cd2ce44b 100644 --- a/rtdata/languages/Turkish +++ b/rtdata/languages/Turkish @@ -1,631 +1,631 @@ -# -# This file is part of RawTherapee. -# -# Copyright (c) 2004-2010 Gabor Horvath -# -# RawTherapee is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# RawTherapee is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with RawTherapee. If not, see . -# -# Turkish -# 2.3.2008 -# Oguz -ADJUSTER_RESET_TO_DEFAULT;Varsayılana dön -CURVEEDITOR_FILEDLGFILTERANY;Bütün dosyalar -CURVEEDITOR_FILEDLGFILTERCURVE;Eğri dosyaları -CURVEEDITOR_LINEAR;Doğrusal -CURVEEDITOR_LOADDLGLABEL;Eğriyi yükle... -CURVEEDITOR_SAVEDLGLABEL;Eğriyi kaydet... -CURVEEDITOR_TOOLTIPLINEAR;Eğriyi düzelt -CURVEEDITOR_TOOLTIPLOAD;Kayıtlı bir eğriyi yü -CURVEEDITOR_TOOLTIPSAVE;Kullanılan eğriyi kaydet -EXIFFILTER_APERTURE;Aperture -EXIFFILTER_CAMERA;Camera -EXIFFILTER_DIALOGLABEL;Exif Filter -EXIFFILTER_FOCALLEN;Focal Length -EXIFFILTER_ISO;ISO -EXIFFILTER_LENS;Lens -EXIFFILTER_SHUTTER;Shutter -EXIFPANEL_ADDEDIT;Add/Edit -EXIFPANEL_ADDEDITHINT;Add new tag or edit tag -EXIFPANEL_ADDTAGDLG_ENTERVALUE;Enter value -EXIFPANEL_ADDTAGDLG_SELECTTAG;Select tag -EXIFPANEL_ADDTAGDLG_TITLE;Add/Edit Tag -EXIFPANEL_KEEPHINT;Keep the selected tags when writing output file -EXIFPANEL_KEEP;Keep -EXIFPANEL_REMOVEHINT;Remove the selected tags when writing output file -EXIFPANEL_REMOVE;Remove -EXIFPANEL_RESETALLHINT;Reset all tags to their original values -EXIFPANEL_RESETALL;Reset All -EXIFPANEL_RESETHINT;Reset the selected tags to their original values -EXIFPANEL_RESET;Reset -EXIFPANEL_SUBDIRECTORY;Subdirectory -FILEBROWSER_APPLYPROFILE;Apply profile -FILEBROWSER_ARRANGEMENTHINT;Change between vertical/horizontal alignment of thumbnails -FILEBROWSER_CLEARPROFILE;Clear profile -FILEBROWSER_COPYPROFILE;Copy profile -FILEBROWSER_DELETEDLGLABEL;File delete confirmation -FILEBROWSER_DELETEDLGMSG;Are you sure you want to delete the selected %1 files? -FILEBROWSER_EMPTYTRASH;Empty Trash -FILEBROWSER_EMPTYTRASHHINT;Permanently delete the files of the trash -FILEBROWSER_EXIFFILTERAPPLY;Apply -FILEBROWSER_EXIFFILTERAPPLYHINT;Switch on/off exif filter of the file browser -FILEBROWSER_EXIFFILTERLABEL;Exif Filter -FILEBROWSER_EXIFFILTERSETTINGSHINT;Change settings of the exif filter -FILEBROWSER_EXIFFILTERSETTINGS;Setup -FILEBROWSER_PARTIALPASTEPROFILE;Partial paste -FILEBROWSER_PASTEPROFILE;Paste profile -FILEBROWSER_POPUPCANCELJOB;Cancel job -FILEBROWSER_POPUPMOVEEND;Move to end of queue -FILEBROWSER_POPUPMOVEHEAD;Move to head of queue -FILEBROWSER_POPUPOPEN;Open -FILEBROWSER_POPUPPROCESS;Put to processing queue -FILEBROWSER_POPUPRANK1;Rank 1 -FILEBROWSER_POPUPRANK2;Rank 2 -FILEBROWSER_POPUPRANK3;Rank 3 -FILEBROWSER_POPUPRANK4;Rank 4 -FILEBROWSER_POPUPRANK5;Rank 5 -FILEBROWSER_POPUPREMOVE;Remove from filesystem -FILEBROWSER_POPUPRENAME;Rename -FILEBROWSER_POPUPSELECTALL;Select all -FILEBROWSER_POPUPTRASH;Move to trash -FILEBROWSER_POPUPUNRANK;Unrank -FILEBROWSER_POPUPUNTRASH;Remove from trash -FILEBROWSER_PROCESSINGSETTINGSHINT;Set the file format and output directory -FILEBROWSER_PROCESSINGSETTINGS;Settings -FILEBROWSER_RENAMEDLGLABEL;Rename file -FILEBROWSER_RENAMEDLGMSG;Rename file "%1" to: -FILEBROWSER_SHOWDIRHINT;Show all images of the directory -FILEBROWSER_SHOWQUEUEHINT;Show content of the processing queue -FILEBROWSER_SHOWRANK1HINT;Show images ranked as 1 star -FILEBROWSER_SHOWRANK2HINT;Show images ranked as 2 star -FILEBROWSER_SHOWRANK3HINT;Show images ranked as 3 star -FILEBROWSER_SHOWRANK4HINT;Show images ranked as 4 star -FILEBROWSER_SHOWRANK5HINT;Show images ranked as 5 star -FILEBROWSER_SHOWTRASHHINT;Show content of the trash -FILEBROWSER_SHOWUNRANKHINT;Show unranked images -FILEBROWSER_STARTPROCESSINGHINT;Start processing/saving of images in the queue -FILEBROWSER_STARTPROCESSING;Start Processing -FILEBROWSER_STOPPROCESSINGHINT;Stop processing of images -FILEBROWSER_STOPPROCESSING;Stop processing -FILEBROWSER_THUMBSIZE;Thumb. size -FILEBROWSER_ZOOMINHINT;Increase thumbnail size -FILEBROWSER_ZOOMOUTHINT;Decrease thumbnail size -GENERAL_ABOUT;Hakkında -GENERAL_CANCEL;İptal -GENERAL_DISABLED;Devre dışı -GENERAL_DISABLE;Etkisizleştir -GENERAL_ENABLED;Etkin -GENERAL_ENABLE;Etkinleştir -GENERAL_LANDSCAPE;Yatay -GENERAL_LOAD;Yükle -GENERAL_NA;Uygun değil -GENERAL_NO;Hayır -GENERAL_OK;Tamam -GENERAL_PORTRAIT;Dikey -GENERAL_SAVE;Kaydet -GENERAL_YES;Evet -HISTOGRAM_LABEL;Histogram -HISTOGRAM_TOOLTIP_B;Mavi histogramını göster/gizle -HISTOGRAM_TOOLTIP_G;Yeşil histogramını göster/gizle -HISTOGRAM_TOOLTIP_L;CIELAB aydınlık histogramını göster/gizle -HISTOGRAM_TOOLTIP_R;Kırmızı histogramını göster/gizle -HISTORY_CHANGED;Changed -HISTORY_CUSTOMCURVE;Özel eğri -HISTORY_DELSNAPSHOT;Şipşağı sil -HISTORY_FROMCLIPBOARD;From clipboard -HISTORY_LABEL;Geçmiş -HISTORY_MSG_10;Karaltı sıkıştırma -HISTORY_MSG_11;Ton eğrisi -HISTORY_MSG_12;Otomatik pozlama -HISTORY_MSG_13;Pozlama kırpma -HISTORY_MSG_14;Aydınlık - parlaklık -HISTORY_MSG_15;Aydınlık - zıtlık -HISTORY_MSG_16;Aydınlık - siyah -HISTORY_MSG_17;Aydınlık - parıltı sıkıştırma -HISTORY_MSG_18;Aydınlık - karaltı sıkıştırma -HISTORY_MSG_19;Aydınlık eğrisi -HISTORY_MSG_1;Fotoğraf yüklendi -HISTORY_MSG_20;Keskinleştirme -HISTORY_MSG_21;Keskinleştirme - çap -HISTORY_MSG_22;Keskinleştirme - miktar -HISTORY_MSG_23;Keskinleştirme - eşik -HISTORY_MSG_24;Sadece kenarları keskinleştir -HISTORY_MSG_25;Keskinleştirme - kenar bulma kuralları -HISTORY_MSG_26;Keskinleştirme - kenar payı -HISTORY_MSG_27;Keskinleştirme - hale denetimi -HISTORY_MSG_28;Hale denetimi - miktar -HISTORY_MSG_29;Keskinleştirme - yöntem -HISTORY_MSG_2;Profil yüklendi -HISTORY_MSG_30;Ters evrişim - çap -HISTORY_MSG_31;Ters evrişim - miktar -HISTORY_MSG_32;Ters evrişim - düşürme -HISTORY_MSG_33;Ters evrişim - yineleme -HISTORY_MSG_34;Renk kırpmayı önle -HISTORY_MSG_35;Doygunluk kısıtlayıcı -HISTORY_MSG_36;Doygunluk sınırı -HISTORY_MSG_37;Renk iteleme -HISTORY_MSG_38;Beyaz ayarı - yöntem -HISTORY_MSG_39;Renk ısısı -HISTORY_MSG_3;Profil değişti -HISTORY_MSG_40;Beyaz ayarı - tint -HISTORY_MSG_41;"A" renk kayması -HISTORY_MSG_42;"B" kayması -HISTORY_MSG_43;Aydınlık gürültü giderme -HISTORY_MSG_44;Aydınlık gürültü giderme - çap -HISTORY_MSG_45;Aydınlık gürültü giderme - kenar payı -HISTORY_MSG_46;Renk gürültü giderme -HISTORY_MSG_47;Renk gürültü giderme - çap -HISTORY_MSG_48;Renk gürültü giderme - kenar payı -HISTORY_MSG_49;Kenar duyarlı renk gürültüsü giderme -HISTORY_MSG_4;Geçmişte gezinti -HISTORY_MSG_50;Karaltı/parıltı aracı -HISTORY_MSG_51;Parıltı iteleme -HISTORY_MSG_52;Karaltı iteleme -HISTORY_MSG_53;Parıltı - ton genişliği -HISTORY_MSG_54;Karaltı - ton genişliği -HISTORY_MSG_55;Bölgesel zıtlık -HISTORY_MSG_56;Karaltı/parıltı - zıtlık -HISTORY_MSG_57;Döndürme -HISTORY_MSG_58;Yatayda çevirme -HISTORY_MSG_59;Dikeyde çevirme -HISTORY_MSG_5;Parlaklık -HISTORY_MSG_60;Döndürme -HISTORY_MSG_61;Döndürme -HISTORY_MSG_62;Lens bükülmesi düzeltme -HISTORY_MSG_63;Yer imi seçildi -HISTORY_MSG_64;Fotoğrafı kırp -HISTORY_MSG_65;Renk kayması düzeltme -HISTORY_MSG_66;Parıltı kurtarma -HISTORY_MSG_67;Parıltı kurtarma - miktar -HISTORY_MSG_68;Parıltı kurtarma - yöntem -HISTORY_MSG_69;Çalışma renk uzayı -HISTORY_MSG_6;Zıtlık -HISTORY_MSG_70;Çıktı renk uzayı -HISTORY_MSG_71;Girdi renk uzayı -HISTORY_MSG_72;Çerçeve etkisi düzeltme -HISTORY_MSG_73;Kanal karıştırıcı -HISTORY_MSG_74;Yeniden boyutlandırma - ölçek -HISTORY_MSG_75;Yeniden boyutlandırma - yöntem -HISTORY_MSG_76;Exif Metadata -HISTORY_MSG_77;IPTC Metadata -HISTORY_MSG_78;Data specified for resize -HISTORY_MSG_79;Resize width -HISTORY_MSG_7;Siyah -HISTORY_MSG_80;Resize height -HISTORY_MSG_81;Resize enabled -HISTORY_MSG_8;Pozlama telafisi -HISTORY_MSG_9;Parıltı sıkıştırma -HISTORY_NEWSNAPSHOTAS;... olarak -HISTORY_NEWSNAPSHOT;Yeni şipşak -HISTORY_NEWSSDIALOGLABEL;Şipşak etiketi: -HISTORY_NEWSSDIALOGTITLE;Yeni şipşak ekle -HISTORY_SETTO;Belirle -HISTORY_SNAPSHOT;Şipşak -HISTORY_SNAPSHOTS;Şipşaklar -ICMPANEL_FILEDLGFILTERANY;Bütün dosyalar -ICMPANEL_FILEDLGFILTERICM;ICC profil dosyaları -ICMPANEL_GAMMABEFOREINPUT;Profile applies Gamma -ICMPANEL_INPUTCAMERA;Kamera varsayılanı -ICMPANEL_INPUTCUSTOM;Özel -ICMPANEL_INPUTDLGLABEL;Girdi ICC profilini seç... -ICMPANEL_INPUTEMBEDDED;Mümkün olduğunda gömülü profili kullan -ICMPANEL_INPUTPROFILE;Girdi Profili -ICMPANEL_NOICM;No ICM: sRGB çıktı -ICMPANEL_OUTPUTDLGLABEL;Çıktı ICC profilini seç... -ICMPANEL_OUTPUTPROFILE;Çıktı profili -ICMPANEL_SAVEREFERENCE;Save reference image for profiling -ICMPANEL_WORKINGPROFILE;Çalışma profili -IMAGEAREA_DETAILVIEW;Detay görünümü -IPTCPANEL_AUTHOR;Author -IPTCPANEL_AUTHORHINT;Name of the creator of the object, e.g. writer, photographer or graphic artist (By-line). -IPTCPANEL_AUTHORSPOSITION;Author's position -IPTCPANEL_AUTHORSPOSITIONHINT;Title of the creator or creators of the object (By-line Title). -IPTCPANEL_CAPTION;Caption -IPTCPANEL_CAPTIONHINT;A textual description of the data (Caption - Abstract). -IPTCPANEL_CAPTIONWRITER;Caption Writer -IPTCPANEL_CAPTIONWRITERHINT;The name of the person involved in the writing, editing or correcting the image or caption/abstract (Writer - Editor). -IPTCPANEL_CATEGORY;Category -IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider (Category). -IPTCPANEL_CITY;City -IPTCPANEL_CITYHINT;City of image origin (City). -IPTCPANEL_COPYHINT;Copy IPTC settings to clipboard -IPTCPANEL_COPYRIGHT;Copyright -IPTCPANEL_COPYRIGHTHINT;Any necessary copyright notice (Copyright Notice). -IPTCPANEL_COUNTRY;Country -IPTCPANEL_COUNTRYHINT;The name of the country/primary location where the image was created (Country - Primary Location Name). -IPTCPANEL_CREDIT;Credit -IPTCPANEL_CREDITHINT;Identifies the provider of the image, not necessarily the owner/creator (Credit). -IPTCPANEL_DATECREATED;Date Created -IPTCPANEL_DATECREATEDHINT;The date the intellectual content of the image was created; Format: JJJJMMTT (Date Created). -IPTCPANEL_EMBEDDED;Embedded -IPTCPANEL_EMBEDDEDHINT;Reset to IPTC data embedded in the image file -IPTCPANEL_HEADLINE;Headline -IPTCPANEL_HEADLINEHINT;A publishable entry providing a synopsis of the contents of the image (Headline). -IPTCPANEL_INSTRUCTIONSHINT;Other editorial instructions concerning the use of the image (Special Instructions). -IPTCPANEL_INSTRUCTIONS;Instructions -IPTCPANEL_KEYWORDSHINT;Used to indicate specific information retrieval words (Keywords). -IPTCPANEL_KEYWORDS;Keywords -IPTCPANEL_PASTEHINT;Paste IPTC settings from clipboard -IPTCPANEL_PROVINCEHINT;The Province/State where the image originates (Province-State). -IPTCPANEL_PROVINCE;Province -IPTCPANEL_RESETHINT;Reset to profile default -IPTCPANEL_RESET;Reset -IPTCPANEL_SOURCEHINT;The original owner of the intellectual content of the image (Source). -IPTCPANEL_SOURCE;Source -IPTCPANEL_SUPPCATEGORIESHINT;Further refines the subject of the image (Supplemental Categories). -IPTCPANEL_SUPPCATEGORIES;Suppl. Categories -IPTCPANEL_TITLEHINT;A shorthand reference for the image (Object Name). -IPTCPANEL_TITLE;Title -IPTCPANEL_TRANSREFERENCEHINT;A code representing the location of original transmission (Original Transmission Reference). -IPTCPANEL_TRANSREFERENCE;Trans. Reference -MAIN_BUTTON_EXIT;Exit -MAIN_BUTTON_PREFERENCES;Seçenekler -MAIN_BUTTON_QUEUE;Put to queue -MAIN_BUTTON_SAVEAS;... olarak -MAIN_BUTTON_SAVE;Görüntüyü kaydet -MAIN_BUTTON_SENDTOEDITOR;Send to editor -MAIN_FRAME_BATCHQUEUE;Batch Queue -MAIN_FRAME_FILEBROWSER;File Browser -MAIN_FRAME_PLACES_ADD;Add -MAIN_FRAME_PLACES_DEL;Del -MAIN_FRAME_PLACES;Places -MAIN_FRAME_RECENT;Recent Folders -MAIN_MSG_ALREADYEXISTS;Dosya zaten var. -MAIN_MSG_CANNOTLOAD;Görüntü yüklenemiyor -MAIN_MSG_CANNOTSAVE;Dosya kaydetmede hata -MAIN_MSG_CANNOTSTARTEDITOR;Can not start editor. -MAIN_MSG_CANNOTSTARTEDITOR_SECONDARY;Please set the correct path in the "Preferences" dialog. -MAIN_MSG_EXITJOBSINQUEUEINFO;Unprocessed images in the queue will be lost on exit. -MAIN_MSG_EXITJOBSINQUEUEQUEST;Are you sure you want to exit? There are unprocessed images waiting in the queue. -MAIN_MSG_JOBSINQUEUE;iş sırada -MAIN_MSG_QOVERWRITE;Üzerine yazmak ister misiniz? -MAIN_TAB_BASIC;Temel -MAIN_TAB_COLOR;Color -MAIN_TAB_DETAIL;Detail -MAIN_TAB_DEVELOP;Develop -MAIN_TAB_EXIF;Exif -MAIN_TAB_EXPOSURE;Exposure -MAIN_TAB_FILTER;Filter -MAIN_TAB_ICM;Renk yönetimi -MAIN_TAB_IPTC;IPTC -MAIN_TAB_METADATA;Metadata -MAIN_TAB_TAGGING;Tagging -MAIN_TAB_TRANSFORM;Dönüşüm -MAIN_TOOLTIP_HIDEFP;Alt tablayı göster/gizle (dizin ve dosya gezgni, shortcut key: F) -MAIN_TOOLTIP_HIDEHP;Sol tablayı göster/gizle (geçmiş ile birlikte, shortcut key: H) -MAIN_TOOLTIP_INDCLIPPEDH;Kırpılmış parıltı gösterme -MAIN_TOOLTIP_INDCLIPPEDS;Kırpılmış karaltı gösterme -MAIN_TOOLTIP_PREFERENCES;Seçenekleri belirle -MAIN_TOOLTIP_QINFO;Görüntü hakkında kısa bilgi -MAIN_TOOLTIP_SAVEAS;Görüntüyü seçili klasöre kaydet -MAIN_TOOLTIP_SAVE;Görüntüyü varsayılan klasöre kaydet -PARTIALPASTE_BASICGROUP;Basic settings -PARTIALPASTE_CACORRECTION;C/A correction -PARTIALPASTE_COARSETRANS;90 deg rotation / flipping -PARTIALPASTE_COLORBOOST;Color boost -PARTIALPASTE_COLORDENOISE;Color denoise -PARTIALPASTE_COLORGROUP;Color related settings -PARTIALPASTE_COLORMIXER;Color mixer -PARTIALPASTE_COLORSHIFT;Color shift -PARTIALPASTE_COMPOSITIONGROUP;Composition settings -PARTIALPASTE_CROP;Crop -PARTIALPASTE_DIALOGLABEL;Partial paste processing profile -PARTIALPASTE_DISTORTION;Distortion correction -PARTIALPASTE_EXIFCHANGES;Changes to exif data -PARTIALPASTE_EXPOSURE;Exposure -PARTIALPASTE_HLRECOVERY;Highlight recovery -PARTIALPASTE_ICMSETTINGS;ICM settings -PARTIALPASTE_IPTCINFO;IPTC info -PARTIALPASTE_LENSGROUP;Lens related settings -PARTIALPASTE_LUMACURVE;Luminance curve -PARTIALPASTE_LUMADENOISE;Luminance noise reduction -PARTIALPASTE_LUMINANCEGROUP;Luminance related settings -PARTIALPASTE_METAICMGROUP;Metadata/ICM settings -PARTIALPASTE_RESIZE;Resize -PARTIALPASTE_ROTATION;Rotation -PARTIALPASTE_SHADOWSHIGHLIGHTS;Shadows/Highlights -PARTIALPASTE_SHARPENING;Sharpening -PARTIALPASTE_VIGNETTING;Vignetting correction -PARTIALPASTE_WHITEBALANCE;White balance -PREFERENCES_APPLNEXTSTARTUP;Bir sonraki başlamada uygulacacak. -PREFERENCES_BLINKCLIPPED;Kırpılan alanlar yanıp-sönsün -PREFERENCES_CACHECLEARALL;Clear All -PREFERENCES_CACHECLEARPROFILES;Clear Profiles -PREFERENCES_CACHECLEARTHUMBS;Clear Thumbnails -PREFERENCES_CACHEFORMAT1;Proprietary (faster and better quality) -PREFERENCES_CACHEFORMAT2;JPEG (smaller disk footprint) -PREFERENCES_CACHEMAXENTRIES;Maximal Number of Cache Entries -PREFERENCES_CACHEOPTS;Cache Options -PREFERENCES_CACHESTRAT1;Prefer Speed to Low Memory Consumption -PREFERENCES_CACHESTRAT2;Prefer Low Memory Consumption to Speed -PREFERENCES_CACHESTRAT;Cache Strategy -PREFERENCES_CACHETHUMBFORM;Cache Thumbnail Format -PREFERENCES_CACHETHUMBHEIGHT;Maximal Thumbnail Height -PREFERENCES_CLEARDLG_LINE1;Clearing cache -PREFERENCES_CLEARDLG_LINE2;This may take a few seconds. -PREFERENCES_CLEARDLG_TITLE;Please wait -PREFERENCES_CLIPPINGIND;Kırpma gösterme -PREFERENCES_CMETRICINTENT;Renkölçer -PREFERENCES_DATEFORMATHINT;You can use the following formatting strings:\n%y : year\n%m : month\n%d : day\n\nFor example, the hungarian date format is:\n%y/%m/%d -PREFERENCES_DATEFORMAT;Tarih biçimi -PREFERENCES_DEFAULTLANG;Varsayılan dil -PREFERENCES_DEFAULTTHEME;Default theme -PREFERENCES_DEMOSAICINGALGO;Demozaikleme algoritması -PREFERENCES_DIRHOME;Kullanıcı dizini -PREFERENCES_DIRLAST;Son gidilen dizin -PREFERENCES_DIROTHER;Diğer -PREFERENCES_DIRSELECTDLG;Başlangıç görüntü dizinini seç... -PREFERENCES_DIRSOFTWARE;Kurulum dizini -PREFERENCES_DMETHOD;Yöntem -PREFERENCES_EDITORCMDLINE;Other command line -PREFERENCES_EXTERNALEDITOR;External editor -PREFERENCES_FALSECOLOR;Hatalı-renk bastırma değerleri -PREFERENCES_FBROWSEROPTS;Dosya gezgini seçenekleri -PREFERENCES_FILEFORMAT;Dosya biçimi -PREFERENCES_FORIMAGE;Gürüntü dosyaları için -PREFERENCES_FORRAW;RAW dosyaları için -PREFERENCES_GIMPPATH;GIMP installation directory -PREFERENCES_GTKTHEME;GTK default -PREFERENCES_HINT;İpucu -PREFERENCES_HLTHRESHOLD;Kırpılmış parıltılar için eşik -PREFERENCES_ICCDIR;ICC profilleri dizini -PREFERENCES_IMPROCPARAMS;Varsayılan görüntü işleme değişkenleri -PREFERENCES_INTENT_ABSOLUTE;Mutlak -PREFERENCES_INTENT_PERCEPTUAL;Algısal -PREFERENCES_INTENT_RELATIVE;Bağıl -PREFERENCES_INTENT_SATURATION;Doyum -PREFERENCES_LIVETHUMBNAILS;Live Thumbnails (slower) -PREFERENCES_MONITORICC;Ekran profili -PREFERENCES_OUTDIR;Çıktı dizini -PREFERENCES_OUTDIRFOLDERHINT;Put the saved images to the seledted folder -PREFERENCES_OUTDIRFOLDER;Save to folder -PREFERENCES_OUTDIRHINT;You can use the following formatting strings:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nThese formatting strings refer to the directories and sub-paths of the path of the raw file.\n\nFor example, if /home/tom/image/02-09-2006/dsc0012.nefhas been opened, the meaning of the formatting strings are:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nIf you want to save the output image where the original is, write:\n%p1/%f\n\nIf you want to save the output image in a directory 'converted' located the directory of the original, write:\n%p1/converted/%f\n\nIf you want to save the output image in directory '/home/tom/converted' with keeping the same subdirectory of dates, write:\n%p2/converted/%d1/%f -PREFERENCES_OUTDIRTEMPLATEHINT;You can use the following formatting strings:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nThese formatting strings refer to the directories and sub-paths of the path of the raw file.\n\nFor example, if /home/tom/image/02-09-2006/dsc0012.nefhas been opened, the meaning of the formatting strings are:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nIf you want to save the output image where the original is, write:\n%p1/%f\n\nIf you want to save the output image in a directory 'converted' located the directory of the original, write:\n%p1/converted/%f\n\nIf you want to save the output image in directory '/home/tom/converted' with keeping the same subdirectory of dates, write:\n%p2/converted/%d1/%f -PREFERENCES_OUTDIRTEMPLATE;Use Template -PREFERENCES_PARSEDEXTADD;Add Extension -PREFERENCES_PARSEDEXTADDHINT;Type an extension and press this button to append list -PREFERENCES_PARSEDEXTDELHINT;Delete selected extension from the list -PREFERENCES_PARSEDEXT;Parsed Extensions -PREFERENCES_PROFILEHANDLING;Processing Profile Handling -PREFERENCES_PROFILELOADPR;Profile Loading Priority -PREFERENCES_PROFILEPRCACHE;Profile in Cache -PREFERENCES_PROFILEPRFILE;Profile Next to the Input File -PREFERENCES_PROFILESAVECACHE;Save Processing Parameters to the Cache -PREFERENCES_PROFILESAVEINPUT;Save Processing Parameters Next to the Input File -PREFERENCES_PSPATH;Adobe Photoshop installation directory -PREFERENCES_SELECTICCDIRDLG;ICC profil dizinini seç... -PREFERENCES_SELECTLANG;Dil seç -PREFERENCES_SELECTMONITORPROFDLG;Ekrana ait ICC profilini seç... -PREFERENCES_SELECTTHEME;Select theme -PREFERENCES_SHOWBASICEXIF;Temel exif bilgisini göster -PREFERENCES_SHOWDATETIME;Tarih ve saati göster -PREFERENCES_SHOWONLYRAW;Sadece RAW dosyalarını göster -PREFERENCES_SHTHRESHOLD;Kırpılmış karaltılar için eşik -PREFERENCES_STARTUPIMDIR;Başlangıç görüntü dizini -PREFERENCES_TAB_BROWSER;Dosya gezgini -PREFERENCES_TAB_COLORMGR;Renk yönetimi -PREFERENCES_TAB_GENERAL;Genel -PREFERENCES_TAB_IMPROC;Görüntü işleme -PREFERENCES_TAB_OUTPUT;Çıktı seçenekleri -PREFERENCES_THUMBSIZE;Küçük-resim boyutu -PROFILEPANEL_FILEDLGFILTERANY;Bütün dosyalar -PROFILEPANEL_FILEDLGFILTERPP;Art-işleme profilleri -PROFILEPANEL_LABEL;Art-işleme profilleri -PROFILEPANEL_LOADDLGLABEL;Art-işleme değişkenlerini yükle... -PROFILEPANEL_PCUSTOM;Özel -PROFILEPANEL_PFILE;Dosyadan -PROFILEPANEL_PLASTPHOTO;Son Fotoğraf -PROFILEPANEL_PLASTSAVED;Son kaydedilen -PROFILEPANEL_PROFILE;Profil -PROFILEPANEL_SAVEDLGLABEL;Art-işleme değişkenlerini kaydet... -PROFILEPANEL_TOOLTIPCOPY;Copy current profile to clipboard -PROFILEPANEL_TOOLTIPLOAD;Kayıtlı bir profil yükle -PROFILEPANEL_TOOLTIPPASTE; Paste profile from clipboard -PROFILEPANEL_TOOLTIPSAVE;Geçerli profili kaydet -PROGRESSBAR_DECODING;Raw dosyası açılıyor... -PROGRESSBAR_DEMOSAICING;Demozaikleniyor... -PROGRESSBAR_LOADING;Görüntü yükleniyor... -PROGRESSBAR_LOADJPEG;JPEG dosyası yükleniyor... -PROGRESSBAR_LOADPNG;PNG dosyası yükleniyor... -PROGRESSBAR_LOADTIFF;TIFF dosyası yükleniyor... -PROGRESSBAR_PROCESSING;Görüntü işleniyor... -PROGRESSBAR_READY;Hazır. -PROGRESSBAR_SAVEJPEG;JPEG dosyası kaydediliyor... -PROGRESSBAR_SAVEPNG;PNG dosyası kaydediliyor... -PROGRESSBAR_SAVETIFF;TIFF dosyası kaydediliyor... -PROGRESSDLG_LOADING;Loading file... -PROGRESSDLG_PROCESSING;Processing image... -PROGRESSDLG_SAVING;Saving file... -QINFO_FOCALLENGTH;Odak uzunluğu -QINFO_ISO;ISO -QINFO_LENS;Lens -QINFO_NOEXIF;Exif bilgisi yok. -SAVEDLG_FILEFORMAT;Dosya biçimi -SAVEDLG_JPEGQUAL;JPEG kalitesi -SAVEDLG_JPGFILTER;JPEG dosyaları -SAVEDLG_PNGCOMPR;PNG sıkıştırma düzeyi -SAVEDLG_PNGFILTER;PNG dosyaları -SAVEDLG_PUTTOQUEUEHEAD;Put to the head of the processing queue -SAVEDLG_PUTTOQUEUE;Put into processing queue -SAVEDLG_PUTTOQUEUETAIL;Put to the end of the processing queue -SAVEDLG_SAVEIMMEDIATELY;Save immediately -SAVEDLG_SAVESPP;İşeme değişkenlerini görüntü ile birlikte kaydet -SAVEDLG_TIFFFILTER;TIFF dosyaları -TOOLBAR_TOOLTIP_CROP;Seçimi kırp (shorcut key: C) -TOOLBAR_TOOLTIP_HAND;El aracı (shortcut key: N) -TOOLBAR_TOOLTIP_STRAIGHTEN;Düz çizgi seçimi (shortcut key: S) -TOOLBAR_TOOLTIP_WB;Nokta beyaz ayarı (shortcut key: W) -TP_CACORRECTION_BLUE;Mavi -TP_CACORRECTION_LABEL;Renk sapması düzeltme -TP_CACORRECTION_RED;Kırmızı -TP_CHMIXER_BLUE;Mavi -TP_CHMIXER_GREEN;Yeşil -TP_CHMIXER_LABEL;Kanal karıştırıcı -TP_CHMIXER_RED;Kırmızı -TP_COARSETRAF_DEGREE;açı: -TP_COARSETRAF_TOOLTIP_HFLIP;Yatayda çevir -TP_COARSETRAF_TOOLTIP_ROTLEFT;Sola döndür -TP_COARSETRAF_TOOLTIP_ROTRIGHT;Sağa döndür -TP_COARSETRAF_TOOLTIP_VFLIP;Dikeyde çevir -TP_COLORBOOST_ACHANNEL;"a" kanalı -TP_COLORBOOST_AMOUNT;Miktar -TP_COLORBOOST_AVOIDCOLORCLIP;Renk kırpılasını önle -TP_COLORBOOST_BCHANNEL;"b" kanalı -TP_COLORBOOST_CHAB;a ve b -TP_COLORBOOST_CHANNEL;Kanal -TP_COLORBOOST_CHSEPARATE;ayrık -TP_COLORBOOST_ENABLESATLIMITER;Doygunluk sınırlamayı etkinleştir -TP_COLORBOOST_LABEL;Renk iteleme -TP_COLORBOOST_SATLIMIT;Doygunluk sınırı -TP_COLORDENOISE_EDGESENSITIVE;Kenar duyarlı -TP_COLORDENOISE_EDGETOLERANCE;Kenar payı -TP_COLORDENOISE_LABEL;Renk gürültüsü azaltma -TP_COLORDENOISE_RADIUS;Çap -TP_COLORSHIFT_BLUEYELLOW;Mavi-sarı -TP_COLORSHIFT_GREENMAGENTA;Yeşil-macenta -TP_COLORSHIFT_LABEL;Renk kayması -TP_CROP_DPI;DPI= -TP_CROP_FIXRATIO;En-boy oranını düzelt: -TP_CROP_GTDIAGONALS;Çaprazlar kuralı -TP_CROP_GTHARMMEANS1;Harmonik ortalamalar 1 -TP_CROP_GTHARMMEANS2;Harmonik ortalamalar 2 -TP_CROP_GTHARMMEANS3;Harmonik ortalamalar 3 -TP_CROP_GTHARMMEANS4;Harmonik ortalamalar 4 -TP_CROP_GTNONE;Yok -TP_CROP_GTRULETHIRDS;Üçler kuralı -TP_CROP_GUIDETYPE;Kılavuz türü: -TP_CROP_H;Y -TP_CROP_LABEL;Kırp -TP_CROP_SELECTCROP; Kırpma alanı seç -TP_CROP_W;G -TP_CROP_X;x -TP_CROP_Y;y -TP_DISTORTION_AMOUNT;Miktar -TP_DISTORTION_LABEL;Bükme -TP_EXPOSURE_AUTOLEVELS;Otomatik seviyeler -TP_EXPOSURE_BLACKLEVEL;Siyah -TP_EXPOSURE_BRIGHTNESS;Parlaklık -TP_EXPOSURE_CLIP;Kırpma -TP_EXPOSURE_COMPRHIGHLIGHTS;Parıltı sıkıştırma -TP_EXPOSURE_COMPRSHADOWS;Karaltı sıkıştırma -TP_EXPOSURE_CONTRAST;Zıtlık -TP_EXPOSURE_CURVEEDITOR;Ton eğrisi -TP_EXPOSURE_EXPCOMP;Poz. telafisi -TP_EXPOSURE_LABEL;Pozlama -TP_HLREC_CIELAB;CIELab Blending -TP_HLREC_COLOR;Renk yayılımı -TP_HLREC_LABEL;Parıltı kurtarma -TP_HLREC_LUMINANCE;Aydınlık kurtarma -TP_HLREC_METHOD;Yöntem: -TP_ICM_FILEDLGFILTERANY;Bütün dosyalar -TP_ICM_FILEDLGFILTERICM;ICC profil dosyaları -TP_ICM_GAMMABEFOREINPUT;Profile applies Gamma -TP_ICM_INPUTCAMERA;Kamera varsayılanı -TP_ICM_INPUTCUSTOM;Özel -TP_ICM_INPUTDLGLABEL;Girdi ICC profilini seç... -TP_ICM_INPUTEMBEDDED;Mümkün olduğunda gömülü profili kullan -TP_ICM_INPUTPROFILE;Girdi Profili -TP_ICM_LABEL;ICM -TP_ICM_NOICM;No ICM: sRGB çıktı -TP_ICM_OUTPUTDLGLABEL;Çıktı ICC profilini seç... -TP_ICM_OUTPUTPROFILE;Çıktı profili -TP_ICM_SAVEREFERENCE;Save reference image for profiling -TP_ICM_WORKINGPROFILE;Çalışma profili -TP_LUMACURVE_BLACKLEVEL;Siyah -TP_LUMACURVE_BRIGHTNESS;Parlaklık -TP_LUMACURVE_COMPRHIGHLIGHTS;Parıltı sıkıştırma -TP_LUMACURVE_COMPRSHADOWS;Karaltı sıkıştırma -TP_LUMACURVE_CONTRAST;Zıtlık -TP_LUMACURVE_CURVEEDITOR;Aydınlık eğrisi -TP_LUMACURVE_LABEL;Aydınlık eğrisi -TP_LUMADENOISE_EDGETOLERANCE;Kenar payı -TP_LUMADENOISE_LABEL;Aydınlık gürültüsü azaltma -TP_LUMADENOISE_RADIUS;Çap -TP_RESIZE_BICUBIC;Bikübik -TP_RESIZE_BICUBICSF;Bikübik (yumuşak) -TP_RESIZE_BICUBICSH;Bikübik (keskin) -TP_RESIZE_BILINEAR;Çift-doğrusal -TP_RESIZE_FULLSIZE;Tam gürüntü boyutu: -TP_RESIZE_H;Y: -TP_RESIZE_LABEL;Boyutları değiştir -TP_RESIZE_METHOD;Yöntem: -TP_RESIZE_NEAREST;En yakın -TP_RESIZE_SCALE;Ölçekle -TP_RESIZE_W;G: -TP_ROTATE_AUTOCROP;Otomatik kırpma -TP_ROTATE_DEGREE;Açı -TP_ROTATE_FILL;Doldur -TP_ROTATE_LABEL;Döndür -TP_ROTATE_SELECTLINE; Düz çizgi seç -TP_SHADOWSHLIGHTS_HIGHLIGHTS;Parıltılar -TP_SHADOWSHLIGHTS_HLTONALW;Tonsal genişlik -TP_SHADOWSHLIGHTS_LABEL;Karaltılar/parıltılar -TP_SHADOWSHLIGHTS_LOCALCONTR;Bölgesel zıtlık -TP_SHADOWSHLIGHTS_RADIUS;Çap -TP_SHADOWSHLIGHTS_SHADOWS;Karaltılar -TP_SHADOWSHLIGHTS_SHTONALW;Tonsal genişlik -TP_SHARPENING_AMOUNT;Miktar -TP_SHARPENING_EDRADIUS;Çap -TP_SHARPENING_EDTOLERANCE;Kenar payı -TP_SHARPENING_HALOCONTROL;Hale denetimi -TP_SHARPENING_HCAMOUNT;Miktar -TP_SHARPENING_LABEL;Keskinleştirme -TP_SHARPENING_METHOD;Yöntem -TP_SHARPENING_ONLYEDGES;Sadece kenarları keskinleştir -TP_SHARPENING_RADIUS;Çap -TP_SHARPENING_RLD_AMOUNT;Miktar -TP_SHARPENING_RLD_DAMPING;Düşürme -TP_SHARPENING_RLD_ITERATIONS;Yineleme -TP_SHARPENING_RLD;R-L Ters evrişimi -TP_SHARPENING_THRESHOLD;Eşik -TP_SHARPENING_USM;Bulanıklık Maskesi -TP_VIGNETTING_AMOUNT;Miktar -TP_VIGNETTING_LABEL;Çerçeve etkisi giderme -TP_VIGNETTING_RADIUS;Çap -TP_WBALANCE_AUTO;Otomatik -TP_WBALANCE_CAMERA;Kamera -TP_WBALANCE_CUSTOM;Özel -TP_WBALANCE_GREEN;Tint -TP_WBALANCE_LABEL;Beyaz ayarı -TP_WBALANCE_METHOD;Yöntem -TP_WBALANCE_SIZE;Boyut: -TP_WBALANCE_SPOTWB;Spot BA -TP_WBALANCE_TEMPERATURE;Isı -ZOOMBAR_DETAIL;Detay -ZOOMBAR_HUGE;Devasa -ZOOMBAR_LARGE;Büyük -ZOOMBAR_NORMAL;Normal -ZOOMBAR_PREVIEW;Önizleme -ZOOMBAR_SCALE;Ölçek -ZOOMBAR_SMALL;Küçük - -GENERAL_HIGH_QUALITY;High Quality -GENERAL_UNCHANGED;(Unchanged) -MAIN_MSG_PLACES;Places -GENERAL_BEFORE;Before -GENERAL_AFTER;After -MAIN_TOOLTIP_TOGGLE;Toggle before/after view -MAIN_BUTTON_PUTTOQUEUE;Put to queue -MAIN_MSG_NAVIGATOR;Navigator -FILEBROWSER_TOOLTIP_STOPPROCESSING;Start processing automatically when a new job arrives -BATCHQUEUE_AUTOSTART;Auto start -TP_DETAIL_AMOUNT;Amount -TP_RESIZE_SPECIFY;Specify: -TP_RESIZE_SCALE;Scale -TP_RESIZE_WIDTH;Width -TP_RESIZE_HEIGHT;Height -MAIN_TOGGLE_BEFORE_AFTER;B|A - +# +# This file is part of RawTherapee. +# +# Copyright (c) 2004-2010 Gabor Horvath +# +# RawTherapee is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# RawTherapee is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with RawTherapee. If not, see . +# +# Turkish +# 2.3.2008 +# Oguz +ADJUSTER_RESET_TO_DEFAULT;Varsayılana dön +CURVEEDITOR_FILEDLGFILTERANY;Bütün dosyalar +CURVEEDITOR_FILEDLGFILTERCURVE;Eğri dosyaları +CURVEEDITOR_LINEAR;Doğrusal +CURVEEDITOR_LOADDLGLABEL;Eğriyi yükle... +CURVEEDITOR_SAVEDLGLABEL;Eğriyi kaydet... +CURVEEDITOR_TOOLTIPLINEAR;Eğriyi düzelt +CURVEEDITOR_TOOLTIPLOAD;Kayıtlı bir eğriyi yü +CURVEEDITOR_TOOLTIPSAVE;Kullanılan eğriyi kaydet +EXIFFILTER_APERTURE;Aperture +EXIFFILTER_CAMERA;Camera +EXIFFILTER_DIALOGLABEL;Exif Filter +EXIFFILTER_FOCALLEN;Focal Length +EXIFFILTER_ISO;ISO +EXIFFILTER_LENS;Lens +EXIFFILTER_SHUTTER;Shutter +EXIFPANEL_ADDEDIT;Add/Edit +EXIFPANEL_ADDEDITHINT;Add new tag or edit tag +EXIFPANEL_ADDTAGDLG_ENTERVALUE;Enter value +EXIFPANEL_ADDTAGDLG_SELECTTAG;Select tag +EXIFPANEL_ADDTAGDLG_TITLE;Add/Edit Tag +EXIFPANEL_KEEPHINT;Keep the selected tags when writing output file +EXIFPANEL_KEEP;Keep +EXIFPANEL_REMOVEHINT;Remove the selected tags when writing output file +EXIFPANEL_REMOVE;Remove +EXIFPANEL_RESETALLHINT;Reset all tags to their original values +EXIFPANEL_RESETALL;Reset All +EXIFPANEL_RESETHINT;Reset the selected tags to their original values +EXIFPANEL_RESET;Reset +EXIFPANEL_SUBDIRECTORY;Subdirectory +FILEBROWSER_APPLYPROFILE;Apply profile +FILEBROWSER_ARRANGEMENTHINT;Change between vertical/horizontal alignment of thumbnails +FILEBROWSER_CLEARPROFILE;Clear profile +FILEBROWSER_COPYPROFILE;Copy profile +FILEBROWSER_DELETEDLGLABEL;File delete confirmation +FILEBROWSER_DELETEDLGMSG;Are you sure you want to delete the selected %1 files? +FILEBROWSER_EMPTYTRASH;Empty Trash +FILEBROWSER_EMPTYTRASHHINT;Permanently delete the files of the trash +FILEBROWSER_EXIFFILTERAPPLY;Apply +FILEBROWSER_EXIFFILTERAPPLYHINT;Switch on/off exif filter of the file browser +FILEBROWSER_EXIFFILTERLABEL;Exif Filter +FILEBROWSER_EXIFFILTERSETTINGSHINT;Change settings of the exif filter +FILEBROWSER_EXIFFILTERSETTINGS;Setup +FILEBROWSER_PARTIALPASTEPROFILE;Partial paste +FILEBROWSER_PASTEPROFILE;Paste profile +FILEBROWSER_POPUPCANCELJOB;Cancel job +FILEBROWSER_POPUPMOVEEND;Move to end of queue +FILEBROWSER_POPUPMOVEHEAD;Move to head of queue +FILEBROWSER_POPUPOPEN;Open +FILEBROWSER_POPUPPROCESS;Put to processing queue +FILEBROWSER_POPUPRANK1;Rank 1 +FILEBROWSER_POPUPRANK2;Rank 2 +FILEBROWSER_POPUPRANK3;Rank 3 +FILEBROWSER_POPUPRANK4;Rank 4 +FILEBROWSER_POPUPRANK5;Rank 5 +FILEBROWSER_POPUPREMOVE;Remove from filesystem +FILEBROWSER_POPUPRENAME;Rename +FILEBROWSER_POPUPSELECTALL;Select all +FILEBROWSER_POPUPTRASH;Move to trash +FILEBROWSER_POPUPUNRANK;Unrank +FILEBROWSER_POPUPUNTRASH;Remove from trash +FILEBROWSER_PROCESSINGSETTINGSHINT;Set the file format and output directory +FILEBROWSER_PROCESSINGSETTINGS;Settings +FILEBROWSER_RENAMEDLGLABEL;Rename file +FILEBROWSER_RENAMEDLGMSG;Rename file "%1" to: +FILEBROWSER_SHOWDIRHINT;Show all images of the directory +FILEBROWSER_SHOWQUEUEHINT;Show content of the processing queue +FILEBROWSER_SHOWRANK1HINT;Show images ranked as 1 star +FILEBROWSER_SHOWRANK2HINT;Show images ranked as 2 star +FILEBROWSER_SHOWRANK3HINT;Show images ranked as 3 star +FILEBROWSER_SHOWRANK4HINT;Show images ranked as 4 star +FILEBROWSER_SHOWRANK5HINT;Show images ranked as 5 star +FILEBROWSER_SHOWTRASHHINT;Show content of the trash +FILEBROWSER_SHOWUNRANKHINT;Show unranked images +FILEBROWSER_STARTPROCESSINGHINT;Start processing/saving of images in the queue +FILEBROWSER_STARTPROCESSING;Start Processing +FILEBROWSER_STOPPROCESSINGHINT;Stop processing of images +FILEBROWSER_STOPPROCESSING;Stop processing +FILEBROWSER_THUMBSIZE;Thumb. size +FILEBROWSER_ZOOMINHINT;Increase thumbnail size +FILEBROWSER_ZOOMOUTHINT;Decrease thumbnail size +GENERAL_ABOUT;Hakkında +GENERAL_CANCEL;İptal +GENERAL_DISABLED;Devre dışı +GENERAL_DISABLE;Etkisizleştir +GENERAL_ENABLED;Etkin +GENERAL_ENABLE;Etkinleştir +GENERAL_LANDSCAPE;Yatay +GENERAL_LOAD;Yükle +GENERAL_NA;Uygun değil +GENERAL_NO;Hayır +GENERAL_OK;Tamam +GENERAL_PORTRAIT;Dikey +GENERAL_SAVE;Kaydet +GENERAL_YES;Evet +HISTOGRAM_LABEL;Histogram +HISTOGRAM_TOOLTIP_B;Mavi histogramını göster/gizle +HISTOGRAM_TOOLTIP_G;Yeşil histogramını göster/gizle +HISTOGRAM_TOOLTIP_L;CIELAB aydınlık histogramını göster/gizle +HISTOGRAM_TOOLTIP_R;Kırmızı histogramını göster/gizle +HISTORY_CHANGED;Changed +HISTORY_CUSTOMCURVE;Özel eğri +HISTORY_DELSNAPSHOT;Şipşağı sil +HISTORY_FROMCLIPBOARD;From clipboard +HISTORY_LABEL;Geçmiş +HISTORY_MSG_10;Karaltı sıkıştırma +HISTORY_MSG_11;Ton eğrisi +HISTORY_MSG_12;Otomatik pozlama +HISTORY_MSG_13;Pozlama kırpma +HISTORY_MSG_14;Aydınlık - parlaklık +HISTORY_MSG_15;Aydınlık - zıtlık +HISTORY_MSG_16;Aydınlık - siyah +HISTORY_MSG_17;Aydınlık - parıltı sıkıştırma +HISTORY_MSG_18;Aydınlık - karaltı sıkıştırma +HISTORY_MSG_19;Aydınlık eğrisi +HISTORY_MSG_1;Fotoğraf yüklendi +HISTORY_MSG_20;Keskinleştirme +HISTORY_MSG_21;Keskinleştirme - çap +HISTORY_MSG_22;Keskinleştirme - miktar +HISTORY_MSG_23;Keskinleştirme - eşik +HISTORY_MSG_24;Sadece kenarları keskinleştir +HISTORY_MSG_25;Keskinleştirme - kenar bulma kuralları +HISTORY_MSG_26;Keskinleştirme - kenar payı +HISTORY_MSG_27;Keskinleştirme - hale denetimi +HISTORY_MSG_28;Hale denetimi - miktar +HISTORY_MSG_29;Keskinleştirme - yöntem +HISTORY_MSG_2;Profil yüklendi +HISTORY_MSG_30;Ters evrişim - çap +HISTORY_MSG_31;Ters evrişim - miktar +HISTORY_MSG_32;Ters evrişim - düşürme +HISTORY_MSG_33;Ters evrişim - yineleme +HISTORY_MSG_34;Renk kırpmayı önle +HISTORY_MSG_35;Doygunluk kısıtlayıcı +HISTORY_MSG_36;Doygunluk sınırı +HISTORY_MSG_37;Renk iteleme +HISTORY_MSG_38;Beyaz ayarı - yöntem +HISTORY_MSG_39;Renk ısısı +HISTORY_MSG_3;Profil değişti +HISTORY_MSG_40;Beyaz ayarı - tint +HISTORY_MSG_41;"A" renk kayması +HISTORY_MSG_42;"B" kayması +HISTORY_MSG_43;Aydınlık gürültü giderme +HISTORY_MSG_44;Aydınlık gürültü giderme - çap +HISTORY_MSG_45;Aydınlık gürültü giderme - kenar payı +HISTORY_MSG_46;Renk gürültü giderme +HISTORY_MSG_47;Renk gürültü giderme - çap +HISTORY_MSG_48;Renk gürültü giderme - kenar payı +HISTORY_MSG_49;Kenar duyarlı renk gürültüsü giderme +HISTORY_MSG_4;Geçmişte gezinti +HISTORY_MSG_50;Karaltı/parıltı aracı +HISTORY_MSG_51;Parıltı iteleme +HISTORY_MSG_52;Karaltı iteleme +HISTORY_MSG_53;Parıltı - ton genişliği +HISTORY_MSG_54;Karaltı - ton genişliği +HISTORY_MSG_55;Bölgesel zıtlık +HISTORY_MSG_56;Karaltı/parıltı - zıtlık +HISTORY_MSG_57;Döndürme +HISTORY_MSG_58;Yatayda çevirme +HISTORY_MSG_59;Dikeyde çevirme +HISTORY_MSG_5;Parlaklık +HISTORY_MSG_60;Döndürme +HISTORY_MSG_61;Döndürme +HISTORY_MSG_62;Lens bükülmesi düzeltme +HISTORY_MSG_63;Yer imi seçildi +HISTORY_MSG_64;Fotoğrafı kırp +HISTORY_MSG_65;Renk kayması düzeltme +HISTORY_MSG_66;Parıltı kurtarma +HISTORY_MSG_67;Parıltı kurtarma - miktar +HISTORY_MSG_68;Parıltı kurtarma - yöntem +HISTORY_MSG_69;Çalışma renk uzayı +HISTORY_MSG_6;Zıtlık +HISTORY_MSG_70;Çıktı renk uzayı +HISTORY_MSG_71;Girdi renk uzayı +HISTORY_MSG_72;Çerçeve etkisi düzeltme +HISTORY_MSG_73;Kanal karıştırıcı +HISTORY_MSG_74;Yeniden boyutlandırma - ölçek +HISTORY_MSG_75;Yeniden boyutlandırma - yöntem +HISTORY_MSG_76;Exif Metadata +HISTORY_MSG_77;IPTC Metadata +HISTORY_MSG_78;Data specified for resize +HISTORY_MSG_79;Resize width +HISTORY_MSG_7;Siyah +HISTORY_MSG_80;Resize height +HISTORY_MSG_81;Resize enabled +HISTORY_MSG_8;Pozlama telafisi +HISTORY_MSG_9;Parıltı sıkıştırma +HISTORY_NEWSNAPSHOTAS;... olarak +HISTORY_NEWSNAPSHOT;Yeni şipşak +HISTORY_NEWSSDIALOGLABEL;Şipşak etiketi: +HISTORY_NEWSSDIALOGTITLE;Yeni şipşak ekle +HISTORY_SETTO;Belirle +HISTORY_SNAPSHOT;Şipşak +HISTORY_SNAPSHOTS;Şipşaklar +ICMPANEL_FILEDLGFILTERANY;Bütün dosyalar +ICMPANEL_FILEDLGFILTERICM;ICC profil dosyaları +ICMPANEL_GAMMABEFOREINPUT;Profile applies Gamma +ICMPANEL_INPUTCAMERA;Kamera varsayılanı +ICMPANEL_INPUTCUSTOM;Özel +ICMPANEL_INPUTDLGLABEL;Girdi ICC profilini seç... +ICMPANEL_INPUTEMBEDDED;Mümkün olduğunda gömülü profili kullan +ICMPANEL_INPUTPROFILE;Girdi Profili +ICMPANEL_NOICM;No ICM: sRGB çıktı +ICMPANEL_OUTPUTDLGLABEL;Çıktı ICC profilini seç... +ICMPANEL_OUTPUTPROFILE;Çıktı profili +ICMPANEL_SAVEREFERENCE;Save reference image for profiling +ICMPANEL_WORKINGPROFILE;Çalışma profili +IMAGEAREA_DETAILVIEW;Detay görünümü +IPTCPANEL_AUTHOR;Author +IPTCPANEL_AUTHORHINT;Name of the creator of the object, e.g. writer, photographer or graphic artist (By-line). +IPTCPANEL_AUTHORSPOSITION;Author's position +IPTCPANEL_AUTHORSPOSITIONHINT;Title of the creator or creators of the object (By-line Title). +IPTCPANEL_CAPTION;Caption +IPTCPANEL_CAPTIONHINT;A textual description of the data (Caption - Abstract). +IPTCPANEL_CAPTIONWRITER;Caption Writer +IPTCPANEL_CAPTIONWRITERHINT;The name of the person involved in the writing, editing or correcting the image or caption/abstract (Writer - Editor). +IPTCPANEL_CATEGORY;Category +IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider (Category). +IPTCPANEL_CITY;City +IPTCPANEL_CITYHINT;City of image origin (City). +IPTCPANEL_COPYHINT;Copy IPTC settings to clipboard +IPTCPANEL_COPYRIGHT;Copyright +IPTCPANEL_COPYRIGHTHINT;Any necessary copyright notice (Copyright Notice). +IPTCPANEL_COUNTRY;Country +IPTCPANEL_COUNTRYHINT;The name of the country/primary location where the image was created (Country - Primary Location Name). +IPTCPANEL_CREDIT;Credit +IPTCPANEL_CREDITHINT;Identifies the provider of the image, not necessarily the owner/creator (Credit). +IPTCPANEL_DATECREATED;Date Created +IPTCPANEL_DATECREATEDHINT;The date the intellectual content of the image was created; Format: JJJJMMTT (Date Created). +IPTCPANEL_EMBEDDED;Embedded +IPTCPANEL_EMBEDDEDHINT;Reset to IPTC data embedded in the image file +IPTCPANEL_HEADLINE;Headline +IPTCPANEL_HEADLINEHINT;A publishable entry providing a synopsis of the contents of the image (Headline). +IPTCPANEL_INSTRUCTIONSHINT;Other editorial instructions concerning the use of the image (Special Instructions). +IPTCPANEL_INSTRUCTIONS;Instructions +IPTCPANEL_KEYWORDSHINT;Used to indicate specific information retrieval words (Keywords). +IPTCPANEL_KEYWORDS;Keywords +IPTCPANEL_PASTEHINT;Paste IPTC settings from clipboard +IPTCPANEL_PROVINCEHINT;The Province/State where the image originates (Province-State). +IPTCPANEL_PROVINCE;Province +IPTCPANEL_RESETHINT;Reset to profile default +IPTCPANEL_RESET;Reset +IPTCPANEL_SOURCEHINT;The original owner of the intellectual content of the image (Source). +IPTCPANEL_SOURCE;Source +IPTCPANEL_SUPPCATEGORIESHINT;Further refines the subject of the image (Supplemental Categories). +IPTCPANEL_SUPPCATEGORIES;Suppl. Categories +IPTCPANEL_TITLEHINT;A shorthand reference for the image (Object Name). +IPTCPANEL_TITLE;Title +IPTCPANEL_TRANSREFERENCEHINT;A code representing the location of original transmission (Original Transmission Reference). +IPTCPANEL_TRANSREFERENCE;Trans. Reference +MAIN_BUTTON_EXIT;Exit +MAIN_BUTTON_PREFERENCES;Seçenekler +MAIN_BUTTON_QUEUE;Put to queue +MAIN_BUTTON_SAVEAS;... olarak +MAIN_BUTTON_SAVE;Görüntüyü kaydet +MAIN_BUTTON_SENDTOEDITOR;Send to editor +MAIN_FRAME_BATCHQUEUE;Batch Queue +MAIN_FRAME_FILEBROWSER;File Browser +MAIN_FRAME_PLACES_ADD;Add +MAIN_FRAME_PLACES_DEL;Del +MAIN_FRAME_PLACES;Places +MAIN_FRAME_RECENT;Recent Folders +MAIN_MSG_ALREADYEXISTS;Dosya zaten var. +MAIN_MSG_CANNOTLOAD;Görüntü yüklenemiyor +MAIN_MSG_CANNOTSAVE;Dosya kaydetmede hata +MAIN_MSG_CANNOTSTARTEDITOR;Can not start editor. +MAIN_MSG_CANNOTSTARTEDITOR_SECONDARY;Please set the correct path in the "Preferences" dialog. +MAIN_MSG_EXITJOBSINQUEUEINFO;Unprocessed images in the queue will be lost on exit. +MAIN_MSG_EXITJOBSINQUEUEQUEST;Are you sure you want to exit? There are unprocessed images waiting in the queue. +MAIN_MSG_JOBSINQUEUE;iş sırada +MAIN_MSG_QOVERWRITE;Üzerine yazmak ister misiniz? +MAIN_TAB_BASIC;Temel +MAIN_TAB_COLOR;Color +MAIN_TAB_DETAIL;Detail +MAIN_TAB_DEVELOP;Develop +MAIN_TAB_EXIF;Exif +MAIN_TAB_EXPOSURE;Exposure +MAIN_TAB_FILTER;Filter +MAIN_TAB_ICM;Renk yönetimi +MAIN_TAB_IPTC;IPTC +MAIN_TAB_METADATA;Metadata +MAIN_TAB_TAGGING;Tagging +MAIN_TAB_TRANSFORM;Dönüşüm +MAIN_TOOLTIP_HIDEFP;Alt tablayı göster/gizle (dizin ve dosya gezgni, shortcut key: F) +MAIN_TOOLTIP_HIDEHP;Sol tablayı göster/gizle (geçmiş ile birlikte, shortcut key: H) +MAIN_TOOLTIP_INDCLIPPEDH;Kırpılmış parıltı gösterme +MAIN_TOOLTIP_INDCLIPPEDS;Kırpılmış karaltı gösterme +MAIN_TOOLTIP_PREFERENCES;Seçenekleri belirle +MAIN_TOOLTIP_QINFO;Görüntü hakkında kısa bilgi +MAIN_TOOLTIP_SAVEAS;Görüntüyü seçili klasöre kaydet +MAIN_TOOLTIP_SAVE;Görüntüyü varsayılan klasöre kaydet +PARTIALPASTE_BASICGROUP;Basic settings +PARTIALPASTE_CACORRECTION;C/A correction +PARTIALPASTE_COARSETRANS;90 deg rotation / flipping +PARTIALPASTE_COLORBOOST;Color boost +PARTIALPASTE_COLORDENOISE;Color denoise +PARTIALPASTE_COLORGROUP;Color related settings +PARTIALPASTE_COLORMIXER;Color mixer +PARTIALPASTE_COLORSHIFT;Color shift +PARTIALPASTE_COMPOSITIONGROUP;Composition settings +PARTIALPASTE_CROP;Crop +PARTIALPASTE_DIALOGLABEL;Partial paste processing profile +PARTIALPASTE_DISTORTION;Distortion correction +PARTIALPASTE_EXIFCHANGES;Changes to exif data +PARTIALPASTE_EXPOSURE;Exposure +PARTIALPASTE_HLRECOVERY;Highlight recovery +PARTIALPASTE_ICMSETTINGS;ICM settings +PARTIALPASTE_IPTCINFO;IPTC info +PARTIALPASTE_LENSGROUP;Lens related settings +PARTIALPASTE_LUMACURVE;Luminance curve +PARTIALPASTE_LUMADENOISE;Luminance noise reduction +PARTIALPASTE_LUMINANCEGROUP;Luminance related settings +PARTIALPASTE_METAICMGROUP;Metadata/ICM settings +PARTIALPASTE_RESIZE;Resize +PARTIALPASTE_ROTATION;Rotation +PARTIALPASTE_SHADOWSHIGHLIGHTS;Shadows/Highlights +PARTIALPASTE_SHARPENING;Sharpening +PARTIALPASTE_VIGNETTING;Vignetting correction +PARTIALPASTE_WHITEBALANCE;White balance +PREFERENCES_APPLNEXTSTARTUP;Bir sonraki başlamada uygulacacak. +PREFERENCES_BLINKCLIPPED;Kırpılan alanlar yanıp-sönsün +PREFERENCES_CACHECLEARALL;Clear All +PREFERENCES_CACHECLEARPROFILES;Clear Profiles +PREFERENCES_CACHECLEARTHUMBS;Clear Thumbnails +PREFERENCES_CACHEFORMAT1;Proprietary (faster and better quality) +PREFERENCES_CACHEFORMAT2;JPEG (smaller disk footprint) +PREFERENCES_CACHEMAXENTRIES;Maximal Number of Cache Entries +PREFERENCES_CACHEOPTS;Cache Options +PREFERENCES_CACHESTRAT1;Prefer Speed to Low Memory Consumption +PREFERENCES_CACHESTRAT2;Prefer Low Memory Consumption to Speed +PREFERENCES_CACHESTRAT;Cache Strategy +PREFERENCES_CACHETHUMBFORM;Cache Thumbnail Format +PREFERENCES_CACHETHUMBHEIGHT;Maximal Thumbnail Height +PREFERENCES_CLEARDLG_LINE1;Clearing cache +PREFERENCES_CLEARDLG_LINE2;This may take a few seconds. +PREFERENCES_CLEARDLG_TITLE;Please wait +PREFERENCES_CLIPPINGIND;Kırpma gösterme +PREFERENCES_CMETRICINTENT;Renkölçer +PREFERENCES_DATEFORMATHINT;You can use the following formatting strings:\n%y : year\n%m : month\n%d : day\n\nFor example, the hungarian date format is:\n%y/%m/%d +PREFERENCES_DATEFORMAT;Tarih biçimi +PREFERENCES_DEFAULTLANG;Varsayılan dil +PREFERENCES_DEFAULTTHEME;Default theme +PREFERENCES_DEMOSAICINGALGO;Demozaikleme algoritması +PREFERENCES_DIRHOME;Kullanıcı dizini +PREFERENCES_DIRLAST;Son gidilen dizin +PREFERENCES_DIROTHER;Diğer +PREFERENCES_DIRSELECTDLG;Başlangıç görüntü dizinini seç... +PREFERENCES_DIRSOFTWARE;Kurulum dizini +PREFERENCES_DMETHOD;Yöntem +PREFERENCES_EDITORCMDLINE;Other command line +PREFERENCES_EXTERNALEDITOR;External editor +PREFERENCES_FALSECOLOR;Hatalı-renk bastırma değerleri +PREFERENCES_FBROWSEROPTS;Dosya gezgini seçenekleri +PREFERENCES_FILEFORMAT;Dosya biçimi +PREFERENCES_FORIMAGE;Gürüntü dosyaları için +PREFERENCES_FORRAW;RAW dosyaları için +PREFERENCES_GIMPPATH;GIMP installation directory +PREFERENCES_GTKTHEME;GTK default +PREFERENCES_HINT;İpucu +PREFERENCES_HLTHRESHOLD;Kırpılmış parıltılar için eşik +PREFERENCES_ICCDIR;ICC profilleri dizini +PREFERENCES_IMPROCPARAMS;Varsayılan görüntü işleme değişkenleri +PREFERENCES_INTENT_ABSOLUTE;Mutlak +PREFERENCES_INTENT_PERCEPTUAL;Algısal +PREFERENCES_INTENT_RELATIVE;Bağıl +PREFERENCES_INTENT_SATURATION;Doyum +PREFERENCES_LIVETHUMBNAILS;Live Thumbnails (slower) +PREFERENCES_MONITORICC;Ekran profili +PREFERENCES_OUTDIR;Çıktı dizini +PREFERENCES_OUTDIRFOLDERHINT;Put the saved images to the seledted folder +PREFERENCES_OUTDIRFOLDER;Save to folder +PREFERENCES_OUTDIRHINT;You can use the following formatting strings:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nThese formatting strings refer to the directories and sub-paths of the path of the raw file.\n\nFor example, if /home/tom/image/02-09-2006/dsc0012.nefhas been opened, the meaning of the formatting strings are:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nIf you want to save the output image where the original is, write:\n%p1/%f\n\nIf you want to save the output image in a directory 'converted' located the directory of the original, write:\n%p1/converted/%f\n\nIf you want to save the output image in directory '/home/tom/converted' with keeping the same subdirectory of dates, write:\n%p2/converted/%d1/%f +PREFERENCES_OUTDIRTEMPLATEHINT;You can use the following formatting strings:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\nThese formatting strings refer to the directories and sub-paths of the path of the raw file.\n\nFor example, if /home/tom/image/02-09-2006/dsc0012.nefhas been opened, the meaning of the formatting strings are:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\nIf you want to save the output image where the original is, write:\n%p1/%f\n\nIf you want to save the output image in a directory 'converted' located the directory of the original, write:\n%p1/converted/%f\n\nIf you want to save the output image in directory '/home/tom/converted' with keeping the same subdirectory of dates, write:\n%p2/converted/%d1/%f +PREFERENCES_OUTDIRTEMPLATE;Use Template +PREFERENCES_PARSEDEXTADD;Add Extension +PREFERENCES_PARSEDEXTADDHINT;Type an extension and press this button to append list +PREFERENCES_PARSEDEXTDELHINT;Delete selected extension from the list +PREFERENCES_PARSEDEXT;Parsed Extensions +PREFERENCES_PROFILEHANDLING;Processing Profile Handling +PREFERENCES_PROFILELOADPR;Profile Loading Priority +PREFERENCES_PROFILEPRCACHE;Profile in Cache +PREFERENCES_PROFILEPRFILE;Profile Next to the Input File +PREFERENCES_PROFILESAVECACHE;Save Processing Parameters to the Cache +PREFERENCES_PROFILESAVEINPUT;Save Processing Parameters Next to the Input File +PREFERENCES_PSPATH;Adobe Photoshop installation directory +PREFERENCES_SELECTICCDIRDLG;ICC profil dizinini seç... +PREFERENCES_SELECTLANG;Dil seç +PREFERENCES_SELECTMONITORPROFDLG;Ekrana ait ICC profilini seç... +PREFERENCES_SELECTTHEME;Select theme +PREFERENCES_SHOWBASICEXIF;Temel exif bilgisini göster +PREFERENCES_SHOWDATETIME;Tarih ve saati göster +PREFERENCES_SHOWONLYRAW;Sadece RAW dosyalarını göster +PREFERENCES_SHTHRESHOLD;Kırpılmış karaltılar için eşik +PREFERENCES_STARTUPIMDIR;Başlangıç görüntü dizini +PREFERENCES_TAB_BROWSER;Dosya gezgini +PREFERENCES_TAB_COLORMGR;Renk yönetimi +PREFERENCES_TAB_GENERAL;Genel +PREFERENCES_TAB_IMPROC;Görüntü işleme +PREFERENCES_TAB_OUTPUT;Çıktı seçenekleri +PREFERENCES_THUMBSIZE;Küçük-resim boyutu +PROFILEPANEL_FILEDLGFILTERANY;Bütün dosyalar +PROFILEPANEL_FILEDLGFILTERPP;Art-işleme profilleri +PROFILEPANEL_LABEL;Art-işleme profilleri +PROFILEPANEL_LOADDLGLABEL;Art-işleme değişkenlerini yükle... +PROFILEPANEL_PCUSTOM;Özel +PROFILEPANEL_PFILE;Dosyadan +PROFILEPANEL_PLASTPHOTO;Son Fotoğraf +PROFILEPANEL_PLASTSAVED;Son kaydedilen +PROFILEPANEL_PROFILE;Profil +PROFILEPANEL_SAVEDLGLABEL;Art-işleme değişkenlerini kaydet... +PROFILEPANEL_TOOLTIPCOPY;Copy current profile to clipboard +PROFILEPANEL_TOOLTIPLOAD;Kayıtlı bir profil yükle +PROFILEPANEL_TOOLTIPPASTE; Paste profile from clipboard +PROFILEPANEL_TOOLTIPSAVE;Geçerli profili kaydet +PROGRESSBAR_DECODING;Raw dosyası açılıyor... +PROGRESSBAR_DEMOSAICING;Demozaikleniyor... +PROGRESSBAR_LOADING;Görüntü yükleniyor... +PROGRESSBAR_LOADJPEG;JPEG dosyası yükleniyor... +PROGRESSBAR_LOADPNG;PNG dosyası yükleniyor... +PROGRESSBAR_LOADTIFF;TIFF dosyası yükleniyor... +PROGRESSBAR_PROCESSING;Görüntü işleniyor... +PROGRESSBAR_READY;Hazır. +PROGRESSBAR_SAVEJPEG;JPEG dosyası kaydediliyor... +PROGRESSBAR_SAVEPNG;PNG dosyası kaydediliyor... +PROGRESSBAR_SAVETIFF;TIFF dosyası kaydediliyor... +PROGRESSDLG_LOADING;Loading file... +PROGRESSDLG_PROCESSING;Processing image... +PROGRESSDLG_SAVING;Saving file... +QINFO_FOCALLENGTH;Odak uzunluğu +QINFO_ISO;ISO +QINFO_LENS;Lens +QINFO_NOEXIF;Exif bilgisi yok. +SAVEDLG_FILEFORMAT;Dosya biçimi +SAVEDLG_JPEGQUAL;JPEG kalitesi +SAVEDLG_JPGFILTER;JPEG dosyaları +SAVEDLG_PNGCOMPR;PNG sıkıştırma düzeyi +SAVEDLG_PNGFILTER;PNG dosyaları +SAVEDLG_PUTTOQUEUEHEAD;Put to the head of the processing queue +SAVEDLG_PUTTOQUEUE;Put into processing queue +SAVEDLG_PUTTOQUEUETAIL;Put to the end of the processing queue +SAVEDLG_SAVEIMMEDIATELY;Save immediately +SAVEDLG_SAVESPP;İşeme değişkenlerini görüntü ile birlikte kaydet +SAVEDLG_TIFFFILTER;TIFF dosyaları +TOOLBAR_TOOLTIP_CROP;Seçimi kırp (shorcut key: C) +TOOLBAR_TOOLTIP_HAND;El aracı (shortcut key: N) +TOOLBAR_TOOLTIP_STRAIGHTEN;Düz çizgi seçimi (shortcut key: S) +TOOLBAR_TOOLTIP_WB;Nokta beyaz ayarı (shortcut key: W) +TP_CACORRECTION_BLUE;Mavi +TP_CACORRECTION_LABEL;Renk sapması düzeltme +TP_CACORRECTION_RED;Kırmızı +TP_CHMIXER_BLUE;Mavi +TP_CHMIXER_GREEN;Yeşil +TP_CHMIXER_LABEL;Kanal karıştırıcı +TP_CHMIXER_RED;Kırmızı +TP_COARSETRAF_DEGREE;açı: +TP_COARSETRAF_TOOLTIP_HFLIP;Yatayda çevir +TP_COARSETRAF_TOOLTIP_ROTLEFT;Sola döndür +TP_COARSETRAF_TOOLTIP_ROTRIGHT;Sağa döndür +TP_COARSETRAF_TOOLTIP_VFLIP;Dikeyde çevir +TP_COLORBOOST_ACHANNEL;"a" kanalı +TP_COLORBOOST_AMOUNT;Miktar +TP_COLORBOOST_AVOIDCOLORCLIP;Renk kırpılasını önle +TP_COLORBOOST_BCHANNEL;"b" kanalı +TP_COLORBOOST_CHAB;a ve b +TP_COLORBOOST_CHANNEL;Kanal +TP_COLORBOOST_CHSEPARATE;ayrık +TP_COLORBOOST_ENABLESATLIMITER;Doygunluk sınırlamayı etkinleştir +TP_COLORBOOST_LABEL;Renk iteleme +TP_COLORBOOST_SATLIMIT;Doygunluk sınırı +TP_COLORDENOISE_EDGESENSITIVE;Kenar duyarlı +TP_COLORDENOISE_EDGETOLERANCE;Kenar payı +TP_COLORDENOISE_LABEL;Renk gürültüsü azaltma +TP_COLORDENOISE_RADIUS;Çap +TP_COLORSHIFT_BLUEYELLOW;Mavi-sarı +TP_COLORSHIFT_GREENMAGENTA;Yeşil-macenta +TP_COLORSHIFT_LABEL;Renk kayması +TP_CROP_DPI;DPI= +TP_CROP_FIXRATIO;En-boy oranını düzelt: +TP_CROP_GTDIAGONALS;Çaprazlar kuralı +TP_CROP_GTHARMMEANS1;Harmonik ortalamalar 1 +TP_CROP_GTHARMMEANS2;Harmonik ortalamalar 2 +TP_CROP_GTHARMMEANS3;Harmonik ortalamalar 3 +TP_CROP_GTHARMMEANS4;Harmonik ortalamalar 4 +TP_CROP_GTNONE;Yok +TP_CROP_GTRULETHIRDS;Üçler kuralı +TP_CROP_GUIDETYPE;Kılavuz türü: +TP_CROP_H;Y +TP_CROP_LABEL;Kırp +TP_CROP_SELECTCROP; Kırpma alanı seç +TP_CROP_W;G +TP_CROP_X;x +TP_CROP_Y;y +TP_DISTORTION_AMOUNT;Miktar +TP_DISTORTION_LABEL;Bükme +TP_EXPOSURE_AUTOLEVELS;Otomatik seviyeler +TP_EXPOSURE_BLACKLEVEL;Siyah +TP_EXPOSURE_BRIGHTNESS;Parlaklık +TP_EXPOSURE_CLIP;Kırpma +TP_EXPOSURE_COMPRHIGHLIGHTS;Parıltı sıkıştırma +TP_EXPOSURE_COMPRSHADOWS;Karaltı sıkıştırma +TP_EXPOSURE_CONTRAST;Zıtlık +TP_EXPOSURE_CURVEEDITOR;Ton eğrisi +TP_EXPOSURE_EXPCOMP;Poz. telafisi +TP_EXPOSURE_LABEL;Pozlama +TP_HLREC_CIELAB;CIELab Blending +TP_HLREC_COLOR;Renk yayılımı +TP_HLREC_LABEL;Parıltı kurtarma +TP_HLREC_LUMINANCE;Aydınlık kurtarma +TP_HLREC_METHOD;Yöntem: +TP_ICM_FILEDLGFILTERANY;Bütün dosyalar +TP_ICM_FILEDLGFILTERICM;ICC profil dosyaları +TP_ICM_GAMMABEFOREINPUT;Profile applies Gamma +TP_ICM_INPUTCAMERA;Kamera varsayılanı +TP_ICM_INPUTCUSTOM;Özel +TP_ICM_INPUTDLGLABEL;Girdi ICC profilini seç... +TP_ICM_INPUTEMBEDDED;Mümkün olduğunda gömülü profili kullan +TP_ICM_INPUTPROFILE;Girdi Profili +TP_ICM_LABEL;ICM +TP_ICM_NOICM;No ICM: sRGB çıktı +TP_ICM_OUTPUTDLGLABEL;Çıktı ICC profilini seç... +TP_ICM_OUTPUTPROFILE;Çıktı profili +TP_ICM_SAVEREFERENCE;Save reference image for profiling +TP_ICM_WORKINGPROFILE;Çalışma profili +TP_LUMACURVE_BLACKLEVEL;Siyah +TP_LUMACURVE_BRIGHTNESS;Parlaklık +TP_LUMACURVE_COMPRHIGHLIGHTS;Parıltı sıkıştırma +TP_LUMACURVE_COMPRSHADOWS;Karaltı sıkıştırma +TP_LUMACURVE_CONTRAST;Zıtlık +TP_LUMACURVE_CURVEEDITOR;Aydınlık eğrisi +TP_LUMACURVE_LABEL;Aydınlık eğrisi +TP_LUMADENOISE_EDGETOLERANCE;Kenar payı +TP_LUMADENOISE_LABEL;Aydınlık gürültüsü azaltma +TP_LUMADENOISE_RADIUS;Çap +TP_RESIZE_BICUBIC;Bikübik +TP_RESIZE_BICUBICSF;Bikübik (yumuşak) +TP_RESIZE_BICUBICSH;Bikübik (keskin) +TP_RESIZE_BILINEAR;Çift-doğrusal +TP_RESIZE_FULLSIZE;Tam gürüntü boyutu: +TP_RESIZE_H;Y: +TP_RESIZE_LABEL;Boyutları değiştir +TP_RESIZE_METHOD;Yöntem: +TP_RESIZE_NEAREST;En yakın +TP_RESIZE_SCALE;Ölçekle +TP_RESIZE_W;G: +TP_ROTATE_AUTOCROP;Otomatik kırpma +TP_ROTATE_DEGREE;Açı +TP_ROTATE_FILL;Doldur +TP_ROTATE_LABEL;Döndür +TP_ROTATE_SELECTLINE; Düz çizgi seç +TP_SHADOWSHLIGHTS_HIGHLIGHTS;Parıltılar +TP_SHADOWSHLIGHTS_HLTONALW;Tonsal genişlik +TP_SHADOWSHLIGHTS_LABEL;Karaltılar/parıltılar +TP_SHADOWSHLIGHTS_LOCALCONTR;Bölgesel zıtlık +TP_SHADOWSHLIGHTS_RADIUS;Çap +TP_SHADOWSHLIGHTS_SHADOWS;Karaltılar +TP_SHADOWSHLIGHTS_SHTONALW;Tonsal genişlik +TP_SHARPENING_AMOUNT;Miktar +TP_SHARPENING_EDRADIUS;Çap +TP_SHARPENING_EDTOLERANCE;Kenar payı +TP_SHARPENING_HALOCONTROL;Hale denetimi +TP_SHARPENING_HCAMOUNT;Miktar +TP_SHARPENING_LABEL;Keskinleştirme +TP_SHARPENING_METHOD;Yöntem +TP_SHARPENING_ONLYEDGES;Sadece kenarları keskinleştir +TP_SHARPENING_RADIUS;Çap +TP_SHARPENING_RLD_AMOUNT;Miktar +TP_SHARPENING_RLD_DAMPING;Düşürme +TP_SHARPENING_RLD_ITERATIONS;Yineleme +TP_SHARPENING_RLD;R-L Ters evrişimi +TP_SHARPENING_THRESHOLD;Eşik +TP_SHARPENING_USM;Bulanıklık Maskesi +TP_VIGNETTING_AMOUNT;Miktar +TP_VIGNETTING_LABEL;Çerçeve etkisi giderme +TP_VIGNETTING_RADIUS;Çap +TP_WBALANCE_AUTO;Otomatik +TP_WBALANCE_CAMERA;Kamera +TP_WBALANCE_CUSTOM;Özel +TP_WBALANCE_GREEN;Tint +TP_WBALANCE_LABEL;Beyaz ayarı +TP_WBALANCE_METHOD;Yöntem +TP_WBALANCE_SIZE;Boyut: +TP_WBALANCE_SPOTWB;Spot BA +TP_WBALANCE_TEMPERATURE;Isı +ZOOMBAR_DETAIL;Detay +ZOOMBAR_HUGE;Devasa +ZOOMBAR_LARGE;Büyük +ZOOMBAR_NORMAL;Normal +ZOOMBAR_PREVIEW;Önizleme +ZOOMBAR_SCALE;Ölçek +ZOOMBAR_SMALL;Küçük + +GENERAL_HIGH_QUALITY;High Quality +GENERAL_UNCHANGED;(Unchanged) +MAIN_MSG_PLACES;Places +GENERAL_BEFORE;Before +GENERAL_AFTER;After +MAIN_TOOLTIP_TOGGLE;Toggle before/after view +MAIN_BUTTON_PUTTOQUEUE;Put to queue +MAIN_MSG_NAVIGATOR;Navigator +FILEBROWSER_TOOLTIP_STOPPROCESSING;Start processing automatically when a new job arrives +BATCHQUEUE_AUTOSTART;Auto start +TP_DETAIL_AMOUNT;Amount +TP_RESIZE_SPECIFY;Specify: +TP_RESIZE_SCALE;Scale +TP_RESIZE_WIDTH;Width +TP_RESIZE_HEIGHT;Height +MAIN_TOGGLE_BEFORE_AFTER;B|A + ### diff --git a/rtengine/alignedbuffer.h b/rtengine/alignedbuffer.h index 4eabe5665..360507b42 100644 --- a/rtengine/alignedbuffer.h +++ b/rtengine/alignedbuffer.h @@ -1,31 +1,31 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _ALIGNEDBUFFER_ #define _ALIGNEDBUFFER_ template class AlignedBuffer { private: - T* real ; - + T* real ; + public: - T* data ; + T* data ; AlignedBuffer (int size, int align=16) { real = new T[size+2*align]; diff --git a/rtengine/bilateral2.cc b/rtengine/bilateral2.cc index 956f661e4..7ead1c616 100644 --- a/rtengine/bilateral2.cc +++ b/rtengine/bilateral2.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include void bilateral_unsigned (unsigned short** src, unsigned short** dst, unsigned short** buffer, Dim dim, double sigma, double sens) { diff --git a/rtengine/bilateral2.h b/rtengine/bilateral2.h index a4fa0d55e..531c248cc 100644 --- a/rtengine/bilateral2.h +++ b/rtengine/bilateral2.h @@ -1,48 +1,48 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _BILATERAL2_ #define _BILATERAL2_ -#include -#include -#include +#include +#include +#include #include #include #include #include -#define ELEM(a,b) (src[i - a][j - b] * ec[src[i - a][j - b]-src[i][j]+0x10000]) +#define ELEM(a,b) (src[i - a][j - b] * ec[src[i - a][j - b]-src[i][j]+0x10000]) #define SULY(a,b) (ec[src[i - a][j - b]-src[i][j]+0x10000]) #define BL_BEGIN(a,b) double scale = (a); \ - int* ec = new int [0x20000]; \ - for (int i=0; i<0x20000; i++) \ - ec[i] = (int)(exp(-(double)(i-0x10000)*(double)(i-0x10000) / (2.0*sens*sens))*scale); \ + int* ec = new int [0x20000]; \ + for (int i=0; i<0x20000; i++) \ + ec[i] = (int)(exp(-(double)(i-0x10000)*(double)(i-0x10000) / (2.0*sens*sens))*scale); \ int start = row_from; \ if (start<(b)) start = (b); \ int end = row_to; \ if (end>H-(b)) end = H-(b); \ - for (int i=start; i=end || j>=W-(b)) \ dst[i][j] = src[i][j]; \ @@ -55,18 +55,18 @@ v /= a11*SULY(-1,-1) + a12*SULY(-1,0) + a11*SULY(-1,1) + \ a21*SULY(0,-1) + a22*SULY(0,0) + a21*SULY(0,1) + \ a11*SULY(1,-1) + a12*SULY(1,0) + a11*SULY(1,1); - -#define BL_OPER5(a11,a12,a13,a21,a22,a23,a31,a32,a33) A v = a11*ELEM(-2,-2) + a12*ELEM(-2,-1) + a13*ELEM(-2,0) + a12*ELEM(-2,1) + a11*ELEM(-2,2) + \ + +#define BL_OPER5(a11,a12,a13,a21,a22,a23,a31,a32,a33) A v = a11*ELEM(-2,-2) + a12*ELEM(-2,-1) + a13*ELEM(-2,0) + a12*ELEM(-2,1) + a11*ELEM(-2,2) + \ a21*ELEM(-1,-2) + a22*ELEM(-1,-1) + a23*ELEM(-1,0) + a22*ELEM(-1,1) + a21*ELEM(-1,2) + \ a31*ELEM(0,-2) + a32*ELEM(0,-1) + a33*ELEM(0,0) + a32*ELEM(0,1) + a31*ELEM(0,2) + \ a21*ELEM(1,-2) + a22*ELEM(1,-1) + a23*ELEM(1,0) + a22*ELEM(1,1) + a21*ELEM(1,2) + \ a11*ELEM(2,-2) + a12*ELEM(2,-1) + a13*ELEM(2,0) + a12*ELEM(2,1) + a11*ELEM(2,2); \ - v /= a11*SULY(-2,-2) + a12*SULY(-2,-1) + a13*SULY(-2,0) + a12*SULY(-2,1) + a11*SULY(-2,2) + \ + v /= a11*SULY(-2,-2) + a12*SULY(-2,-1) + a13*SULY(-2,0) + a12*SULY(-2,1) + a11*SULY(-2,2) + \ a21*SULY(-1,-2) + a22*SULY(-1,-1) + a23*SULY(-1,0) + a22*SULY(-1,1) + a21*SULY(-1,2) + \ a31*SULY(0,-2) + a32*SULY(0,-1) + a33*SULY(0,0) + a32*SULY(0,1) + a31*SULY(0,2) + \ a21*SULY(1,-2) + a22*SULY(1,-1) + a23*SULY(1,0) + a22*SULY(1,1) + a21*SULY(1,2) + \ - a11*SULY(2,-2) + a12*SULY(2,-1) + a13*SULY(2,0) + a12*SULY(2,1) + a11*SULY(2,2); + a11*SULY(2,-2) + a12*SULY(2,-1) + a13*SULY(2,0) + a12*SULY(2,1) + a11*SULY(2,2); #define BL_OPER7(a11,a12,a13,a14,a21,a22,a23,a24,a31,a32,a33,a34,a41,a42,a43,a44) \ A v = a11*ELEM(-3,-3) + a12*ELEM(-3,-2) + a13*ELEM(-3,-1) + a14*ELEM(-3,0) + a13*ELEM(-3,1) + a12*ELEM(-3,2) + a11*ELEM(-3,3) + \ @@ -83,7 +83,7 @@ a31*SULY(1,-3) + a32*SULY(1,-2) + a33*SULY(1,-1) + a34*SULY(1,0) + a33*SULY(1,1) + a32*SULY(1,2) + a31*SULY(1,3) + \ a21*SULY(2,-3) + a22*SULY(2,-2) + a23*SULY(2,-1) + a24*SULY(2,0) + a23*SULY(2,1) + a22*SULY(2,2) + a21*SULY(2,3) + \ a11*SULY(3,-3) + a12*SULY(3,-2) + a13*SULY(3,-1) + a14*SULY(3,0) + a13*SULY(3,1) + a12*SULY(3,2) + a11*SULY(3,3); - + #define BL_OPER9(a11,a12,a13,a14,a15,a21,a22,a23,a24,a25,a31,a32,a33,a34,a35,a41,a42,a43,a44,a45,a51,a52,a53,a54,a55) \ A v = a11*ELEM(-4,-4) + a12*ELEM(-4,-3) + a13*ELEM(-4,-2) + a14*ELEM(-4,-1) + a15*ELEM(-4,0) + a14*ELEM(-4,1) + a13*ELEM(-4,2) + a12*ELEM(-4,3) + a11*ELEM(-4,4) + \ @@ -192,7 +192,7 @@ template void bilateral12 (T** src, T** dst, T** buffer, int W BL_BEGIN(322,3) BL_OPER7(0,0,1,1,0,1,4,6,1,4,11,16,1,6,16,23) BL_END(3) -} +} // sigma = 1.3 template void bilateral13 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { @@ -217,7 +217,7 @@ template void bilateral15 (T** src, T** dst, T** buffer, int W BL_OPER9(0,0,0,1,1,0,1,2,4,5,0,2,6,12,14,1,4,12,22,28,1,5,14,28,35) BL_END(4) } - + // sigma = 1.6 template void bilateral16 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { @@ -233,7 +233,7 @@ template void bilateral17 (T** src, T** dst, T** buffer, int W BL_OPER9(0,0,1,1,1,0,1,2,3,4,1,2,5,8,9,1,3,8,13,16,1,4,9,16,19) BL_END(4) } - + // sigma = 1.8 template void bilateral18 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { @@ -250,53 +250,53 @@ template void bilateral19 (T** src, T** dst, T** buffer, int W BL_END(4) } -// sigma = 2 -template void bilateral20 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { +// sigma = 2 +template void bilateral20 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { BL_BEGIN(116,5) BL_OPER11(0,0,0,1,1,1,0,0,1,2,3,3,0,1,2,4,7,7,1,2,4,8,12,14,1,3,7,12,18,20,1,3,7,14,20,23) BL_END(5) -} - -// sigma = 2.1 -template void bilateral21 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { +} + +// sigma = 2.1 +template void bilateral21 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { BL_BEGIN(127,5) BL_OPER11(0,0,0,1,1,1,0,0,1,2,3,3,0,1,2,4,6,7,1,2,4,8,11,12,1,3,6,11,15,17,1,3,7,12,17,19) BL_END(5) -} +} -// sigma = 2.2 -template void bilateral22 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { +// sigma = 2.2 +template void bilateral22 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { BL_BEGIN(109,5) BL_OPER11(0,0,0,1,1,2,0,1,2,3,3,4,1,2,3,5,7,8,1,3,5,9,12,13,1,3,7,12,16,18,2,4,8,13,18,20) BL_END(5) } -// sigma = 2.3 -template void bilateral23 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { +// sigma = 2.3 +template void bilateral23 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { BL_BEGIN(132,5) BL_OPER11(0,0,1,1,1,1,0,1,1,2,3,3,1,1,3,5,6,7,1,2,5,7,10,11,1,3,6,10,13,14,1,3,7,11,14,16) BL_END(5) } -// sigma = 2.4 -template void bilateral24 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { +// sigma = 2.4 +template void bilateral24 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { BL_BEGIN(156,5) BL_OPER11(0,0,1,1,1,1,0,1,1,2,3,3,1,1,3,4,5,6,1,2,4,6,8,9,1,3,5,8,10,11,1,3,6,9,11,12) BL_END(5) } -// sigma = 2.5 -template void bilateral25 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { +// sigma = 2.5 +template void bilateral25 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { BL_BEGIN(173,5) BL_OPER11(0,0,1,1,1,1,0,1,1,2,3,3,1,1,2,4,5,5,1,2,4,5,7,7,1,3,5,7,9,9,1,3,5,7,9,10) BL_END(5) -} +} class Dim { @@ -368,59 +368,59 @@ void bilateral_unsigned (unsigned short** src, unsigned short** dst, unsigned sh void bilateral_signed (short** src, short** dst, short** buffer, Dim dim, double sigma, double sens); /* -template void bilateral (T** src, int** dst, int W, int H, int sigmar, double sigmas) { - - time_t t1 = clock (); - - int r = 2.0*sigmas + 0.5; - - double scaleg = 1024.0; - - double MAXINT = 65536.0*65536.0; - double sgmax = 275000/(MAXINT/2.0/sigmar/sigmar+(r+1)*(r+1)/sigmas/sigmas); - printf ("sgmax = %lf\n", sgmax); - if (scaleg>sgmax) - scaleg = sgmax; - - // kernel vector for the spatial gaussian filter * 1024 - int* kernel = new int[1+2*r]; - for (int i=0; i<2*r+1; i++) { - kernel[i] = scaleg / (2.0*sigmas*sigmas) * (i-r)*(i-r) + 0.25; - printf ("kerneli = %d\n", kernel[i]); - } - - // exponential lookup table - int scale = (2.0*sigmar*sigmar) / scaleg; - int scalem = 65535/((1+2*r)*(1+2*r)); - int ec[256000]; - for (int i=0; i<256000; i++) - ec[i] = exp (-i/scaleg) * scalem; - - for (int i=r; i void bilateral (T** src, int** dst, int W, int H, int sigmar, double sigmas) { + + time_t t1 = clock (); + + int r = 2.0*sigmas + 0.5; + + double scaleg = 1024.0; + + double MAXINT = 65536.0*65536.0; + double sgmax = 275000/(MAXINT/2.0/sigmar/sigmar+(r+1)*(r+1)/sigmas/sigmas); + printf ("sgmax = %lf\n", sgmax); + if (scaleg>sgmax) + scaleg = sgmax; + + // kernel vector for the spatial gaussian filter * 1024 + int* kernel = new int[1+2*r]; + for (int i=0; i<2*r+1; i++) { + kernel[i] = scaleg / (2.0*sigmas*sigmas) * (i-r)*(i-r) + 0.25; + printf ("kerneli = %d\n", kernel[i]); + } + + // exponential lookup table + int scale = (2.0*sigmar*sigmar) / scaleg; + int scalem = 65535/((1+2*r)*(1+2*r)); + int ec[256000]; + for (int i=0; i<256000; i++) + ec[i] = exp (-i/scaleg) * scalem; + + for (int i=r; i - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include #define MAXVAL 0xffff #define CLIP(a) ((a)>0?((a)>8)+1)<<8) / ((src[i][j]>>8)+1)]) -//#define ELEM(a,b) (src[i-a][j-b] * ec[src[i-a][j-b]-src[i][j]+0x10000]) +#define ELEM(a,b) (src[i-a][j-b] * ec[(((src[i-a][j-b]>>8)+1)<<8) / ((src[i][j]>>8)+1)]) +//#define ELEM(a,b) (src[i-a][j-b] * ec[src[i-a][j-b]-src[i][j]+0x10000]) //#define SULY(a,b) (ec[src[i-a][j-b]-src[i][j]+0x10000]) #define SULY(a,b) (ec[(((src[i-a][j-b]>>8)+1)<<8) / ((src[i][j]>>8)+1)]) @@ -31,17 +31,17 @@ int* ec = new int [0x10001]; \ ec[0] = 1; \ for (int i=1; i<0x10001; i++) \ - ec[i] = (int)(exp(-log(i/256.0)*log(i/256.0) / (2.0*sens/1000*sens/1000*i/256.0))*scale); \ + ec[i] = (int)(exp(-log(i/256.0)*log(i/256.0) / (2.0*sens/1000*sens/1000*i/256.0))*scale); \ /* ec[i] = (int)(exp(-(double)(i-0x10000)*(double)(i-0x10000) / (2.0*sens*sens))*scale); */\ int start = row_from; \ if (start<(b)) start = (b); \ int end = row_to; \ if (end>H-(b)) end = H-(b); \ - for (int i=start; i=end || j>=W-(b)) \ dst[i][j] = src[i][j]; \ @@ -54,18 +54,18 @@ v /= a11*SULY(-1,-1) + a12*SULY(-1,0) + a11*SULY(-1,1) + \ a21*SULY(0,-1) + a22*SULY(0,0) + a21*SULY(0,1) + \ a11*SULY(1,-1) + a12*SULY(1,0) + a11*SULY(1,1); - -#define BL_OPER5(a11,a12,a13,a21,a22,a23,a31,a32,a33) A v = a11*ELEM(-2,-2) + a12*ELEM(-2,-1) + a13*ELEM(-2,0) + a12*ELEM(-2,1) + a11*ELEM(-2,2) + \ + +#define BL_OPER5(a11,a12,a13,a21,a22,a23,a31,a32,a33) A v = a11*ELEM(-2,-2) + a12*ELEM(-2,-1) + a13*ELEM(-2,0) + a12*ELEM(-2,1) + a11*ELEM(-2,2) + \ a21*ELEM(-1,-2) + a22*ELEM(-1,-1) + a23*ELEM(-1,0) + a22*ELEM(-1,1) + a21*ELEM(-1,2) + \ a31*ELEM(0,-2) + a32*ELEM(0,-1) + a33*ELEM(0,0) + a32*ELEM(0,1) + a31*ELEM(0,2) + \ a21*ELEM(1,-2) + a22*ELEM(1,-1) + a23*ELEM(1,0) + a22*ELEM(1,1) + a21*ELEM(1,2) + \ a11*ELEM(2,-2) + a12*ELEM(2,-1) + a13*ELEM(2,0) + a12*ELEM(2,1) + a11*ELEM(2,2); \ - v /= a11*SULY(-2,-2) + a12*SULY(-2,-1) + a13*SULY(-2,0) + a12*SULY(-2,1) + a11*SULY(-2,2) + \ + v /= a11*SULY(-2,-2) + a12*SULY(-2,-1) + a13*SULY(-2,0) + a12*SULY(-2,1) + a11*SULY(-2,2) + \ a21*SULY(-1,-2) + a22*SULY(-1,-1) + a23*SULY(-1,0) + a22*SULY(-1,1) + a21*SULY(-1,2) + \ a31*SULY(0,-2) + a32*SULY(0,-1) + a33*SULY(0,0) + a32*SULY(0,1) + a31*SULY(0,2) + \ a21*SULY(1,-2) + a22*SULY(1,-1) + a23*SULY(1,0) + a22*SULY(1,1) + a21*SULY(1,2) + \ - a11*SULY(2,-2) + a12*SULY(2,-1) + a13*SULY(2,0) + a12*SULY(2,1) + a11*SULY(2,2); + a11*SULY(2,-2) + a12*SULY(2,-1) + a13*SULY(2,0) + a12*SULY(2,1) + a11*SULY(2,2); #define BL_OPER7(a11,a12,a13,a14,a21,a22,a23,a24,a31,a32,a33,a34,a41,a42,a43,a44) \ A v = a11*ELEM(-3,-3) + a12*ELEM(-3,-2) + a13*ELEM(-3,-1) + a14*ELEM(-3,0) + a13*ELEM(-3,1) + a12*ELEM(-3,2) + a11*ELEM(-3,3) + \ @@ -82,7 +82,7 @@ a31*SULY(1,-3) + a32*SULY(1,-2) + a33*SULY(1,-1) + a34*SULY(1,0) + a33*SULY(1,1) + a32*SULY(1,2) + a31*SULY(1,3) + \ a21*SULY(2,-3) + a22*SULY(2,-2) + a23*SULY(2,-1) + a24*SULY(2,0) + a23*SULY(2,1) + a22*SULY(2,2) + a21*SULY(2,3) + \ a11*SULY(3,-3) + a12*SULY(3,-2) + a13*SULY(3,-1) + a14*SULY(3,0) + a13*SULY(3,1) + a12*SULY(3,2) + a11*SULY(3,3); - + #define BL_OPER9(a11,a12,a13,a14,a15,a21,a22,a23,a24,a25,a31,a32,a33,a34,a35,a41,a42,a43,a44,a45,a51,a52,a53,a54,a55) \ A v = a11*ELEM(-4,-4) + a12*ELEM(-4,-3) + a13*ELEM(-4,-2) + a14*ELEM(-4,-1) + a15*ELEM(-4,0) + a14*ELEM(-4,1) + a13*ELEM(-4,2) + a12*ELEM(-4,3) + a11*ELEM(-4,4) + \ @@ -191,7 +191,7 @@ template void bilateral12 (T** src, T** dst, T** buffer, int W BL_BEGIN(322,3) BL_OPER7(0,0,1,1,0,1,4,6,1,4,11,16,1,6,16,23) BL_END(3) -} +} // sigma = 1.3 template void bilateral13 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { @@ -216,7 +216,7 @@ template void bilateral15 (T** src, T** dst, T** buffer, int W BL_OPER9(0,0,0,1,1,0,1,2,4,5,0,2,6,12,14,1,4,12,22,28,1,5,14,28,35) BL_END(4) } - + // sigma = 1.6 template void bilateral16 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { @@ -232,7 +232,7 @@ template void bilateral17 (T** src, T** dst, T** buffer, int W BL_OPER9(0,0,1,1,1,0,1,2,3,4,1,2,5,8,9,1,3,8,13,16,1,4,9,16,19) BL_END(4) } - + // sigma = 1.8 template void bilateral18 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { @@ -249,53 +249,53 @@ template void bilateral19 (T** src, T** dst, T** buffer, int W BL_END(4) } -// sigma = 2 -template void bilateral20 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { +// sigma = 2 +template void bilateral20 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { BL_BEGIN(116,5) BL_OPER11(0,0,0,1,1,1,0,0,1,2,3,3,0,1,2,4,7,7,1,2,4,8,12,14,1,3,7,12,18,20,1,3,7,14,20,23) BL_END(5) -} - -// sigma = 2.1 -template void bilateral21 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { +} + +// sigma = 2.1 +template void bilateral21 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { BL_BEGIN(127,5) BL_OPER11(0,0,0,1,1,1,0,0,1,2,3,3,0,1,2,4,6,7,1,2,4,8,11,12,1,3,6,11,15,17,1,3,7,12,17,19) BL_END(5) -} +} -// sigma = 2.2 -template void bilateral22 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { +// sigma = 2.2 +template void bilateral22 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { BL_BEGIN(109,5) BL_OPER11(0,0,0,1,1,2,0,1,2,3,3,4,1,2,3,5,7,8,1,3,5,9,12,13,1,3,7,12,16,18,2,4,8,13,18,20) BL_END(5) } -// sigma = 2.3 -template void bilateral23 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { +// sigma = 2.3 +template void bilateral23 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { BL_BEGIN(132,5) BL_OPER11(0,0,1,1,1,1,0,1,1,2,3,3,1,1,3,5,6,7,1,2,5,7,10,11,1,3,6,10,13,14,1,3,7,11,14,16) BL_END(5) } -// sigma = 2.4 -template void bilateral24 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { +// sigma = 2.4 +template void bilateral24 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { BL_BEGIN(156,5) BL_OPER11(0,0,1,1,1,1,0,1,1,2,3,3,1,1,3,4,5,6,1,2,4,6,8,9,1,3,5,8,10,11,1,3,6,9,11,12) BL_END(5) } -// sigma = 2.5 -template void bilateral25 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { +// sigma = 2.5 +template void bilateral25 (T** src, T** dst, T** buffer, int W, int H, int row_from, int row_to, double sens) { BL_BEGIN(173,5) BL_OPER11(0,0,1,1,1,1,0,1,1,2,3,3,1,1,2,4,5,5,1,2,4,5,7,7,1,3,5,7,9,9,1,3,5,7,9,10) BL_END(5) -} +} class Dim { @@ -372,63 +372,63 @@ void bilateral_signed (short** src, short** dst, short** buffer, Dim dim, double bilateral (src, dst, buffer, dim, sigma, sens); } - + /* -template void bilateral (T** src, int** dst, int W, int H, int sigmar, double sigmas) { - - time_t t1 = clock (); - - int r = 2.0*sigmas + 0.5; - - double scaleg = 1024.0; - - double MAXINT = 65536.0*65536.0; - double sgmax = 275000/(MAXINT/2.0/sigmar/sigmar+(r+1)*(r+1)/sigmas/sigmas); - printf ("sgmax = %lf\n", sgmax); - if (scaleg>sgmax) - scaleg = sgmax; - - // kernel vector for the spatial gaussian filter * 1024 - int* kernel = new int[1+2*r]; - for (int i=0; i<2*r+1; i++) { - kernel[i] = scaleg / (2.0*sigmas*sigmas) * (i-r)*(i-r) + 0.25; - printf ("kerneli = %d\n", kernel[i]); - } - - // exponential lookup table - int scale = (2.0*sigmar*sigmar) / scaleg; - int scalem = 65535/((1+2*r)*(1+2*r)); - int ec[256000]; - for (int i=0; i<256000; i++) - ec[i] = exp (-i/scaleg) * scalem; - - for (int i=r; i void bilateral (T** src, int** dst, int W, int H, int sigmar, double sigmas) { + + time_t t1 = clock (); + + int r = 2.0*sigmas + 0.5; + + double scaleg = 1024.0; + + double MAXINT = 65536.0*65536.0; + double sgmax = 275000/(MAXINT/2.0/sigmar/sigmar+(r+1)*(r+1)/sigmas/sigmas); + printf ("sgmax = %lf\n", sgmax); + if (scaleg>sgmax) + scaleg = sgmax; + + // kernel vector for the spatial gaussian filter * 1024 + int* kernel = new int[1+2*r]; + for (int i=0; i<2*r+1; i++) { + kernel[i] = scaleg / (2.0*sigmas*sigmas) * (i-r)*(i-r) + 0.25; + printf ("kerneli = %d\n", kernel[i]); + } + + // exponential lookup table + int scale = (2.0*sigmar*sigmar) / scaleg; + int scalem = 65535/((1+2*r)*(1+2*r)); + int ec[256000]; + for (int i=0; i<256000; i++) + ec[i] = exp (-i/scaleg) * scalem; + + for (int i=r; i void bilateral (T** src, T** dst, T** buffer, int W, int H, int sigmar, double sigmas) { diff --git a/rtengine/colorclip.h b/rtengine/colorclip.h index 91ecb3fc4..f5d4faab1 100644 --- a/rtengine/colorclip.h +++ b/rtengine/colorclip.h @@ -1,132 +1,132 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -inline double tightestroot (double L, double a, double b, double r1, double r2, double r3); - -#ifndef __COLORCLIP__ -#define __COLORCLIP__ - -#include -#include "median.h" - -// gives back the tightest >0 amplification by which color clipping occures - -inline double tightestroot (double L, double a, double b, double r1, double r2, double r3) { - - register double an = a/500.0, bn = b/200.0, p = (L+16.0)/116.0; - - double coeff3 = r1*an*an*an - r3*bn*bn*bn; - double coeff2 = 3.0 * p * (r1*an*an + r3*bn*bn); - double coeff1 = 3.0 * p*p * (r1*an - r3*bn); - double coeff0 = p*p*p*(r1+r2+r3) - 1.0; - - double a1 = coeff2 / coeff3; - double a2 = coeff1 / coeff3; - double a3 = coeff0 / coeff3; - - double Q = (a1 * a1 - 3.0 * a2) / 9.0; - double R = (2.0 * a1 * a1 * a1 - 9.0 * a1 * a2 + 27.0 * a3) / 54.0; - double Qcubed = Q * Q * Q; - double d = Qcubed - R * R; - -// printf ("input L=%g, a=%g, b=%g\n", L, a, b); -// printf ("c1=%g, c2=%g, c3=%g, c4=%g\n", coeff3, coeff2, coeff1, coeff0); - - - /* Three real roots */ - if (d >= 0) { - double theta = acos(R / sqrt(Qcubed)); - double sqrtQ = sqrt(Q); - double x0 = -2.0 * sqrtQ * cos( theta / 3.0) - a1 / 3.0; - double x1 = -2.0 * sqrtQ * cos((theta + 2.0 * M_PI) / 3.0) - a1 / 3.0; - double x2 = -2.0 * sqrtQ * cos((theta + 4.0 * M_PI) / 3.0) - a1 / 3.0; - -// printf ("3 roots: %g, %g, %g\n", x0, x1, x2); - - SORT3 (x0,x1,x2,a1,a2,a3); - if (a1>0) - return a1; - if (a2>0) - return a2; - if (a3>0) - return a3; - return -1; - } - - /* One real root */ - else { -// double e = pow(sqrt(-d) + fabs(R), 1.0 / 3.0); - double e = exp (1.0 / 3.0 * log (sqrt(-d) + fabs(R))); - - if (R > 0) - e = -e; - - double x0 = (e + Q / e) - a1 / 3.0; - -// printf ("1 root: %g\n", x0); - - if (x0<0) - return -1; - else - return x0; - } -} - - -/******************************************************************************* - * FindCubicRoots - * - * Solve: - * coeff[3] * x^3 + coeff[2] * x^2 + coeff[1] * x + coeff[0] = 0 - * - * returns: - * 3 - 3 real roots - * 1 - 1 real root (2 complex conjugate) - *******************************************************************************/ - -/*long -FindCubicRoots(const FLOAT coeff[4], FLOAT x[3]) -{ - FLOAT a1 = coeff[2] / coeff[3]; - FLOAT a2 = coeff[1] / coeff[3]; - FLOAT a3 = coeff[0] / coeff[3]; - - double_t Q = (a1 * a1 - 3 * a2) / 9; - double_t R = (2 * a1 * a1 * a1 - 9 * a1 * a2 + 27 * a3) / 54; - double_t Qcubed = Q * Q * Q; - double_t d = Qcubed - R * R; - - if (d >= 0) { - double_t theta = acos(R / sqrt(Qcubed)); - double_t sqrtQ = sqrt(Q); - x[0] = -2 * sqrtQ * cos( theta / 3) - a1 / 3; - x[1] = -2 * sqrtQ * cos((theta + 2 * pi) / 3) - a1 / 3; - x[2] = -2 * sqrtQ * cos((theta + 4 * pi) / 3) - a1 / 3; - return (3); - } - - else { - double_t e = pow(sqrt(-d) + fabs(R), 1. / 3.); - if (R > 0) - e = -e; - x[0] = (e + Q / e) - a1 / 3.; - return (1); - } -} -*/ -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +inline double tightestroot (double L, double a, double b, double r1, double r2, double r3); + +#ifndef __COLORCLIP__ +#define __COLORCLIP__ + +#include +#include "median.h" + +// gives back the tightest >0 amplification by which color clipping occures + +inline double tightestroot (double L, double a, double b, double r1, double r2, double r3) { + + register double an = a/500.0, bn = b/200.0, p = (L+16.0)/116.0; + + double coeff3 = r1*an*an*an - r3*bn*bn*bn; + double coeff2 = 3.0 * p * (r1*an*an + r3*bn*bn); + double coeff1 = 3.0 * p*p * (r1*an - r3*bn); + double coeff0 = p*p*p*(r1+r2+r3) - 1.0; + + double a1 = coeff2 / coeff3; + double a2 = coeff1 / coeff3; + double a3 = coeff0 / coeff3; + + double Q = (a1 * a1 - 3.0 * a2) / 9.0; + double R = (2.0 * a1 * a1 * a1 - 9.0 * a1 * a2 + 27.0 * a3) / 54.0; + double Qcubed = Q * Q * Q; + double d = Qcubed - R * R; + +// printf ("input L=%g, a=%g, b=%g\n", L, a, b); +// printf ("c1=%g, c2=%g, c3=%g, c4=%g\n", coeff3, coeff2, coeff1, coeff0); + + + /* Three real roots */ + if (d >= 0) { + double theta = acos(R / sqrt(Qcubed)); + double sqrtQ = sqrt(Q); + double x0 = -2.0 * sqrtQ * cos( theta / 3.0) - a1 / 3.0; + double x1 = -2.0 * sqrtQ * cos((theta + 2.0 * M_PI) / 3.0) - a1 / 3.0; + double x2 = -2.0 * sqrtQ * cos((theta + 4.0 * M_PI) / 3.0) - a1 / 3.0; + +// printf ("3 roots: %g, %g, %g\n", x0, x1, x2); + + SORT3 (x0,x1,x2,a1,a2,a3); + if (a1>0) + return a1; + if (a2>0) + return a2; + if (a3>0) + return a3; + return -1; + } + + /* One real root */ + else { +// double e = pow(sqrt(-d) + fabs(R), 1.0 / 3.0); + double e = exp (1.0 / 3.0 * log (sqrt(-d) + fabs(R))); + + if (R > 0) + e = -e; + + double x0 = (e + Q / e) - a1 / 3.0; + +// printf ("1 root: %g\n", x0); + + if (x0<0) + return -1; + else + return x0; + } +} + + +/******************************************************************************* + * FindCubicRoots + * + * Solve: + * coeff[3] * x^3 + coeff[2] * x^2 + coeff[1] * x + coeff[0] = 0 + * + * returns: + * 3 - 3 real roots + * 1 - 1 real root (2 complex conjugate) + *******************************************************************************/ + +/*long +FindCubicRoots(const FLOAT coeff[4], FLOAT x[3]) +{ + FLOAT a1 = coeff[2] / coeff[3]; + FLOAT a2 = coeff[1] / coeff[3]; + FLOAT a3 = coeff[0] / coeff[3]; + + double_t Q = (a1 * a1 - 3 * a2) / 9; + double_t R = (2 * a1 * a1 * a1 - 9 * a1 * a2 + 27 * a3) / 54; + double_t Qcubed = Q * Q * Q; + double_t d = Qcubed - R * R; + + if (d >= 0) { + double_t theta = acos(R / sqrt(Qcubed)); + double_t sqrtQ = sqrt(Q); + x[0] = -2 * sqrtQ * cos( theta / 3) - a1 / 3; + x[1] = -2 * sqrtQ * cos((theta + 2 * pi) / 3) - a1 / 3; + x[2] = -2 * sqrtQ * cos((theta + 4 * pi) / 3) - a1 / 3; + return (3); + } + + else { + double_t e = pow(sqrt(-d) + fabs(R), 1. / 3.); + if (R > 0) + e = -e; + x[0] = (e + Q / e) - a1 / 3.; + return (1); + } +} +*/ +#endif diff --git a/rtengine/colortemp.cc b/rtengine/colortemp.cc index 92a72c07c..458fd24cd 100644 --- a/rtengine/colortemp.cc +++ b/rtengine/colortemp.cc @@ -1,87 +1,87 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include -using namespace rtengine; - -ColorTemp::ColorTemp (double t, double g) : temp(t), green(g) { - - clip (temp, green); -} - -void ColorTemp::clip (double &temp, double &green) { - - if (temp < MINTEMP) - temp = MINTEMP; - else if (temp > MAXTEMP) - temp = MAXTEMP; - - if (green < MINGREEN) - green = MINGREEN; - else if (green > MAXGREEN) - green = MAXGREEN; -} - -void ColorTemp::mul2temp (double rmul, double gmul, double bmul, double& temp, double& green) { - - double maxtemp=20000, mintemp=1000; - double tmpr, tmpg, tmpb; - temp=(maxtemp+mintemp)/2; - while (maxtemp-mintemp>1) { - temp2mul (temp, 1.0, tmpr, tmpg, tmpb); - if (tmpb/tmpr > bmul/rmul) - maxtemp = temp; - else - mintemp = temp; - temp=(maxtemp+mintemp)/2; - } - green = (tmpg/tmpr) / (gmul/rmul); - clip (temp, green); -} - -void ColorTemp::temp2mul (double temp, double green, double& rmul, double& gmul, double& bmul) { - - clip (temp, green); - - double xD; - if (temp<=4000) { - xD = 0.27475e9/(temp*temp*temp) - 0.98598e6/(temp*temp) + 1.17444e3/temp + 0.145986; - } else if (temp<=7000) { - xD = -4.6070e9/(temp*temp*temp) + 2.9678e6/(temp*temp) + 0.09911e3/temp + 0.244063; - } else { - xD = -2.0064e9/(temp*temp*temp) + 1.9018e6/(temp*temp) + 0.24748e3/temp + 0.237040; - } - double yD = -3.0*xD*xD + 2.87*xD - 0.275; - - double X = xD/yD; - double Y = 1.0; - double Z = (1.0-xD-yD)/yD; - - rmul = X * 3.24071 - Y * 1.53726 - Z * 0.498571; - gmul = - X * 0.969258 + Y * 1.87599 + Z * 0.0415557; - bmul = X * 0.0556352 - Y * 0.203996 + Z * 1.05707; - gmul /= green; - - double max = rmul; - if (gmul>max) max = gmul; - if (bmul>max) max = bmul; - rmul /= max; - gmul /= max; - bmul /= max; -} +using namespace rtengine; + +ColorTemp::ColorTemp (double t, double g) : temp(t), green(g) { + + clip (temp, green); +} + +void ColorTemp::clip (double &temp, double &green) { + + if (temp < MINTEMP) + temp = MINTEMP; + else if (temp > MAXTEMP) + temp = MAXTEMP; + + if (green < MINGREEN) + green = MINGREEN; + else if (green > MAXGREEN) + green = MAXGREEN; +} + +void ColorTemp::mul2temp (double rmul, double gmul, double bmul, double& temp, double& green) { + + double maxtemp=20000, mintemp=1000; + double tmpr, tmpg, tmpb; + temp=(maxtemp+mintemp)/2; + while (maxtemp-mintemp>1) { + temp2mul (temp, 1.0, tmpr, tmpg, tmpb); + if (tmpb/tmpr > bmul/rmul) + maxtemp = temp; + else + mintemp = temp; + temp=(maxtemp+mintemp)/2; + } + green = (tmpg/tmpr) / (gmul/rmul); + clip (temp, green); +} + +void ColorTemp::temp2mul (double temp, double green, double& rmul, double& gmul, double& bmul) { + + clip (temp, green); + + double xD; + if (temp<=4000) { + xD = 0.27475e9/(temp*temp*temp) - 0.98598e6/(temp*temp) + 1.17444e3/temp + 0.145986; + } else if (temp<=7000) { + xD = -4.6070e9/(temp*temp*temp) + 2.9678e6/(temp*temp) + 0.09911e3/temp + 0.244063; + } else { + xD = -2.0064e9/(temp*temp*temp) + 1.9018e6/(temp*temp) + 0.24748e3/temp + 0.237040; + } + double yD = -3.0*xD*xD + 2.87*xD - 0.275; + + double X = xD/yD; + double Y = 1.0; + double Z = (1.0-xD-yD)/yD; + + rmul = X * 3.24071 - Y * 1.53726 - Z * 0.498571; + gmul = - X * 0.969258 + Y * 1.87599 + Z * 0.0415557; + bmul = X * 0.0556352 - Y * 0.203996 + Z * 1.05707; + gmul /= green; + + double max = rmul; + if (gmul>max) max = gmul; + if (bmul>max) max = bmul; + rmul /= max; + gmul /= max; + bmul /= max; +} diff --git a/rtengine/colortemp.h b/rtengine/colortemp.h index 8cae8c965..3fb4aa237 100644 --- a/rtengine/colortemp.h +++ b/rtengine/colortemp.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _COLORTEMP_ #define _COLORTEMP_ @@ -47,11 +47,11 @@ class ColorTemp { void getMultipliers (double &mulr, double &mulg, double &mulb) { temp2mul (temp, green, mulr, mulg, mulb); } - static void mul2temp (double rmul, double gmul, double bmul, double& temp, double& green); + static void mul2temp (double rmul, double gmul, double bmul, double& temp, double& green); static void temp2mul (double temp, double green, double& rmul, double& gmul, double& bmul); - bool operator== (const ColorTemp& other) { return fabs(temp-other.temp)<1e-10 && fabs(green-other.green)<1e-10; } - bool operator!= (const ColorTemp& other) { return !(*this==other); } + bool operator== (const ColorTemp& other) { return fabs(temp-other.temp)<1e-10 && fabs(green-other.green)<1e-10; } + bool operator!= (const ColorTemp& other) { return !(*this==other); } }; }; #endif diff --git a/rtengine/common.h b/rtengine/common.h index 6f76831d7..61b5d4720 100644 --- a/rtengine/common.h +++ b/rtengine/common.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _COMMON_ #define _COMMON_ diff --git a/rtengine/coord2d.h b/rtengine/coord2d.h index a78caf124..40066c948 100644 --- a/rtengine/coord2d.h +++ b/rtengine/coord2d.h @@ -1,33 +1,33 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef __COORD2D__ -#define __COORD2D__ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef __COORD2D__ +#define __COORD2D__ namespace rtengine { - -class Coord2D { - - public: - double x, y; - Coord2D (double x_, double y_) : x(x_), y(y_) {} - Coord2D () {} - void set (double x_, double y_) { x = x_; y = y_; } -}; -}; -#endif + +class Coord2D { + + public: + double x, y; + Coord2D (double x_, double y_) : x(x_), y(y_) {} + Coord2D () {} + void set (double x_, double y_) { x = x_; y = y_; } +}; +}; +#endif diff --git a/rtengine/cubic.cc b/rtengine/cubic.cc index 9f576d0c8..ba3600ab8 100644 --- a/rtengine/cubic.cc +++ b/rtengine/cubic.cc @@ -1,82 +1,82 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -/* Copyright (C) 1997-2001 Ken Turkowski. - * - * All rights reserved. - * - * Warranty Information - * Even though I have reviewed this software, I make no warranty - * or representation, either express or implied, with respect to this - * software, its quality, accuracy, merchantability, or fitness for a - * particular purpose. As a result, this software is provided "as is," - * and you, its user, are assuming the entire risk as to its quality - * and accuracy. - * - * This code may be used and freely distributed as long as it includes - * this copyright notice and the above warranty information. - */ - -#include - - -#define FLOAT float -#define double_t double - -/******************************************************************************* - * FindCubicRoots - * - * Solve: - * coeff[3] * x^3 + coeff[2] * x^2 + coeff[1] * x + coeff[0] = 0 - * - * returns: - * 3 - 3 real roots - * 1 - 1 real root (2 complex conjugate) - *******************************************************************************/ - -long -FindCubicRoots(const FLOAT coeff[4], FLOAT x[3]) -{ - FLOAT a1 = coeff[2] / coeff[3]; - FLOAT a2 = coeff[1] / coeff[3]; - FLOAT a3 = coeff[0] / coeff[3]; - - double_t Q = (a1 * a1 - 3 * a2) / 9; - double_t R = (2 * a1 * a1 * a1 - 9 * a1 * a2 + 27 * a3) / 54; - double_t Qcubed = Q * Q * Q; - double_t d = Qcubed - R * R; - - /* Three real roots */ - if (d >= 0) { - double_t theta = acos(R / sqrt(Qcubed)); - double_t sqrtQ = sqrt(Q); - x[0] = -2 * sqrtQ * cos( theta / 3) - a1 / 3; - x[1] = -2 * sqrtQ * cos((theta + 2 * 3.14159265) / 3) - a1 / 3; - x[2] = -2 * sqrtQ * cos((theta + 4 * 3.14159265) / 3) - a1 / 3; - return (3); - } - - /* One real root */ - else { - double_t e = pow(sqrt(-d) + fabs(R), 1. / 3.); - if (R > 0) - e = -e; - x[0] = (e + Q / e) - a1 / 3.; - return (1); - } -} +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +/* Copyright (C) 1997-2001 Ken Turkowski. + * + * All rights reserved. + * + * Warranty Information + * Even though I have reviewed this software, I make no warranty + * or representation, either express or implied, with respect to this + * software, its quality, accuracy, merchantability, or fitness for a + * particular purpose. As a result, this software is provided "as is," + * and you, its user, are assuming the entire risk as to its quality + * and accuracy. + * + * This code may be used and freely distributed as long as it includes + * this copyright notice and the above warranty information. + */ + +#include + + +#define FLOAT float +#define double_t double + +/******************************************************************************* + * FindCubicRoots + * + * Solve: + * coeff[3] * x^3 + coeff[2] * x^2 + coeff[1] * x + coeff[0] = 0 + * + * returns: + * 3 - 3 real roots + * 1 - 1 real root (2 complex conjugate) + *******************************************************************************/ + +long +FindCubicRoots(const FLOAT coeff[4], FLOAT x[3]) +{ + FLOAT a1 = coeff[2] / coeff[3]; + FLOAT a2 = coeff[1] / coeff[3]; + FLOAT a3 = coeff[0] / coeff[3]; + + double_t Q = (a1 * a1 - 3 * a2) / 9; + double_t R = (2 * a1 * a1 * a1 - 9 * a1 * a2 + 27 * a3) / 54; + double_t Qcubed = Q * Q * Q; + double_t d = Qcubed - R * R; + + /* Three real roots */ + if (d >= 0) { + double_t theta = acos(R / sqrt(Qcubed)); + double_t sqrtQ = sqrt(Q); + x[0] = -2 * sqrtQ * cos( theta / 3) - a1 / 3; + x[1] = -2 * sqrtQ * cos((theta + 2 * 3.14159265) / 3) - a1 / 3; + x[2] = -2 * sqrtQ * cos((theta + 4 * 3.14159265) / 3) - a1 / 3; + return (3); + } + + /* One real root */ + else { + double_t e = pow(sqrt(-d) + fabs(R), 1. / 3.); + if (R > 0) + e = -e; + x[0] = (e + Q / e) - a1 / 3.; + return (1); + } +} diff --git a/rtengine/cubint.cc b/rtengine/cubint.cc index 220b6c1c7..ef49ea033 100644 --- a/rtengine/cubint.cc +++ b/rtengine/cubint.cc @@ -1,75 +1,75 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#define A (-0.85) -//#define CLIP(a) ((a>CMAXVAL)?a=CMAXVAL:((a<0)?0:a)) - -inline void cubint (Image16* src, int xs, int ys, double Dx, double Dy, unsigned short *r, unsigned short *g, unsigned short *b, double mul) { - - register double w[4]; - - { register double t1, t2; - t1 = -A*(Dx-1.0)*Dx; - t2 = (3.0-2.0*Dx)*Dx*Dx; - w[3] = t1*Dx; - w[2] = t1*(Dx-1.0) + t2; - w[1] = -t1*Dx + 1.0 - t2; - w[0] = -t1*(Dx-1.0); - } - - register double rd, gd, bd; - double yr[4], yg[4], yb[4]; - - for (int k=ys, kx=0; kr[k][i] * w[ix]; - gd += src->g[k][i] * w[ix]; - bd += src->b[k][i] * w[ix]; - } - yr[kx] = rd; yg[kx] = gd; yb[kx] = bd; - } - - - { register double t1, t2; - t1 = -A*(Dy-1.0)*Dy; - t2 = (3.0-2.0*Dy)*Dy*Dy; - w[3] = t1*Dy; - w[2] = t1*(Dy-1.0) + t2; - w[1] = -t1*Dy + 1.0 - t2; - w[0] = -t1*(Dy-1.0); - } - - rd = gd = bd = 0.0; - for (int i=0; i<4; i++) { - rd += yr[i] * w[i]; - gd += yg[i] * w[i]; - bd += yb[i] * w[i]; - } - +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#define A (-0.85) +//#define CLIP(a) ((a>CMAXVAL)?a=CMAXVAL:((a<0)?0:a)) + +inline void cubint (Image16* src, int xs, int ys, double Dx, double Dy, unsigned short *r, unsigned short *g, unsigned short *b, double mul) { + + register double w[4]; + + { register double t1, t2; + t1 = -A*(Dx-1.0)*Dx; + t2 = (3.0-2.0*Dx)*Dx*Dx; + w[3] = t1*Dx; + w[2] = t1*(Dx-1.0) + t2; + w[1] = -t1*Dx + 1.0 - t2; + w[0] = -t1*(Dx-1.0); + } + + register double rd, gd, bd; + double yr[4], yg[4], yb[4]; + + for (int k=ys, kx=0; kr[k][i] * w[ix]; + gd += src->g[k][i] * w[ix]; + bd += src->b[k][i] * w[ix]; + } + yr[kx] = rd; yg[kx] = gd; yb[kx] = bd; + } + + + { register double t1, t2; + t1 = -A*(Dy-1.0)*Dy; + t2 = (3.0-2.0*Dy)*Dy*Dy; + w[3] = t1*Dy; + w[2] = t1*(Dy-1.0) + t2; + w[1] = -t1*Dy + 1.0 - t2; + w[0] = -t1*(Dy-1.0); + } + + rd = gd = bd = 0.0; + for (int i=0; i<4; i++) { + rd += yr[i] * w[i]; + gd += yg[i] * w[i]; + bd += yb[i] * w[i]; + } + rd*=mul; gd*=mul; bd*=mul; - - *r = (int)CLIP(rd); - *g = (int)CLIP(gd); - *b = (int)CLIP(bd); - -// if (xs==100 && ys==100) -// printf ("r=%g, g=%g\n", *r, *g); -} + + *r = (int)CLIP(rd); + *g = (int)CLIP(gd); + *b = (int)CLIP(bd); + +// if (xs==100 && ys==100) +// printf ("r=%g, g=%g\n", *r, *g); +} diff --git a/rtengine/cubintch.cc b/rtengine/cubintch.cc index 5e0aa9207..c9416bc63 100644 --- a/rtengine/cubintch.cc +++ b/rtengine/cubintch.cc @@ -1,61 +1,61 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ - -inline void cubintch (unsigned short** src, int xs, int ys, double Dx, double Dy, unsigned short *r, double mul) { - - register double w[4]; - - { register double t1, t2; - t1 = -A*(Dx-1.0)*Dx; - t2 = (3.0-2.0*Dx)*Dx*Dx; - w[3] = t1*Dx; - w[2] = t1*(Dx-1.0) + t2; - w[1] = -t1*Dx + 1.0 - t2; - w[0] = -t1*(Dx-1.0); - } - - register double rd; - double yr[4]; - - for (int k=ys, kx=0; k + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ + +inline void cubintch (unsigned short** src, int xs, int ys, double Dx, double Dy, unsigned short *r, double mul) { + + register double w[4]; + + { register double t1, t2; + t1 = -A*(Dx-1.0)*Dx; + t2 = (3.0-2.0*Dx)*Dx*Dx; + w[3] = t1*Dx; + w[2] = t1*(Dx-1.0) + t2; + w[1] = -t1*Dx + 1.0 - t2; + w[0] = -t1*(Dx-1.0); + } + + register double rd; + double yr[4]; + + for (int k=ys, kx=0; k - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include diff --git a/rtengine/curves.h b/rtengine/curves.h index 39b61bb1f..0d6d6753c 100644 --- a/rtengine/curves.h +++ b/rtengine/curves.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef __CURVES_H__ #define __CURVES_H__ diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index 1270dc376..806382e20 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -1,25 +1,25 @@ -/* - * This file is part of RawTherapee. - * +/* + * This file is part of RawTherapee. + * * The functions defined after the original "main" are copyrighted * by Gabor Horvath and protected by the GNU * General Public License. * The original copyright notice of Dave Coffin is valid for everything - * before that point (see below). - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ + * before that point (see below). + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ /*RT*/#include /*RT*/#include /*RT*/int ciff_base, ciff_len, exif_base, pre_filters; diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index cc8956099..ea806dd4b 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include diff --git a/rtengine/dcrop.h b/rtengine/dcrop.h index 71ca82654..65115825c 100644 --- a/rtengine/dcrop.h +++ b/rtengine/dcrop.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _CROP_H_ #define _CROP_H_ diff --git a/rtengine/ex1simple.cc b/rtengine/ex1simple.cc index 5295df92a..334c21b71 100644 --- a/rtengine/ex1simple.cc +++ b/rtengine/ex1simple.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include //#include diff --git a/rtengine/ex2simple.cc b/rtengine/ex2simple.cc index 941e5787f..e59b05409 100644 --- a/rtengine/ex2simple.cc +++ b/rtengine/ex2simple.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include //#include diff --git a/rtengine/gauss.cc b/rtengine/gauss.cc index 1b208dc9d..4b4c199cb 100644 --- a/rtengine/gauss.cc +++ b/rtengine/gauss.cc @@ -1,49 +1,49 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include - -void gaussHorizontal_unsigned (unsigned short** src, unsigned short** dst, AlignedBuffer* buffer, int W, int row_from, int row_to, double sigma) { - - gaussHorizontal (src, dst, buffer, W, row_from, row_to, sigma); -} - -void gaussVertical_unsigned (unsigned short** src, unsigned short** dst, AlignedBuffer* buffer, int H, int col_from, int col_to, double sigma) { - - gaussVertical (src, dst, buffer, H, col_from, col_to, sigma); -} - -void gaussHorizontal_signed (short** src, short** dst, AlignedBuffer* buffer, int W, int row_from, int row_to, double sigma) { - - gaussHorizontal (src, dst, buffer, W, row_from, row_to, sigma); -} - -void gaussVertical_signed (short** src, short** dst, AlignedBuffer* buffer, int H, int col_from, int col_to, double sigma) { - - gaussVertical (src, dst, buffer, H, col_from, col_to, sigma); -} - -void gaussHorizontal_float (float** src, float** dst, AlignedBuffer* buffer, int W, int row_from, int row_to, double sigma) { - - gaussHorizontal (src, dst, buffer, W, row_from, row_to, sigma); -} - -void gaussVertical_float (float** src, float** dst, AlignedBuffer* buffer, int H, int col_from, int col_to, double sigma) { - - gaussVertical (src, dst, buffer, H, col_from, col_to, sigma); -} +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include + +void gaussHorizontal_unsigned (unsigned short** src, unsigned short** dst, AlignedBuffer* buffer, int W, int row_from, int row_to, double sigma) { + + gaussHorizontal (src, dst, buffer, W, row_from, row_to, sigma); +} + +void gaussVertical_unsigned (unsigned short** src, unsigned short** dst, AlignedBuffer* buffer, int H, int col_from, int col_to, double sigma) { + + gaussVertical (src, dst, buffer, H, col_from, col_to, sigma); +} + +void gaussHorizontal_signed (short** src, short** dst, AlignedBuffer* buffer, int W, int row_from, int row_to, double sigma) { + + gaussHorizontal (src, dst, buffer, W, row_from, row_to, sigma); +} + +void gaussVertical_signed (short** src, short** dst, AlignedBuffer* buffer, int H, int col_from, int col_to, double sigma) { + + gaussVertical (src, dst, buffer, H, col_from, col_to, sigma); +} + +void gaussHorizontal_float (float** src, float** dst, AlignedBuffer* buffer, int W, int row_from, int row_to, double sigma) { + + gaussHorizontal (src, dst, buffer, W, row_from, row_to, sigma); +} + +void gaussVertical_float (float** src, float** dst, AlignedBuffer* buffer, int H, int col_from, int col_to, double sigma) { + + gaussVertical (src, dst, buffer, H, col_from, col_to, sigma); +} diff --git a/rtengine/gauss.h b/rtengine/gauss.h index 6f708b40f..3e7fe2252 100644 --- a/rtengine/gauss.h +++ b/rtengine/gauss.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _GAUSS_H_ #define _GAUSS_H_ diff --git a/rtengine/hlmultipliers.cc b/rtengine/hlmultipliers.cc index eafa43d62..0ebf5bbd7 100644 --- a/rtengine/hlmultipliers.cc +++ b/rtengine/hlmultipliers.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include diff --git a/rtengine/hlrecovery.cc b/rtengine/hlrecovery.cc index d19769f92..c844b425b 100644 --- a/rtengine/hlrecovery.cc +++ b/rtengine/hlrecovery.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ namespace rtengine { diff --git a/rtengine/iccmatrices.h b/rtengine/iccmatrices.h index 66d25cb6d..463d255e3 100644 --- a/rtengine/iccmatrices.h +++ b/rtengine/iccmatrices.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _ICCMATRICES_ #define _ICCMATRICES_ diff --git a/rtengine/iccstore.cc b/rtengine/iccstore.cc index dccf950a5..32a146f44 100644 --- a/rtengine/iccstore.cc +++ b/rtengine/iccstore.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #ifdef WIN32 #include diff --git a/rtengine/iccstore.h b/rtengine/iccstore.h index a7434bec6..3c0a9dc49 100644 --- a/rtengine/iccstore.h +++ b/rtengine/iccstore.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef __ICCSTORE__ #define __ICCSTORE__ @@ -74,9 +74,9 @@ class ICCStore { std::vector getOutputProfiles (); }; -extern ICCStore iccStore; +extern ICCStore iccStore; //extern const char* wpnames[]; -} +} #endif diff --git a/rtengine/iimage.h b/rtengine/iimage.h index 03ef519e9..5fbfb4b06 100644 --- a/rtengine/iimage.h +++ b/rtengine/iimage.h @@ -1,96 +1,96 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _IIMAGE_ -#define _IIMAGE_ - -#include -#include - -namespace rtengine { - - class ProgressListener; - - /** This class represents an image (the result of the image processing) */ - class IImage { - public: - /** Returns a mutex that can is useful in many situations. No image operations shuold be performed without locking this mutex. - * @return The mutex */ - virtual Glib::Mutex& getMutex ()=0; - virtual cmsHPROFILE getProfile ()=0; - /** Returns the width of the image. - * @return The width of the image */ - virtual int getWidth ()=0; - /** Returns the height of the image. - * @return The height of the image */ - virtual int getHeight ()=0; - /** Returns the bits per pixel of the image. - * @return The bits per pixel of the image */ - virtual int getBitsPerPixel ()=0; - /** Saves the image to file. It autodetects the format (jpg, tif, png are supported). - * @param fname is the name of the file - @return the error code, 0 if none */ - virtual int saveToFile (Glib::ustring fname)=0; - /** Saves the image to file in a png format. - * @param fname is the name of the file - * @param compression is the amount of compression (0-6), -1 corresponds to the default - * @param bps can be 8 or 16 depending on the bits per pixels the output file will have - @return the error code, 0 if none */ - virtual int saveAsPNG (Glib::ustring fname, int compression = -1, int bps = -1)=0; - /** Saves the image to file in a jpg format. - * @param fname is the name of the file - * @param quality is the quality of the jpeg (0...100), set it to -1 to use default - @return the error code, 0 if none */ - virtual int saveAsJPEG (Glib::ustring fname, int quality = 100)=0; - /** Saves the image to file in a tif format. - * @param fname is the name of the file - * @param bps can be 8 or 16 depending on the bits per pixels the output file will have - @return the error code, 0 if none */ - virtual int saveAsTIFF (Glib::ustring fname, int bps = -1)=0; - /** Sets the progress listener if you want to follow the progress of the image saving operations (optional). - * @param pl is the pointer to the class implementing the ProgressListener interface */ - virtual void setSaveProgressListener (ProgressListener* pl)=0; - /** Free the image */ - virtual void free ()=0; - }; - - /** This class represents an image having a classical 8 bits/pixel representation */ - class IImage8 : public IImage { - public: - /** Returns the pixel data, in r/g/b order from top left to bottom right continously. - * @return a pointer to the pixel data */ - virtual const unsigned char* getData ()=0; - }; - - /** This class represents an image having a 16 bits/pixel planar representation. - The planes are stored as two dimensional arrays. All the rows have a 8-byte alignment. */ - class IImage16 : public IImage { - public: - /** Returns the "red" plane data. - * @return the two dimensional array of the red plane */ - virtual unsigned short** getRPlane ()=0; - /** Returns the "green" plane data. - * @return the two dimensional array of the green plane */ - virtual unsigned short** getGPlane ()=0; - /** Returns the "blue" plane data. - * @return the two dimensional array of the blue plane */ - virtual unsigned short** getBPlane ()=0; - }; -} - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _IIMAGE_ +#define _IIMAGE_ + +#include +#include + +namespace rtengine { + + class ProgressListener; + + /** This class represents an image (the result of the image processing) */ + class IImage { + public: + /** Returns a mutex that can is useful in many situations. No image operations shuold be performed without locking this mutex. + * @return The mutex */ + virtual Glib::Mutex& getMutex ()=0; + virtual cmsHPROFILE getProfile ()=0; + /** Returns the width of the image. + * @return The width of the image */ + virtual int getWidth ()=0; + /** Returns the height of the image. + * @return The height of the image */ + virtual int getHeight ()=0; + /** Returns the bits per pixel of the image. + * @return The bits per pixel of the image */ + virtual int getBitsPerPixel ()=0; + /** Saves the image to file. It autodetects the format (jpg, tif, png are supported). + * @param fname is the name of the file + @return the error code, 0 if none */ + virtual int saveToFile (Glib::ustring fname)=0; + /** Saves the image to file in a png format. + * @param fname is the name of the file + * @param compression is the amount of compression (0-6), -1 corresponds to the default + * @param bps can be 8 or 16 depending on the bits per pixels the output file will have + @return the error code, 0 if none */ + virtual int saveAsPNG (Glib::ustring fname, int compression = -1, int bps = -1)=0; + /** Saves the image to file in a jpg format. + * @param fname is the name of the file + * @param quality is the quality of the jpeg (0...100), set it to -1 to use default + @return the error code, 0 if none */ + virtual int saveAsJPEG (Glib::ustring fname, int quality = 100)=0; + /** Saves the image to file in a tif format. + * @param fname is the name of the file + * @param bps can be 8 or 16 depending on the bits per pixels the output file will have + @return the error code, 0 if none */ + virtual int saveAsTIFF (Glib::ustring fname, int bps = -1)=0; + /** Sets the progress listener if you want to follow the progress of the image saving operations (optional). + * @param pl is the pointer to the class implementing the ProgressListener interface */ + virtual void setSaveProgressListener (ProgressListener* pl)=0; + /** Free the image */ + virtual void free ()=0; + }; + + /** This class represents an image having a classical 8 bits/pixel representation */ + class IImage8 : public IImage { + public: + /** Returns the pixel data, in r/g/b order from top left to bottom right continously. + * @return a pointer to the pixel data */ + virtual const unsigned char* getData ()=0; + }; + + /** This class represents an image having a 16 bits/pixel planar representation. + The planes are stored as two dimensional arrays. All the rows have a 8-byte alignment. */ + class IImage16 : public IImage { + public: + /** Returns the "red" plane data. + * @return the two dimensional array of the red plane */ + virtual unsigned short** getRPlane ()=0; + /** Returns the "green" plane data. + * @return the two dimensional array of the green plane */ + virtual unsigned short** getGPlane ()=0; + /** Returns the "blue" plane data. + * @return the two dimensional array of the blue plane */ + virtual unsigned short** getBPlane ()=0; + }; +} + +#endif diff --git a/rtengine/image16.h b/rtengine/image16.h index 256c8b8eb..d4e9e9188 100644 --- a/rtengine/image16.h +++ b/rtengine/image16.h @@ -1,23 +1,23 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -// -// A class representing a 16 bit rgb image with separate planes and 16 byte aligned data +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +// +// A class representing a 16 bit rgb image with separate planes and 16 byte aligned data // #ifndef _IMAGE16_ #define _IMAGE16_ @@ -72,9 +72,9 @@ class Image16 : public ImageIO, public IImage16 { virtual int getWidth () { return width; } virtual int getHeight () { return height; } virtual int getBitsPerPixel () { return 16; } - virtual int saveToFile (Glib::ustring fname) { return save (fname); } - virtual int saveAsPNG (Glib::ustring fname, int compression = -1, int bps = -1) { return savePNG (fname, compression, bps); } - virtual int saveAsJPEG (Glib::ustring fname, int quality = 100) { return saveJPEG (fname, quality); } + virtual int saveToFile (Glib::ustring fname) { return save (fname); } + virtual int saveAsPNG (Glib::ustring fname, int compression = -1, int bps = -1) { return savePNG (fname, compression, bps); } + virtual int saveAsJPEG (Glib::ustring fname, int quality = 100) { return saveJPEG (fname, quality); } virtual int saveAsTIFF (Glib::ustring fname, int bps = -1) { return saveTIFF (fname, bps); } virtual void setSaveProgressListener (ProgressListener* pl) { return setProgressListener (pl); } virtual void free () { delete this; } diff --git a/rtengine/image8.cc b/rtengine/image8.cc index 697b31c9f..da575d6db 100644 --- a/rtengine/image8.cc +++ b/rtengine/image8.cc @@ -1,108 +1,108 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include - -using namespace rtengine; - - -Image8::Image8 () - : width(-1), height(-1), data(NULL) { -} - -Image8::Image8 (int w, int h) - : width(w), height (h), data(NULL) { - - allocate (w, h); -} - -void Image8::allocate (int width, int height) { - - if (data!=NULL) - delete [] data; - - data = new unsigned char [width * height * 3]; - this->width = width; - this->height = height; -} - -Image8::~Image8 () { - - if (data!=NULL) - delete [] data; -} - -void Image8::getScanline (int row, unsigned char* buffer, int bps) { - - if (data==NULL) - return; - - if (bps==8) - memcpy (buffer, data + row*width*3, width*3); - else if (bps==16) { - unsigned short* sbuffer = (unsigned short*) buffer; - for (int i=0, ix = row*width*3; i> 8; - } -} - -unsigned char Image8::r (int row, int col) { - - return data[3*(row*width+col)]; -} - -unsigned char Image8::g (int row, int col) { - - return data[3*(row*width+col)+1]; -} - -unsigned char Image8::b (int row, int col) { - - return data[3*(row*width+col)+2]; -} - -void Image8::r (int row, int col, unsigned char val) { - - data[3*(row*width+col)] = val; -} - -void Image8::g (int row, int col, unsigned char val) { - - data[3*(row*width+col)+1] = val; -} - -void Image8::b (int row, int col, unsigned char val) { - - data[3*(row*width+col)+2] = val; -} - +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include + +using namespace rtengine; + + +Image8::Image8 () + : width(-1), height(-1), data(NULL) { +} + +Image8::Image8 (int w, int h) + : width(w), height (h), data(NULL) { + + allocate (w, h); +} + +void Image8::allocate (int width, int height) { + + if (data!=NULL) + delete [] data; + + data = new unsigned char [width * height * 3]; + this->width = width; + this->height = height; +} + +Image8::~Image8 () { + + if (data!=NULL) + delete [] data; +} + +void Image8::getScanline (int row, unsigned char* buffer, int bps) { + + if (data==NULL) + return; + + if (bps==8) + memcpy (buffer, data + row*width*3, width*3); + else if (bps==16) { + unsigned short* sbuffer = (unsigned short*) buffer; + for (int i=0, ix = row*width*3; i> 8; + } +} + +unsigned char Image8::r (int row, int col) { + + return data[3*(row*width+col)]; +} + +unsigned char Image8::g (int row, int col) { + + return data[3*(row*width+col)+1]; +} + +unsigned char Image8::b (int row, int col) { + + return data[3*(row*width+col)+2]; +} + +void Image8::r (int row, int col, unsigned char val) { + + data[3*(row*width+col)] = val; +} + +void Image8::g (int row, int col, unsigned char val) { + + data[3*(row*width+col)+1] = val; +} + +void Image8::b (int row, int col, unsigned char val) { + + data[3*(row*width+col)+2] = val; +} + diff --git a/rtengine/image8.h b/rtengine/image8.h index 289b82009..422169fe1 100644 --- a/rtengine/image8.h +++ b/rtengine/image8.h @@ -1,50 +1,50 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -// -// A class representing a 8 bit rgb image without alpha channel -// -#ifndef _IMAGE8_ -#define _IMAGE8_ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +// +// A class representing a 8 bit rgb image without alpha channel +// +#ifndef _IMAGE8_ +#define _IMAGE8_ -#include +#include #include namespace rtengine { - -class Image8 : public ImageIO, public IImage8 { - - public: - unsigned char* data; - int width; + +class Image8 : public ImageIO, public IImage8 { + + public: + unsigned char* data; + int width; int height; - Image8 (); - Image8 (int width, int height); - ~Image8 (); - - unsigned char r (int row, int col); - unsigned char g (int row, int col); - unsigned char b (int row, int col); - void r (int row, int col, unsigned char val); - void g (int row, int col, unsigned char val); - void b (int row, int col, unsigned char val); - + Image8 (); + Image8 (int width, int height); + ~Image8 (); + + unsigned char r (int row, int col); + unsigned char g (int row, int col); + unsigned char b (int row, int col); + void r (int row, int col, unsigned char val); + void g (int row, int col, unsigned char val); + void b (int row, int col, unsigned char val); + virtual int getW () { return width; } virtual int getH () { return height; } virtual void allocate (int width, int height); @@ -58,14 +58,14 @@ class Image8 : public ImageIO, public IImage8 { virtual int getWidth () { return width; } virtual int getHeight () { return height; } virtual int getBitsPerPixel () { return 16; } - virtual int saveToFile (Glib::ustring fname) { return save (fname); } - virtual int saveAsPNG (Glib::ustring fname, int compression = -1, int bps = -1) { return savePNG (fname, compression, bps); } - virtual int saveAsJPEG (Glib::ustring fname, int quality = 100) { return saveJPEG (fname, quality); } + virtual int saveToFile (Glib::ustring fname) { return save (fname); } + virtual int saveAsPNG (Glib::ustring fname, int compression = -1, int bps = -1) { return savePNG (fname, compression, bps); } + virtual int saveAsJPEG (Glib::ustring fname, int quality = 100) { return saveJPEG (fname, quality); } virtual int saveAsTIFF (Glib::ustring fname, int bps = -1) { return saveTIFF (fname, bps); } virtual void setSaveProgressListener (ProgressListener* pl) { setProgressListener (pl); } virtual void free () { delete this; } virtual const unsigned char* getData () { return data; } -}; -}; -#endif +}; +}; +#endif diff --git a/rtengine/imagedata.h b/rtengine/imagedata.h index 553b43ebd..e00457fb4 100644 --- a/rtengine/imagedata.h +++ b/rtengine/imagedata.h @@ -1,70 +1,70 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef __IMAGEDATA_H__ -#define __IMAGEDATA_H__ - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace rtengine { - -class ImageData : public ImageMetaData { - - protected: - rtexif::TagDirectory* root; - IptcData* iptc; - - struct tm time; - int iso_speed; - double aperture; - double focal_len; - double shutter; - std::string make, model; - std::string lens; - - void extractInfo (); - - public: - - ImageData (Glib::ustring fname, RawMetaDataLocation* rml=NULL); - ~ImageData (); - - const rtexif::TagDirectory* getExifData () const { return root; } - const std::vector getIPTCData () const; - - bool hasExif () const { return root && root->getCount(); } - bool hasIPTC () const { return iptc; } - - struct tm getDateTime () const { return time; } - int getISOSpeed () const { return iso_speed; } - double getFNumber () const { return aperture; } - double getFocalLen () const { return focal_len; } - double getShutterSpeed () const { return shutter; } - std::string getMake () const { return make; } - std::string getModel () const { return model; } - std::string getLens () const { return lens; } -}; -}; -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef __IMAGEDATA_H__ +#define __IMAGEDATA_H__ + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace rtengine { + +class ImageData : public ImageMetaData { + + protected: + rtexif::TagDirectory* root; + IptcData* iptc; + + struct tm time; + int iso_speed; + double aperture; + double focal_len; + double shutter; + std::string make, model; + std::string lens; + + void extractInfo (); + + public: + + ImageData (Glib::ustring fname, RawMetaDataLocation* rml=NULL); + ~ImageData (); + + const rtexif::TagDirectory* getExifData () const { return root; } + const std::vector getIPTCData () const; + + bool hasExif () const { return root && root->getCount(); } + bool hasIPTC () const { return iptc; } + + struct tm getDateTime () const { return time; } + int getISOSpeed () const { return iso_speed; } + double getFNumber () const { return aperture; } + double getFocalLen () const { return focal_len; } + double getShutterSpeed () const { return shutter; } + std::string getMake () const { return make; } + std::string getModel () const { return model; } + std::string getLens () const { return lens; } +}; +}; +#endif diff --git a/rtengine/imageio.h b/rtengine/imageio.h index a48bd819e..e3d1bc58c 100644 --- a/rtengine/imageio.h +++ b/rtengine/imageio.h @@ -1,87 +1,87 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _IMAGEIO_ -#define _IMAGEIO_ - -#define IMIO_SUCCESS 0 -#define IMIO_CANNOTREADFILE 1 -#define IMIO_INVALIDHEADER 2 -#define IMIO_HEADERERROR 3 -#define IMIO_READERROR 4 -#define IMIO_VARIANTNOTSUPPORTED 5 - -#include -#include -#include -#include -#include - -namespace rtengine { - -class ImageIO { - - protected: - ProgressListener* pl; - cmsHPROFILE embProfile; - char* profileData; - int profileLength; - char* loadedProfileData; - int loadedProfileLength; - std::vector > exifChange; - IptcData* iptc; - const rtexif::TagDirectory* exifRoot; - Glib::Mutex imutex; - - public: - static Glib::ustring errorMsg[6]; - - ImageIO () : pl (NULL), embProfile(NULL), profileData(NULL), exifRoot (NULL), iptc(NULL), loadedProfileData(NULL), loadedProfileLength(0) {} - - virtual ~ImageIO (); - - void setProgressListener (ProgressListener* l) { pl = l; } - - virtual int getW () =0; - virtual int getH () =0; - virtual void allocate (int width, int height) =0; - virtual int getBPS () =0; - virtual void getScanline (int row, unsigned char* buffer, int bps) {} - virtual void setScanline (int row, unsigned char* buffer, int bps) {} - - int load (Glib::ustring fname); - int save (Glib::ustring fname); - - int loadPNG (Glib::ustring fname); - int loadJPEG (Glib::ustring fname); - int loadTIFF (Glib::ustring fname); - - int savePNG (Glib::ustring fname, int compression = -1, int bps = -1); - int saveJPEG (Glib::ustring fname, int quality = 100); - int saveTIFF (Glib::ustring fname, int bps = -1); - - cmsHPROFILE getEmbeddedProfile () { return embProfile; } - void getEmbeddedProfileData (int& length, unsigned char*& pdata) { length = loadedProfileLength; pdata = (unsigned char*)loadedProfileData; } - - void setMetadata (const rtexif::TagDirectory* eroot, const std::vector& exif, const std::vector& iptcc); - void setOutputProfile (char* pdata, int plen); - Glib::Mutex& mutex () { return imutex; } -}; - -}; -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _IMAGEIO_ +#define _IMAGEIO_ + +#define IMIO_SUCCESS 0 +#define IMIO_CANNOTREADFILE 1 +#define IMIO_INVALIDHEADER 2 +#define IMIO_HEADERERROR 3 +#define IMIO_READERROR 4 +#define IMIO_VARIANTNOTSUPPORTED 5 + +#include +#include +#include +#include +#include + +namespace rtengine { + +class ImageIO { + + protected: + ProgressListener* pl; + cmsHPROFILE embProfile; + char* profileData; + int profileLength; + char* loadedProfileData; + int loadedProfileLength; + std::vector > exifChange; + IptcData* iptc; + const rtexif::TagDirectory* exifRoot; + Glib::Mutex imutex; + + public: + static Glib::ustring errorMsg[6]; + + ImageIO () : pl (NULL), embProfile(NULL), profileData(NULL), exifRoot (NULL), iptc(NULL), loadedProfileData(NULL), loadedProfileLength(0) {} + + virtual ~ImageIO (); + + void setProgressListener (ProgressListener* l) { pl = l; } + + virtual int getW () =0; + virtual int getH () =0; + virtual void allocate (int width, int height) =0; + virtual int getBPS () =0; + virtual void getScanline (int row, unsigned char* buffer, int bps) {} + virtual void setScanline (int row, unsigned char* buffer, int bps) {} + + int load (Glib::ustring fname); + int save (Glib::ustring fname); + + int loadPNG (Glib::ustring fname); + int loadJPEG (Glib::ustring fname); + int loadTIFF (Glib::ustring fname); + + int savePNG (Glib::ustring fname, int compression = -1, int bps = -1); + int saveJPEG (Glib::ustring fname, int quality = 100); + int saveTIFF (Glib::ustring fname, int bps = -1); + + cmsHPROFILE getEmbeddedProfile () { return embProfile; } + void getEmbeddedProfileData (int& length, unsigned char*& pdata) { length = loadedProfileLength; pdata = (unsigned char*)loadedProfileData; } + + void setMetadata (const rtexif::TagDirectory* eroot, const std::vector& exif, const std::vector& iptcc); + void setOutputProfile (char* pdata, int plen); + Glib::Mutex& mutex () { return imutex; } +}; + +}; +#endif diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h index c9795abeb..2e260c853 100644 --- a/rtengine/imagesource.h +++ b/rtengine/imagesource.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _IMAGESOURCE_ #define _IMAGESOURCE_ diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index ebbad1bc4..0e8cf81f1 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index 1324bf5a2..01be6df96 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _IMPROCCOORDINATOR_H_ #define _IMPROCCOORDINATOR_H_ diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 1ed8dfbf6..67420c1af 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _IMPROCFUN_H_ #define _IMPROCFUN_H_ diff --git a/rtengine/init.cc b/rtengine/init.cc index c14056106..167ca3e3a 100644 --- a/rtengine/init.cc +++ b/rtengine/init.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include diff --git a/rtengine/iptcpairs.h b/rtengine/iptcpairs.h index f4f0c0b07..5efdb79dd 100644 --- a/rtengine/iptcpairs.h +++ b/rtengine/iptcpairs.h @@ -1,46 +1,46 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _IPTCPAIRS_ #define _IPTCPAIRS_ - -struct IptcPair { - IptcTag tag; - int size; - Glib::ustring field; + +struct IptcPair { + IptcTag tag; + int size; + Glib::ustring field; }; - -const IptcPair strTags[] = {IPTC_TAG_CAPTION, 2000, "Caption", - IPTC_TAG_WRITER_EDITOR, 32, "CaptionWriter", - IPTC_TAG_HEADLINE, 256, "Headline", - IPTC_TAG_SPECIAL_INSTRUCTIONS, 256, "Instructions", - IPTC_TAG_CATEGORY, 3, "Category", - IPTC_TAG_BYLINE, 32, "Author", - IPTC_TAG_BYLINE_TITLE, 32, "AuthorsPosition", - IPTC_TAG_CREDIT, 32, "Credit", - IPTC_TAG_SOURCE, 32, "Source", - IPTC_TAG_COPYRIGHT_NOTICE, 128, "Copyright", - IPTC_TAG_CITY, 32, "City", - IPTC_TAG_STATE, 32, "Province", - IPTC_TAG_COUNTRY_NAME, 64, "Country", - IPTC_TAG_OBJECT_NAME, 64, "Title", - IPTC_TAG_ORIG_TRANS_REF, 32, "TransReference", + +const IptcPair strTags[] = {IPTC_TAG_CAPTION, 2000, "Caption", + IPTC_TAG_WRITER_EDITOR, 32, "CaptionWriter", + IPTC_TAG_HEADLINE, 256, "Headline", + IPTC_TAG_SPECIAL_INSTRUCTIONS, 256, "Instructions", + IPTC_TAG_CATEGORY, 3, "Category", + IPTC_TAG_BYLINE, 32, "Author", + IPTC_TAG_BYLINE_TITLE, 32, "AuthorsPosition", + IPTC_TAG_CREDIT, 32, "Credit", + IPTC_TAG_SOURCE, 32, "Source", + IPTC_TAG_COPYRIGHT_NOTICE, 128, "Copyright", + IPTC_TAG_CITY, 32, "City", + IPTC_TAG_STATE, 32, "Province", + IPTC_TAG_COUNTRY_NAME, 64, "Country", + IPTC_TAG_OBJECT_NAME, 64, "Title", + IPTC_TAG_ORIG_TRANS_REF, 32, "TransReference", IPTC_TAG_DATE_CREATED, 8, "DateCreated"}; #endif diff --git a/rtengine/loadinitial.cc b/rtengine/loadinitial.cc index 515d703fd..f12ce63b8 100644 --- a/rtengine/loadinitial.cc +++ b/rtengine/loadinitial.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include diff --git a/rtengine/median.h b/rtengine/median.h index e963d484b..185a7e409 100644 --- a/rtengine/median.h +++ b/rtengine/median.h @@ -1,222 +1,222 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#define SORT3(a1,a2,a3,b1,b2,b3) \ - { \ - if ((a1)<(a2)) { \ - if ((a2)<(a3)) { \ - (b1) = (a1); (b2) = (a2); (b3) = (a3); \ - } \ - else if ((a1)<(a3)) { \ - (b1) = (a1); (b2) = (a3); (b3) = (a2); \ - } \ - else { \ - (b1) = (a3); (b2) = (a1); (b3) = (a2); \ - } \ - } \ - else { \ - if ((a3)<(a2)) { \ - (b1) = (a3); (b2) = (a2); (b3) = (a1); \ - } \ - else if ((a3)<(a1)) { \ - (b1) = (a2); (b2) = (a3); (b3) = (a1); \ - } \ - else { \ - (b1) = (a2); (b2) = (a1); (b3) = (a3); \ - } \ - } \ - } - -#define MERGESORT(a1,a2,a3,b1,b2,b3,c1,c2,c3,c4,c5,c6) \ - {\ - if (a1 + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#define SORT3(a1,a2,a3,b1,b2,b3) \ + { \ + if ((a1)<(a2)) { \ + if ((a2)<(a3)) { \ + (b1) = (a1); (b2) = (a2); (b3) = (a3); \ + } \ + else if ((a1)<(a3)) { \ + (b1) = (a1); (b2) = (a3); (b3) = (a2); \ + } \ + else { \ + (b1) = (a3); (b2) = (a1); (b3) = (a2); \ + } \ + } \ + else { \ + if ((a3)<(a2)) { \ + (b1) = (a3); (b2) = (a2); (b3) = (a1); \ + } \ + else if ((a3)<(a1)) { \ + (b1) = (a2); (b2) = (a3); (b3) = (a1); \ + } \ + else { \ + (b1) = (a2); (b2) = (a1); (b3) = (a3); \ + } \ + } \ + } + +#define MERGESORT(a1,a2,a3,b1,b2,b3,c1,c2,c3,c4,c5,c6) \ + {\ + if (a1 - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#define MINMAX3(a,b,c,min,max) \ -{ \ -if ((a)<(b)) { \ - if ((b)<(c)) { \ - (min) = (a); \ - (max) = (c); \ - } \ - else { \ - (max) = (b); \ - if ((a)<(c)) \ - (min) = (a); \ - else \ - (min) = (c); \ - } \ -} else { \ - if ((b)>(c)) { \ - (min) = (c); \ - (max) = (a); \ - } \ - else { \ - (min) = (b); \ - if ((a)>(c)) \ - (max) = (a); \ - else \ - (max) = (c); \ - } \ -} \ -} - -#define MIN3(a,b,c,min) \ -{ \ -if ((a)<(b)) { \ - if ((a)<(c)) \ - (min) = (a); \ - else \ - (min) = (c); \ -} else { \ - if ((b)>(c)) \ - (min) = (c); \ - else \ - (min) = (b); \ -} \ -} - -#define MAX3(a,b,c,min) \ -{ \ -if ((a)>(b)) { \ - if ((a)>(c)) \ - (max) = (a); \ - else \ - (max) = (c); \ -} else { \ - if ((b)<(c)) \ - (max) = (c); \ - else \ - (max) = (b); \ -} \ -} +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#define MINMAX3(a,b,c,min,max) \ +{ \ +if ((a)<(b)) { \ + if ((b)<(c)) { \ + (min) = (a); \ + (max) = (c); \ + } \ + else { \ + (max) = (b); \ + if ((a)<(c)) \ + (min) = (a); \ + else \ + (min) = (c); \ + } \ +} else { \ + if ((b)>(c)) { \ + (min) = (c); \ + (max) = (a); \ + } \ + else { \ + (min) = (b); \ + if ((a)>(c)) \ + (max) = (a); \ + else \ + (max) = (c); \ + } \ +} \ +} + +#define MIN3(a,b,c,min) \ +{ \ +if ((a)<(b)) { \ + if ((a)<(c)) \ + (min) = (a); \ + else \ + (min) = (c); \ +} else { \ + if ((b)>(c)) \ + (min) = (c); \ + else \ + (min) = (b); \ +} \ +} + +#define MAX3(a,b,c,min) \ +{ \ +if ((a)>(b)) { \ + if ((a)>(c)) \ + (max) = (a); \ + else \ + (max) = (c); \ +} else { \ + if ((b)<(c)) \ + (max) = (c); \ + else \ + (max) = (b); \ +} \ +} diff --git a/rtengine/myfile.cc b/rtengine/myfile.cc index aee82f5d8..ed414ac19 100644 --- a/rtengine/myfile.cc +++ b/rtengine/myfile.cc @@ -1,135 +1,135 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include -#ifdef RAWZOR_SUPPORT -#include -#endif - -IMFILE* fopen (const char* fname) { - - FILE* f = fopen (fname, "rb"); - if (!f) - return NULL; - IMFILE* mf = new IMFILE; - fseek (f, 0, SEEK_END); - mf->size = ftell (f); - mf->data = new char [mf->size]; - fseek (f, 0, SEEK_SET); - fread (mf->data, 1, mf->size, f); - fclose (f); - mf->pos = 0; - mf->eof = false; -#ifdef RAWZOR_SUPPORT - // RAWZOR support begin - bool rawzor = false; - Glib::ustring bname = Glib::path_get_basename(fname); - int lastdot = bname.find_last_of ('.'); - if (lastdot!=bname.npos) - rawzor = bname.substr (lastdot).casefold() == Glib::ustring(".rwz").casefold(); - - if (rawzor) { - int realSize = 0; - if (!m_rwz_check (mf->data, mf->size, &realSize)) { - char* realData = new char [realSize]; - m_rwz_decompress (mf->data, mf->size, realData, realSize); - delete [] mf->data; - mf->data = realData; - mf->size = realSize; - } - } - // RAWZOR support end -#endif - - return mf; -} - -IMFILE* gfopen (const char* fname) { - - FILE* f = g_fopen (fname, "rb"); - if (!f) - return NULL; - IMFILE* mf = new IMFILE; - fseek (f, 0, SEEK_END); - mf->size = ftell (f); - mf->data = new char [mf->size]; - fseek (f, 0, SEEK_SET); - fread (mf->data, 1, mf->size, f); - fclose (f); - mf->pos = 0; - mf->eof = false; - -#ifdef RAWZOR_SUPPORT - // RAWZOR support begin - bool rawzor = false; - Glib::ustring bname = Glib::path_get_basename(fname); - int lastdot = bname.find_last_of ('.'); - if (lastdot!=bname.npos) - rawzor = bname.substr (lastdot).casefold() == Glib::ustring(".rwz").casefold(); - - if (rawzor) { - int realSize = 0; - if (!m_rwz_check (mf->data, mf->size, &realSize)) { - char* realData = new char [realSize]; - m_rwz_decompress (mf->data, mf->size, realData, realSize); - delete [] mf->data; - mf->data = realData; - mf->size = realSize; - } - } - // RAWZOR support end -#endif - return mf; -} - -IMFILE* fopen (unsigned* buf, int size) { - - IMFILE* mf = new IMFILE; - mf->size = size; - mf->data = new char [mf->size]; - memcpy (mf->data, buf, size); - mf->pos = 0; - mf->eof = false; - return mf; -} - -void fclose (IMFILE* f) { - - delete [] f->data; - delete f; -} - -int fscanf (IMFILE* f, const char* s ...) { - - va_list ap; - return sscanf (f->data, s, ap); -} - -char* fgets (char* s, int n, IMFILE* f) { - - if (f->pos>=f->size) { - f->eof = true; - return NULL; - } - int i = 0; - do s[i++] = f->data[f->pos++]; - while (ipossize); - return s; -} +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include +#ifdef RAWZOR_SUPPORT +#include +#endif + +IMFILE* fopen (const char* fname) { + + FILE* f = fopen (fname, "rb"); + if (!f) + return NULL; + IMFILE* mf = new IMFILE; + fseek (f, 0, SEEK_END); + mf->size = ftell (f); + mf->data = new char [mf->size]; + fseek (f, 0, SEEK_SET); + fread (mf->data, 1, mf->size, f); + fclose (f); + mf->pos = 0; + mf->eof = false; +#ifdef RAWZOR_SUPPORT + // RAWZOR support begin + bool rawzor = false; + Glib::ustring bname = Glib::path_get_basename(fname); + int lastdot = bname.find_last_of ('.'); + if (lastdot!=bname.npos) + rawzor = bname.substr (lastdot).casefold() == Glib::ustring(".rwz").casefold(); + + if (rawzor) { + int realSize = 0; + if (!m_rwz_check (mf->data, mf->size, &realSize)) { + char* realData = new char [realSize]; + m_rwz_decompress (mf->data, mf->size, realData, realSize); + delete [] mf->data; + mf->data = realData; + mf->size = realSize; + } + } + // RAWZOR support end +#endif + + return mf; +} + +IMFILE* gfopen (const char* fname) { + + FILE* f = g_fopen (fname, "rb"); + if (!f) + return NULL; + IMFILE* mf = new IMFILE; + fseek (f, 0, SEEK_END); + mf->size = ftell (f); + mf->data = new char [mf->size]; + fseek (f, 0, SEEK_SET); + fread (mf->data, 1, mf->size, f); + fclose (f); + mf->pos = 0; + mf->eof = false; + +#ifdef RAWZOR_SUPPORT + // RAWZOR support begin + bool rawzor = false; + Glib::ustring bname = Glib::path_get_basename(fname); + int lastdot = bname.find_last_of ('.'); + if (lastdot!=bname.npos) + rawzor = bname.substr (lastdot).casefold() == Glib::ustring(".rwz").casefold(); + + if (rawzor) { + int realSize = 0; + if (!m_rwz_check (mf->data, mf->size, &realSize)) { + char* realData = new char [realSize]; + m_rwz_decompress (mf->data, mf->size, realData, realSize); + delete [] mf->data; + mf->data = realData; + mf->size = realSize; + } + } + // RAWZOR support end +#endif + return mf; +} + +IMFILE* fopen (unsigned* buf, int size) { + + IMFILE* mf = new IMFILE; + mf->size = size; + mf->data = new char [mf->size]; + memcpy (mf->data, buf, size); + mf->pos = 0; + mf->eof = false; + return mf; +} + +void fclose (IMFILE* f) { + + delete [] f->data; + delete f; +} + +int fscanf (IMFILE* f, const char* s ...) { + + va_list ap; + return sscanf (f->data, s, ap); +} + +char* fgets (char* s, int n, IMFILE* f) { + + if (f->pos>=f->size) { + f->eof = true; + return NULL; + } + int i = 0; + do s[i++] = f->data[f->pos++]; + while (ipossize); + return s; +} diff --git a/rtengine/myfile.h b/rtengine/myfile.h index c81d2eaac..99c450d8f 100644 --- a/rtengine/myfile.h +++ b/rtengine/myfile.h @@ -1,91 +1,91 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _MYFILE_ #define _MYFILE_ #include -#include +#include #include -struct IMFILE { - - int pos; - int size; - char* data; - bool eof; -}; - +struct IMFILE { + + int pos; + int size; + char* data; + bool eof; +}; + IMFILE* fopen (const char* fname); IMFILE* gfopen (const char* fname);IMFILE* fopen (unsigned* buf, int size); void fclose (IMFILE* f); -inline int ftell (IMFILE* f) { - - return f->pos; -} - -inline int feof (IMFILE* f) { - - return f->eof; -} - -inline void fseek (IMFILE* f, int p, int how) { - - if (how==SEEK_SET) - f->pos = p; - else if (how==SEEK_CUR) - f->pos += p; - else if (how==SEEK_END) - f->pos = f->size-p; -} - -inline int fgetc (IMFILE* f) { - - if (f->possize) - return (unsigned char)f->data[f->pos++]; - f->eof = true; - return EOF; -} - -inline int getc (IMFILE* f) { - - if (f->possize) - return (unsigned char)f->data[f->pos++]; - f->eof = true; - return EOF; -} - -inline int fread (void* dst, int es, int count, IMFILE* f) { - - int s = es*count; - int avail = f->size - f->pos; - if (s<=avail) { - memcpy (dst, f->data+f->pos, s); - f->pos += s; - return count; - } - else { - memcpy (dst, f->data+f->pos, avail); - f->pos += avail; - f->eof = true; - return avail/es; - } -} - +inline int ftell (IMFILE* f) { + + return f->pos; +} + +inline int feof (IMFILE* f) { + + return f->eof; +} + +inline void fseek (IMFILE* f, int p, int how) { + + if (how==SEEK_SET) + f->pos = p; + else if (how==SEEK_CUR) + f->pos += p; + else if (how==SEEK_END) + f->pos = f->size-p; +} + +inline int fgetc (IMFILE* f) { + + if (f->possize) + return (unsigned char)f->data[f->pos++]; + f->eof = true; + return EOF; +} + +inline int getc (IMFILE* f) { + + if (f->possize) + return (unsigned char)f->data[f->pos++]; + f->eof = true; + return EOF; +} + +inline int fread (void* dst, int es, int count, IMFILE* f) { + + int s = es*count; + int avail = f->size - f->pos; + if (s<=avail) { + memcpy (dst, f->data+f->pos, s); + f->pos += s; + return count; + } + else { + memcpy (dst, f->data+f->pos, avail); + f->pos += avail; + f->eof = true; + return avail/es; + } +} + int fscanf (IMFILE* f, const char* s ...); char* fgets (char* s, int n, IMFILE* f); #endif diff --git a/rtengine/mytime.h b/rtengine/mytime.h index 240076aa0..13ab8400a 100644 --- a/rtengine/mytime.h +++ b/rtengine/mytime.h @@ -1,62 +1,62 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _MYTIME_ -#define _MYTIME_ - -#ifdef WIN32 -#include -#elif defined __APPLE__ -#include -#else -#include -#endif - -class MyTime { - - public: -#ifndef WIN32 - timespec t; -#else - DWORD t; -#endif - - void set () { -#ifdef WIN32 - t = GetTickCount (); -#elif defined __APPLE__ - struct timeval tv; - gettimeofday(&tv, NULL); - t.tv_sec = tv.tv_sec; - t.tv_nsec = tv.tv_usec*1000; -#else - clock_gettime (CLOCK_REALTIME, &t); -#endif -} - - int etime (MyTime a) { -#ifndef WIN32 - return (t.tv_sec-a.t.tv_sec)*1000000 + (t.tv_nsec-a.t.tv_nsec)/1000; -#else - return (t - a.t)*1000; -#endif - } -}; - - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _MYTIME_ +#define _MYTIME_ + +#ifdef WIN32 +#include +#elif defined __APPLE__ +#include +#else +#include +#endif + +class MyTime { + + public: +#ifndef WIN32 + timespec t; +#else + DWORD t; +#endif + + void set () { +#ifdef WIN32 + t = GetTickCount (); +#elif defined __APPLE__ + struct timeval tv; + gettimeofday(&tv, NULL); + t.tv_sec = tv.tv_sec; + t.tv_nsec = tv.tv_usec*1000; +#else + clock_gettime (CLOCK_REALTIME, &t); +#endif +} + + int etime (MyTime a) { +#ifndef WIN32 + return (t.tv_sec-a.t.tv_sec)*1000000 + (t.tv_nsec-a.t.tv_nsec)/1000; +#else + return (t - a.t)*1000; +#endif + } +}; + + +#endif diff --git a/rtengine/processingjob.cc b/rtengine/processingjob.cc index 4c0b1ddcb..a55ad4bc6 100644 --- a/rtengine/processingjob.cc +++ b/rtengine/processingjob.cc @@ -1,39 +1,39 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include - -namespace rtengine { - -ProcessingJob* ProcessingJob::create (const Glib::ustring& fname, bool isRaw, const procparams::ProcParams& pparams) { - - return new ProcessingJobImpl (fname, isRaw, pparams); -} - -ProcessingJob* ProcessingJob::create (InitialImage* initialImage, const procparams::ProcParams& pparams) { - - return new ProcessingJobImpl (initialImage, pparams); -} - -void ProcessingJob::destroy (ProcessingJob* job) { +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include - delete (ProcessingJobImpl*) job; -} +namespace rtengine { + +ProcessingJob* ProcessingJob::create (const Glib::ustring& fname, bool isRaw, const procparams::ProcParams& pparams) { + + return new ProcessingJobImpl (fname, isRaw, pparams); +} + +ProcessingJob* ProcessingJob::create (InitialImage* initialImage, const procparams::ProcParams& pparams) { + + return new ProcessingJobImpl (initialImage, pparams); +} + +void ProcessingJob::destroy (ProcessingJob* job) { + + delete (ProcessingJobImpl*) job; +} + +} -} - diff --git a/rtengine/processingjob.h b/rtengine/processingjob.h index 050bde66a..5b7c13ab1 100644 --- a/rtengine/processingjob.h +++ b/rtengine/processingjob.h @@ -1,45 +1,45 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _PROCESSINGJOB_ -#define _PROCESSINGJOB_ - -#include - -namespace rtengine { - -class ProcessingJobImpl : public ProcessingJob { - - public: - Glib::ustring fname; - bool isRaw; - InitialImage* initialImage; - procparams::ProcParams pparams; - - ProcessingJobImpl (const Glib::ustring& fn, bool iR, const procparams::ProcParams& pp) - : fname(fn), isRaw(iR), initialImage(NULL) { pparams = pp; } - - ProcessingJobImpl (InitialImage* iImage, const procparams::ProcParams& pp) - : fname(""), initialImage(iImage) { pparams = pp; iImage->increaseRef(); } - - ~ProcessingJobImpl () { if (initialImage) initialImage->decreaseRef(); } -}; - -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _PROCESSINGJOB_ +#define _PROCESSINGJOB_ + +#include + +namespace rtengine { + +class ProcessingJobImpl : public ProcessingJob { + + public: + Glib::ustring fname; + bool isRaw; + InitialImage* initialImage; + procparams::ProcParams pparams; + + ProcessingJobImpl (const Glib::ustring& fn, bool iR, const procparams::ProcParams& pp) + : fname(fn), isRaw(iR), initialImage(NULL) { pparams = pp; } + + ProcessingJobImpl (InitialImage* iImage, const procparams::ProcParams& pp) + : fname(""), initialImage(iImage) { pparams = pp; iImage->increaseRef(); } + + ~ProcessingJobImpl () { if (initialImage) initialImage->decreaseRef(); } +}; + +}; + +#endif diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 9e0452b8d..7c1729bc5 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1,114 +1,114 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef __PROCEVENT__ -#define __PROCEVENT__ - -#include - -#define NUMOFEVENTS 83 - -namespace rtengine { - -enum ProcEvent { - EvPhotoLoaded=0, - EvProfileLoaded=1, - EvProfileChanged=2, - EvHistoryBrowsed=3, - EvBrightness=4, - EvContrast=5, - EvBlack=6, - EvExpComp=7, - EvHLCompr=8, - EvSHCompr=9, - EvToneCurve=10, - EvAutoExp=11, - EvClip=12, - EvLBrightness=13, - EvLContrast=14, - EvLBlack=15, - EvLHLCompr=16, - EvLSHCompr=17, - EvLCurve=18, - EvShrEnabled=19, - EvShrRadius=20, - EvShrAmount=21, - EvShrThresh=22, - EvShrEdgeOnly=23, - EvShrEdgeRadius=24, - EvShrEdgeTolerance=25, - EvShrHaloControl=26, - EvShrHaloAmount=27, - EvShrMethod=28, - EvShrDRadius=29, - EvShrDAmount=30, - EvShrDDamping=31, - EvShrDIterations=32, - EvCBAvoidClip=33, - EvCBSatLimiter=34, - EvCBSatLimit=35, - EvCBBoost=36, - EvWBMethod=37, - EvWBTemp=38, - EvWBGreen=39, - EvCShiftA=40, - EvCShiftB=41, - EvLDNEnabled=42, - EvLDNRadius=43, - EvLDNEdgeTolerance=44, - EvCDNEnabled=45, - EvCDNRadius=46, - EvCDNEdgeTolerance=47, - EvCDNEdgeSensitive=48, - EvSHEnabled=49, - EvSHHighlights=50, - EvSHShadows=51, - EvSHHLTonalW=52, - EvSHSHTonalW=53, - EvSHLContrast=54, - EvSHRadius=55, - EvCTRotate=56, - EvCTHFlip=57, - EvCTVFlip=58, - EvROTDegree=59, - EvROTFill=60, - EvDISTAmount=61, - EvBookmarkSelected=62, - EvCrop=63, - EvCACorr=64, - EvHREnabled=65, - EvHRAmount=66, - EvHRMethod=67, - EvWProfile=68, - EvOProfile=69, - EvIProfile=70, - EvVignetting=71, - EvChMixer=72, - EvResizeScale=73, - EvResizeMethod=74, - EvExif=75, - EvIPTC=76, - EvResizeSpec=77, - EvResizeWidth=78, - EvResizeHeight=79, - EvResizeEnabled=80, - EvProfileChangeNotification=81, - EvSHHighQuality=82 - }; -} -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef __PROCEVENT__ +#define __PROCEVENT__ + +#include + +#define NUMOFEVENTS 83 + +namespace rtengine { + +enum ProcEvent { + EvPhotoLoaded=0, + EvProfileLoaded=1, + EvProfileChanged=2, + EvHistoryBrowsed=3, + EvBrightness=4, + EvContrast=5, + EvBlack=6, + EvExpComp=7, + EvHLCompr=8, + EvSHCompr=9, + EvToneCurve=10, + EvAutoExp=11, + EvClip=12, + EvLBrightness=13, + EvLContrast=14, + EvLBlack=15, + EvLHLCompr=16, + EvLSHCompr=17, + EvLCurve=18, + EvShrEnabled=19, + EvShrRadius=20, + EvShrAmount=21, + EvShrThresh=22, + EvShrEdgeOnly=23, + EvShrEdgeRadius=24, + EvShrEdgeTolerance=25, + EvShrHaloControl=26, + EvShrHaloAmount=27, + EvShrMethod=28, + EvShrDRadius=29, + EvShrDAmount=30, + EvShrDDamping=31, + EvShrDIterations=32, + EvCBAvoidClip=33, + EvCBSatLimiter=34, + EvCBSatLimit=35, + EvCBBoost=36, + EvWBMethod=37, + EvWBTemp=38, + EvWBGreen=39, + EvCShiftA=40, + EvCShiftB=41, + EvLDNEnabled=42, + EvLDNRadius=43, + EvLDNEdgeTolerance=44, + EvCDNEnabled=45, + EvCDNRadius=46, + EvCDNEdgeTolerance=47, + EvCDNEdgeSensitive=48, + EvSHEnabled=49, + EvSHHighlights=50, + EvSHShadows=51, + EvSHHLTonalW=52, + EvSHSHTonalW=53, + EvSHLContrast=54, + EvSHRadius=55, + EvCTRotate=56, + EvCTHFlip=57, + EvCTVFlip=58, + EvROTDegree=59, + EvROTFill=60, + EvDISTAmount=61, + EvBookmarkSelected=62, + EvCrop=63, + EvCACorr=64, + EvHREnabled=65, + EvHRAmount=66, + EvHRMethod=67, + EvWProfile=68, + EvOProfile=69, + EvIProfile=70, + EvVignetting=71, + EvChMixer=72, + EvResizeScale=73, + EvResizeMethod=74, + EvExif=75, + EvIPTC=76, + EvResizeSpec=77, + EvResizeWidth=78, + EvResizeHeight=79, + EvResizeEnabled=80, + EvProfileChangeNotification=81, + EvSHHighQuality=82 + }; +} +#endif diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 31449afbf..5ffbe6b62 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _PROCPARAMS_H_ #define _PROCPARAMS_H_ diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 4fb9dd12a..47ac0097c 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -1,3126 +1,3126 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace rtengine { - -int loadRaw (const char* fname, struct RawImage* ri); - -extern const Settings* settings; - -#undef ABS -#undef MAX -#undef MIN -#undef DIST -#undef MAXVAL -#undef CLIP -#undef THREAD_PRIORITY_NORMAL - -#define ABS(a) ((a)<0?-(a):(a)) -#define MAX(a,b) ((a)<(b)?(b):(a)) -#define MIN(a,b) ((a)>(b)?(b):(a)) -#define DIST(a,b) (ABS(a-b)) -#define MAXVAL 0xffff -#define CLIP(a) ((a)>0?((a)allocation) - free (ri->allocation); - if (ri->data) - free (ri->data); - if (ri->profile_data) - free (ri->profile_data); - delete ri; - } - if (green) - freeArray(green, H); - if (red) - freeArray(red, H); - if (blue) - freeArray(blue, H); - - delete [] cache; - if (hrmap[0]!=NULL) { - int dh = H/HR_SCALE; - freeArray(hrmap[0], dh); - freeArray(hrmap[1], dh); - freeArray(hrmap[2], dh); - } - if (needhr) - freeArray(needhr, H); - if (hpmap) - freeArray(hpmap, H); - if (camProfile) - cmsCloseProfile (camProfile); - if (embProfile) - cmsCloseProfile (embProfile); -} - -void RawImageSource::transformRect (PreviewProps pp, int tran, int &ssx1, int &ssy1, int &width, int &height, int &fw) { - - pp.x += border; - pp.y += border; - - if (d1x) { - if ((tran & TR_ROT) == TR_R90 || (tran & TR_ROT) == TR_R270) { - pp.x /= 2; - pp.w = pp.w/2+1; - } - else { - pp.y /= 2; - pp.h = pp.h/2+1; - } - } - - int w = W, h = H; - if (fuji) { - w = ri->fuji_width * 2 + 1; - h = (H - ri->fuji_width)*2 + 1; - } - - int sw = w, sh = h; - if ((tran & TR_ROT) == TR_R90 || (tran & TR_ROT) == TR_R270) { - sw = h; - sh = w; - } - int ppx = pp.x, ppy = pp.y; - if (tran & TR_HFLIP) - ppx = sw - pp.x - pp.w; - if (tran & TR_VFLIP) - ppy = sh - pp.y - pp.h; - - int sx1 = ppx; - int sy1 = ppy; - int sx2 = ppx + pp.w; - int sy2 = ppy + pp.h; - - if ((tran & TR_ROT) == TR_R180) { - sx1 = w - ppx - pp.w; - sy1 = h - ppy - pp.h; - sx2 = sx1 + pp.w; - sy2 = sy1 + pp.h; - } - else if ((tran & TR_ROT) == TR_R90) { - sx1 = ppy; - sy1 = h - ppx - pp.w; - sx2 = sx1 + pp.h; - sy2 = sy1 + pp.w; - } - else if ((tran & TR_ROT) == TR_R270) { - sx1 = w - ppy - pp.h; - sy1 = ppx; - sx2 = sx1 + pp.h; - sy2 = sy1 + pp.w; - } - - if (fuji) { - // atszamoljuk a koordinatakat fuji-ra: - ssx1 = (sx1+sy1) / 2; - ssy1 = (sy1 - sx2 ) / 2 + ri->fuji_width; - int ssx2 = (sx2+sy2) / 2 + 1; - int ssy2 = (sy2 - sx1) / 2 + ri->fuji_width; - fw = (sx2 - sx1) / 2 / pp.skip; - width = (ssx2 - ssx1) / pp.skip + ((ssx2 - ssx1) % pp.skip > 0); - height = (ssy2 - ssy1) / pp.skip + ((ssy2 - ssy1) % pp.skip > 0); - } - else { - ssx1 = sx1; - ssy1 = sy1; - width = (sx2 - sx1) / pp.skip + ((sx2 - sx1) % pp.skip > 0); - height = (sy2 - sy1) / pp.skip + ((sy2 - sy1) % pp.skip > 0); - } -} - -void RawImageSource::getImage (ColorTemp ctemp, int tran, Image16* image, PreviewProps pp, HRecParams hrp, ColorManagementParams cmp) { - - isrcMutex.lock (); - - tran = defTransform (tran); - - // compute channel multipliers - double r, g, b, rm, gm, bm; - ctemp.getMultipliers (r, g, b); - rm = icoeff[0][0]*r + icoeff[0][1]*g + icoeff[0][2]*b; - gm = icoeff[1][0]*r + icoeff[1][1]*g + icoeff[1][2]*b; - bm = icoeff[2][0]*r + icoeff[2][1]*g + icoeff[2][2]*b; - rm = ri->camwb_red / rm; - gm = ri->camwb_green / gm; - bm = ri->camwb_blue / bm; - double mul_lum = 0.299*rm + 0.587*gm + 0.114*bm; - rm /= mul_lum; - gm /= mul_lum; - bm /= mul_lum; - - if (hrp.enabled) - defGain = log(ri->defgain) / log(2.0); - else { - defGain = 0.0; - rm *= ri->defgain; - gm *= ri->defgain; - bm *= ri->defgain; - } - - if (hrp.enabled==true && hrp.method=="Color" && hrmap[0]==NULL) - updateHLRecoveryMap_ColorPropagation (); - - // compute image area to render in order to provide the requested part of the image - int sx1, sy1, imwidth, imheight, fw; - transformRect (pp, tran, sx1, sy1, imwidth, imheight, fw); - - // check possible overflows - int maximwidth, maximheight; - if ((tran & TR_ROT) == TR_R90 || (tran & TR_ROT) == TR_R270) { - maximwidth = image->height; - maximheight = image->width; - } - else { - maximwidth = image->width; - maximheight = image->height; - } - if (d1x) - maximheight /= 2; - - // correct if overflow (very rare), but not fuji because it is corrected in transline - if (!fuji && imwidth>maximwidth) - imwidth = maximwidth; - if (!fuji && imheight>maximheight) - imheight = maximheight; - - // render the requested image part - unsigned short* red = new unsigned short[imwidth]; - unsigned short* grn = new unsigned short[imwidth]; - unsigned short* blue = new unsigned short[imwidth]; - - for (int i=sy1,ix=0; ixfilters && this->red && this->blue) { - for (int j=0,jx=sx1; jred[i][jx]); - grn[j] = CLIP(gm*green[i][jx]); - blue[j] = CLIP(bm*this->blue[i][jx]); - } - } else if(ri->filters) { - if (i==0) - interpolate_row_rb_mul_pp (red, blue, NULL, green[i], green[i+1], i, rm, gm, bm, sx1, imwidth, pp.skip); - else if (i==H-1) - interpolate_row_rb_mul_pp (red, blue, green[i-1], green[i], NULL, i, rm, gm, bm, sx1, imwidth, pp.skip); - else - interpolate_row_rb_mul_pp (red, blue, green[i-1], green[i], green[i+1], i, rm, gm, bm, sx1, imwidth, pp.skip); - - for (int j=0,jx=sx1; jdata[i][jx*3+0]); - grn[j] = CLIP(gm*ri->data[i][jx*3+1]); - blue[j] = CLIP(bm*ri->data[i][jx*3+2]); - } - } - - if (hrp.enabled) - hlRecovery (hrp.method, red, grn, blue, i, sx1, imwidth, pp.skip); - - transLine (red, grn, blue, ix, image, tran, imwidth, imheight, fw); - } - - delete [] red; - delete [] grn; - delete [] blue; - - if (fuji) { - int a = ((tran & TR_ROT) == TR_R90 && image->width%2==0) || ((tran & TR_ROT) == TR_R180 && image->height%2+image->width%2==1) || ((tran & TR_ROT) == TR_R270 && image->height%2==0); - // first row - for (int j=1+a; jwidth-1; j+=2) { - image->r[0][j] = (image->r[1][j] + image->r[0][j+1] + image->r[0][j-1]) / 3; - image->g[0][j] = (image->g[1][j] + image->g[0][j+1] + image->g[0][j-1]) / 3; - image->b[0][j] = (image->b[1][j] + image->b[0][j+1] + image->b[0][j-1]) / 3; - } - // other rows - for (int i=1; iheight-1; i++) { - for (int j=2-(a+i+1)%2; jwidth-1; j+=2) { - // edge-adaptive interpolation - double dh = (ABS(image->r[i][j+1] - image->r[i][j-1]) + ABS(image->g[i][j+1] - image->g[i][j-1]) + ABS(image->b[i][j+1] - image->b[i][j-1])) / 1.0; - double dv = (ABS(image->r[i+1][j] - image->r[i-1][j]) + ABS(image->g[i+1][j] - image->g[i-1][j]) + ABS(image->b[i+1][j] - image->b[i-1][j])) / 1.0; - double eh = 1.0 / (1.0 + dh); - double ev = 1.0 / (1.0 + dv); - image->r[i][j] = (eh * (image->r[i][j+1] + image->r[i][j-1]) + ev * (image->r[i+1][j] + image->r[i-1][j])) / (2.0 * (eh + ev)); - image->g[i][j] = (eh * (image->g[i][j+1] + image->g[i][j-1]) + ev * (image->g[i+1][j] + image->g[i-1][j])) / (2.0 * (eh + ev)); - image->b[i][j] = (eh * (image->b[i][j+1] + image->b[i][j-1]) + ev * (image->b[i+1][j] + image->b[i-1][j])) / (2.0 * (eh + ev)); - } - // first pixel - if (2-(a+i+1)%2==2) { - image->r[i][0] = (image->r[i+1][0] + image->r[i-1][0] + image->r[i][1]) / 3; - image->g[i][0] = (image->g[i+1][0] + image->g[i-1][0] + image->g[i][1]) / 3; - image->b[i][0] = (image->b[i+1][0] + image->b[i-1][0] + image->b[i][1]) / 3; - } - // last pixel - if (2-(a+i+image->width)%2==2) { - image->r[i][image->width-1] = (image->r[i+1][image->width-1] + image->r[i-1][image->width-1] + image->r[i][image->width-2]) / 3; - image->g[i][image->width-1] = (image->g[i+1][image->width-1] + image->g[i-1][image->width-1] + image->g[i][image->width-2]) / 3; - image->b[i][image->width-1] = (image->b[i+1][image->width-1] + image->b[i-1][image->width-1] + image->b[i][image->width-2]) / 3; - } - } - // last row - int b = (a==1 && image->height%2) || (a==0 && image->height%2==0); - for (int j=1+b; jwidth-1; j+=2) { - image->r[image->height-1][j] = (image->r[image->height-2][j] + image->r[image->height-1][j+1] + image->r[image->height-1][j-1]) / 3; - image->g[image->height-1][j] = (image->g[image->height-2][j] + image->g[image->height-1][j+1] + image->g[image->height-1][j-1]) / 3; - image->b[image->height-1][j] = (image->b[image->height-2][j] + image->b[image->height-1][j+1] + image->b[image->height-1][j-1]) / 3; - } - } - - // Flip if needed - if (tran & TR_HFLIP) - hflip (image); - if (tran & TR_VFLIP) - vflip (image); - - // Color correction - if (ri->filters && pp.skip==1) - correction_YIQ_LQ (image, settings->colorCorrectionSteps); - - // Applying postmul - colorSpaceConversion (image, cmp, embProfile, camProfile, cam, defGain); - - isrcMutex.unlock (); -} - -void RawImageSource::rotateLine (unsigned short* line, unsigned short** channel, int tran, int i, int w, int h) { - - if ((tran & TR_ROT) == TR_R180) - for (int j=0; j=0 && yheight && y>=0 && xwidth) { - image->r[image->height-1-y][image->width-1-x] = red[j]; - image->g[image->height-1-y][image->width-1-x] = green[j]; - image->b[image->height-1-y][image->width-1-x] = blue[j]; - } - } - } - else if ((tran & TR_ROT) == TR_R270) { - int end = MIN(h+fw-i, w-fw+i); - for (int j=start; j=0 && xheight && y>=0 && ywidth) { - image->r[image->height-1-x][y] = red[j]; - image->g[image->height-1-x][y] = green[j]; - image->b[image->height-1-x][y] = blue[j]; - } - } - } - else if ((tran & TR_ROT) == TR_R90) { - int end = MIN(h+fw-i, w-fw+i); - for (int j=start; j=0 && ywidth && y>=0 && xheight) { - image->r[x][image->width-1-y] = red[j]; - image->g[x][image->width-1-y] = green[j]; - image->b[x][image->width-1-y] = blue[j]; - } - } - } - else { - int end = MIN(h+fw-i, w-fw+i); - for (int j=start; j=0 && yheight && y>=0 && xwidth) { - image->r[y][x] = red[j]; - image->g[y][x] = green[j]; - image->b[y][x] = blue[j]; - } - } - } - } - // Nikon D1X vertical interpolation + coarse rotation - else if (d1x) { - // copy new pixels - if ((tran & TR_ROT) == TR_R180) { - for (int j=0; jr[2*imheight-2-2*i][imwidth-1-j] = red[j]; - image->g[2*imheight-2-2*i][imwidth-1-j] = green[j]; - image->b[2*imheight-2-2*i][imwidth-1-j] = blue[j]; - } - - if (i==1 || i==2) { // linear interpolation - int row = 2*imheight-1-2*i; - for (int j=0; jr[row][col] = (red[j] + image->r[row+1][col]) >> 1; - image->g[row][col] = (green[j] + image->g[row+1][col]) >> 1; - image->b[row][col] = (blue[j] + image->b[row+1][col]) >> 1; - } - } - else if (i==imheight-1) { - int row = 2*imheight-1-2*i; - for (int j=0; jr[row][col] = (red[j] + image->r[row+1][col]) >> 1; - image->g[row][col] = (green[j] + image->g[row+1][col]) >> 1; - image->b[row][col] = (blue[j] + image->b[row+1][col]) >> 1; - } - row = 2*imheight-1-2*i+2; - for (int j=0; jr[row][col] = (red[j] + image->r[row+1][col]) >> 1; - image->g[row][col] = (green[j] + image->g[row+1][col]) >> 1; - image->b[row][col] = (blue[j] + image->b[row+1][col]) >> 1; - } - } - else if (i>2 && ir[row][col] = CLIP((int)(-0.0625*red[j] + 0.5625*image->r[row-1][col] + 0.5625*image->r[row+1][col] - 0.0625*image->r[row+3][col])); - image->g[row][col] = CLIP((int)(-0.0625*green[j] + 0.5625*image->g[row-1][col] + 0.5625*image->g[row+1][col] - 0.0625*image->g[row+3][col])); - image->b[row][col] = CLIP((int)(-0.0625*blue[j] + 0.5625*image->b[row-1][col] + 0.5625*image->b[row+1][col] - 0.0625*image->b[row+3][col])); - } - } - } - else if ((tran & TR_ROT) == TR_R90) { - for (int j=0; jr[j][2*imheight-2-2*i] = red[j]; - image->g[j][2*imheight-2-2*i] = green[j]; - image->b[j][2*imheight-2-2*i] = blue[j]; - } - if (i==1 || i==2) { // linear interpolation - int col = 2*imheight-1-2*i; - for (int j=0; jr[j][col] = (red[j] + image->r[j][col+1]) >> 1; - image->g[j][col] = (green[j] + image->g[j][col+1]) >> 1; - image->b[j][col] = (blue[j] + image->b[j][col+1]) >> 1; - } - } - else if (i==imheight-1) { - int col = 2*imheight-1-2*i; - for (int j=0; jr[j][col] = (red[j] + image->r[j][col+1]) >> 1; - image->g[j][col] = (green[j] + image->g[j][col+1]) >> 1; - image->b[j][col] = (blue[j] + image->b[j][col+1]) >> 1; - } - col = 2*imheight-1-2*i+2; - for (int j=0; jr[j][col] = (red[j] + image->r[j][col+1]) >> 1; - image->g[j][col] = (green[j] + image->g[j][col+1]) >> 1; - image->b[j][col] = (blue[j] + image->b[j][col+1]) >> 1; - } - } - else if (i>2 && ir[j][col] = CLIP((int)(-0.0625*red[j] + 0.5625*image->r[j][col-1] + 0.5625*image->r[j][col+1] - 0.0625*image->r[j][col+3])); - image->g[j][col] = CLIP((int)(-0.0625*green[j] + 0.5625*image->g[j][col-1] + 0.5625*image->g[j][col+1] - 0.0625*image->g[j][col+3])); - image->b[j][col] = CLIP((int)(-0.0625*blue[j] + 0.5625*image->b[j][col-1] + 0.5625*image->b[j][col+1] - 0.0625*image->b[j][col+3])); - } - } - } - else if ((tran & TR_ROT) == TR_R270) { - for (int j=0; jr[imwidth-1-j][2*i] = red[j]; - image->g[imwidth-1-j][2*i] = green[j]; - image->b[imwidth-1-j][2*i] = blue[j]; - } - if (i==1 || i==2) { // linear interpolation - for (int j=0; jr[row][2*i-1] = (red[j] + image->r[row][2*i-2]) >> 1; - image->g[row][2*i-1] = (green[j] + image->g[row][2*i-2]) >> 1; - image->b[row][2*i-1] = (blue[j] + image->b[row][2*i-2]) >> 1; - } - } - else if (i==imheight-1) { - for (int j=0; jr[row][2*i-1] = (red[j] + image->r[row][2*i-2]) >> 1; - image->g[row][2*i-1] = (green[j] + image->g[row][2*i-2]) >> 1; - image->b[row][2*i-1] = (blue[j] + image->b[row][2*i-2]) >> 1; - image->r[row][2*i-3] = (image->r[row][2*i-2] + image->r[row][2*i-4]) >> 1; - image->g[row][2*i-3] = (image->g[row][2*i-2] + image->g[row][2*i-4]) >> 1; - image->b[row][2*i-3] = (image->b[row][2*i-2] + image->b[row][2*i-4]) >> 1; - } - } - else if (i>0 && ir[row][2*i-3] = CLIP((int)(-0.0625*red[j] + 0.5625*image->r[row][2*i-2] + 0.5625*image->r[row][2*i-4] - 0.0625*image->r[row][2*i-6])); - image->g[row][2*i-3] = CLIP((int)(-0.0625*green[j] + 0.5625*image->g[row][2*i-2] + 0.5625*image->g[row][2*i-4] - 0.0625*image->g[row][2*i-6])); - image->b[row][2*i-3] = CLIP((int)(-0.0625*blue[j] + 0.5625*image->b[row][2*i-2] + 0.5625*image->b[row][2*i-4] - 0.0625*image->b[row][2*i-6])); - } - } - } - else { - rotateLine (red, image->r, tran, 2*i, imwidth, imheight); - rotateLine (green, image->g, tran, 2*i, imwidth, imheight); - rotateLine (blue, image->b, tran, 2*i, imwidth, imheight); - - if (i==1 || i==2) { // linear interpolation - for (int j=0; jr[2*i-1][j] = (red[j] + image->r[2*i-2][j]) >> 1; - image->g[2*i-1][j] = (green[j] + image->g[2*i-2][j]) >> 1; - image->b[2*i-1][j] = (blue[j] + image->b[2*i-2][j]) >> 1; - } - } - else if (i==imheight-1) { - for (int j=0; jr[2*i-3][j] = (image->r[2*i-4][j] + image->r[2*i-2][j]) >> 1; - image->g[2*i-3][j] = (image->g[2*i-4][j] + image->g[2*i-2][j]) >> 1; - image->b[2*i-3][j] = (image->b[2*i-4][j] + image->b[2*i-2][j]) >> 1; - image->r[2*i-1][j] = (red[j] + image->r[2*i-2][j]) >> 1; - image->g[2*i-1][j] = (green[j] + image->g[2*i-2][j]) >> 1; - image->b[2*i-1][j] = (blue[j] + image->b[2*i-2][j]) >> 1; - } - } - else if (i>2 && ir[2*i-3][j] = CLIP((int)(-0.0625*red[j] + 0.5625*image->r[2*i-2][j] + 0.5625*image->r[2*i-4][j] - 0.0625*image->r[2*i-6][j])); - image->g[2*i-3][j] = CLIP((int)(-0.0625*green[j] + 0.5625*image->g[2*i-2][j] + 0.5625*image->g[2*i-4][j] - 0.0625*image->g[2*i-6][j])); - image->b[2*i-3][j] = CLIP((int)(-0.0625*blue[j] + 0.5625*image->b[2*i-2][j] + 0.5625*image->b[2*i-4][j] - 0.0625*image->b[2*i-6][j])); - } - } - } - } - // other (conventional) CCD coarse rotation - else { - rotateLine (red, image->r, tran, i, imwidth, imheight); - rotateLine (green, image->g, tran, i, imwidth, imheight); - rotateLine (blue, image->b, tran, i, imwidth, imheight); - } -} - -void RawImageSource::getFullSize (int& w, int& h, int tr) { - - tr = defTransform (tr); - - if (fuji) { - w = ri->fuji_width * 2 + 1; - h = (H - ri->fuji_width)*2 + 1; - } - else if (d1x) { - w = W; - h = 2*H-1; - } - else { - w = W; - h = H; - } - - if ((tr & TR_ROT) == TR_R90 || (tr & TR_ROT) == TR_R270) { - int tmp = w; - w = h; - h = tmp; - } - w -= 2 * border; - h -= 2 * border; -} - -void RawImageSource::getSize (int tran, PreviewProps pp, int& w, int& h) { - - tran = defTransform (tran); - -// if (fuji) { -// return; -// } -// else if (d1x) { -// return; -// } -// else { - w = pp.w / pp.skip + (pp.w % pp.skip > 0); - h = pp.h / pp.skip + (pp.h % pp.skip > 0); -// } -} - -void RawImageSource::hflip (Image16* image) { - int width = image->width; - int height = image->height; - - unsigned short* rowr = new unsigned short[width]; - unsigned short* rowg = new unsigned short[width]; - unsigned short* rowb = new unsigned short[width]; - for (int i=0; ir[i][width-1-j]; - rowg[j] = image->g[i][width-1-j]; - rowb[j] = image->b[i][width-1-j]; - } - memcpy (image->r[i], rowr, width*sizeof(unsigned short)); - memcpy (image->g[i], rowg, width*sizeof(unsigned short)); - memcpy (image->b[i], rowb, width*sizeof(unsigned short)); - } - delete [] rowr; - delete [] rowg; - delete [] rowb; -} - -void RawImageSource::vflip (Image16* image) { - int width = image->width; - int height = image->height; - - register unsigned short tmp; - for (int i=0; ir[i][j]; - image->r[i][j] = image->r[height-1-i][j]; - image->r[height-1-i][j] = tmp; - tmp = image->g[i][j]; - image->g[i][j] = image->g[height-1-i][j]; - image->g[height-1-i][j] = tmp; - tmp = image->b[i][j]; - image->b[i][j] = image->b[height-1-i][j]; - image->b[height-1-i][j] = tmp; - } -} - -void RawImageSource::inverse33 (double (*coeff)[3], double (*icoeff)[3]) { - double nom = coeff[0][2]*coeff[1][1]*coeff[2][0] - coeff[0][1]*coeff[1][2]*coeff[2][0] - coeff[0][2]*coeff[1][0]*coeff[2][1] + coeff[0][0]*coeff[1][2]*coeff[2][1] + coeff[0][1]*coeff[1][0]*coeff[2][2] - coeff[0][0]*coeff[1][1]*coeff[2][2]; - icoeff[0][0] = (coeff[1][2]*coeff[2][1]-coeff[1][1]*coeff[2][2]) / nom; - icoeff[0][1] = -(coeff[0][2]*coeff[2][1]-coeff[0][1]*coeff[2][2]) / nom; - icoeff[0][2] = (coeff[0][2]*coeff[1][1]-coeff[0][1]*coeff[1][2]) / nom; - icoeff[1][0] = -(coeff[1][2]*coeff[2][0]-coeff[1][0]*coeff[2][2]) / nom; - icoeff[1][1] = (coeff[0][2]*coeff[2][0]-coeff[0][0]*coeff[2][2]) / nom; - icoeff[1][2] = -(coeff[0][2]*coeff[1][0]-coeff[0][0]*coeff[1][2]) / nom; - icoeff[2][0] = (coeff[1][1]*coeff[2][0]-coeff[1][0]*coeff[2][1]) / nom; - icoeff[2][1] = -(coeff[0][1]*coeff[2][0]-coeff[0][0]*coeff[2][1]) / nom; - icoeff[2][2] = (coeff[0][1]*coeff[1][0]-coeff[0][0]*coeff[1][1]) / nom; -} - -int RawImageSource::load (Glib::ustring fname) { - - fileName = fname; - - if (plistener) { - plistener->setProgressStr ("Decoding..."); - plistener->setProgress (0.0); - } - - ri = new RawImage; - int res = loadRaw (fname.c_str(), ri); - if (res) - return res; - - if(red) { - delete red; - red = 0; - } - if(green) { - delete green; - green = 0; - } - if(blue) { - delete blue; - blue = 0; - } - - W = ri->width; - H = ri->height; - - d1x = !strcmp(ri->model, "D1X"); - fuji = ri->fuji_width; - if (d1x) - border = 8; - - for (int i=0; i<3; i++) - for (int j=0; j<3; j++) - coeff[i][j] = ri->coeff[i][j]; - - // compute inverse of the color transformation matrix - inverse33 (coeff, icoeff); - - double cam_r = coeff[0][0]*ri->camwb_red + coeff[0][1]*ri->camwb_green + coeff[0][2]*ri->camwb_blue; - double cam_g = coeff[1][0]*ri->camwb_red + coeff[1][1]*ri->camwb_green + coeff[1][2]*ri->camwb_blue; - double cam_b = coeff[2][0]*ri->camwb_red + coeff[2][1]*ri->camwb_green + coeff[2][2]*ri->camwb_blue; - - wb = ColorTemp (cam_r, cam_g, cam_b); - - double tr = icoeff[0][0] * cam_r + icoeff[0][1] * cam_g + icoeff[0][2] * cam_b; - double tg = icoeff[1][0] * cam_r + icoeff[1][1] * cam_g + icoeff[1][2] * cam_b; - double tb = icoeff[2][0] * cam_r + icoeff[2][1] * cam_g + icoeff[2][2] * cam_b; - - // create profile - memset (cam, 0, sizeof(cam)); - for (int i=0; i<3; i++) - for (int j=0; j<3; j++) - for (int k=0; k<3; k++) - cam[i][j] += coeff[k][i] * sRGB_d50[k][j]; - camProfile = iccStore.createFromMatrix (cam, false, "Camera"); - inverse33 (cam, icam); - - if (ri->profile_data) - embProfile = cmsOpenProfileFromMem (ri->profile_data, ri->profile_len); - - defGain = log(ri->defgain) / log(2.0); - - RawMetaDataLocation rml; - rml.exifBase = ri->exifbase; - rml.ciffBase = ri->ciff_base; - rml.ciffLength = ri->ciff_len; - - idata = new ImageData (fname, &rml); - - // check if it is an olympus E camera, if yes, compute G channel pre-compensation factors - if (((idata->getMake().size()>=7 && idata->getMake().substr(0,7)=="OLYMPUS" && idata->getModel()[0]=='E') || (idata->getMake().size()>=9 && idata->getMake().substr(0,7)=="Panasonic")) && settings->demosaicMethod!="vng4" && ri->filters) { - // global correction - int ng1=0, ng2=0; - double avgg1=0, avgg2=0; - for (int i=border; idata[i][j]; - ng1++; - } - else { - avgg2 += ri->data[i][j]; - ng2++; - } - } - double corrg1 = ((double)avgg1/ng1 + (double)avgg2/ng2) / 2.0 / ((double)avgg1/ng1); - double corrg2 = ((double)avgg1/ng1 + (double)avgg2/ng2) / 2.0 / ((double)avgg2/ng2); - for (int i=border; idata[i][j] = CLIP(ri->data[i][j] * (i%2 ? corrg2 : corrg1)); - - // local correction in a 9x9 box -/* unsigned short* corr_alloc = new unsigned short[W*H]; - unsigned short** corr_data = new unsigned short* [H]; - for (int i=0; iallocation, W*H*sizeof(unsigned short)); - for (int i=border; idata[i-4][j-4] + ri->data[i-4][j-2] + ri->data[i-4][j] + ri->data[i-4][j+2] + - ri->data[i-2][j-4] + ri->data[i-2][j-2] + ri->data[i-2][j] + ri->data[i-2][j+2] + - ri->data[i][j-4] + ri->data[i][j-2] + ri->data[i][j] + ri->data[i][j+2] + - ri->data[i+2][j-4] + ri->data[i+2][j-2] + ri->data[i+2][j] + ri->data[i+2][j+2]; - unsigned int ag2 = ri->data[i-3][j-3] + ri->data[i-3][j-1] + ri->data[i-3][j+1] + ri->data[i-3][j+1] + - ri->data[i-1][j-3] + ri->data[i-1][j-1] + ri->data[i-1][j+1] + ri->data[i-1][j+1] + - ri->data[i+1][j-3] + ri->data[i+1][j-1] + ri->data[i+1][j+1] + ri->data[i+1][j+1] + - ri->data[i+3][j-3] + ri->data[i+3][j-1] + ri->data[i+3][j+1] + ri->data[i+3][j+1]; - unsigned int val = (ri->data[i][j] + ri->data[i][j] * ag2 / ag1) / 2; - corr_data[i][j] = CLIP (val); - } - memcpy (ri->allocation, corr_alloc, W*H*sizeof(unsigned short)); - delete corr_alloc; - delete corr_data; -*/ - } - - if (ri->filters) { - // demosaic - if (settings->demosaicMethod=="hphd") - hphd_demosaic (); - else if (settings->demosaicMethod=="vng4") - vng4_demosaic (); - else if (settings->demosaicMethod=="ahd") - ahd_demosaic (); - else if (settings->demosaicMethod=="ppg") - ppg_demosaic (); - else if (settings->demosaicMethod=="dcb") - dcb_demosaic(settings->dcb_iterations, settings->dcb_enhance? 1:0); - else - eahd_demosaic (); - } - - - if (plistener) { - plistener->setProgressStr ("Ready."); - plistener->setProgress (1.0); - } - - return 0; -} - -int RawImageSource::defTransform (int tran) { - - int deg = ri->rotate_deg; - if ((tran & TR_ROT) == TR_R180) - deg += 180; - else if ((tran & TR_ROT) == TR_R90) - deg += 90; - else if ((tran & TR_ROT) == TR_R270) - deg += 270; - deg %= 360; - - int ret = 0; - if (deg==90) - ret |= TR_R90; - else if (deg==180) - ret |= TR_R180; - else if (deg==270) - ret |= TR_R270; - if (tran & TR_HFLIP) - ret |= TR_HFLIP; - if (tran & TR_VFLIP) - ret |= TR_VFLIP; - return ret; -} - -void RawImageSource::correction_YIQ_LQ_ (Image16* im, int row_from, int row_to) { - - int W = im->width; - - int** rbconv_Y = new int*[3]; - int** rbconv_I = new int*[3]; - int** rbconv_Q = new int*[3]; - int** rbout_I = new int*[3]; - int** rbout_Q = new int*[3]; - for (int i=0; i<3; i++) { - rbconv_Y[i] = new int[W]; - rbconv_I[i] = new int[W]; - rbconv_Q[i] = new int[W]; - rbout_I[i] = new int[W]; - rbout_Q[i] = new int[W]; - } - - int* row_I = new int[W]; - int* row_Q = new int[W]; - - int* pre1_I = new int[3]; - int* pre2_I = new int[3]; - int* post1_I = new int[3]; - int* post2_I = new int[3]; - int middle_I[6]; - int* pre1_Q = new int[3]; - int* pre2_Q = new int[3]; - int* post1_Q = new int[3]; - int* post2_Q = new int[3]; - int middle_Q[6]; - int* tmp; - - int ppx=0, px=(row_from-1)%3, cx=row_from%3, nx=0; - - convert_row_to_YIQ (im->r[row_from-1], im->g[row_from-1], im->b[row_from-1], rbconv_Y[px], rbconv_I[px], rbconv_Q[px], W); - convert_row_to_YIQ (im->r[row_from], im->g[row_from], im->b[row_from], rbconv_Y[cx], rbconv_I[cx], rbconv_Q[cx], W); - - for (int j=0; jr[i+1], im->g[i+1], im->b[i+1], rbconv_Y[nx], rbconv_I[nx], rbconv_Q[nx], W); - - SORT3(rbconv_I[px][0],rbconv_I[cx][0],rbconv_I[nx][0],pre1_I[0],pre1_I[1],pre1_I[2]); - SORT3(rbconv_I[px][1],rbconv_I[cx][1],rbconv_I[nx][1],pre2_I[0],pre2_I[1],pre2_I[2]); - SORT3(rbconv_Q[px][0],rbconv_Q[cx][0],rbconv_Q[nx][0],pre1_Q[0],pre1_Q[1],pre1_Q[2]); - SORT3(rbconv_Q[px][1],rbconv_Q[cx][1],rbconv_Q[nx][1],pre2_Q[0],pre2_Q[1],pre2_Q[2]); - - // median I channel - for (int j=1; jrow_from) { - for (int j=1; jr[i-1], im->g[i-1], im->b[i-1], rbconv_Y[px], row_I, row_Q, W); - } - } - // blur last 3 row and finalize H-1th row - for (int j=1; jr[row_to-1], im->g[row_to-1], im->b[row_to-1], rbconv_Y[cx], row_I, row_Q, W); - - freeArray(rbconv_Y, 3); - freeArray(rbconv_I, 3); - freeArray(rbconv_Q, 3); - freeArray(rbout_I, 3); - freeArray(rbout_Q, 3); - delete [] row_I; - delete [] row_Q; - delete [] pre1_I; - delete [] pre2_I; - delete [] post1_I; - delete [] post2_I; - delete [] pre1_Q; - delete [] pre2_Q; - delete [] post1_Q; - delete [] post2_Q; -} - - -void RawImageSource::correction_YIQ_LQ (Image16* im, int times) { - - if (im->height<4) - return; - - MyTime t1, t2; - - t1.set (); - for (int t=0; tdualThreadEnabled) { - Glib::Thread *thread1 = Glib::Thread::create(sigc::bind(sigc::mem_fun(*this, &RawImageSource::correction_YIQ_LQ_), im, 1, im->height/2), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); - Glib::Thread *thread2 = Glib::Thread::create(sigc::bind(sigc::mem_fun(*this, &RawImageSource::correction_YIQ_LQ_), im, im->height/2, im->height-1), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); - thread1->join (); - thread2->join (); - } - else - correction_YIQ_LQ_ (im, 1, im->height-1); - } - t2.set (); -// printf ("Corrected. (%d)\n", t2.etime(t1)); -} - - - -void RawImageSource::convert_row_to_YIQ (unsigned short* r, unsigned short* g, unsigned short* b, int* Y, int* I, int* Q, int W) { - for (int j=0; j -void RawImageSource::convert_to_cielab_row (unsigned short* ar, unsigned short* ag, unsigned short* ab, short* oL, short* oa, short* ob) { - - for (int j=0; jthreshold) - oL[j] = 300.0*cache[(int)y]; - else - oL[j] = 300.0 * 903.3 * y / CMAXVAL; - - oa[j] = 32.0 * 500.0 * ((x>threshold ? cache[(int)x] : 7.787*x/CMAXVAL+16.0/116.0) - (y>threshold ? cache[(int)y] : 7.787*y/CMAXVAL+16.0/116.0)); - ob[j] = 32.0 * 200.0 * ((y>threshold ? cache[(int)y] : 7.787*y/CMAXVAL+16.0/116.0) - (z>threshold ? cache[(int)z] : 7.787*z/CMAXVAL+16.0/116.0)); - } -} - -void RawImageSource::interpolate_row_g (unsigned short* agh, unsigned short* agv, int i) { - - for (int j=0; jdata[i][j]; - agv[j] = ri->data[i][j]; - } - else { - int gh=0; - int gv=0; - if (j>1 && jdata[i][j-2] + 2*ri->data[i][j-1] + 2*ri->data[i][j] + 2*ri->data[i][j+1] -ri->data[i][j+2]) / 4; - int maxgh = MAX(ri->data[i][j-1], ri->data[i][j+1]); - int mingh = MIN(ri->data[i][j-1], ri->data[i][j+1]); - if (gh>maxgh) - gh = maxgh; - else if (ghdata[i][1]; - else if (j==1) - gh = (ri->data[i][0] + ri->data[i][2]) / 2; - else if (j==W-1) - gh = ri->data[i][W-2]; - else if (j==W-2) - gh = (ri->data[i][W-1] + ri->data[i][W-3]) / 2; - - if (i>1 && idata[i-2][j] + 2*ri->data[i-1][j] + 2*ri->data[i][j] + 2*ri->data[i+1][j] - ri->data[i+2][j]) / 4; - int maxgv = MAX(ri->data[i-1][j], ri->data[i+1][j]); - int mingv = MIN(ri->data[i-1][j], ri->data[i+1][j]); - if (gv>maxgv) - gv = maxgv; - else if (gvdata[1][j]; - else if (i==1) - gv = (ri->data[0][j] + ri->data[2][j]) / 2; - else if (i==H-1) - gv = ri->data[H-2][j]; - else if (i==H-2) - gv = (ri->data[H-1][j] + ri->data[H-3][j]) / 2; - - agh[j] = CLIP(gh); - agv[j] = CLIP(gv); - } - } -} - -void RawImageSource::interpolate_row_rb (unsigned short* ar, unsigned short* ab, unsigned short* pg, unsigned short* cg, unsigned short* ng, int i) { - if (ISRED(ri,i,0) || ISRED(ri,i,1)) { - // RGRGR or GRGRGR line - for (int j=0; jdata[i][j]; - // blue: cross interpolation - int b = 0; - int n = 0; - if (i>0 && j>0) { - b += ri->data[i-1][j-1] - pg[j-1]; - n++; - } - if (i>0 && jdata[i-1][j+1] - pg[j+1]; - n++; - } - if (i0) { - b += ri->data[i+1][j-1] - ng[j-1]; - n++; - } - if (idata[i+1][j+1] - ng[j+1]; - n++; - } - b = cg[j] + b / n; - ab[j] = CLIP(b); - } - else { - // linear R-G interp. horizontally - int r; - if (j==0) - r = cg[0] + ri->data[i][1] - cg[1]; - else if (j==W-1) - r = cg[W-1] + ri->data[i][W-2] - cg[W-2]; - else - r = cg[j] + (ri->data[i][j-1] - cg[j-1] + ri->data[i][j+1] - cg[j+1]) / 2; - ar[j] = CLIP(r); - // linear B-G interp. vertically - int b; - if (i==0) - b = ng[j] + ri->data[1][j] - cg[j]; - else if (i==H-1) - b = pg[j] + ri->data[H-2][j] - cg[j]; - else - b = cg[j] + (ri->data[i-1][j] - pg[j] + ri->data[i+1][j] - ng[j]) / 2; - ab[j] = CLIP(b); - } - } - } - else { - // BGBGB or GBGBGB line - for (int j=0; jdata[i][j]; - // blue: cross interpolation - int r = 0; - int n = 0; - if (i>0 && j>0) { - r += ri->data[i-1][j-1] - pg[j-1]; - n++; - } - if (i>0 && jdata[i-1][j+1] - pg[j+1]; - n++; - } - if (i0) { - r += ri->data[i+1][j-1] - ng[j-1]; - n++; - } - if (idata[i+1][j+1] - ng[j+1]; - n++; - } - r = cg[j] + r / n; - - ar[j] = CLIP(r); - } - else { - // linear B-G interp. horizontally - int b; - if (j==0) - b = cg[0] + ri->data[i][1] - cg[1]; - else if (j==W-1) - b = cg[W-1] + ri->data[i][W-2] - cg[W-2]; - else - b = cg[j] + (ri->data[i][j-1] - cg[j-1] + ri->data[i][j+1] - cg[j+1]) / 2; - ab[j] = CLIP(b); - // linear R-G interp. vertically - int r; - if (i==0) - r = ng[j] + ri->data[1][j] - cg[j]; - else if (i==H-1) - r = pg[j] + ri->data[H-2][j] - cg[j]; - else - r = cg[j] + (ri->data[i-1][j] - pg[j] + ri->data[i+1][j] - ng[j]) / 2; - ar[j] = CLIP(r); - } - } - } -} - -void RawImageSource::interpolate_row_rb_mul_pp (unsigned short* ar, unsigned short* ab, unsigned short* pg, unsigned short* cg, unsigned short* ng, int i, double r_mul, double g_mul, double b_mul, int x1, int width, int skip) { - - if (ISRED(ri,i,0) || ISRED(ri,i,1)) { - // RGRGR or GRGRGR line - for (int j=x1, jx=0; jxdata[i][j]); - // blue: cross interpolation - int b = 0; - int n = 0; - if (i>0 && j>0) { - b += b_mul*ri->data[i-1][j-1] - g_mul*pg[j-1]; - n++; - } - if (i>0 && jdata[i-1][j+1] - g_mul*pg[j+1]; - n++; - } - if (i0) { - b += b_mul*ri->data[i+1][j-1] - g_mul*ng[j-1]; - n++; - } - if (idata[i+1][j+1] - g_mul*ng[j+1]; - n++; - } - b = g_mul*cg[j] + b / n; - ab[jx] = CLIP(b); - } - else { - // linear R-G interp. horizontally - int r; - if (j==0) - r = g_mul*cg[0] + r_mul*ri->data[i][1] - g_mul*cg[1]; - else if (j==W-1) - r = g_mul*cg[W-1] + r_mul*ri->data[i][W-2] - g_mul*cg[W-2]; - else - r = g_mul*cg[j] + (r_mul*ri->data[i][j-1] - g_mul*cg[j-1] + r_mul*ri->data[i][j+1] - g_mul*cg[j+1]) / 2; - ar[jx] = CLIP(r); - // linear B-G interp. vertically - int b; - if (i==0) - b = g_mul*ng[j] + b_mul*ri->data[1][j] - g_mul*cg[j]; - else if (i==H-1) - b = g_mul*pg[j] + b_mul*ri->data[H-2][j] - g_mul*cg[j]; - else - b = g_mul*cg[j] + (b_mul*ri->data[i-1][j] - g_mul*pg[j] + b_mul*ri->data[i+1][j] - g_mul*ng[j]) / 2; - ab[jx] = CLIP(b); - } - } - } - else { - // BGBGB or GBGBGB line - for (int j=x1, jx=0; jxdata[i][j]); - // blue: cross interpolation - int r = 0; - int n = 0; - if (i>0 && j>0) { - r += r_mul*ri->data[i-1][j-1] - g_mul*pg[j-1]; - n++; - } - if (i>0 && jdata[i-1][j+1] - g_mul*pg[j+1]; - n++; - } - if (i0) { - r += r_mul*ri->data[i+1][j-1] - g_mul*ng[j-1]; - n++; - } - if (idata[i+1][j+1] - g_mul*ng[j+1]; - n++; - } - r = g_mul*cg[j] + r / n; - - ar[jx] = CLIP(r); - } - else { - // linear B-G interp. horizontally - int b; - if (j==0) - b = g_mul*cg[0] + b_mul*ri->data[i][1] - g_mul*cg[1]; - else if (j==W-1) - b = g_mul*cg[W-1] + b_mul*ri->data[i][W-2] - g_mul*cg[W-2]; - else - b = g_mul*cg[j] + (b_mul*ri->data[i][j-1] - g_mul*cg[j-1] + b_mul*ri->data[i][j+1] - g_mul*cg[j+1]) / 2; - ab[jx] = CLIP(b); - // linear R-G interp. vertically - int r; - if (i==0) - r = g_mul*ng[j] + r_mul*ri->data[1][j] - g_mul*cg[j]; - else if (i==H-1) - r = g_mul*pg[j] + r_mul*ri->data[H-2][j] - g_mul*cg[j]; - else - r = g_mul*cg[j] + (r_mul*ri->data[i-1][j] - g_mul*pg[j] + r_mul*ri->data[i+1][j] - g_mul*ng[j]) / 2; - ar[jx] = CLIP(r); - } - } - } -} - - -void RawImageSource::colorSpaceConversion (Image16* im, ColorManagementParams cmp, cmsHPROFILE embedded, cmsHPROFILE camprofile, double camMatrix[3][3], double& defgain) { - - if (cmp.input == "(none)") - return; - - MyTime t1, t2, t3; - - t1.set (); - - cmsHPROFILE in; - cmsHPROFILE out; - - Glib::ustring inProfile = cmp.input; - - if (inProfile=="(embedded)") { - if (embedded) - in = embedded; - else - in = camprofile; - } - else if (inProfile=="(camera)" || inProfile=="") - in = camprofile; - else { - in = iccStore.getProfile (inProfile); - if (in==NULL) - inProfile = "(camera)"; - } - - - if (inProfile=="(camera)" || inProfile=="" || (inProfile=="(embedded)" && !embedded)) { - // in this case we avoid using the slllllooooooowwww lcms - -// out = iccStore.workingSpace (wProfile); -// hTransform = cmsCreateTransform (in, TYPE_RGB_16_PLANAR, out, TYPE_RGB_16_PLANAR, settings->colorimetricIntent, cmsFLAGS_MATRIXINPUT | cmsFLAGS_MATRIXOUTPUT);//cmsFLAGS_MATRIXINPUT | cmsFLAGS_MATRIXOUTPUT); -// cmsDoTransform (hTransform, im->data, im->data, im->planestride/2); -// cmsDeleteTransform(hTransform); - TMatrix work = iccStore.workingSpaceInverseMatrix (cmp.working); - double mat[3][3] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; - for (int i=0; i<3; i++) - for (int j=0; j<3; j++) - for (int k=0; k<3; k++) - mat[i][j] += camMatrix[i][k] * work[k][j]; - - for (int i=0; iheight; i++) - for (int j=0; jwidth; j++) { - - int newr = mat[0][0]*im->r[i][j] + mat[1][0]*im->g[i][j] + mat[2][0]*im->b[i][j]; - int newg = mat[0][1]*im->r[i][j] + mat[1][1]*im->g[i][j] + mat[2][1]*im->b[i][j]; - int newb = mat[0][2]*im->r[i][j] + mat[1][2]*im->g[i][j] + mat[2][2]*im->b[i][j]; - - im->r[i][j] = CLIP(newr); - im->g[i][j] = CLIP(newg); - im->b[i][j] = CLIP(newb); - } - } - else { - out = iccStore.workingSpace (cmp.working); -// out = iccStore.workingSpaceGamma (wProfile); - lcmsMutex->lock (); - cmsHTRANSFORM hTransform = cmsCreateTransform (in, TYPE_RGB_16_PLANAR, out, TYPE_RGB_16_PLANAR, settings->colorimetricIntent, 0); - lcmsMutex->unlock (); - if (hTransform) { - if (cmp.gammaOnInput) { - double gd = pow (2.0, defgain); - defgain = 0.0; - for (int i=0; iheight; i++) - for (int j=0; jwidth; j++) { - im->r[i][j] = CurveFactory::gamma (CLIP(defgain*im->r[i][j])); - im->g[i][j] = CurveFactory::gamma (CLIP(defgain*im->g[i][j])); - im->b[i][j] = CurveFactory::gamma (CLIP(defgain*im->b[i][j])); - } - } - cmsDoTransform (hTransform, im->data, im->data, im->planestride/2); - } - else { - lcmsMutex->lock (); - hTransform = cmsCreateTransform (camprofile, TYPE_RGB_16_PLANAR, out, TYPE_RGB_16_PLANAR, settings->colorimetricIntent, 0); - lcmsMutex->unlock (); - cmsDoTransform (hTransform, im->data, im->data, im->planestride/2); - } - cmsDeleteTransform(hTransform); - } - t3.set (); -// printf ("ICM TIME: %d\n", t3.etime(t1)); -} - -void RawImageSource::eahd_demosaic () { - - if (plistener) { - plistener->setProgressStr ("Demosaicing..."); - plistener->setProgress (0.0); - } - - // prepare chache and constants for cielab conversion - lc00 = (0.412453 * coeff[0][0] + 0.357580 * coeff[1][0] + 0.180423 * coeff[2][0]) / 0.950456; - lc01 = (0.412453 * coeff[0][1] + 0.357580 * coeff[1][1] + 0.180423 * coeff[2][1]) / 0.950456; - lc02 = (0.412453 * coeff[0][2] + 0.357580 * coeff[1][2] + 0.180423 * coeff[2][2]) / 0.950456; - - lc10 = 0.212671 * coeff[0][0] + 0.715160 * coeff[1][0] + 0.072169 * coeff[2][0]; - lc11 = 0.212671 * coeff[0][1] + 0.715160 * coeff[1][1] + 0.072169 * coeff[2][1]; - lc12 = 0.212671 * coeff[0][2] + 0.715160 * coeff[1][2] + 0.072169 * coeff[2][2]; - - lc20 = (0.019334 * coeff[0][0] + 0.119193 * coeff[1][0] + 0.950227 * coeff[2][0]) / 1.088754; - lc21 = (0.019334 * coeff[0][1] + 0.119193 * coeff[1][1] + 0.950227 * coeff[2][1]) / 1.088754; - lc22 = (0.019334 * coeff[0][2] + 0.119193 * coeff[1][2] + 0.950227 * coeff[2][2]) / 1.088754; - - int maxindex = 2*65536; - cache = new double[maxindex]; - threshold = (int)(0.008856*CMAXVAL); - for (int i=0; isv) { // fixate horizontal pixel - dLmaph[dmi] = DIST(lLh[ix][j], lLh[idx][j+y]); - dCamaph[dmi] = DIST(lah[ix][j], lah[idx][j+y]); - dCbmaph[dmi] = DIST(lbh[ix][j], lbh[idx][j+y]); - dLmapv[dmi] = DIST(lLv[ix][j], lLh[idx][j+y]); - dCamapv[dmi] = DIST(lav[ix][j], lah[idx][j+y]); - dCbmapv[dmi] = DIST(lbv[ix][j], lbh[idx][j+y]); - } - else if (shdata[i-1][j]; - else { - hc = homh[imx][j]; - vc = homv[imx][j]; - if (hc > vc) - green[i-1][j] = gh[(i-1)%4][j]; - else if (hc < vc) - green[i-1][j] = gv[(i-1)%4][j]; - else - green[i-1][j] = (gh[(i-1)%4][j] + gv[(i-1)%4][j]) / 2; - } - } - - if (!(i%20) && plistener) - plistener->setProgress ((double)i / (H-2)); - } - // finish H-2th and H-1th row, homogenity value is still valailable - int hc, vc; - for (int i=H-1; i vc) - green[i-1][j] = gh[(i-1)%4][j]; - else if (hc < vc) - green[i-1][j] = gv[(i-1)%4][j]; - else - green[i-1][j] = (gh[(i-1)%4][j] + gv[(i-1)%4][j]) / 2; - } - - freeArray2(rh, 3); - freeArray2(gh, 4); - freeArray2(bh, 3); - freeArray2(rv, 3); - freeArray2(gv, 4); - freeArray2(bv, 3); - freeArray2(lLh, 3); - freeArray2(lah, 3); - freeArray2(lbh, 3); - freeArray2(homh, 3); - freeArray2(lLv, 3); - freeArray2(lav, 3); - freeArray2(lbv, 3); - freeArray2(homv, 3); -} - -void RawImageSource::hphd_vertical (float** hpmap, int col_from, int col_to) { - - float* temp = new float[MAX(W,H)]; - float* avg = new float[MAX(W,H)]; - float* dev = new float[MAX(W,H)]; - - memset (temp, 0, MAX(W,H)*sizeof(float)); - memset (avg, 0, MAX(W,H)*sizeof(float)); - memset (dev, 0, MAX(W,H)*sizeof(float)); - - for (int k=col_from; kdata[i-5][k] - 8*ri->data[i-4][k] + 27*ri->data[i-3][k] - 48*ri->data[i-2][k] + 42*ri->data[i-1][k] - - (ri->data[i+5][k] - 8*ri->data[i+4][k] + 27*ri->data[i+3][k] - 48*ri->data[i+2][k] + 42*ri->data[i+1][k])) / 100.0; - temp[i] = ABS(temp[i]); - } - for (int j=4; jdata[i][j-5] - 8*ri->data[i][j-4] + 27*ri->data[i][j-3] - 48*ri->data[i][j-2] + 42*ri->data[i][j-1] - - (ri->data[i][j+5] - 8*ri->data[i][j+4] + 27*ri->data[i][j+3] - 48*ri->data[i][j+2] + 42*ri->data[i][j+1])) / 100; - temp[j] = ABS(temp[j]); - } - for (int j=4; jhpmap[i][j] = 2; - else if (hpv < 0.8*hpmap[i][j]) - this->hpmap[i][j] = 1; - else - this->hpmap[i][j] = 0; - } - } - delete [] temp; - delete [] avg; - delete [] dev; -} - -void RawImageSource::hphd_green (int row_from, int row_to) { - - for (int i=row_from; idata[i][j]; - else { - if (this->hpmap[i][j]==1) { - int g2 = ri->data[i][j+1] + ((ri->data[i][j] - ri->data[i][j+2]) >> 1); - int g4 = ri->data[i][j-1] + ((ri->data[i][j] - ri->data[i][j-2]) >> 1); - - int dx = ri->data[i][j+1] - ri->data[i][j-1]; - int d1 = ri->data[i][j+3] - ri->data[i][j+1]; - int d2 = ri->data[i][j+2] - ri->data[i][j]; - int d3 = (ri->data[i-1][j+2] - ri->data[i-1][j]) >> 1; - int d4 = (ri->data[i+1][j+2] - ri->data[i+1][j]) >> 1; - - double e2 = 1.0 / (1.0 + ABS(dx) + ABS(d1) + ABS(d2) + ABS(d3) + ABS(d4)); - - d1 = ri->data[i][j-3] - ri->data[i][j-1]; - d2 = ri->data[i][j-2] - ri->data[i][j]; - d3 = (ri->data[i-1][j-2] - ri->data[i-1][j]) >> 1; - d4 = (ri->data[i+1][j-2] - ri->data[i+1][j]) >> 1; - - double e4 = 1.0 / (1.0 + ABS(dx) + ABS(d1) + ABS(d2) + ABS(d3) + ABS(d4)); - - green[i][j] = CLIP((e2 * g2 + e4 * g4) / (e2 + e4)); - } - else if (this->hpmap[i][j]==2) { - int g1 = ri->data[i-1][j] + ((ri->data[i][j] - ri->data[i-2][j]) >> 1); - int g3 = ri->data[i+1][j] + ((ri->data[i][j] - ri->data[i+2][j]) >> 1); - - int dy = ri->data[i+1][j] - ri->data[i-1][j]; - int d1 = ri->data[i-1][j] - ri->data[i-3][j]; - int d2 = ri->data[i][j] - ri->data[i-2][j]; - int d3 = (ri->data[i][j-1] - ri->data[i-2][j-1]) >> 1; - int d4 = (ri->data[i][j+1] - ri->data[i-2][j+1]) >> 1; - - double e1 = 1.0 / (1.0 + ABS(dy) + ABS(d1) + ABS(d2) + ABS(d3) + ABS(d4)); - - d1 = ri->data[i+1][j] - ri->data[i+3][j]; - d2 = ri->data[i][j] - ri->data[i+2][j]; - d3 = (ri->data[i][j-1] - ri->data[i+2][j-1]) >> 1; - d4 = (ri->data[i][j+1] - ri->data[i+2][j+1]) >> 1; - - double e3 = 1.0 / (1.0 + ABS(dy) + ABS(d1) + ABS(d2) + ABS(d3) + ABS(d4)); - - green[i][j] = CLIP((e1 * g1 + e3 * g3) / (e1 + e3)); - } - else { - int g1 = ri->data[i-1][j] + ((ri->data[i][j] - ri->data[i-2][j]) >> 1); - int g2 = ri->data[i][j+1] + ((ri->data[i][j] - ri->data[i][j+2]) >> 1); - int g3 = ri->data[i+1][j] + ((ri->data[i][j] - ri->data[i+2][j]) >> 1); - int g4 = ri->data[i][j-1] + ((ri->data[i][j] - ri->data[i][j-2]) >> 1); - - int dx = ri->data[i][j+1] - ri->data[i][j-1]; - int dy = ri->data[i+1][j] - ri->data[i-1][j]; - - int d1 = ri->data[i-1][j] - ri->data[i-3][j]; - int d2 = ri->data[i][j] - ri->data[i-2][j]; - int d3 = (ri->data[i][j-1] - ri->data[i-2][j-1]) >> 1; - int d4 = (ri->data[i][j+1] - ri->data[i-2][j+1]) >> 1; - - double e1 = 1.0 / (1.0 + ABS(dy) + ABS(d1) + ABS(d2) + ABS(d3) + ABS(d4)); - - d1 = ri->data[i][j+3] - ri->data[i][j+1]; - d2 = ri->data[i][j+2] - ri->data[i][j]; - d3 = (ri->data[i-1][j+2] - ri->data[i-1][j]) >> 1; - d4 = (ri->data[i+1][j+2] - ri->data[i+1][j]) >> 1; - - double e2 = 1.0 / (1.0 + ABS(dx) + ABS(d1) + ABS(d2) + ABS(d3) + ABS(d4)); - - d1 = ri->data[i+1][j] - ri->data[i+3][j]; - d2 = ri->data[i][j] - ri->data[i+2][j]; - d3 = (ri->data[i][j-1] - ri->data[i+2][j-1]) >> 1; - d4 = (ri->data[i][j+1] - ri->data[i+2][j+1]) >> 1; - - double e3 = 1.0 / (1.0 + ABS(dy) + ABS(d1) + ABS(d2) + ABS(d3) + ABS(d4)); - - d1 = ri->data[i][j-3] - ri->data[i][j-1]; - d2 = ri->data[i][j-2] - ri->data[i][j]; - d3 = (ri->data[i-1][j-2] - ri->data[i-1][j]) >> 1; - d4 = (ri->data[i+1][j-2] - ri->data[i+1][j]) >> 1; - - double e4 = 1.0 / (1.0 + ABS(dx) + ABS(d1) + ABS(d2) + ABS(d3) + ABS(d4)); - - green[i][j] = CLIP((e1*g1 + e2*g2 + e3*g3 + e4*g4) / (e1 + e2 + e3 + e4)); - } - } - } - } -} - -void RawImageSource::hphd_demosaic () { - - if (plistener) { - plistener->setProgressStr ("Demosaicing..."); - plistener->setProgress (0.0); - } - - float** hpmap = new float*[H]; - for (int i=0; idualThreadEnabled) { - Glib::Thread *thread1 = Glib::Thread::create(sigc::bind(sigc::mem_fun(*this, &RawImageSource::hphd_vertical), hpmap, 0, W/2), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); - Glib::Thread *thread2 = Glib::Thread::create(sigc::bind(sigc::mem_fun(*this, &RawImageSource::hphd_vertical), hpmap, W/2, W), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); - thread1->join (); - thread2->join (); - } - else - hphd_vertical (hpmap, 0, W); - - if (plistener) - plistener->setProgress (0.33); - - // horizontal - this->hpmap = allocArray(W, H); - for (int i=0; ihpmap[i], 0, W*sizeof(char)); - - if (settings->dualThreadEnabled) { - Glib::Thread *thread1 = Glib::Thread::create(sigc::bind(sigc::mem_fun(*this, &RawImageSource::hphd_horizontal), hpmap, 0, H/2), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); - Glib::Thread *thread2 = Glib::Thread::create(sigc::bind(sigc::mem_fun(*this, &RawImageSource::hphd_horizontal), hpmap, H/2, H), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); - thread1->join (); - thread2->join (); - } - else - hphd_horizontal (hpmap, 0, H); - - freeArray(hpmap, H); - - if (plistener) - plistener->setProgress (0.66); - -// reconstruct G - green = new unsigned short*[H]; - for (int i=0; idualThreadEnabled) { - Glib::Thread *thread1 = Glib::Thread::create(sigc::bind(sigc::mem_fun(*this, &RawImageSource::hphd_green), 3, H/2), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); - Glib::Thread *thread2 = Glib::Thread::create(sigc::bind(sigc::mem_fun(*this, &RawImageSource::hphd_green), H/2, H-3), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); - thread1->join (); - thread2->join (); - } - else - hphd_green (3, H-3); - - if (plistener) - plistener->setProgress (1.0); -} - -void RawImageSource::HLRecovery_Luminance (unsigned short* rin, unsigned short* gin, unsigned short* bin, unsigned short* rout, unsigned short* gout, unsigned short* bout, int width, int maxval) { - - for (int i=0; imaxval || g>maxval || b>maxval) { - int ro = MIN (r, maxval); - int go = MIN (g, maxval); - int bo = MIN (b, maxval); - double L = r + g + b; - double C = 1.732050808 * (r - g); - double H = 2 * b - r - g; - double Co = 1.732050808 * (ro - go); - double Ho = 2 * bo - ro - go; - if (r!=g && g!=b) { - double ratio = sqrt ((Co*Co+Ho*Ho) / (C*C+H*H)); - C *= ratio; - H *= ratio; - } - int rr = L / 3.0 - H / 6.0 + C / 3.464101615; - int gr = L / 3.0 - H / 6.0 - C / 3.464101615; - int br = L / 3.0 + H / 3.0; - rout[i] = CLIP(rr); - gout[i] = CLIP(gr); - bout[i] = CLIP(br); - } - else { - rout[i] = rin[i]; - gout[i] = gin[i]; - bout[i] = bin[i]; - } - } -} - -void RawImageSource::HLRecovery_CIELab (unsigned short* rin, unsigned short* gin, unsigned short* bin, unsigned short* rout, unsigned short* gout, unsigned short* bout, int width, int maxval, double cam[3][3], double icam[3][3]) { - - static bool crTableReady = false; - static double fv[0x10000]; - if (!crTableReady) { - for (int ix=0; ix < 0x10000; ix++) { - double rx = ix / 65535.0; - fv[ix] = rx > 0.008856 ? exp(1.0/3 * log(rx)) : 7.787*rx + 16/116.0; - } - crTableReady = true; - } - - for (int i=0; imaxval || g>maxval || b>maxval) { - int ro = MIN (r, maxval); - int go = MIN (g, maxval); - int bo = MIN (b, maxval); - double yy = cam[0][1]*r + cam[1][1]*g + cam[2][1]*b; - double fy = fv[CLIP((int)yy)]; - // compute LCH decompostion of the clipped pixel (only color information, thus C and H will be used) - double x = cam[0][0]*ro + cam[1][0]*go + cam[2][0]*bo; - double y = cam[0][1]*ro + cam[1][1]*go + cam[2][1]*bo; - double z = cam[0][2]*ro + cam[1][2]*go + cam[2][2]*bo; - x = fv[CLIP((int)x)]; - y = fv[CLIP((int)y)]; - z = fv[CLIP((int)z)]; - // convert back to rgb - double fz = fy - y + z; - double fx = fy + x - y; - double zr = (fz<=0.206893) ? ((116.0*fz-16.0)/903.3) : (fz * fz * fz); - double xr = (fx<=0.206893) ? ((116.0*fx-16.0)/903.3) : (fx * fx * fx); - x = xr*65535.0 - 0.5; - y = yy; - z = zr*65535.0 - 0.5; - int rr = icam[0][0]*x + icam[1][0]*y + icam[2][0]*z; - int gr = icam[0][1]*x + icam[1][1]*y + icam[2][1]*z; - int br = icam[0][2]*x + icam[1][2]*y + icam[2][2]*z; - rout[i] = CLIP(rr); - gout[i] = CLIP(gr); - bout[i] = CLIP(br); - } - else { - rout[i] = rin[i]; - gout[i] = gin[i]; - bout[i] = bin[i]; - } - } -} - -void RawImageSource::hlRecovery (std::string method, unsigned short* red, unsigned short* green, unsigned short* blue, int i, int sx1, int width, int skip) { - - if (method=="Luminance") - HLRecovery_Luminance (red, green, blue, red, green, blue, width, 65535 / ri->defgain); - else if (method=="CIELab blending") - HLRecovery_CIELab (red, green, blue, red, green, blue, width, 65535 / ri->defgain, cam, icam); - else if (method=="Color") - HLRecovery_ColorPropagation (red, green, blue, i, sx1, width, skip); -} - -int RawImageSource::getAEHistogram (unsigned int* histogram, int& histcompr) { - - histcompr = 3; - - memset (histogram, 0, (65536>>histcompr)*sizeof(int)); - - for (int i=border; iheight-border; i++) { - int start, end; - if (fuji) { - int fw = ri->fuji_width; - start = ABS(fw-i) + border; - end = MIN( ri->height+ ri->width-fw-i, fw+i) - border; - } - else { - start = border; - end = ri->width-border; - } - if (ri->filters) - for (int j=start; jdata[i][j]>>histcompr]+=2; - else - histogram[ri->data[i][j]>>histcompr]+=4; - else - for (int j=start; j<3*end; j++) { - histogram[ri->data[i][j+0]>>histcompr]++; - histogram[ri->data[i][j+1]>>histcompr]++; - histogram[ri->data[i][j+2]>>histcompr]++; - } - } - return 1; -} - -ColorTemp RawImageSource::getAutoWB () { - - double avg_r = 0; - double avg_g = 0; - double avg_b = 0; - int rn = 0, gn = 0, bn = 0; - - if (fuji) { - for (int i=32; iheight-32; i++) { - int fw = ri->fuji_width; - int start = ABS(fw-i) + 32; - int end = MIN(ri->height+ri->width-fw-i, fw+i) - 32; - for (int j=start; jfilters) { - double d = CLIP(ri->defgain*ri->data[i][3*j]); - if (d>64000) - continue; - avg_r += d*d*d*d*d*d; rn++; - d = CLIP(ri->defgain*ri->data[i][3*j+1]); - if (d>64000) - continue; - avg_g += d*d*d*d*d*d; gn++; - d = CLIP(ri->defgain*ri->data[i][3*j+2]); - if (d>64000) - continue; - avg_b += d*d*d*d*d*d; bn++; - } - else { - double d = CLIP(ri->defgain*ri->data[i][j]); - if (d>64000) - continue; - double dp = d*d*d*d*d*d; - if (ISRED(ri,i,j)) { - avg_r += dp; - rn++; - } - else if (ISGREEN(ri,i,j)) { - avg_g += dp; - gn++; - } - else if (ISBLUE(ri,i,j)) { - avg_b += dp; - bn++; - } - } - } - } - } - else { - for (int i=32; iheight-32; i++) - for (int j=32; jwidth-32; j++) { - if (!ri->filters) { - double d = CLIP(ri->defgain*ri->data[i][3*j]); - if (d>64000) - continue; - avg_r += d*d*d*d*d*d; rn++; - d = CLIP(ri->defgain*ri->data[i][3*j+1]); - if (d>64000) - continue; - avg_g += d*d*d*d*d*d; gn++; - d = CLIP(ri->defgain*ri->data[i][3*j+2]); - if (d>64000) - continue; - avg_b += d*d*d*d*d*d; bn++; - } - else { - double d = CLIP(ri->defgain*ri->data[i][j]); - if (d>64000) - continue; - double dp = d*d*d*d*d*d; - if (ISRED(ri,i,j)) { - avg_r += dp; - rn++; - } - else if (ISGREEN(ri,i,j)) { - avg_g += dp; - gn++; - } - else if (ISBLUE(ri,i,j)) { - avg_b += dp; - bn++; - } - } - } - } - - printf ("AVG: %g %g %g\n", avg_r/rn, avg_g/gn, avg_b/bn); - -// double img_r, img_g, img_b; -// wb.getMultipliers (img_r, img_g, img_b); - -// return ColorTemp (pow(avg_r/rn, 1.0/6.0)*img_r, pow(avg_g/gn, 1.0/6.0)*img_g, pow(avg_b/bn, 1.0/6.0)*img_b); - - double reds = pow (avg_r/rn, 1.0/6.0) * ri->camwb_red; - double greens = pow (avg_g/gn, 1.0/6.0) * ri->camwb_green; - double blues = pow (avg_b/bn, 1.0/6.0) * ri->camwb_blue; - - double rm = coeff[0][0]*reds + coeff[0][1]*greens + coeff[0][2]*blues; - double gm = coeff[1][0]*reds + coeff[1][1]*greens + coeff[1][2]*blues; - double bm = coeff[2][0]*reds + coeff[2][1]*greens + coeff[2][2]*blues; - - return ColorTemp (rm, gm, bm); -} - -void RawImageSource::transformPosition (int x, int y, int tran, int& ttx, int& tty) { - - tran = defTransform (tran); - - x += border; - y += border; - - if (d1x) { - if ((tran & TR_ROT) == TR_R90 || (tran & TR_ROT) == TR_R270) - x /= 2; - else - y /= 2; - } - - int w = W, h = H; - if (fuji) { - w = ri->fuji_width * 2 + 1; - h = (H - ri->fuji_width)*2 + 1; - } - int sw = w, sh = h; - if ((tran & TR_ROT) == TR_R90 || (tran & TR_ROT) == TR_R270) { - sw = h; - sh = w; - } - - int ppx = x, ppy = y; - if (tran & TR_HFLIP) - ppx = sw - 1 - x ; - if (tran & TR_VFLIP) - ppy = sh - 1 - y; - - int tx = ppx; - int ty = ppy; - - if ((tran & TR_ROT) == TR_R180) { - tx = w - 1 - ppx; - ty = h - 1 - ppy; - } - else if ((tran & TR_ROT) == TR_R90) { - tx = ppy; - ty = h - 1 - ppx; - } - else if ((tran & TR_ROT) == TR_R270) { - tx = w - 1 - ppy; - ty = ppx; - } - - if (fuji) { - ttx = (tx+ty) / 2; - tty = (ty-tx) / 2 + ri->fuji_width; - } - else { - ttx = tx; - tty = ty; - } -} - -ColorTemp RawImageSource::getSpotWB (std::vector red, std::vector green, std::vector& blue, int tran) { - - int x; int y; - int d[9][2] = {0,0, -1,-1, -1,0, -1,1, 0,-1, 0,1, 1,-1, 1,0, 1,1}; - double reds = 0, greens = 0, blues = 0; - int rn = 0, gn = 0, bn = 0; - - if (!ri->filters) { - for (int i=0; i=0 && y>=0 && xdata[y][3*x]; - rn++; - } - transformPosition (green[i].x, green[i].y, tran, x, y); - if (x>=0 && y>=0 && xdata[y][3*x+1]; - gn++; - } - transformPosition (blue[i].x, blue[i].y, tran, x, y); - if (x>=0 && y>=0 && xdata[y][3*x+2]; - bn++; - } - } - } - else { - for (int i=0; i=0 && yv>=0 && xvdata[yv][xv]; - rn++; - break; - } - } - transformPosition (green[i].x, green[i].y, tran, x, y); - for (int k=0; k<9; k++) { - int xv = x + d[k][0]; - int yv = y + d[k][1]; - if (ISGREEN(ri,yv,xv) && xv>=0 && yv>=0 && xvdata[yv][xv]; - gn++; - break; - } - } - transformPosition (blue[i].x, blue[i].y, tran, x, y); - for (int k=0; k<9; k++) { - int xv = x + d[k][0]; - int yv = y + d[k][1]; - if (ISBLUE(ri,yv,xv) && xv>=0 && yv>=0 && xvdata[yv][xv]; - bn++; - break; - } - } - } - } - - reds = reds/rn * ri->camwb_red; - greens = greens/gn * ri->camwb_green; - blues = blues/bn * ri->camwb_blue; - - double rm = coeff[0][0]*reds + coeff[0][1]*greens + coeff[0][2]*blues; - double gm = coeff[1][0]*reds + coeff[1][1]*greens + coeff[1][2]*blues; - double bm = coeff[2][0]*reds + coeff[2][1]*greens + coeff[2][2]*blues; - - return ColorTemp (rm, gm, bm); -} - -#define FORCC for (c=0; c < colors; c++) -#define fc(row,col) \ - (ri->prefilters >> ((((row) << 1 & 14) + ((col) & 1)) << 1) & 3) -typedef unsigned short ushort; -void RawImageSource::vng4_demosaic () { - - static const signed char *cp, terms[] = { - -2,-2,+0,-1,0,0x01, -2,-2,+0,+0,1,0x01, -2,-1,-1,+0,0,0x01, - -2,-1,+0,-1,0,0x02, -2,-1,+0,+0,0,0x03, -2,-1,+0,+1,1,0x01, - -2,+0,+0,-1,0,0x06, -2,+0,+0,+0,1,0x02, -2,+0,+0,+1,0,0x03, - -2,+1,-1,+0,0,0x04, -2,+1,+0,-1,1,0x04, -2,+1,+0,+0,0,0x06, - -2,+1,+0,+1,0,0x02, -2,+2,+0,+0,1,0x04, -2,+2,+0,+1,0,0x04, - -1,-2,-1,+0,0,0x80, -1,-2,+0,-1,0,0x01, -1,-2,+1,-1,0,0x01, - -1,-2,+1,+0,1,0x01, -1,-1,-1,+1,0,0x88, -1,-1,+1,-2,0,0x40, - -1,-1,+1,-1,0,0x22, -1,-1,+1,+0,0,0x33, -1,-1,+1,+1,1,0x11, - -1,+0,-1,+2,0,0x08, -1,+0,+0,-1,0,0x44, -1,+0,+0,+1,0,0x11, - -1,+0,+1,-2,1,0x40, -1,+0,+1,-1,0,0x66, -1,+0,+1,+0,1,0x22, - -1,+0,+1,+1,0,0x33, -1,+0,+1,+2,1,0x10, -1,+1,+1,-1,1,0x44, - -1,+1,+1,+0,0,0x66, -1,+1,+1,+1,0,0x22, -1,+1,+1,+2,0,0x10, - -1,+2,+0,+1,0,0x04, -1,+2,+1,+0,1,0x04, -1,+2,+1,+1,0,0x04, - +0,-2,+0,+0,1,0x80, +0,-1,+0,+1,1,0x88, +0,-1,+1,-2,0,0x40, - +0,-1,+1,+0,0,0x11, +0,-1,+2,-2,0,0x40, +0,-1,+2,-1,0,0x20, - +0,-1,+2,+0,0,0x30, +0,-1,+2,+1,1,0x10, +0,+0,+0,+2,1,0x08, - +0,+0,+2,-2,1,0x40, +0,+0,+2,-1,0,0x60, +0,+0,+2,+0,1,0x20, - +0,+0,+2,+1,0,0x30, +0,+0,+2,+2,1,0x10, +0,+1,+1,+0,0,0x44, - +0,+1,+1,+2,0,0x10, +0,+1,+2,-1,1,0x40, +0,+1,+2,+0,0,0x60, - +0,+1,+2,+1,0,0x20, +0,+1,+2,+2,0,0x10, +1,-2,+1,+0,0,0x80, - +1,-1,+1,+1,0,0x88, +1,+0,+1,+2,0,0x08, +1,+0,+2,-1,0,0x40, - +1,+0,+2,+1,0,0x10 - }, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 }; - - if (plistener) { - plistener->setProgressStr ("Demosaicing..."); - plistener->setProgress (0.0); - } - - ushort (*brow[5])[4], *pix; - int prow=7, pcol=1, *ip, *code[16][16], gval[8], gmin, gmax, sum[4]; - int row, col, x, y, x1, x2, y1, y2, t, weight, grads, color, diag; - int g, diff, thold, num, c, width=W, height=H, colors=4; - ushort (*image)[4]; - int lcode[16][16][32], shift, i, j; - - image = (ushort (*)[4]) calloc (H*W, sizeof *image); - for (int ii=0; iidata[ii][jj]; - -// first linear interpolation - for (row=0; row < 16; row++) - for (col=0; col < 16; col++) { - ip = lcode[row][col]; - memset (sum, 0, sizeof sum); - for (y=-1; y <= 1; y++) - for (x=-1; x <= 1; x++) { - shift = (y==0) + (x==0); - if (shift == 2) continue; - color = fc(row+y,col+x); - *ip++ = (width*y + x)*4 + color; - *ip++ = shift; - *ip++ = color; - sum[color] += 1 << shift; - } - FORCC - if (c != fc(row,col)) { - *ip++ = c; - *ip++ = 256 / sum[c]; - } - } - - for (row=1; row < height-1; row++) - for (col=1; col < width-1; col++) { - pix = image[row*width+col]; - ip = lcode[row & 15][col & 15]; - memset (sum, 0, sizeof sum); - for (i=8; i--; ip+=3) - sum[ip[2]] += pix[ip[0]] << ip[1]; - for (i=colors; --i; ip+=2) - pix[ip[0]] = sum[ip[0]] * ip[1] >> 8; - } - -// lin_interpolate(); - - - ip = (int *) calloc ((prow+1)*(pcol+1), 1280); - for (row=0; row <= prow; row++) /* Precalculate for VNG */ - for (col=0; col <= pcol; col++) { - code[row][col] = ip; - for (cp=terms, t=0; t < 64; t++) { - y1 = *cp++; x1 = *cp++; - y2 = *cp++; x2 = *cp++; - weight = *cp++; - grads = *cp++; - color = fc(row+y1,col+x1); - if (fc(row+y2,col+x2) != color) continue; - diag = (fc(row,col+1) == color && fc(row+1,col) == color) ? 2:1; - if (abs(y1-y2) == diag && abs(x1-x2) == diag) continue; - *ip++ = (y1*width + x1)*4 + color; - *ip++ = (y2*width + x2)*4 + color; - *ip++ = weight; - for (g=0; g < 8; g++) - if (grads & 1< gval[g]) gmin = gval[g]; - if (gmax < gval[g]) gmax = gval[g]; - } - if (gmax == 0) { - memcpy (brow[2][col], pix, sizeof *image); - continue; - } - thold = gmin + (gmax >> 1); - memset (sum, 0, sizeof sum); - for (num=g=0; g < 8; g++,ip+=2) { /* Average the neighbors */ - if (gval[g] <= thold) { - FORCC - if (c == color && ip[1]) - sum[c] += (pix[c] + pix[ip[1]]) >> 1; - else - sum[c] += pix[ip[0] + c]; - num++; - } - } - FORCC { /* Save to buffer */ - t = pix[color]; - if (c != color) - t += (sum[c] - sum[color]) / num; - brow[2][col][c] = CLIP(t); - } - } - if (row > 3) /* Write buffer to image */ - memcpy (image[(row-2)*width+2], brow[0]+2, (width-4)*sizeof *image); - for (g=0; g < 4; g++) - brow[(g-1) & 3] = brow[g]; - if (!(row%20) && plistener) - plistener->setProgress ((double)row / (H-2)); - } - memcpy (image[(row-2)*width+2], brow[0]+2, (width-4)*sizeof *image); - memcpy (image[(row-1)*width+2], brow[1]+2, (width-4)*sizeof *image); - free (brow[4]); - free (code[0][0]); - - green = new unsigned short*[H]; - for (int i=0; i> 1; - } - free (image); -} - -//#define ABS(x) (((int)(x) ^ ((int)(x) >> 31)) - ((int)(x) >> 31)) -//#define MIN(a,b) ((a) < (b) ? (a) : (b)) -//#define MAX(a,b) ((a) > (b) ? (a) : (b)) -//#define LIM(x,min,max) MAX(min,MIN(x,max)) -//#define CLIP(x) LIM(x,0,65535) -#undef fc -#define fc(row,col) \ - (ri->filters >> ((((row) << 1 & 14) + ((col) & 1)) << 1) & 3) -#define FC(x,y) fc(x,y) -#define LIM(x,min,max) MAX(min,MIN(x,max)) -#define ULIM(x,y,z) ((y) < (z) ? LIM(x,y,z) : LIM(x,z,y)) - -/* - Patterned Pixel Grouping Interpolation by Alain Desbiolles -*/ -void RawImageSource::ppg_demosaic() -{ - int width=W, height=H; - int dir[5] = { 1, width, -1, -width, 1 }; - int row, col, diff[2], guess[2], c, d, i; - ushort (*pix)[4]; - - ushort (*image)[4]; - int colors = 3; - - if (plistener) { - plistener->setProgressStr ("Demosaicing..."); - plistener->setProgress (0.0); - } - - image = (ushort (*)[4]) calloc (H*W, sizeof *image); - for (int ii=0; iidata[ii][jj]; - - border_interpolate(3, image); - -/* Fill in the green layer with gradients and pattern recognition: */ - for (row=3; row < height-3; row++) { - for (col=3+(FC(row,3) & 1), c=FC(row,col); col < width-3; col+=2) { - pix = image + row*width+col; - for (i=0; (d=dir[i]) > 0; i++) { - guess[i] = (pix[-d][1] + pix[0][c] + pix[d][1]) * 2 - - pix[-2*d][c] - pix[2*d][c]; - diff[i] = ( ABS(pix[-2*d][c] - pix[ 0][c]) + - ABS(pix[ 2*d][c] - pix[ 0][c]) + - ABS(pix[ -d][1] - pix[ d][1]) ) * 3 + - ( ABS(pix[ 3*d][1] - pix[ d][1]) + - ABS(pix[-3*d][1] - pix[-d][1]) ) * 2; - } - d = dir[i = diff[0] > diff[1]]; - pix[0][1] = ULIM(guess[i] >> 2, pix[d][1], pix[-d][1]); - } - if(plistener) plistener->setProgress(0.33*row/(height-3)); - } -/* Calculate red and blue for each green pixel: */ - for (row=1; row < height-1; row++) { - for (col=1+(FC(row,2) & 1), c=FC(row,col+1); col < width-1; col+=2) { - pix = image + row*width+col; - for (i=0; (d=dir[i]) > 0; c=2-c, i++) - pix[0][c] = CLIP((pix[-d][c] + pix[d][c] + 2*pix[0][1] - - pix[-d][1] - pix[d][1]) >> 1); - } - if(plistener) plistener->setProgress(0.33 + 0.33*row/(height-1)); - } -/* Calculate blue for red pixels and vice versa: */ - for (row=1; row < height-1; row++) { - for (col=1+(FC(row,1) & 1), c=2-FC(row,col); col < width-1; col+=2) { - pix = image + row*width+col; - for (i=0; (d=dir[i]+dir[i+1]) > 0; i++) { - diff[i] = ABS(pix[-d][c] - pix[d][c]) + - ABS(pix[-d][1] - pix[0][1]) + - ABS(pix[ d][1] - pix[0][1]); - guess[i] = pix[-d][c] + pix[d][c] + 2*pix[0][1] - - pix[-d][1] - pix[d][1]; - } - if (diff[0] != diff[1]) - pix[0][c] = CLIP(guess[diff[0] > diff[1]] >> 1); - else - pix[0][c] = CLIP((guess[0]+guess[1]) >> 2); - } - if(plistener) plistener->setProgress(0.67 + 0.33*row/(height-1)); - } - - red = new unsigned short*[H]; - for (int i=0; i= border && row < height-border) - col = width-border; - memset (sum, 0, sizeof sum); - for (y=row-1; y != row+2; y++) - for (x=col-1; x != col+2; x++) - if (y < height && x < width) { - f = fc(y,x); - sum[f] += image[y*width+x][f]; - sum[f+4]++; - } - f = fc(row,col); - FORCC if (c != f && sum[c+4]) - image[row*width+col][c] = sum[c] / sum[c+4]; - } -} - -/* - Adaptive Homogeneity-Directed interpolation is based on - the work of Keigo Hirakawa, Thomas Parks, and Paul Lee. - */ -#define TS 256 /* Tile Size */ -#define FORC(cnt) for (c=0; c < cnt; c++) -#define FORC3 FORC(3) -#define SQR(x) ((x)*(x)) - -void RawImageSource::ahd_demosaic() -{ - int i, j, k, top, left, row, col, tr, tc, c, d, val, hm[2]; - ushort (*pix)[4], (*rix)[3]; - static const int dir[4] = { -1, 1, -TS, TS }; - unsigned ldiff[2][4], abdiff[2][4], leps, abeps; - float r, cbrt[0x10000], xyz[3], xyz_cam[3][4]; - ushort (*rgb)[TS][TS][3]; - short (*lab)[TS][TS][3], (*lix)[3]; - char (*homo)[TS][TS], *buffer; - - int width=W, height=H; - ushort (*image)[4]; - int colors = 3; - - const double xyz_rgb[3][3] = { /* XYZ from RGB */ - { 0.412453, 0.357580, 0.180423 }, - { 0.212671, 0.715160, 0.072169 }, - { 0.019334, 0.119193, 0.950227 } }; - const float d65_white[3] = { 0.950456, 1, 1.088754 }; - - if (plistener) { - plistener->setProgressStr ("Demosaicing..."); - plistener->setProgress (0.0); - } - - image = (ushort (*)[4]) calloc (H*W, sizeof *image); - for (int ii=0; iidata[ii][jj]; - - for (i=0; i < 0x10000; i++) { - r = i / 65535.0; - cbrt[i] = r > 0.008856 ? pow(r,1/3.0) : 7.787*r + 16/116.0; - } - for (i=0; i < 3; i++) - for (j=0; j < colors; j++) - for (xyz_cam[i][j] = k=0; k < 3; k++) - xyz_cam[i][j] += xyz_rgb[i][k] * coeff[k][j] / d65_white[i]; - - border_interpolate(5, image); - buffer = (char *) malloc (26*TS*TS); /* 1664 kB */ - //merror (buffer, "ahd_interpolate()"); - rgb = (ushort(*)[TS][TS][3]) buffer; - lab = (short (*)[TS][TS][3])(buffer + 12*TS*TS); - homo = (char (*)[TS][TS]) (buffer + 24*TS*TS); - - for (top=2; top < height-5; top += TS-6) - for (left=2; left < width-5; left += TS-6) { - -/* Interpolate green horizontally and vertically: */ - for (row = top; row < top+TS && row < height-2; row++) { - col = left + (FC(row,left) & 1); - for (c = FC(row,col); col < left+TS && col < width-2; col+=2) { - pix = image + row*width+col; - val = ((pix[-1][1] + pix[0][c] + pix[1][1]) * 2 - - pix[-2][c] - pix[2][c]) >> 2; - rgb[0][row-top][col-left][1] = ULIM(val,pix[-1][1],pix[1][1]); - val = ((pix[-width][1] + pix[0][c] + pix[width][1]) * 2 - - pix[-2*width][c] - pix[2*width][c]) >> 2; - rgb[1][row-top][col-left][1] = ULIM(val,pix[-width][1],pix[width][1]); - } - } - - if(plistener) plistener->setProgress (0.33); -/* Interpolate red and blue, and convert to CIELab: */ - for (d=0; d < 2; d++) - for (row=top+1; row < top+TS-1 && row < height-3; row++) - for (col=left+1; col < left+TS-1 && col < width-3; col++) { - pix = image + row*width+col; - rix = &rgb[d][row-top][col-left]; - lix = &lab[d][row-top][col-left]; - if ((c = 2 - FC(row,col)) == 1) { - c = FC(row+1,col); - val = pix[0][1] + (( pix[-1][2-c] + pix[1][2-c] - - rix[-1][1] - rix[1][1] ) >> 1); - rix[0][2-c] = CLIP(val); - val = pix[0][1] + (( pix[-width][c] + pix[width][c] - - rix[-TS][1] - rix[TS][1] ) >> 1); - } else - val = rix[0][1] + (( pix[-width-1][c] + pix[-width+1][c] - + pix[+width-1][c] + pix[+width+1][c] - - rix[-TS-1][1] - rix[-TS+1][1] - - rix[+TS-1][1] - rix[+TS+1][1] + 1) >> 2); - rix[0][c] = CLIP(val); - c = FC(row,col); - rix[0][c] = pix[0][c]; - xyz[0] = xyz[1] = xyz[2] = 0.5; - FORCC { - xyz[0] += xyz_cam[0][c] * rix[0][c]; - xyz[1] += xyz_cam[1][c] * rix[0][c]; - xyz[2] += xyz_cam[2][c] * rix[0][c]; - } - xyz[0] = cbrt[CLIP((int) xyz[0])]; - xyz[1] = cbrt[CLIP((int) xyz[1])]; - xyz[2] = cbrt[CLIP((int) xyz[2])]; - lix[0][0] = 64 * (116 * xyz[1] - 16); - lix[0][1] = 64 * 500 * (xyz[0] - xyz[1]); - lix[0][2] = 64 * 200 * (xyz[1] - xyz[2]); - } - - if(plistener) plistener->setProgress (0.5); -/* Build homogeneity maps from the CIELab images: */ - memset (homo, 0, 2*TS*TS); - for (row=top+2; row < top+TS-2 && row < height-4; row++) { - tr = row-top; - for (col=left+2; col < left+TS-2 && col < width-4; col++) { - tc = col-left; - for (d=0; d < 2; d++) { - lix = &lab[d][tr][tc]; - for (i=0; i < 4; i++) { - ldiff[d][i] = ABS(lix[0][0]-lix[dir[i]][0]); - abdiff[d][i] = SQR(lix[0][1]-lix[dir[i]][1]) - + SQR(lix[0][2]-lix[dir[i]][2]); - } - } - leps = MIN(MAX(ldiff[0][0],ldiff[0][1]), - MAX(ldiff[1][2],ldiff[1][3])); - abeps = MIN(MAX(abdiff[0][0],abdiff[0][1]), - MAX(abdiff[1][2],abdiff[1][3])); - for (d=0; d < 2; d++) - for (i=0; i < 4; i++) - if (ldiff[d][i] <= leps && abdiff[d][i] <= abeps) - homo[d][tr][tc]++; - } - } - if(plistener) plistener->setProgress (0.8); -/* Combine the most homogenous pixels for the final result: */ - for (row=top+3; row < top+TS-3 && row < height-5; row++) { - tr = row-top; - for (col=left+3; col < left+TS-3 && col < width-5; col++) { - tc = col-left; - for (d=0; d < 2; d++) - for (hm[d]=0, i=tr-1; i <= tr+1; i++) - for (j=tc-1; j <= tc+1; j++) - hm[d] += homo[d][i][j]; - if (hm[0] != hm[1]) - FORC3 image[row*width+col][c] = rgb[hm[1] > hm[0]][tr][tc][c]; - else - FORC3 image[row*width+col][c] = - (rgb[0][tr][tc][c] + rgb[1][tr][tc][c]) >> 1; - } - } - } - if(plistener) plistener->setProgress (1.0); - free (buffer); - red = new unsigned short*[H]; - for (int i=0; i ( image[indx-1][1] + image[indx+1][1] + image[indx-u][1] + image[indx+u][1])/4.0) - image[indx][3] = ((MIN( image[indx-1][1], image[indx+1][1]) + image[indx-1][1] + image[indx+1][1] ) < (MIN( image[indx-u][1], image[indx+u][1]) + image[indx-u][1] + image[indx+u][1])); - else - image[indx][3] = ((MAX( image[indx-1][1], image[indx+1][1]) + image[indx-1][1] + image[indx+1][1] ) > (MAX( image[indx-u][1], image[indx+u][1]) + image[indx-u][1] + image[indx+u][1])) ; - } - } -} - - - - - -// interpolated green pixels are corrected using the map -void RawImageSource::dcb_correction(ushort (*image)[4]) -{ - int width=W, height=H; - int current, row, col, c, u=width, v=2*u, indx; - - for (row=4; row < height-4; row++) { - for (col=4, indx=row*width+col; col < width-4; col++, indx++) { - - c = FC(row,col); - - if (c != 1) - { - current = 4*image[indx][3] + - 2*(image[indx+u][3] + image[indx-u][3] + image[indx+1][3] + image[indx-1][3]) + - image[indx+v][3] + image[indx-v][3] + image[indx+2][3] + image[indx-2][3]; - - image[indx][1] = ((16-current)*(image[indx-1][1] + image[indx+1][1])/2.0 + current*(image[indx-u][1] + image[indx+u][1])/2.0)/16.0; - } - - } - } - -} - -// R and B smoothing using green contrast, all pixels except 2 pixel wide border -void RawImageSource::dcb_pp(ushort (*image)[4]) -{ - int width=W, height=H; - int g1, r1, b1, u=width, indx, row, col; - - - for (row=2; row < height-2; row++) - for (col=2, indx=row*u+col; col < width-2; col++, indx++) { - - r1 = ( image[indx-1][0] + image[indx+1][0] + image[indx-u][0] + image[indx+u][0] + image[indx-u-1][0] + image[indx+u+1][0] + image[indx-u+1][0] + image[indx+u-1][0])/8.0; - g1 = ( image[indx-1][1] + image[indx+1][1] + image[indx-u][1] + image[indx+u][1] + image[indx-u-1][1] + image[indx+u+1][1] + image[indx-u+1][1] + image[indx+u-1][1])/8.0; - b1 = ( image[indx-1][2] + image[indx+1][2] + image[indx-u][2] + image[indx+u][2] + image[indx-u-1][2] + image[indx+u+1][2] + image[indx-u+1][2] + image[indx+u-1][2])/8.0; - - image[indx][0] = CLIP(r1 + ( image[indx][1] - g1 )); - image[indx][2] = CLIP(b1 + ( image[indx][1] - g1 )); - - } -} - -// interpolated green pixels are corrected using the map -// with correction -void RawImageSource::dcb_correction2(ushort (*image)[4]) -{ - int width=W, height=H; - int current, row, col, c, u=width, v=2*u, indx; - ushort (*pix)[4]; - - for (row=4; row < height-4; row++) { - for (col=4, indx=row*width+col; col < width-4; col++, indx++) { - - c = FC(row,col); - - if (c != 1) - { - current = 4*image[indx][3] + - 2*(image[indx+u][3] + image[indx-u][3] + image[indx+1][3] + image[indx-1][3]) + - image[indx+v][3] + image[indx-v][3] + image[indx+2][3] + image[indx-2][3]; - - image[indx][1] = CLIP(((16-current)*((image[indx-1][1] + image[indx+1][1])/2.0 + image[indx][c] - (image[indx+2][c] + image[indx-2][c])/2.0) + current*((image[indx-u][1] + image[indx+u][1])/2.0 + image[indx][c] - (image[indx+v][c] + image[indx-v][c])/2.0))/16.0); - } - - } - } - -} - -// restores red and blue -void RawImageSource::restore_from_buffer(ushort (*image)[4], float (*image2)[3]) -{ - int width=W, height=H; - int indx; - - for (indx=0; indx < height*width; indx++) { - image[indx][0]=image2[indx][0]; //R - image[indx][2]=image2[indx][2]; //B - } -} - -// image refinement -void RawImageSource::dcb_refinement(ushort (*image)[4]) -{ - int width=W, height=H; - int row, col, c, u=width, v=2*u, w=3*u, x=4*u, y=5*u, indx, max, min; - float f[4], g[4]; - - for (row=5; row < height-5; row++) - for (col=5+(FC(row,1)&1),indx=row*width+col,c=FC(row,col); col < u-5; col+=2,indx+=2) { - -// Cubic Spline Interpolation by Li and Randhawa, modified by Jacek Gozdz and Luis Sanz Rodríguez - f[0]=1.0/(1.0+abs(image[indx-u][c]-image[indx][c])+abs(image[indx-u][1]-image[indx][1])); - f[1]=1.0/(1.0+abs(image[indx+1][c]-image[indx][c])+abs(image[indx+1][1]-image[indx][1])); - f[2]=1.0/(1.0+abs(image[indx-1][c]-image[indx][c])+abs(image[indx-1][1]-image[indx][1])); - f[3]=1.0/(1.0+abs(image[indx+u][c]-image[indx][c])+abs(image[indx+u][1]-image[indx][1])); - -g[0]=CLIP(image[indx-u][1]+0.5*(image[indx][c]-image[indx-u][c]) + 0.25*(image[indx][c]-image[indx-v][c])); -g[1]=CLIP(image[indx+1][1]+0.5*(image[indx][c]-image[indx+1][c]) + 0.25*(image[indx][c]-image[indx+2][c])); -g[2]=CLIP(image[indx-1][1]+0.5*(image[indx][c]-image[indx-1][c]) + 0.25*(image[indx][c]-image[indx-2][c])); -g[3]=CLIP(image[indx+u][1]+0.5*(image[indx][c]-image[indx+u][c]) + 0.25*(image[indx][c]-image[indx+v][c])); - - - - image[indx][1]=CLIP(((f[0]*g[0]+f[1]*g[1]+f[2]*g[2]+f[3]*g[3])/(f[0]+f[1]+f[2]+f[3]) )); - -// get rid of the overshooted pixels - min = MIN(image[indx+1+u][1], MIN(image[indx+1-u][1], MIN(image[indx-1+u][1], MIN(image[indx-1-u][1], MIN(image[indx-1][1], MIN(image[indx+1][1], MIN(image[indx-u][1], image[indx+u][1]))))))); - - max = MAX(image[indx+1+u][1], MAX(image[indx+1-u][1], MAX(image[indx-1+u][1], MAX(image[indx-1-u][1], MAX(image[indx-1][1], MAX(image[indx+1][1], MAX(image[indx-u][1], image[indx+u][1]))))))); - - image[indx][1] = ULIM(image[indx][1], max, min); - - - } -} - -// missing colors are interpolated using high quality algorithm by Luis Sanz Rodríguez -void RawImageSource::dcb_color_full(ushort (*image)[4]) -{ - int width=W, height=H; - int row,col,c,d,i,j,u=width,v=2*u,w=3*u,indx; - float f[4],g[4],(*chroma)[2]; - - chroma = (float (*)[2]) calloc(width*height,sizeof *chroma); - //merror (chroma, "dcb_color_full()"); - - for (row=1; row < height-1; row++) - for (col=1+(FC(row,1)&1),indx=row*width+col,c=FC(row,col),d=c/2; col < u-1; col+=2,indx+=2) - chroma[indx][d]=image[indx][c]-image[indx][1]; - - for (row=3; rowsetProgressStr ("Demosaicing..."); - plistener->setProgress (0.0); - } - - image = (ushort (*)[4]) calloc (H*W, sizeof *image); - for (int ii=0; iidata[ii][jj]; - - border_interpolate(2, image); - copy_to_buffer(image2, image); - - hid(image); - dcb_color(image); - - while (i<=iterations) { - //if (verbose) fprintf (stderr,_("DCB correction pass %d...\n"), i); - hid2(image); - hid2(image); - hid2(image); - dcb_map(image); - dcb_correction(image); - if(plistener) plistener->setProgress (0.33*i/iterations); - i++; - } - if(plistener) plistener->setProgress (0.33); - - dcb_color(image); - dcb_pp(image); - hid2(image); - hid2(image); - hid2(image); - - //if (verbose) fprintf (stderr,_("finishing DCB...\n")); - if(plistener) plistener->setProgress (0.5); - - dcb_map(image); - dcb_correction2(image); - - restore_from_buffer(image, image2); - - dcb_map(image); - dcb_correction(image); - - dcb_color(image); - dcb_pp(image); - dcb_map(image); - dcb_correction(image); - - dcb_map(image); - dcb_correction(image); - - restore_from_buffer(image, image2); - dcb_color(image); - - if(plistener) plistener->setProgress (0.7); - if (dcb_enhance) { - //if (verbose) fprintf (stderr,_("optional DCB refinement...\n")); - dcb_refinement(image); - dcb_color_full(image); - } - - if(plistener) plistener->setProgress (1.0); - - free(image2); - - red = new unsigned short*[H]; - for (int i=0; i + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace rtengine { + +int loadRaw (const char* fname, struct RawImage* ri); + +extern const Settings* settings; + +#undef ABS +#undef MAX +#undef MIN +#undef DIST +#undef MAXVAL +#undef CLIP +#undef THREAD_PRIORITY_NORMAL + +#define ABS(a) ((a)<0?-(a):(a)) +#define MAX(a,b) ((a)<(b)?(b):(a)) +#define MIN(a,b) ((a)>(b)?(b):(a)) +#define DIST(a,b) (ABS(a-b)) +#define MAXVAL 0xffff +#define CLIP(a) ((a)>0?((a)allocation) + free (ri->allocation); + if (ri->data) + free (ri->data); + if (ri->profile_data) + free (ri->profile_data); + delete ri; + } + if (green) + freeArray(green, H); + if (red) + freeArray(red, H); + if (blue) + freeArray(blue, H); + + delete [] cache; + if (hrmap[0]!=NULL) { + int dh = H/HR_SCALE; + freeArray(hrmap[0], dh); + freeArray(hrmap[1], dh); + freeArray(hrmap[2], dh); + } + if (needhr) + freeArray(needhr, H); + if (hpmap) + freeArray(hpmap, H); + if (camProfile) + cmsCloseProfile (camProfile); + if (embProfile) + cmsCloseProfile (embProfile); +} + +void RawImageSource::transformRect (PreviewProps pp, int tran, int &ssx1, int &ssy1, int &width, int &height, int &fw) { + + pp.x += border; + pp.y += border; + + if (d1x) { + if ((tran & TR_ROT) == TR_R90 || (tran & TR_ROT) == TR_R270) { + pp.x /= 2; + pp.w = pp.w/2+1; + } + else { + pp.y /= 2; + pp.h = pp.h/2+1; + } + } + + int w = W, h = H; + if (fuji) { + w = ri->fuji_width * 2 + 1; + h = (H - ri->fuji_width)*2 + 1; + } + + int sw = w, sh = h; + if ((tran & TR_ROT) == TR_R90 || (tran & TR_ROT) == TR_R270) { + sw = h; + sh = w; + } + int ppx = pp.x, ppy = pp.y; + if (tran & TR_HFLIP) + ppx = sw - pp.x - pp.w; + if (tran & TR_VFLIP) + ppy = sh - pp.y - pp.h; + + int sx1 = ppx; + int sy1 = ppy; + int sx2 = ppx + pp.w; + int sy2 = ppy + pp.h; + + if ((tran & TR_ROT) == TR_R180) { + sx1 = w - ppx - pp.w; + sy1 = h - ppy - pp.h; + sx2 = sx1 + pp.w; + sy2 = sy1 + pp.h; + } + else if ((tran & TR_ROT) == TR_R90) { + sx1 = ppy; + sy1 = h - ppx - pp.w; + sx2 = sx1 + pp.h; + sy2 = sy1 + pp.w; + } + else if ((tran & TR_ROT) == TR_R270) { + sx1 = w - ppy - pp.h; + sy1 = ppx; + sx2 = sx1 + pp.h; + sy2 = sy1 + pp.w; + } + + if (fuji) { + // atszamoljuk a koordinatakat fuji-ra: + ssx1 = (sx1+sy1) / 2; + ssy1 = (sy1 - sx2 ) / 2 + ri->fuji_width; + int ssx2 = (sx2+sy2) / 2 + 1; + int ssy2 = (sy2 - sx1) / 2 + ri->fuji_width; + fw = (sx2 - sx1) / 2 / pp.skip; + width = (ssx2 - ssx1) / pp.skip + ((ssx2 - ssx1) % pp.skip > 0); + height = (ssy2 - ssy1) / pp.skip + ((ssy2 - ssy1) % pp.skip > 0); + } + else { + ssx1 = sx1; + ssy1 = sy1; + width = (sx2 - sx1) / pp.skip + ((sx2 - sx1) % pp.skip > 0); + height = (sy2 - sy1) / pp.skip + ((sy2 - sy1) % pp.skip > 0); + } +} + +void RawImageSource::getImage (ColorTemp ctemp, int tran, Image16* image, PreviewProps pp, HRecParams hrp, ColorManagementParams cmp) { + + isrcMutex.lock (); + + tran = defTransform (tran); + + // compute channel multipliers + double r, g, b, rm, gm, bm; + ctemp.getMultipliers (r, g, b); + rm = icoeff[0][0]*r + icoeff[0][1]*g + icoeff[0][2]*b; + gm = icoeff[1][0]*r + icoeff[1][1]*g + icoeff[1][2]*b; + bm = icoeff[2][0]*r + icoeff[2][1]*g + icoeff[2][2]*b; + rm = ri->camwb_red / rm; + gm = ri->camwb_green / gm; + bm = ri->camwb_blue / bm; + double mul_lum = 0.299*rm + 0.587*gm + 0.114*bm; + rm /= mul_lum; + gm /= mul_lum; + bm /= mul_lum; + + if (hrp.enabled) + defGain = log(ri->defgain) / log(2.0); + else { + defGain = 0.0; + rm *= ri->defgain; + gm *= ri->defgain; + bm *= ri->defgain; + } + + if (hrp.enabled==true && hrp.method=="Color" && hrmap[0]==NULL) + updateHLRecoveryMap_ColorPropagation (); + + // compute image area to render in order to provide the requested part of the image + int sx1, sy1, imwidth, imheight, fw; + transformRect (pp, tran, sx1, sy1, imwidth, imheight, fw); + + // check possible overflows + int maximwidth, maximheight; + if ((tran & TR_ROT) == TR_R90 || (tran & TR_ROT) == TR_R270) { + maximwidth = image->height; + maximheight = image->width; + } + else { + maximwidth = image->width; + maximheight = image->height; + } + if (d1x) + maximheight /= 2; + + // correct if overflow (very rare), but not fuji because it is corrected in transline + if (!fuji && imwidth>maximwidth) + imwidth = maximwidth; + if (!fuji && imheight>maximheight) + imheight = maximheight; + + // render the requested image part + unsigned short* red = new unsigned short[imwidth]; + unsigned short* grn = new unsigned short[imwidth]; + unsigned short* blue = new unsigned short[imwidth]; + + for (int i=sy1,ix=0; ixfilters && this->red && this->blue) { + for (int j=0,jx=sx1; jred[i][jx]); + grn[j] = CLIP(gm*green[i][jx]); + blue[j] = CLIP(bm*this->blue[i][jx]); + } + } else if(ri->filters) { + if (i==0) + interpolate_row_rb_mul_pp (red, blue, NULL, green[i], green[i+1], i, rm, gm, bm, sx1, imwidth, pp.skip); + else if (i==H-1) + interpolate_row_rb_mul_pp (red, blue, green[i-1], green[i], NULL, i, rm, gm, bm, sx1, imwidth, pp.skip); + else + interpolate_row_rb_mul_pp (red, blue, green[i-1], green[i], green[i+1], i, rm, gm, bm, sx1, imwidth, pp.skip); + + for (int j=0,jx=sx1; jdata[i][jx*3+0]); + grn[j] = CLIP(gm*ri->data[i][jx*3+1]); + blue[j] = CLIP(bm*ri->data[i][jx*3+2]); + } + } + + if (hrp.enabled) + hlRecovery (hrp.method, red, grn, blue, i, sx1, imwidth, pp.skip); + + transLine (red, grn, blue, ix, image, tran, imwidth, imheight, fw); + } + + delete [] red; + delete [] grn; + delete [] blue; + + if (fuji) { + int a = ((tran & TR_ROT) == TR_R90 && image->width%2==0) || ((tran & TR_ROT) == TR_R180 && image->height%2+image->width%2==1) || ((tran & TR_ROT) == TR_R270 && image->height%2==0); + // first row + for (int j=1+a; jwidth-1; j+=2) { + image->r[0][j] = (image->r[1][j] + image->r[0][j+1] + image->r[0][j-1]) / 3; + image->g[0][j] = (image->g[1][j] + image->g[0][j+1] + image->g[0][j-1]) / 3; + image->b[0][j] = (image->b[1][j] + image->b[0][j+1] + image->b[0][j-1]) / 3; + } + // other rows + for (int i=1; iheight-1; i++) { + for (int j=2-(a+i+1)%2; jwidth-1; j+=2) { + // edge-adaptive interpolation + double dh = (ABS(image->r[i][j+1] - image->r[i][j-1]) + ABS(image->g[i][j+1] - image->g[i][j-1]) + ABS(image->b[i][j+1] - image->b[i][j-1])) / 1.0; + double dv = (ABS(image->r[i+1][j] - image->r[i-1][j]) + ABS(image->g[i+1][j] - image->g[i-1][j]) + ABS(image->b[i+1][j] - image->b[i-1][j])) / 1.0; + double eh = 1.0 / (1.0 + dh); + double ev = 1.0 / (1.0 + dv); + image->r[i][j] = (eh * (image->r[i][j+1] + image->r[i][j-1]) + ev * (image->r[i+1][j] + image->r[i-1][j])) / (2.0 * (eh + ev)); + image->g[i][j] = (eh * (image->g[i][j+1] + image->g[i][j-1]) + ev * (image->g[i+1][j] + image->g[i-1][j])) / (2.0 * (eh + ev)); + image->b[i][j] = (eh * (image->b[i][j+1] + image->b[i][j-1]) + ev * (image->b[i+1][j] + image->b[i-1][j])) / (2.0 * (eh + ev)); + } + // first pixel + if (2-(a+i+1)%2==2) { + image->r[i][0] = (image->r[i+1][0] + image->r[i-1][0] + image->r[i][1]) / 3; + image->g[i][0] = (image->g[i+1][0] + image->g[i-1][0] + image->g[i][1]) / 3; + image->b[i][0] = (image->b[i+1][0] + image->b[i-1][0] + image->b[i][1]) / 3; + } + // last pixel + if (2-(a+i+image->width)%2==2) { + image->r[i][image->width-1] = (image->r[i+1][image->width-1] + image->r[i-1][image->width-1] + image->r[i][image->width-2]) / 3; + image->g[i][image->width-1] = (image->g[i+1][image->width-1] + image->g[i-1][image->width-1] + image->g[i][image->width-2]) / 3; + image->b[i][image->width-1] = (image->b[i+1][image->width-1] + image->b[i-1][image->width-1] + image->b[i][image->width-2]) / 3; + } + } + // last row + int b = (a==1 && image->height%2) || (a==0 && image->height%2==0); + for (int j=1+b; jwidth-1; j+=2) { + image->r[image->height-1][j] = (image->r[image->height-2][j] + image->r[image->height-1][j+1] + image->r[image->height-1][j-1]) / 3; + image->g[image->height-1][j] = (image->g[image->height-2][j] + image->g[image->height-1][j+1] + image->g[image->height-1][j-1]) / 3; + image->b[image->height-1][j] = (image->b[image->height-2][j] + image->b[image->height-1][j+1] + image->b[image->height-1][j-1]) / 3; + } + } + + // Flip if needed + if (tran & TR_HFLIP) + hflip (image); + if (tran & TR_VFLIP) + vflip (image); + + // Color correction + if (ri->filters && pp.skip==1) + correction_YIQ_LQ (image, settings->colorCorrectionSteps); + + // Applying postmul + colorSpaceConversion (image, cmp, embProfile, camProfile, cam, defGain); + + isrcMutex.unlock (); +} + +void RawImageSource::rotateLine (unsigned short* line, unsigned short** channel, int tran, int i, int w, int h) { + + if ((tran & TR_ROT) == TR_R180) + for (int j=0; j=0 && yheight && y>=0 && xwidth) { + image->r[image->height-1-y][image->width-1-x] = red[j]; + image->g[image->height-1-y][image->width-1-x] = green[j]; + image->b[image->height-1-y][image->width-1-x] = blue[j]; + } + } + } + else if ((tran & TR_ROT) == TR_R270) { + int end = MIN(h+fw-i, w-fw+i); + for (int j=start; j=0 && xheight && y>=0 && ywidth) { + image->r[image->height-1-x][y] = red[j]; + image->g[image->height-1-x][y] = green[j]; + image->b[image->height-1-x][y] = blue[j]; + } + } + } + else if ((tran & TR_ROT) == TR_R90) { + int end = MIN(h+fw-i, w-fw+i); + for (int j=start; j=0 && ywidth && y>=0 && xheight) { + image->r[x][image->width-1-y] = red[j]; + image->g[x][image->width-1-y] = green[j]; + image->b[x][image->width-1-y] = blue[j]; + } + } + } + else { + int end = MIN(h+fw-i, w-fw+i); + for (int j=start; j=0 && yheight && y>=0 && xwidth) { + image->r[y][x] = red[j]; + image->g[y][x] = green[j]; + image->b[y][x] = blue[j]; + } + } + } + } + // Nikon D1X vertical interpolation + coarse rotation + else if (d1x) { + // copy new pixels + if ((tran & TR_ROT) == TR_R180) { + for (int j=0; jr[2*imheight-2-2*i][imwidth-1-j] = red[j]; + image->g[2*imheight-2-2*i][imwidth-1-j] = green[j]; + image->b[2*imheight-2-2*i][imwidth-1-j] = blue[j]; + } + + if (i==1 || i==2) { // linear interpolation + int row = 2*imheight-1-2*i; + for (int j=0; jr[row][col] = (red[j] + image->r[row+1][col]) >> 1; + image->g[row][col] = (green[j] + image->g[row+1][col]) >> 1; + image->b[row][col] = (blue[j] + image->b[row+1][col]) >> 1; + } + } + else if (i==imheight-1) { + int row = 2*imheight-1-2*i; + for (int j=0; jr[row][col] = (red[j] + image->r[row+1][col]) >> 1; + image->g[row][col] = (green[j] + image->g[row+1][col]) >> 1; + image->b[row][col] = (blue[j] + image->b[row+1][col]) >> 1; + } + row = 2*imheight-1-2*i+2; + for (int j=0; jr[row][col] = (red[j] + image->r[row+1][col]) >> 1; + image->g[row][col] = (green[j] + image->g[row+1][col]) >> 1; + image->b[row][col] = (blue[j] + image->b[row+1][col]) >> 1; + } + } + else if (i>2 && ir[row][col] = CLIP((int)(-0.0625*red[j] + 0.5625*image->r[row-1][col] + 0.5625*image->r[row+1][col] - 0.0625*image->r[row+3][col])); + image->g[row][col] = CLIP((int)(-0.0625*green[j] + 0.5625*image->g[row-1][col] + 0.5625*image->g[row+1][col] - 0.0625*image->g[row+3][col])); + image->b[row][col] = CLIP((int)(-0.0625*blue[j] + 0.5625*image->b[row-1][col] + 0.5625*image->b[row+1][col] - 0.0625*image->b[row+3][col])); + } + } + } + else if ((tran & TR_ROT) == TR_R90) { + for (int j=0; jr[j][2*imheight-2-2*i] = red[j]; + image->g[j][2*imheight-2-2*i] = green[j]; + image->b[j][2*imheight-2-2*i] = blue[j]; + } + if (i==1 || i==2) { // linear interpolation + int col = 2*imheight-1-2*i; + for (int j=0; jr[j][col] = (red[j] + image->r[j][col+1]) >> 1; + image->g[j][col] = (green[j] + image->g[j][col+1]) >> 1; + image->b[j][col] = (blue[j] + image->b[j][col+1]) >> 1; + } + } + else if (i==imheight-1) { + int col = 2*imheight-1-2*i; + for (int j=0; jr[j][col] = (red[j] + image->r[j][col+1]) >> 1; + image->g[j][col] = (green[j] + image->g[j][col+1]) >> 1; + image->b[j][col] = (blue[j] + image->b[j][col+1]) >> 1; + } + col = 2*imheight-1-2*i+2; + for (int j=0; jr[j][col] = (red[j] + image->r[j][col+1]) >> 1; + image->g[j][col] = (green[j] + image->g[j][col+1]) >> 1; + image->b[j][col] = (blue[j] + image->b[j][col+1]) >> 1; + } + } + else if (i>2 && ir[j][col] = CLIP((int)(-0.0625*red[j] + 0.5625*image->r[j][col-1] + 0.5625*image->r[j][col+1] - 0.0625*image->r[j][col+3])); + image->g[j][col] = CLIP((int)(-0.0625*green[j] + 0.5625*image->g[j][col-1] + 0.5625*image->g[j][col+1] - 0.0625*image->g[j][col+3])); + image->b[j][col] = CLIP((int)(-0.0625*blue[j] + 0.5625*image->b[j][col-1] + 0.5625*image->b[j][col+1] - 0.0625*image->b[j][col+3])); + } + } + } + else if ((tran & TR_ROT) == TR_R270) { + for (int j=0; jr[imwidth-1-j][2*i] = red[j]; + image->g[imwidth-1-j][2*i] = green[j]; + image->b[imwidth-1-j][2*i] = blue[j]; + } + if (i==1 || i==2) { // linear interpolation + for (int j=0; jr[row][2*i-1] = (red[j] + image->r[row][2*i-2]) >> 1; + image->g[row][2*i-1] = (green[j] + image->g[row][2*i-2]) >> 1; + image->b[row][2*i-1] = (blue[j] + image->b[row][2*i-2]) >> 1; + } + } + else if (i==imheight-1) { + for (int j=0; jr[row][2*i-1] = (red[j] + image->r[row][2*i-2]) >> 1; + image->g[row][2*i-1] = (green[j] + image->g[row][2*i-2]) >> 1; + image->b[row][2*i-1] = (blue[j] + image->b[row][2*i-2]) >> 1; + image->r[row][2*i-3] = (image->r[row][2*i-2] + image->r[row][2*i-4]) >> 1; + image->g[row][2*i-3] = (image->g[row][2*i-2] + image->g[row][2*i-4]) >> 1; + image->b[row][2*i-3] = (image->b[row][2*i-2] + image->b[row][2*i-4]) >> 1; + } + } + else if (i>0 && ir[row][2*i-3] = CLIP((int)(-0.0625*red[j] + 0.5625*image->r[row][2*i-2] + 0.5625*image->r[row][2*i-4] - 0.0625*image->r[row][2*i-6])); + image->g[row][2*i-3] = CLIP((int)(-0.0625*green[j] + 0.5625*image->g[row][2*i-2] + 0.5625*image->g[row][2*i-4] - 0.0625*image->g[row][2*i-6])); + image->b[row][2*i-3] = CLIP((int)(-0.0625*blue[j] + 0.5625*image->b[row][2*i-2] + 0.5625*image->b[row][2*i-4] - 0.0625*image->b[row][2*i-6])); + } + } + } + else { + rotateLine (red, image->r, tran, 2*i, imwidth, imheight); + rotateLine (green, image->g, tran, 2*i, imwidth, imheight); + rotateLine (blue, image->b, tran, 2*i, imwidth, imheight); + + if (i==1 || i==2) { // linear interpolation + for (int j=0; jr[2*i-1][j] = (red[j] + image->r[2*i-2][j]) >> 1; + image->g[2*i-1][j] = (green[j] + image->g[2*i-2][j]) >> 1; + image->b[2*i-1][j] = (blue[j] + image->b[2*i-2][j]) >> 1; + } + } + else if (i==imheight-1) { + for (int j=0; jr[2*i-3][j] = (image->r[2*i-4][j] + image->r[2*i-2][j]) >> 1; + image->g[2*i-3][j] = (image->g[2*i-4][j] + image->g[2*i-2][j]) >> 1; + image->b[2*i-3][j] = (image->b[2*i-4][j] + image->b[2*i-2][j]) >> 1; + image->r[2*i-1][j] = (red[j] + image->r[2*i-2][j]) >> 1; + image->g[2*i-1][j] = (green[j] + image->g[2*i-2][j]) >> 1; + image->b[2*i-1][j] = (blue[j] + image->b[2*i-2][j]) >> 1; + } + } + else if (i>2 && ir[2*i-3][j] = CLIP((int)(-0.0625*red[j] + 0.5625*image->r[2*i-2][j] + 0.5625*image->r[2*i-4][j] - 0.0625*image->r[2*i-6][j])); + image->g[2*i-3][j] = CLIP((int)(-0.0625*green[j] + 0.5625*image->g[2*i-2][j] + 0.5625*image->g[2*i-4][j] - 0.0625*image->g[2*i-6][j])); + image->b[2*i-3][j] = CLIP((int)(-0.0625*blue[j] + 0.5625*image->b[2*i-2][j] + 0.5625*image->b[2*i-4][j] - 0.0625*image->b[2*i-6][j])); + } + } + } + } + // other (conventional) CCD coarse rotation + else { + rotateLine (red, image->r, tran, i, imwidth, imheight); + rotateLine (green, image->g, tran, i, imwidth, imheight); + rotateLine (blue, image->b, tran, i, imwidth, imheight); + } +} + +void RawImageSource::getFullSize (int& w, int& h, int tr) { + + tr = defTransform (tr); + + if (fuji) { + w = ri->fuji_width * 2 + 1; + h = (H - ri->fuji_width)*2 + 1; + } + else if (d1x) { + w = W; + h = 2*H-1; + } + else { + w = W; + h = H; + } + + if ((tr & TR_ROT) == TR_R90 || (tr & TR_ROT) == TR_R270) { + int tmp = w; + w = h; + h = tmp; + } + w -= 2 * border; + h -= 2 * border; +} + +void RawImageSource::getSize (int tran, PreviewProps pp, int& w, int& h) { + + tran = defTransform (tran); + +// if (fuji) { +// return; +// } +// else if (d1x) { +// return; +// } +// else { + w = pp.w / pp.skip + (pp.w % pp.skip > 0); + h = pp.h / pp.skip + (pp.h % pp.skip > 0); +// } +} + +void RawImageSource::hflip (Image16* image) { + int width = image->width; + int height = image->height; + + unsigned short* rowr = new unsigned short[width]; + unsigned short* rowg = new unsigned short[width]; + unsigned short* rowb = new unsigned short[width]; + for (int i=0; ir[i][width-1-j]; + rowg[j] = image->g[i][width-1-j]; + rowb[j] = image->b[i][width-1-j]; + } + memcpy (image->r[i], rowr, width*sizeof(unsigned short)); + memcpy (image->g[i], rowg, width*sizeof(unsigned short)); + memcpy (image->b[i], rowb, width*sizeof(unsigned short)); + } + delete [] rowr; + delete [] rowg; + delete [] rowb; +} + +void RawImageSource::vflip (Image16* image) { + int width = image->width; + int height = image->height; + + register unsigned short tmp; + for (int i=0; ir[i][j]; + image->r[i][j] = image->r[height-1-i][j]; + image->r[height-1-i][j] = tmp; + tmp = image->g[i][j]; + image->g[i][j] = image->g[height-1-i][j]; + image->g[height-1-i][j] = tmp; + tmp = image->b[i][j]; + image->b[i][j] = image->b[height-1-i][j]; + image->b[height-1-i][j] = tmp; + } +} + +void RawImageSource::inverse33 (double (*coeff)[3], double (*icoeff)[3]) { + double nom = coeff[0][2]*coeff[1][1]*coeff[2][0] - coeff[0][1]*coeff[1][2]*coeff[2][0] - coeff[0][2]*coeff[1][0]*coeff[2][1] + coeff[0][0]*coeff[1][2]*coeff[2][1] + coeff[0][1]*coeff[1][0]*coeff[2][2] - coeff[0][0]*coeff[1][1]*coeff[2][2]; + icoeff[0][0] = (coeff[1][2]*coeff[2][1]-coeff[1][1]*coeff[2][2]) / nom; + icoeff[0][1] = -(coeff[0][2]*coeff[2][1]-coeff[0][1]*coeff[2][2]) / nom; + icoeff[0][2] = (coeff[0][2]*coeff[1][1]-coeff[0][1]*coeff[1][2]) / nom; + icoeff[1][0] = -(coeff[1][2]*coeff[2][0]-coeff[1][0]*coeff[2][2]) / nom; + icoeff[1][1] = (coeff[0][2]*coeff[2][0]-coeff[0][0]*coeff[2][2]) / nom; + icoeff[1][2] = -(coeff[0][2]*coeff[1][0]-coeff[0][0]*coeff[1][2]) / nom; + icoeff[2][0] = (coeff[1][1]*coeff[2][0]-coeff[1][0]*coeff[2][1]) / nom; + icoeff[2][1] = -(coeff[0][1]*coeff[2][0]-coeff[0][0]*coeff[2][1]) / nom; + icoeff[2][2] = (coeff[0][1]*coeff[1][0]-coeff[0][0]*coeff[1][1]) / nom; +} + +int RawImageSource::load (Glib::ustring fname) { + + fileName = fname; + + if (plistener) { + plistener->setProgressStr ("Decoding..."); + plistener->setProgress (0.0); + } + + ri = new RawImage; + int res = loadRaw (fname.c_str(), ri); + if (res) + return res; + + if(red) { + delete red; + red = 0; + } + if(green) { + delete green; + green = 0; + } + if(blue) { + delete blue; + blue = 0; + } + + W = ri->width; + H = ri->height; + + d1x = !strcmp(ri->model, "D1X"); + fuji = ri->fuji_width; + if (d1x) + border = 8; + + for (int i=0; i<3; i++) + for (int j=0; j<3; j++) + coeff[i][j] = ri->coeff[i][j]; + + // compute inverse of the color transformation matrix + inverse33 (coeff, icoeff); + + double cam_r = coeff[0][0]*ri->camwb_red + coeff[0][1]*ri->camwb_green + coeff[0][2]*ri->camwb_blue; + double cam_g = coeff[1][0]*ri->camwb_red + coeff[1][1]*ri->camwb_green + coeff[1][2]*ri->camwb_blue; + double cam_b = coeff[2][0]*ri->camwb_red + coeff[2][1]*ri->camwb_green + coeff[2][2]*ri->camwb_blue; + + wb = ColorTemp (cam_r, cam_g, cam_b); + + double tr = icoeff[0][0] * cam_r + icoeff[0][1] * cam_g + icoeff[0][2] * cam_b; + double tg = icoeff[1][0] * cam_r + icoeff[1][1] * cam_g + icoeff[1][2] * cam_b; + double tb = icoeff[2][0] * cam_r + icoeff[2][1] * cam_g + icoeff[2][2] * cam_b; + + // create profile + memset (cam, 0, sizeof(cam)); + for (int i=0; i<3; i++) + for (int j=0; j<3; j++) + for (int k=0; k<3; k++) + cam[i][j] += coeff[k][i] * sRGB_d50[k][j]; + camProfile = iccStore.createFromMatrix (cam, false, "Camera"); + inverse33 (cam, icam); + + if (ri->profile_data) + embProfile = cmsOpenProfileFromMem (ri->profile_data, ri->profile_len); + + defGain = log(ri->defgain) / log(2.0); + + RawMetaDataLocation rml; + rml.exifBase = ri->exifbase; + rml.ciffBase = ri->ciff_base; + rml.ciffLength = ri->ciff_len; + + idata = new ImageData (fname, &rml); + + // check if it is an olympus E camera, if yes, compute G channel pre-compensation factors + if (((idata->getMake().size()>=7 && idata->getMake().substr(0,7)=="OLYMPUS" && idata->getModel()[0]=='E') || (idata->getMake().size()>=9 && idata->getMake().substr(0,7)=="Panasonic")) && settings->demosaicMethod!="vng4" && ri->filters) { + // global correction + int ng1=0, ng2=0; + double avgg1=0, avgg2=0; + for (int i=border; idata[i][j]; + ng1++; + } + else { + avgg2 += ri->data[i][j]; + ng2++; + } + } + double corrg1 = ((double)avgg1/ng1 + (double)avgg2/ng2) / 2.0 / ((double)avgg1/ng1); + double corrg2 = ((double)avgg1/ng1 + (double)avgg2/ng2) / 2.0 / ((double)avgg2/ng2); + for (int i=border; idata[i][j] = CLIP(ri->data[i][j] * (i%2 ? corrg2 : corrg1)); + + // local correction in a 9x9 box +/* unsigned short* corr_alloc = new unsigned short[W*H]; + unsigned short** corr_data = new unsigned short* [H]; + for (int i=0; iallocation, W*H*sizeof(unsigned short)); + for (int i=border; idata[i-4][j-4] + ri->data[i-4][j-2] + ri->data[i-4][j] + ri->data[i-4][j+2] + + ri->data[i-2][j-4] + ri->data[i-2][j-2] + ri->data[i-2][j] + ri->data[i-2][j+2] + + ri->data[i][j-4] + ri->data[i][j-2] + ri->data[i][j] + ri->data[i][j+2] + + ri->data[i+2][j-4] + ri->data[i+2][j-2] + ri->data[i+2][j] + ri->data[i+2][j+2]; + unsigned int ag2 = ri->data[i-3][j-3] + ri->data[i-3][j-1] + ri->data[i-3][j+1] + ri->data[i-3][j+1] + + ri->data[i-1][j-3] + ri->data[i-1][j-1] + ri->data[i-1][j+1] + ri->data[i-1][j+1] + + ri->data[i+1][j-3] + ri->data[i+1][j-1] + ri->data[i+1][j+1] + ri->data[i+1][j+1] + + ri->data[i+3][j-3] + ri->data[i+3][j-1] + ri->data[i+3][j+1] + ri->data[i+3][j+1]; + unsigned int val = (ri->data[i][j] + ri->data[i][j] * ag2 / ag1) / 2; + corr_data[i][j] = CLIP (val); + } + memcpy (ri->allocation, corr_alloc, W*H*sizeof(unsigned short)); + delete corr_alloc; + delete corr_data; +*/ + } + + if (ri->filters) { + // demosaic + if (settings->demosaicMethod=="hphd") + hphd_demosaic (); + else if (settings->demosaicMethod=="vng4") + vng4_demosaic (); + else if (settings->demosaicMethod=="ahd") + ahd_demosaic (); + else if (settings->demosaicMethod=="ppg") + ppg_demosaic (); + else if (settings->demosaicMethod=="dcb") + dcb_demosaic(settings->dcb_iterations, settings->dcb_enhance? 1:0); + else + eahd_demosaic (); + } + + + if (plistener) { + plistener->setProgressStr ("Ready."); + plistener->setProgress (1.0); + } + + return 0; +} + +int RawImageSource::defTransform (int tran) { + + int deg = ri->rotate_deg; + if ((tran & TR_ROT) == TR_R180) + deg += 180; + else if ((tran & TR_ROT) == TR_R90) + deg += 90; + else if ((tran & TR_ROT) == TR_R270) + deg += 270; + deg %= 360; + + int ret = 0; + if (deg==90) + ret |= TR_R90; + else if (deg==180) + ret |= TR_R180; + else if (deg==270) + ret |= TR_R270; + if (tran & TR_HFLIP) + ret |= TR_HFLIP; + if (tran & TR_VFLIP) + ret |= TR_VFLIP; + return ret; +} + +void RawImageSource::correction_YIQ_LQ_ (Image16* im, int row_from, int row_to) { + + int W = im->width; + + int** rbconv_Y = new int*[3]; + int** rbconv_I = new int*[3]; + int** rbconv_Q = new int*[3]; + int** rbout_I = new int*[3]; + int** rbout_Q = new int*[3]; + for (int i=0; i<3; i++) { + rbconv_Y[i] = new int[W]; + rbconv_I[i] = new int[W]; + rbconv_Q[i] = new int[W]; + rbout_I[i] = new int[W]; + rbout_Q[i] = new int[W]; + } + + int* row_I = new int[W]; + int* row_Q = new int[W]; + + int* pre1_I = new int[3]; + int* pre2_I = new int[3]; + int* post1_I = new int[3]; + int* post2_I = new int[3]; + int middle_I[6]; + int* pre1_Q = new int[3]; + int* pre2_Q = new int[3]; + int* post1_Q = new int[3]; + int* post2_Q = new int[3]; + int middle_Q[6]; + int* tmp; + + int ppx=0, px=(row_from-1)%3, cx=row_from%3, nx=0; + + convert_row_to_YIQ (im->r[row_from-1], im->g[row_from-1], im->b[row_from-1], rbconv_Y[px], rbconv_I[px], rbconv_Q[px], W); + convert_row_to_YIQ (im->r[row_from], im->g[row_from], im->b[row_from], rbconv_Y[cx], rbconv_I[cx], rbconv_Q[cx], W); + + for (int j=0; jr[i+1], im->g[i+1], im->b[i+1], rbconv_Y[nx], rbconv_I[nx], rbconv_Q[nx], W); + + SORT3(rbconv_I[px][0],rbconv_I[cx][0],rbconv_I[nx][0],pre1_I[0],pre1_I[1],pre1_I[2]); + SORT3(rbconv_I[px][1],rbconv_I[cx][1],rbconv_I[nx][1],pre2_I[0],pre2_I[1],pre2_I[2]); + SORT3(rbconv_Q[px][0],rbconv_Q[cx][0],rbconv_Q[nx][0],pre1_Q[0],pre1_Q[1],pre1_Q[2]); + SORT3(rbconv_Q[px][1],rbconv_Q[cx][1],rbconv_Q[nx][1],pre2_Q[0],pre2_Q[1],pre2_Q[2]); + + // median I channel + for (int j=1; jrow_from) { + for (int j=1; jr[i-1], im->g[i-1], im->b[i-1], rbconv_Y[px], row_I, row_Q, W); + } + } + // blur last 3 row and finalize H-1th row + for (int j=1; jr[row_to-1], im->g[row_to-1], im->b[row_to-1], rbconv_Y[cx], row_I, row_Q, W); + + freeArray(rbconv_Y, 3); + freeArray(rbconv_I, 3); + freeArray(rbconv_Q, 3); + freeArray(rbout_I, 3); + freeArray(rbout_Q, 3); + delete [] row_I; + delete [] row_Q; + delete [] pre1_I; + delete [] pre2_I; + delete [] post1_I; + delete [] post2_I; + delete [] pre1_Q; + delete [] pre2_Q; + delete [] post1_Q; + delete [] post2_Q; +} + + +void RawImageSource::correction_YIQ_LQ (Image16* im, int times) { + + if (im->height<4) + return; + + MyTime t1, t2; + + t1.set (); + for (int t=0; tdualThreadEnabled) { + Glib::Thread *thread1 = Glib::Thread::create(sigc::bind(sigc::mem_fun(*this, &RawImageSource::correction_YIQ_LQ_), im, 1, im->height/2), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); + Glib::Thread *thread2 = Glib::Thread::create(sigc::bind(sigc::mem_fun(*this, &RawImageSource::correction_YIQ_LQ_), im, im->height/2, im->height-1), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); + thread1->join (); + thread2->join (); + } + else + correction_YIQ_LQ_ (im, 1, im->height-1); + } + t2.set (); +// printf ("Corrected. (%d)\n", t2.etime(t1)); +} + + + +void RawImageSource::convert_row_to_YIQ (unsigned short* r, unsigned short* g, unsigned short* b, int* Y, int* I, int* Q, int W) { + for (int j=0; j +void RawImageSource::convert_to_cielab_row (unsigned short* ar, unsigned short* ag, unsigned short* ab, short* oL, short* oa, short* ob) { + + for (int j=0; jthreshold) + oL[j] = 300.0*cache[(int)y]; + else + oL[j] = 300.0 * 903.3 * y / CMAXVAL; + + oa[j] = 32.0 * 500.0 * ((x>threshold ? cache[(int)x] : 7.787*x/CMAXVAL+16.0/116.0) - (y>threshold ? cache[(int)y] : 7.787*y/CMAXVAL+16.0/116.0)); + ob[j] = 32.0 * 200.0 * ((y>threshold ? cache[(int)y] : 7.787*y/CMAXVAL+16.0/116.0) - (z>threshold ? cache[(int)z] : 7.787*z/CMAXVAL+16.0/116.0)); + } +} + +void RawImageSource::interpolate_row_g (unsigned short* agh, unsigned short* agv, int i) { + + for (int j=0; jdata[i][j]; + agv[j] = ri->data[i][j]; + } + else { + int gh=0; + int gv=0; + if (j>1 && jdata[i][j-2] + 2*ri->data[i][j-1] + 2*ri->data[i][j] + 2*ri->data[i][j+1] -ri->data[i][j+2]) / 4; + int maxgh = MAX(ri->data[i][j-1], ri->data[i][j+1]); + int mingh = MIN(ri->data[i][j-1], ri->data[i][j+1]); + if (gh>maxgh) + gh = maxgh; + else if (ghdata[i][1]; + else if (j==1) + gh = (ri->data[i][0] + ri->data[i][2]) / 2; + else if (j==W-1) + gh = ri->data[i][W-2]; + else if (j==W-2) + gh = (ri->data[i][W-1] + ri->data[i][W-3]) / 2; + + if (i>1 && idata[i-2][j] + 2*ri->data[i-1][j] + 2*ri->data[i][j] + 2*ri->data[i+1][j] - ri->data[i+2][j]) / 4; + int maxgv = MAX(ri->data[i-1][j], ri->data[i+1][j]); + int mingv = MIN(ri->data[i-1][j], ri->data[i+1][j]); + if (gv>maxgv) + gv = maxgv; + else if (gvdata[1][j]; + else if (i==1) + gv = (ri->data[0][j] + ri->data[2][j]) / 2; + else if (i==H-1) + gv = ri->data[H-2][j]; + else if (i==H-2) + gv = (ri->data[H-1][j] + ri->data[H-3][j]) / 2; + + agh[j] = CLIP(gh); + agv[j] = CLIP(gv); + } + } +} + +void RawImageSource::interpolate_row_rb (unsigned short* ar, unsigned short* ab, unsigned short* pg, unsigned short* cg, unsigned short* ng, int i) { + if (ISRED(ri,i,0) || ISRED(ri,i,1)) { + // RGRGR or GRGRGR line + for (int j=0; jdata[i][j]; + // blue: cross interpolation + int b = 0; + int n = 0; + if (i>0 && j>0) { + b += ri->data[i-1][j-1] - pg[j-1]; + n++; + } + if (i>0 && jdata[i-1][j+1] - pg[j+1]; + n++; + } + if (i0) { + b += ri->data[i+1][j-1] - ng[j-1]; + n++; + } + if (idata[i+1][j+1] - ng[j+1]; + n++; + } + b = cg[j] + b / n; + ab[j] = CLIP(b); + } + else { + // linear R-G interp. horizontally + int r; + if (j==0) + r = cg[0] + ri->data[i][1] - cg[1]; + else if (j==W-1) + r = cg[W-1] + ri->data[i][W-2] - cg[W-2]; + else + r = cg[j] + (ri->data[i][j-1] - cg[j-1] + ri->data[i][j+1] - cg[j+1]) / 2; + ar[j] = CLIP(r); + // linear B-G interp. vertically + int b; + if (i==0) + b = ng[j] + ri->data[1][j] - cg[j]; + else if (i==H-1) + b = pg[j] + ri->data[H-2][j] - cg[j]; + else + b = cg[j] + (ri->data[i-1][j] - pg[j] + ri->data[i+1][j] - ng[j]) / 2; + ab[j] = CLIP(b); + } + } + } + else { + // BGBGB or GBGBGB line + for (int j=0; jdata[i][j]; + // blue: cross interpolation + int r = 0; + int n = 0; + if (i>0 && j>0) { + r += ri->data[i-1][j-1] - pg[j-1]; + n++; + } + if (i>0 && jdata[i-1][j+1] - pg[j+1]; + n++; + } + if (i0) { + r += ri->data[i+1][j-1] - ng[j-1]; + n++; + } + if (idata[i+1][j+1] - ng[j+1]; + n++; + } + r = cg[j] + r / n; + + ar[j] = CLIP(r); + } + else { + // linear B-G interp. horizontally + int b; + if (j==0) + b = cg[0] + ri->data[i][1] - cg[1]; + else if (j==W-1) + b = cg[W-1] + ri->data[i][W-2] - cg[W-2]; + else + b = cg[j] + (ri->data[i][j-1] - cg[j-1] + ri->data[i][j+1] - cg[j+1]) / 2; + ab[j] = CLIP(b); + // linear R-G interp. vertically + int r; + if (i==0) + r = ng[j] + ri->data[1][j] - cg[j]; + else if (i==H-1) + r = pg[j] + ri->data[H-2][j] - cg[j]; + else + r = cg[j] + (ri->data[i-1][j] - pg[j] + ri->data[i+1][j] - ng[j]) / 2; + ar[j] = CLIP(r); + } + } + } +} + +void RawImageSource::interpolate_row_rb_mul_pp (unsigned short* ar, unsigned short* ab, unsigned short* pg, unsigned short* cg, unsigned short* ng, int i, double r_mul, double g_mul, double b_mul, int x1, int width, int skip) { + + if (ISRED(ri,i,0) || ISRED(ri,i,1)) { + // RGRGR or GRGRGR line + for (int j=x1, jx=0; jxdata[i][j]); + // blue: cross interpolation + int b = 0; + int n = 0; + if (i>0 && j>0) { + b += b_mul*ri->data[i-1][j-1] - g_mul*pg[j-1]; + n++; + } + if (i>0 && jdata[i-1][j+1] - g_mul*pg[j+1]; + n++; + } + if (i0) { + b += b_mul*ri->data[i+1][j-1] - g_mul*ng[j-1]; + n++; + } + if (idata[i+1][j+1] - g_mul*ng[j+1]; + n++; + } + b = g_mul*cg[j] + b / n; + ab[jx] = CLIP(b); + } + else { + // linear R-G interp. horizontally + int r; + if (j==0) + r = g_mul*cg[0] + r_mul*ri->data[i][1] - g_mul*cg[1]; + else if (j==W-1) + r = g_mul*cg[W-1] + r_mul*ri->data[i][W-2] - g_mul*cg[W-2]; + else + r = g_mul*cg[j] + (r_mul*ri->data[i][j-1] - g_mul*cg[j-1] + r_mul*ri->data[i][j+1] - g_mul*cg[j+1]) / 2; + ar[jx] = CLIP(r); + // linear B-G interp. vertically + int b; + if (i==0) + b = g_mul*ng[j] + b_mul*ri->data[1][j] - g_mul*cg[j]; + else if (i==H-1) + b = g_mul*pg[j] + b_mul*ri->data[H-2][j] - g_mul*cg[j]; + else + b = g_mul*cg[j] + (b_mul*ri->data[i-1][j] - g_mul*pg[j] + b_mul*ri->data[i+1][j] - g_mul*ng[j]) / 2; + ab[jx] = CLIP(b); + } + } + } + else { + // BGBGB or GBGBGB line + for (int j=x1, jx=0; jxdata[i][j]); + // blue: cross interpolation + int r = 0; + int n = 0; + if (i>0 && j>0) { + r += r_mul*ri->data[i-1][j-1] - g_mul*pg[j-1]; + n++; + } + if (i>0 && jdata[i-1][j+1] - g_mul*pg[j+1]; + n++; + } + if (i0) { + r += r_mul*ri->data[i+1][j-1] - g_mul*ng[j-1]; + n++; + } + if (idata[i+1][j+1] - g_mul*ng[j+1]; + n++; + } + r = g_mul*cg[j] + r / n; + + ar[jx] = CLIP(r); + } + else { + // linear B-G interp. horizontally + int b; + if (j==0) + b = g_mul*cg[0] + b_mul*ri->data[i][1] - g_mul*cg[1]; + else if (j==W-1) + b = g_mul*cg[W-1] + b_mul*ri->data[i][W-2] - g_mul*cg[W-2]; + else + b = g_mul*cg[j] + (b_mul*ri->data[i][j-1] - g_mul*cg[j-1] + b_mul*ri->data[i][j+1] - g_mul*cg[j+1]) / 2; + ab[jx] = CLIP(b); + // linear R-G interp. vertically + int r; + if (i==0) + r = g_mul*ng[j] + r_mul*ri->data[1][j] - g_mul*cg[j]; + else if (i==H-1) + r = g_mul*pg[j] + r_mul*ri->data[H-2][j] - g_mul*cg[j]; + else + r = g_mul*cg[j] + (r_mul*ri->data[i-1][j] - g_mul*pg[j] + r_mul*ri->data[i+1][j] - g_mul*ng[j]) / 2; + ar[jx] = CLIP(r); + } + } + } +} + + +void RawImageSource::colorSpaceConversion (Image16* im, ColorManagementParams cmp, cmsHPROFILE embedded, cmsHPROFILE camprofile, double camMatrix[3][3], double& defgain) { + + if (cmp.input == "(none)") + return; + + MyTime t1, t2, t3; + + t1.set (); + + cmsHPROFILE in; + cmsHPROFILE out; + + Glib::ustring inProfile = cmp.input; + + if (inProfile=="(embedded)") { + if (embedded) + in = embedded; + else + in = camprofile; + } + else if (inProfile=="(camera)" || inProfile=="") + in = camprofile; + else { + in = iccStore.getProfile (inProfile); + if (in==NULL) + inProfile = "(camera)"; + } + + + if (inProfile=="(camera)" || inProfile=="" || (inProfile=="(embedded)" && !embedded)) { + // in this case we avoid using the slllllooooooowwww lcms + +// out = iccStore.workingSpace (wProfile); +// hTransform = cmsCreateTransform (in, TYPE_RGB_16_PLANAR, out, TYPE_RGB_16_PLANAR, settings->colorimetricIntent, cmsFLAGS_MATRIXINPUT | cmsFLAGS_MATRIXOUTPUT);//cmsFLAGS_MATRIXINPUT | cmsFLAGS_MATRIXOUTPUT); +// cmsDoTransform (hTransform, im->data, im->data, im->planestride/2); +// cmsDeleteTransform(hTransform); + TMatrix work = iccStore.workingSpaceInverseMatrix (cmp.working); + double mat[3][3] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; + for (int i=0; i<3; i++) + for (int j=0; j<3; j++) + for (int k=0; k<3; k++) + mat[i][j] += camMatrix[i][k] * work[k][j]; + + for (int i=0; iheight; i++) + for (int j=0; jwidth; j++) { + + int newr = mat[0][0]*im->r[i][j] + mat[1][0]*im->g[i][j] + mat[2][0]*im->b[i][j]; + int newg = mat[0][1]*im->r[i][j] + mat[1][1]*im->g[i][j] + mat[2][1]*im->b[i][j]; + int newb = mat[0][2]*im->r[i][j] + mat[1][2]*im->g[i][j] + mat[2][2]*im->b[i][j]; + + im->r[i][j] = CLIP(newr); + im->g[i][j] = CLIP(newg); + im->b[i][j] = CLIP(newb); + } + } + else { + out = iccStore.workingSpace (cmp.working); +// out = iccStore.workingSpaceGamma (wProfile); + lcmsMutex->lock (); + cmsHTRANSFORM hTransform = cmsCreateTransform (in, TYPE_RGB_16_PLANAR, out, TYPE_RGB_16_PLANAR, settings->colorimetricIntent, 0); + lcmsMutex->unlock (); + if (hTransform) { + if (cmp.gammaOnInput) { + double gd = pow (2.0, defgain); + defgain = 0.0; + for (int i=0; iheight; i++) + for (int j=0; jwidth; j++) { + im->r[i][j] = CurveFactory::gamma (CLIP(defgain*im->r[i][j])); + im->g[i][j] = CurveFactory::gamma (CLIP(defgain*im->g[i][j])); + im->b[i][j] = CurveFactory::gamma (CLIP(defgain*im->b[i][j])); + } + } + cmsDoTransform (hTransform, im->data, im->data, im->planestride/2); + } + else { + lcmsMutex->lock (); + hTransform = cmsCreateTransform (camprofile, TYPE_RGB_16_PLANAR, out, TYPE_RGB_16_PLANAR, settings->colorimetricIntent, 0); + lcmsMutex->unlock (); + cmsDoTransform (hTransform, im->data, im->data, im->planestride/2); + } + cmsDeleteTransform(hTransform); + } + t3.set (); +// printf ("ICM TIME: %d\n", t3.etime(t1)); +} + +void RawImageSource::eahd_demosaic () { + + if (plistener) { + plistener->setProgressStr ("Demosaicing..."); + plistener->setProgress (0.0); + } + + // prepare chache and constants for cielab conversion + lc00 = (0.412453 * coeff[0][0] + 0.357580 * coeff[1][0] + 0.180423 * coeff[2][0]) / 0.950456; + lc01 = (0.412453 * coeff[0][1] + 0.357580 * coeff[1][1] + 0.180423 * coeff[2][1]) / 0.950456; + lc02 = (0.412453 * coeff[0][2] + 0.357580 * coeff[1][2] + 0.180423 * coeff[2][2]) / 0.950456; + + lc10 = 0.212671 * coeff[0][0] + 0.715160 * coeff[1][0] + 0.072169 * coeff[2][0]; + lc11 = 0.212671 * coeff[0][1] + 0.715160 * coeff[1][1] + 0.072169 * coeff[2][1]; + lc12 = 0.212671 * coeff[0][2] + 0.715160 * coeff[1][2] + 0.072169 * coeff[2][2]; + + lc20 = (0.019334 * coeff[0][0] + 0.119193 * coeff[1][0] + 0.950227 * coeff[2][0]) / 1.088754; + lc21 = (0.019334 * coeff[0][1] + 0.119193 * coeff[1][1] + 0.950227 * coeff[2][1]) / 1.088754; + lc22 = (0.019334 * coeff[0][2] + 0.119193 * coeff[1][2] + 0.950227 * coeff[2][2]) / 1.088754; + + int maxindex = 2*65536; + cache = new double[maxindex]; + threshold = (int)(0.008856*CMAXVAL); + for (int i=0; isv) { // fixate horizontal pixel + dLmaph[dmi] = DIST(lLh[ix][j], lLh[idx][j+y]); + dCamaph[dmi] = DIST(lah[ix][j], lah[idx][j+y]); + dCbmaph[dmi] = DIST(lbh[ix][j], lbh[idx][j+y]); + dLmapv[dmi] = DIST(lLv[ix][j], lLh[idx][j+y]); + dCamapv[dmi] = DIST(lav[ix][j], lah[idx][j+y]); + dCbmapv[dmi] = DIST(lbv[ix][j], lbh[idx][j+y]); + } + else if (shdata[i-1][j]; + else { + hc = homh[imx][j]; + vc = homv[imx][j]; + if (hc > vc) + green[i-1][j] = gh[(i-1)%4][j]; + else if (hc < vc) + green[i-1][j] = gv[(i-1)%4][j]; + else + green[i-1][j] = (gh[(i-1)%4][j] + gv[(i-1)%4][j]) / 2; + } + } + + if (!(i%20) && plistener) + plistener->setProgress ((double)i / (H-2)); + } + // finish H-2th and H-1th row, homogenity value is still valailable + int hc, vc; + for (int i=H-1; i vc) + green[i-1][j] = gh[(i-1)%4][j]; + else if (hc < vc) + green[i-1][j] = gv[(i-1)%4][j]; + else + green[i-1][j] = (gh[(i-1)%4][j] + gv[(i-1)%4][j]) / 2; + } + + freeArray2(rh, 3); + freeArray2(gh, 4); + freeArray2(bh, 3); + freeArray2(rv, 3); + freeArray2(gv, 4); + freeArray2(bv, 3); + freeArray2(lLh, 3); + freeArray2(lah, 3); + freeArray2(lbh, 3); + freeArray2(homh, 3); + freeArray2(lLv, 3); + freeArray2(lav, 3); + freeArray2(lbv, 3); + freeArray2(homv, 3); +} + +void RawImageSource::hphd_vertical (float** hpmap, int col_from, int col_to) { + + float* temp = new float[MAX(W,H)]; + float* avg = new float[MAX(W,H)]; + float* dev = new float[MAX(W,H)]; + + memset (temp, 0, MAX(W,H)*sizeof(float)); + memset (avg, 0, MAX(W,H)*sizeof(float)); + memset (dev, 0, MAX(W,H)*sizeof(float)); + + for (int k=col_from; kdata[i-5][k] - 8*ri->data[i-4][k] + 27*ri->data[i-3][k] - 48*ri->data[i-2][k] + 42*ri->data[i-1][k] - + (ri->data[i+5][k] - 8*ri->data[i+4][k] + 27*ri->data[i+3][k] - 48*ri->data[i+2][k] + 42*ri->data[i+1][k])) / 100.0; + temp[i] = ABS(temp[i]); + } + for (int j=4; jdata[i][j-5] - 8*ri->data[i][j-4] + 27*ri->data[i][j-3] - 48*ri->data[i][j-2] + 42*ri->data[i][j-1] - + (ri->data[i][j+5] - 8*ri->data[i][j+4] + 27*ri->data[i][j+3] - 48*ri->data[i][j+2] + 42*ri->data[i][j+1])) / 100; + temp[j] = ABS(temp[j]); + } + for (int j=4; jhpmap[i][j] = 2; + else if (hpv < 0.8*hpmap[i][j]) + this->hpmap[i][j] = 1; + else + this->hpmap[i][j] = 0; + } + } + delete [] temp; + delete [] avg; + delete [] dev; +} + +void RawImageSource::hphd_green (int row_from, int row_to) { + + for (int i=row_from; idata[i][j]; + else { + if (this->hpmap[i][j]==1) { + int g2 = ri->data[i][j+1] + ((ri->data[i][j] - ri->data[i][j+2]) >> 1); + int g4 = ri->data[i][j-1] + ((ri->data[i][j] - ri->data[i][j-2]) >> 1); + + int dx = ri->data[i][j+1] - ri->data[i][j-1]; + int d1 = ri->data[i][j+3] - ri->data[i][j+1]; + int d2 = ri->data[i][j+2] - ri->data[i][j]; + int d3 = (ri->data[i-1][j+2] - ri->data[i-1][j]) >> 1; + int d4 = (ri->data[i+1][j+2] - ri->data[i+1][j]) >> 1; + + double e2 = 1.0 / (1.0 + ABS(dx) + ABS(d1) + ABS(d2) + ABS(d3) + ABS(d4)); + + d1 = ri->data[i][j-3] - ri->data[i][j-1]; + d2 = ri->data[i][j-2] - ri->data[i][j]; + d3 = (ri->data[i-1][j-2] - ri->data[i-1][j]) >> 1; + d4 = (ri->data[i+1][j-2] - ri->data[i+1][j]) >> 1; + + double e4 = 1.0 / (1.0 + ABS(dx) + ABS(d1) + ABS(d2) + ABS(d3) + ABS(d4)); + + green[i][j] = CLIP((e2 * g2 + e4 * g4) / (e2 + e4)); + } + else if (this->hpmap[i][j]==2) { + int g1 = ri->data[i-1][j] + ((ri->data[i][j] - ri->data[i-2][j]) >> 1); + int g3 = ri->data[i+1][j] + ((ri->data[i][j] - ri->data[i+2][j]) >> 1); + + int dy = ri->data[i+1][j] - ri->data[i-1][j]; + int d1 = ri->data[i-1][j] - ri->data[i-3][j]; + int d2 = ri->data[i][j] - ri->data[i-2][j]; + int d3 = (ri->data[i][j-1] - ri->data[i-2][j-1]) >> 1; + int d4 = (ri->data[i][j+1] - ri->data[i-2][j+1]) >> 1; + + double e1 = 1.0 / (1.0 + ABS(dy) + ABS(d1) + ABS(d2) + ABS(d3) + ABS(d4)); + + d1 = ri->data[i+1][j] - ri->data[i+3][j]; + d2 = ri->data[i][j] - ri->data[i+2][j]; + d3 = (ri->data[i][j-1] - ri->data[i+2][j-1]) >> 1; + d4 = (ri->data[i][j+1] - ri->data[i+2][j+1]) >> 1; + + double e3 = 1.0 / (1.0 + ABS(dy) + ABS(d1) + ABS(d2) + ABS(d3) + ABS(d4)); + + green[i][j] = CLIP((e1 * g1 + e3 * g3) / (e1 + e3)); + } + else { + int g1 = ri->data[i-1][j] + ((ri->data[i][j] - ri->data[i-2][j]) >> 1); + int g2 = ri->data[i][j+1] + ((ri->data[i][j] - ri->data[i][j+2]) >> 1); + int g3 = ri->data[i+1][j] + ((ri->data[i][j] - ri->data[i+2][j]) >> 1); + int g4 = ri->data[i][j-1] + ((ri->data[i][j] - ri->data[i][j-2]) >> 1); + + int dx = ri->data[i][j+1] - ri->data[i][j-1]; + int dy = ri->data[i+1][j] - ri->data[i-1][j]; + + int d1 = ri->data[i-1][j] - ri->data[i-3][j]; + int d2 = ri->data[i][j] - ri->data[i-2][j]; + int d3 = (ri->data[i][j-1] - ri->data[i-2][j-1]) >> 1; + int d4 = (ri->data[i][j+1] - ri->data[i-2][j+1]) >> 1; + + double e1 = 1.0 / (1.0 + ABS(dy) + ABS(d1) + ABS(d2) + ABS(d3) + ABS(d4)); + + d1 = ri->data[i][j+3] - ri->data[i][j+1]; + d2 = ri->data[i][j+2] - ri->data[i][j]; + d3 = (ri->data[i-1][j+2] - ri->data[i-1][j]) >> 1; + d4 = (ri->data[i+1][j+2] - ri->data[i+1][j]) >> 1; + + double e2 = 1.0 / (1.0 + ABS(dx) + ABS(d1) + ABS(d2) + ABS(d3) + ABS(d4)); + + d1 = ri->data[i+1][j] - ri->data[i+3][j]; + d2 = ri->data[i][j] - ri->data[i+2][j]; + d3 = (ri->data[i][j-1] - ri->data[i+2][j-1]) >> 1; + d4 = (ri->data[i][j+1] - ri->data[i+2][j+1]) >> 1; + + double e3 = 1.0 / (1.0 + ABS(dy) + ABS(d1) + ABS(d2) + ABS(d3) + ABS(d4)); + + d1 = ri->data[i][j-3] - ri->data[i][j-1]; + d2 = ri->data[i][j-2] - ri->data[i][j]; + d3 = (ri->data[i-1][j-2] - ri->data[i-1][j]) >> 1; + d4 = (ri->data[i+1][j-2] - ri->data[i+1][j]) >> 1; + + double e4 = 1.0 / (1.0 + ABS(dx) + ABS(d1) + ABS(d2) + ABS(d3) + ABS(d4)); + + green[i][j] = CLIP((e1*g1 + e2*g2 + e3*g3 + e4*g4) / (e1 + e2 + e3 + e4)); + } + } + } + } +} + +void RawImageSource::hphd_demosaic () { + + if (plistener) { + plistener->setProgressStr ("Demosaicing..."); + plistener->setProgress (0.0); + } + + float** hpmap = new float*[H]; + for (int i=0; idualThreadEnabled) { + Glib::Thread *thread1 = Glib::Thread::create(sigc::bind(sigc::mem_fun(*this, &RawImageSource::hphd_vertical), hpmap, 0, W/2), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); + Glib::Thread *thread2 = Glib::Thread::create(sigc::bind(sigc::mem_fun(*this, &RawImageSource::hphd_vertical), hpmap, W/2, W), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); + thread1->join (); + thread2->join (); + } + else + hphd_vertical (hpmap, 0, W); + + if (plistener) + plistener->setProgress (0.33); + + // horizontal + this->hpmap = allocArray(W, H); + for (int i=0; ihpmap[i], 0, W*sizeof(char)); + + if (settings->dualThreadEnabled) { + Glib::Thread *thread1 = Glib::Thread::create(sigc::bind(sigc::mem_fun(*this, &RawImageSource::hphd_horizontal), hpmap, 0, H/2), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); + Glib::Thread *thread2 = Glib::Thread::create(sigc::bind(sigc::mem_fun(*this, &RawImageSource::hphd_horizontal), hpmap, H/2, H), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); + thread1->join (); + thread2->join (); + } + else + hphd_horizontal (hpmap, 0, H); + + freeArray(hpmap, H); + + if (plistener) + plistener->setProgress (0.66); + +// reconstruct G + green = new unsigned short*[H]; + for (int i=0; idualThreadEnabled) { + Glib::Thread *thread1 = Glib::Thread::create(sigc::bind(sigc::mem_fun(*this, &RawImageSource::hphd_green), 3, H/2), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); + Glib::Thread *thread2 = Glib::Thread::create(sigc::bind(sigc::mem_fun(*this, &RawImageSource::hphd_green), H/2, H-3), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); + thread1->join (); + thread2->join (); + } + else + hphd_green (3, H-3); + + if (plistener) + plistener->setProgress (1.0); +} + +void RawImageSource::HLRecovery_Luminance (unsigned short* rin, unsigned short* gin, unsigned short* bin, unsigned short* rout, unsigned short* gout, unsigned short* bout, int width, int maxval) { + + for (int i=0; imaxval || g>maxval || b>maxval) { + int ro = MIN (r, maxval); + int go = MIN (g, maxval); + int bo = MIN (b, maxval); + double L = r + g + b; + double C = 1.732050808 * (r - g); + double H = 2 * b - r - g; + double Co = 1.732050808 * (ro - go); + double Ho = 2 * bo - ro - go; + if (r!=g && g!=b) { + double ratio = sqrt ((Co*Co+Ho*Ho) / (C*C+H*H)); + C *= ratio; + H *= ratio; + } + int rr = L / 3.0 - H / 6.0 + C / 3.464101615; + int gr = L / 3.0 - H / 6.0 - C / 3.464101615; + int br = L / 3.0 + H / 3.0; + rout[i] = CLIP(rr); + gout[i] = CLIP(gr); + bout[i] = CLIP(br); + } + else { + rout[i] = rin[i]; + gout[i] = gin[i]; + bout[i] = bin[i]; + } + } +} + +void RawImageSource::HLRecovery_CIELab (unsigned short* rin, unsigned short* gin, unsigned short* bin, unsigned short* rout, unsigned short* gout, unsigned short* bout, int width, int maxval, double cam[3][3], double icam[3][3]) { + + static bool crTableReady = false; + static double fv[0x10000]; + if (!crTableReady) { + for (int ix=0; ix < 0x10000; ix++) { + double rx = ix / 65535.0; + fv[ix] = rx > 0.008856 ? exp(1.0/3 * log(rx)) : 7.787*rx + 16/116.0; + } + crTableReady = true; + } + + for (int i=0; imaxval || g>maxval || b>maxval) { + int ro = MIN (r, maxval); + int go = MIN (g, maxval); + int bo = MIN (b, maxval); + double yy = cam[0][1]*r + cam[1][1]*g + cam[2][1]*b; + double fy = fv[CLIP((int)yy)]; + // compute LCH decompostion of the clipped pixel (only color information, thus C and H will be used) + double x = cam[0][0]*ro + cam[1][0]*go + cam[2][0]*bo; + double y = cam[0][1]*ro + cam[1][1]*go + cam[2][1]*bo; + double z = cam[0][2]*ro + cam[1][2]*go + cam[2][2]*bo; + x = fv[CLIP((int)x)]; + y = fv[CLIP((int)y)]; + z = fv[CLIP((int)z)]; + // convert back to rgb + double fz = fy - y + z; + double fx = fy + x - y; + double zr = (fz<=0.206893) ? ((116.0*fz-16.0)/903.3) : (fz * fz * fz); + double xr = (fx<=0.206893) ? ((116.0*fx-16.0)/903.3) : (fx * fx * fx); + x = xr*65535.0 - 0.5; + y = yy; + z = zr*65535.0 - 0.5; + int rr = icam[0][0]*x + icam[1][0]*y + icam[2][0]*z; + int gr = icam[0][1]*x + icam[1][1]*y + icam[2][1]*z; + int br = icam[0][2]*x + icam[1][2]*y + icam[2][2]*z; + rout[i] = CLIP(rr); + gout[i] = CLIP(gr); + bout[i] = CLIP(br); + } + else { + rout[i] = rin[i]; + gout[i] = gin[i]; + bout[i] = bin[i]; + } + } +} + +void RawImageSource::hlRecovery (std::string method, unsigned short* red, unsigned short* green, unsigned short* blue, int i, int sx1, int width, int skip) { + + if (method=="Luminance") + HLRecovery_Luminance (red, green, blue, red, green, blue, width, 65535 / ri->defgain); + else if (method=="CIELab blending") + HLRecovery_CIELab (red, green, blue, red, green, blue, width, 65535 / ri->defgain, cam, icam); + else if (method=="Color") + HLRecovery_ColorPropagation (red, green, blue, i, sx1, width, skip); +} + +int RawImageSource::getAEHistogram (unsigned int* histogram, int& histcompr) { + + histcompr = 3; + + memset (histogram, 0, (65536>>histcompr)*sizeof(int)); + + for (int i=border; iheight-border; i++) { + int start, end; + if (fuji) { + int fw = ri->fuji_width; + start = ABS(fw-i) + border; + end = MIN( ri->height+ ri->width-fw-i, fw+i) - border; + } + else { + start = border; + end = ri->width-border; + } + if (ri->filters) + for (int j=start; jdata[i][j]>>histcompr]+=2; + else + histogram[ri->data[i][j]>>histcompr]+=4; + else + for (int j=start; j<3*end; j++) { + histogram[ri->data[i][j+0]>>histcompr]++; + histogram[ri->data[i][j+1]>>histcompr]++; + histogram[ri->data[i][j+2]>>histcompr]++; + } + } + return 1; +} + +ColorTemp RawImageSource::getAutoWB () { + + double avg_r = 0; + double avg_g = 0; + double avg_b = 0; + int rn = 0, gn = 0, bn = 0; + + if (fuji) { + for (int i=32; iheight-32; i++) { + int fw = ri->fuji_width; + int start = ABS(fw-i) + 32; + int end = MIN(ri->height+ri->width-fw-i, fw+i) - 32; + for (int j=start; jfilters) { + double d = CLIP(ri->defgain*ri->data[i][3*j]); + if (d>64000) + continue; + avg_r += d*d*d*d*d*d; rn++; + d = CLIP(ri->defgain*ri->data[i][3*j+1]); + if (d>64000) + continue; + avg_g += d*d*d*d*d*d; gn++; + d = CLIP(ri->defgain*ri->data[i][3*j+2]); + if (d>64000) + continue; + avg_b += d*d*d*d*d*d; bn++; + } + else { + double d = CLIP(ri->defgain*ri->data[i][j]); + if (d>64000) + continue; + double dp = d*d*d*d*d*d; + if (ISRED(ri,i,j)) { + avg_r += dp; + rn++; + } + else if (ISGREEN(ri,i,j)) { + avg_g += dp; + gn++; + } + else if (ISBLUE(ri,i,j)) { + avg_b += dp; + bn++; + } + } + } + } + } + else { + for (int i=32; iheight-32; i++) + for (int j=32; jwidth-32; j++) { + if (!ri->filters) { + double d = CLIP(ri->defgain*ri->data[i][3*j]); + if (d>64000) + continue; + avg_r += d*d*d*d*d*d; rn++; + d = CLIP(ri->defgain*ri->data[i][3*j+1]); + if (d>64000) + continue; + avg_g += d*d*d*d*d*d; gn++; + d = CLIP(ri->defgain*ri->data[i][3*j+2]); + if (d>64000) + continue; + avg_b += d*d*d*d*d*d; bn++; + } + else { + double d = CLIP(ri->defgain*ri->data[i][j]); + if (d>64000) + continue; + double dp = d*d*d*d*d*d; + if (ISRED(ri,i,j)) { + avg_r += dp; + rn++; + } + else if (ISGREEN(ri,i,j)) { + avg_g += dp; + gn++; + } + else if (ISBLUE(ri,i,j)) { + avg_b += dp; + bn++; + } + } + } + } + + printf ("AVG: %g %g %g\n", avg_r/rn, avg_g/gn, avg_b/bn); + +// double img_r, img_g, img_b; +// wb.getMultipliers (img_r, img_g, img_b); + +// return ColorTemp (pow(avg_r/rn, 1.0/6.0)*img_r, pow(avg_g/gn, 1.0/6.0)*img_g, pow(avg_b/bn, 1.0/6.0)*img_b); + + double reds = pow (avg_r/rn, 1.0/6.0) * ri->camwb_red; + double greens = pow (avg_g/gn, 1.0/6.0) * ri->camwb_green; + double blues = pow (avg_b/bn, 1.0/6.0) * ri->camwb_blue; + + double rm = coeff[0][0]*reds + coeff[0][1]*greens + coeff[0][2]*blues; + double gm = coeff[1][0]*reds + coeff[1][1]*greens + coeff[1][2]*blues; + double bm = coeff[2][0]*reds + coeff[2][1]*greens + coeff[2][2]*blues; + + return ColorTemp (rm, gm, bm); +} + +void RawImageSource::transformPosition (int x, int y, int tran, int& ttx, int& tty) { + + tran = defTransform (tran); + + x += border; + y += border; + + if (d1x) { + if ((tran & TR_ROT) == TR_R90 || (tran & TR_ROT) == TR_R270) + x /= 2; + else + y /= 2; + } + + int w = W, h = H; + if (fuji) { + w = ri->fuji_width * 2 + 1; + h = (H - ri->fuji_width)*2 + 1; + } + int sw = w, sh = h; + if ((tran & TR_ROT) == TR_R90 || (tran & TR_ROT) == TR_R270) { + sw = h; + sh = w; + } + + int ppx = x, ppy = y; + if (tran & TR_HFLIP) + ppx = sw - 1 - x ; + if (tran & TR_VFLIP) + ppy = sh - 1 - y; + + int tx = ppx; + int ty = ppy; + + if ((tran & TR_ROT) == TR_R180) { + tx = w - 1 - ppx; + ty = h - 1 - ppy; + } + else if ((tran & TR_ROT) == TR_R90) { + tx = ppy; + ty = h - 1 - ppx; + } + else if ((tran & TR_ROT) == TR_R270) { + tx = w - 1 - ppy; + ty = ppx; + } + + if (fuji) { + ttx = (tx+ty) / 2; + tty = (ty-tx) / 2 + ri->fuji_width; + } + else { + ttx = tx; + tty = ty; + } +} + +ColorTemp RawImageSource::getSpotWB (std::vector red, std::vector green, std::vector& blue, int tran) { + + int x; int y; + int d[9][2] = {0,0, -1,-1, -1,0, -1,1, 0,-1, 0,1, 1,-1, 1,0, 1,1}; + double reds = 0, greens = 0, blues = 0; + int rn = 0, gn = 0, bn = 0; + + if (!ri->filters) { + for (int i=0; i=0 && y>=0 && xdata[y][3*x]; + rn++; + } + transformPosition (green[i].x, green[i].y, tran, x, y); + if (x>=0 && y>=0 && xdata[y][3*x+1]; + gn++; + } + transformPosition (blue[i].x, blue[i].y, tran, x, y); + if (x>=0 && y>=0 && xdata[y][3*x+2]; + bn++; + } + } + } + else { + for (int i=0; i=0 && yv>=0 && xvdata[yv][xv]; + rn++; + break; + } + } + transformPosition (green[i].x, green[i].y, tran, x, y); + for (int k=0; k<9; k++) { + int xv = x + d[k][0]; + int yv = y + d[k][1]; + if (ISGREEN(ri,yv,xv) && xv>=0 && yv>=0 && xvdata[yv][xv]; + gn++; + break; + } + } + transformPosition (blue[i].x, blue[i].y, tran, x, y); + for (int k=0; k<9; k++) { + int xv = x + d[k][0]; + int yv = y + d[k][1]; + if (ISBLUE(ri,yv,xv) && xv>=0 && yv>=0 && xvdata[yv][xv]; + bn++; + break; + } + } + } + } + + reds = reds/rn * ri->camwb_red; + greens = greens/gn * ri->camwb_green; + blues = blues/bn * ri->camwb_blue; + + double rm = coeff[0][0]*reds + coeff[0][1]*greens + coeff[0][2]*blues; + double gm = coeff[1][0]*reds + coeff[1][1]*greens + coeff[1][2]*blues; + double bm = coeff[2][0]*reds + coeff[2][1]*greens + coeff[2][2]*blues; + + return ColorTemp (rm, gm, bm); +} + +#define FORCC for (c=0; c < colors; c++) +#define fc(row,col) \ + (ri->prefilters >> ((((row) << 1 & 14) + ((col) & 1)) << 1) & 3) +typedef unsigned short ushort; +void RawImageSource::vng4_demosaic () { + + static const signed char *cp, terms[] = { + -2,-2,+0,-1,0,0x01, -2,-2,+0,+0,1,0x01, -2,-1,-1,+0,0,0x01, + -2,-1,+0,-1,0,0x02, -2,-1,+0,+0,0,0x03, -2,-1,+0,+1,1,0x01, + -2,+0,+0,-1,0,0x06, -2,+0,+0,+0,1,0x02, -2,+0,+0,+1,0,0x03, + -2,+1,-1,+0,0,0x04, -2,+1,+0,-1,1,0x04, -2,+1,+0,+0,0,0x06, + -2,+1,+0,+1,0,0x02, -2,+2,+0,+0,1,0x04, -2,+2,+0,+1,0,0x04, + -1,-2,-1,+0,0,0x80, -1,-2,+0,-1,0,0x01, -1,-2,+1,-1,0,0x01, + -1,-2,+1,+0,1,0x01, -1,-1,-1,+1,0,0x88, -1,-1,+1,-2,0,0x40, + -1,-1,+1,-1,0,0x22, -1,-1,+1,+0,0,0x33, -1,-1,+1,+1,1,0x11, + -1,+0,-1,+2,0,0x08, -1,+0,+0,-1,0,0x44, -1,+0,+0,+1,0,0x11, + -1,+0,+1,-2,1,0x40, -1,+0,+1,-1,0,0x66, -1,+0,+1,+0,1,0x22, + -1,+0,+1,+1,0,0x33, -1,+0,+1,+2,1,0x10, -1,+1,+1,-1,1,0x44, + -1,+1,+1,+0,0,0x66, -1,+1,+1,+1,0,0x22, -1,+1,+1,+2,0,0x10, + -1,+2,+0,+1,0,0x04, -1,+2,+1,+0,1,0x04, -1,+2,+1,+1,0,0x04, + +0,-2,+0,+0,1,0x80, +0,-1,+0,+1,1,0x88, +0,-1,+1,-2,0,0x40, + +0,-1,+1,+0,0,0x11, +0,-1,+2,-2,0,0x40, +0,-1,+2,-1,0,0x20, + +0,-1,+2,+0,0,0x30, +0,-1,+2,+1,1,0x10, +0,+0,+0,+2,1,0x08, + +0,+0,+2,-2,1,0x40, +0,+0,+2,-1,0,0x60, +0,+0,+2,+0,1,0x20, + +0,+0,+2,+1,0,0x30, +0,+0,+2,+2,1,0x10, +0,+1,+1,+0,0,0x44, + +0,+1,+1,+2,0,0x10, +0,+1,+2,-1,1,0x40, +0,+1,+2,+0,0,0x60, + +0,+1,+2,+1,0,0x20, +0,+1,+2,+2,0,0x10, +1,-2,+1,+0,0,0x80, + +1,-1,+1,+1,0,0x88, +1,+0,+1,+2,0,0x08, +1,+0,+2,-1,0,0x40, + +1,+0,+2,+1,0,0x10 + }, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 }; + + if (plistener) { + plistener->setProgressStr ("Demosaicing..."); + plistener->setProgress (0.0); + } + + ushort (*brow[5])[4], *pix; + int prow=7, pcol=1, *ip, *code[16][16], gval[8], gmin, gmax, sum[4]; + int row, col, x, y, x1, x2, y1, y2, t, weight, grads, color, diag; + int g, diff, thold, num, c, width=W, height=H, colors=4; + ushort (*image)[4]; + int lcode[16][16][32], shift, i, j; + + image = (ushort (*)[4]) calloc (H*W, sizeof *image); + for (int ii=0; iidata[ii][jj]; + +// first linear interpolation + for (row=0; row < 16; row++) + for (col=0; col < 16; col++) { + ip = lcode[row][col]; + memset (sum, 0, sizeof sum); + for (y=-1; y <= 1; y++) + for (x=-1; x <= 1; x++) { + shift = (y==0) + (x==0); + if (shift == 2) continue; + color = fc(row+y,col+x); + *ip++ = (width*y + x)*4 + color; + *ip++ = shift; + *ip++ = color; + sum[color] += 1 << shift; + } + FORCC + if (c != fc(row,col)) { + *ip++ = c; + *ip++ = 256 / sum[c]; + } + } + + for (row=1; row < height-1; row++) + for (col=1; col < width-1; col++) { + pix = image[row*width+col]; + ip = lcode[row & 15][col & 15]; + memset (sum, 0, sizeof sum); + for (i=8; i--; ip+=3) + sum[ip[2]] += pix[ip[0]] << ip[1]; + for (i=colors; --i; ip+=2) + pix[ip[0]] = sum[ip[0]] * ip[1] >> 8; + } + +// lin_interpolate(); + + + ip = (int *) calloc ((prow+1)*(pcol+1), 1280); + for (row=0; row <= prow; row++) /* Precalculate for VNG */ + for (col=0; col <= pcol; col++) { + code[row][col] = ip; + for (cp=terms, t=0; t < 64; t++) { + y1 = *cp++; x1 = *cp++; + y2 = *cp++; x2 = *cp++; + weight = *cp++; + grads = *cp++; + color = fc(row+y1,col+x1); + if (fc(row+y2,col+x2) != color) continue; + diag = (fc(row,col+1) == color && fc(row+1,col) == color) ? 2:1; + if (abs(y1-y2) == diag && abs(x1-x2) == diag) continue; + *ip++ = (y1*width + x1)*4 + color; + *ip++ = (y2*width + x2)*4 + color; + *ip++ = weight; + for (g=0; g < 8; g++) + if (grads & 1< gval[g]) gmin = gval[g]; + if (gmax < gval[g]) gmax = gval[g]; + } + if (gmax == 0) { + memcpy (brow[2][col], pix, sizeof *image); + continue; + } + thold = gmin + (gmax >> 1); + memset (sum, 0, sizeof sum); + for (num=g=0; g < 8; g++,ip+=2) { /* Average the neighbors */ + if (gval[g] <= thold) { + FORCC + if (c == color && ip[1]) + sum[c] += (pix[c] + pix[ip[1]]) >> 1; + else + sum[c] += pix[ip[0] + c]; + num++; + } + } + FORCC { /* Save to buffer */ + t = pix[color]; + if (c != color) + t += (sum[c] - sum[color]) / num; + brow[2][col][c] = CLIP(t); + } + } + if (row > 3) /* Write buffer to image */ + memcpy (image[(row-2)*width+2], brow[0]+2, (width-4)*sizeof *image); + for (g=0; g < 4; g++) + brow[(g-1) & 3] = brow[g]; + if (!(row%20) && plistener) + plistener->setProgress ((double)row / (H-2)); + } + memcpy (image[(row-2)*width+2], brow[0]+2, (width-4)*sizeof *image); + memcpy (image[(row-1)*width+2], brow[1]+2, (width-4)*sizeof *image); + free (brow[4]); + free (code[0][0]); + + green = new unsigned short*[H]; + for (int i=0; i> 1; + } + free (image); +} + +//#define ABS(x) (((int)(x) ^ ((int)(x) >> 31)) - ((int)(x) >> 31)) +//#define MIN(a,b) ((a) < (b) ? (a) : (b)) +//#define MAX(a,b) ((a) > (b) ? (a) : (b)) +//#define LIM(x,min,max) MAX(min,MIN(x,max)) +//#define CLIP(x) LIM(x,0,65535) +#undef fc +#define fc(row,col) \ + (ri->filters >> ((((row) << 1 & 14) + ((col) & 1)) << 1) & 3) +#define FC(x,y) fc(x,y) +#define LIM(x,min,max) MAX(min,MIN(x,max)) +#define ULIM(x,y,z) ((y) < (z) ? LIM(x,y,z) : LIM(x,z,y)) + +/* + Patterned Pixel Grouping Interpolation by Alain Desbiolles +*/ +void RawImageSource::ppg_demosaic() +{ + int width=W, height=H; + int dir[5] = { 1, width, -1, -width, 1 }; + int row, col, diff[2], guess[2], c, d, i; + ushort (*pix)[4]; + + ushort (*image)[4]; + int colors = 3; + + if (plistener) { + plistener->setProgressStr ("Demosaicing..."); + plistener->setProgress (0.0); + } + + image = (ushort (*)[4]) calloc (H*W, sizeof *image); + for (int ii=0; iidata[ii][jj]; + + border_interpolate(3, image); + +/* Fill in the green layer with gradients and pattern recognition: */ + for (row=3; row < height-3; row++) { + for (col=3+(FC(row,3) & 1), c=FC(row,col); col < width-3; col+=2) { + pix = image + row*width+col; + for (i=0; (d=dir[i]) > 0; i++) { + guess[i] = (pix[-d][1] + pix[0][c] + pix[d][1]) * 2 + - pix[-2*d][c] - pix[2*d][c]; + diff[i] = ( ABS(pix[-2*d][c] - pix[ 0][c]) + + ABS(pix[ 2*d][c] - pix[ 0][c]) + + ABS(pix[ -d][1] - pix[ d][1]) ) * 3 + + ( ABS(pix[ 3*d][1] - pix[ d][1]) + + ABS(pix[-3*d][1] - pix[-d][1]) ) * 2; + } + d = dir[i = diff[0] > diff[1]]; + pix[0][1] = ULIM(guess[i] >> 2, pix[d][1], pix[-d][1]); + } + if(plistener) plistener->setProgress(0.33*row/(height-3)); + } +/* Calculate red and blue for each green pixel: */ + for (row=1; row < height-1; row++) { + for (col=1+(FC(row,2) & 1), c=FC(row,col+1); col < width-1; col+=2) { + pix = image + row*width+col; + for (i=0; (d=dir[i]) > 0; c=2-c, i++) + pix[0][c] = CLIP((pix[-d][c] + pix[d][c] + 2*pix[0][1] + - pix[-d][1] - pix[d][1]) >> 1); + } + if(plistener) plistener->setProgress(0.33 + 0.33*row/(height-1)); + } +/* Calculate blue for red pixels and vice versa: */ + for (row=1; row < height-1; row++) { + for (col=1+(FC(row,1) & 1), c=2-FC(row,col); col < width-1; col+=2) { + pix = image + row*width+col; + for (i=0; (d=dir[i]+dir[i+1]) > 0; i++) { + diff[i] = ABS(pix[-d][c] - pix[d][c]) + + ABS(pix[-d][1] - pix[0][1]) + + ABS(pix[ d][1] - pix[0][1]); + guess[i] = pix[-d][c] + pix[d][c] + 2*pix[0][1] + - pix[-d][1] - pix[d][1]; + } + if (diff[0] != diff[1]) + pix[0][c] = CLIP(guess[diff[0] > diff[1]] >> 1); + else + pix[0][c] = CLIP((guess[0]+guess[1]) >> 2); + } + if(plistener) plistener->setProgress(0.67 + 0.33*row/(height-1)); + } + + red = new unsigned short*[H]; + for (int i=0; i= border && row < height-border) + col = width-border; + memset (sum, 0, sizeof sum); + for (y=row-1; y != row+2; y++) + for (x=col-1; x != col+2; x++) + if (y < height && x < width) { + f = fc(y,x); + sum[f] += image[y*width+x][f]; + sum[f+4]++; + } + f = fc(row,col); + FORCC if (c != f && sum[c+4]) + image[row*width+col][c] = sum[c] / sum[c+4]; + } +} + +/* + Adaptive Homogeneity-Directed interpolation is based on + the work of Keigo Hirakawa, Thomas Parks, and Paul Lee. + */ +#define TS 256 /* Tile Size */ +#define FORC(cnt) for (c=0; c < cnt; c++) +#define FORC3 FORC(3) +#define SQR(x) ((x)*(x)) + +void RawImageSource::ahd_demosaic() +{ + int i, j, k, top, left, row, col, tr, tc, c, d, val, hm[2]; + ushort (*pix)[4], (*rix)[3]; + static const int dir[4] = { -1, 1, -TS, TS }; + unsigned ldiff[2][4], abdiff[2][4], leps, abeps; + float r, cbrt[0x10000], xyz[3], xyz_cam[3][4]; + ushort (*rgb)[TS][TS][3]; + short (*lab)[TS][TS][3], (*lix)[3]; + char (*homo)[TS][TS], *buffer; + + int width=W, height=H; + ushort (*image)[4]; + int colors = 3; + + const double xyz_rgb[3][3] = { /* XYZ from RGB */ + { 0.412453, 0.357580, 0.180423 }, + { 0.212671, 0.715160, 0.072169 }, + { 0.019334, 0.119193, 0.950227 } }; + const float d65_white[3] = { 0.950456, 1, 1.088754 }; + + if (plistener) { + plistener->setProgressStr ("Demosaicing..."); + plistener->setProgress (0.0); + } + + image = (ushort (*)[4]) calloc (H*W, sizeof *image); + for (int ii=0; iidata[ii][jj]; + + for (i=0; i < 0x10000; i++) { + r = i / 65535.0; + cbrt[i] = r > 0.008856 ? pow(r,1/3.0) : 7.787*r + 16/116.0; + } + for (i=0; i < 3; i++) + for (j=0; j < colors; j++) + for (xyz_cam[i][j] = k=0; k < 3; k++) + xyz_cam[i][j] += xyz_rgb[i][k] * coeff[k][j] / d65_white[i]; + + border_interpolate(5, image); + buffer = (char *) malloc (26*TS*TS); /* 1664 kB */ + //merror (buffer, "ahd_interpolate()"); + rgb = (ushort(*)[TS][TS][3]) buffer; + lab = (short (*)[TS][TS][3])(buffer + 12*TS*TS); + homo = (char (*)[TS][TS]) (buffer + 24*TS*TS); + + for (top=2; top < height-5; top += TS-6) + for (left=2; left < width-5; left += TS-6) { + +/* Interpolate green horizontally and vertically: */ + for (row = top; row < top+TS && row < height-2; row++) { + col = left + (FC(row,left) & 1); + for (c = FC(row,col); col < left+TS && col < width-2; col+=2) { + pix = image + row*width+col; + val = ((pix[-1][1] + pix[0][c] + pix[1][1]) * 2 + - pix[-2][c] - pix[2][c]) >> 2; + rgb[0][row-top][col-left][1] = ULIM(val,pix[-1][1],pix[1][1]); + val = ((pix[-width][1] + pix[0][c] + pix[width][1]) * 2 + - pix[-2*width][c] - pix[2*width][c]) >> 2; + rgb[1][row-top][col-left][1] = ULIM(val,pix[-width][1],pix[width][1]); + } + } + + if(plistener) plistener->setProgress (0.33); +/* Interpolate red and blue, and convert to CIELab: */ + for (d=0; d < 2; d++) + for (row=top+1; row < top+TS-1 && row < height-3; row++) + for (col=left+1; col < left+TS-1 && col < width-3; col++) { + pix = image + row*width+col; + rix = &rgb[d][row-top][col-left]; + lix = &lab[d][row-top][col-left]; + if ((c = 2 - FC(row,col)) == 1) { + c = FC(row+1,col); + val = pix[0][1] + (( pix[-1][2-c] + pix[1][2-c] + - rix[-1][1] - rix[1][1] ) >> 1); + rix[0][2-c] = CLIP(val); + val = pix[0][1] + (( pix[-width][c] + pix[width][c] + - rix[-TS][1] - rix[TS][1] ) >> 1); + } else + val = rix[0][1] + (( pix[-width-1][c] + pix[-width+1][c] + + pix[+width-1][c] + pix[+width+1][c] + - rix[-TS-1][1] - rix[-TS+1][1] + - rix[+TS-1][1] - rix[+TS+1][1] + 1) >> 2); + rix[0][c] = CLIP(val); + c = FC(row,col); + rix[0][c] = pix[0][c]; + xyz[0] = xyz[1] = xyz[2] = 0.5; + FORCC { + xyz[0] += xyz_cam[0][c] * rix[0][c]; + xyz[1] += xyz_cam[1][c] * rix[0][c]; + xyz[2] += xyz_cam[2][c] * rix[0][c]; + } + xyz[0] = cbrt[CLIP((int) xyz[0])]; + xyz[1] = cbrt[CLIP((int) xyz[1])]; + xyz[2] = cbrt[CLIP((int) xyz[2])]; + lix[0][0] = 64 * (116 * xyz[1] - 16); + lix[0][1] = 64 * 500 * (xyz[0] - xyz[1]); + lix[0][2] = 64 * 200 * (xyz[1] - xyz[2]); + } + + if(plistener) plistener->setProgress (0.5); +/* Build homogeneity maps from the CIELab images: */ + memset (homo, 0, 2*TS*TS); + for (row=top+2; row < top+TS-2 && row < height-4; row++) { + tr = row-top; + for (col=left+2; col < left+TS-2 && col < width-4; col++) { + tc = col-left; + for (d=0; d < 2; d++) { + lix = &lab[d][tr][tc]; + for (i=0; i < 4; i++) { + ldiff[d][i] = ABS(lix[0][0]-lix[dir[i]][0]); + abdiff[d][i] = SQR(lix[0][1]-lix[dir[i]][1]) + + SQR(lix[0][2]-lix[dir[i]][2]); + } + } + leps = MIN(MAX(ldiff[0][0],ldiff[0][1]), + MAX(ldiff[1][2],ldiff[1][3])); + abeps = MIN(MAX(abdiff[0][0],abdiff[0][1]), + MAX(abdiff[1][2],abdiff[1][3])); + for (d=0; d < 2; d++) + for (i=0; i < 4; i++) + if (ldiff[d][i] <= leps && abdiff[d][i] <= abeps) + homo[d][tr][tc]++; + } + } + if(plistener) plistener->setProgress (0.8); +/* Combine the most homogenous pixels for the final result: */ + for (row=top+3; row < top+TS-3 && row < height-5; row++) { + tr = row-top; + for (col=left+3; col < left+TS-3 && col < width-5; col++) { + tc = col-left; + for (d=0; d < 2; d++) + for (hm[d]=0, i=tr-1; i <= tr+1; i++) + for (j=tc-1; j <= tc+1; j++) + hm[d] += homo[d][i][j]; + if (hm[0] != hm[1]) + FORC3 image[row*width+col][c] = rgb[hm[1] > hm[0]][tr][tc][c]; + else + FORC3 image[row*width+col][c] = + (rgb[0][tr][tc][c] + rgb[1][tr][tc][c]) >> 1; + } + } + } + if(plistener) plistener->setProgress (1.0); + free (buffer); + red = new unsigned short*[H]; + for (int i=0; i ( image[indx-1][1] + image[indx+1][1] + image[indx-u][1] + image[indx+u][1])/4.0) + image[indx][3] = ((MIN( image[indx-1][1], image[indx+1][1]) + image[indx-1][1] + image[indx+1][1] ) < (MIN( image[indx-u][1], image[indx+u][1]) + image[indx-u][1] + image[indx+u][1])); + else + image[indx][3] = ((MAX( image[indx-1][1], image[indx+1][1]) + image[indx-1][1] + image[indx+1][1] ) > (MAX( image[indx-u][1], image[indx+u][1]) + image[indx-u][1] + image[indx+u][1])) ; + } + } +} + + + + + +// interpolated green pixels are corrected using the map +void RawImageSource::dcb_correction(ushort (*image)[4]) +{ + int width=W, height=H; + int current, row, col, c, u=width, v=2*u, indx; + + for (row=4; row < height-4; row++) { + for (col=4, indx=row*width+col; col < width-4; col++, indx++) { + + c = FC(row,col); + + if (c != 1) + { + current = 4*image[indx][3] + + 2*(image[indx+u][3] + image[indx-u][3] + image[indx+1][3] + image[indx-1][3]) + + image[indx+v][3] + image[indx-v][3] + image[indx+2][3] + image[indx-2][3]; + + image[indx][1] = ((16-current)*(image[indx-1][1] + image[indx+1][1])/2.0 + current*(image[indx-u][1] + image[indx+u][1])/2.0)/16.0; + } + + } + } + +} + +// R and B smoothing using green contrast, all pixels except 2 pixel wide border +void RawImageSource::dcb_pp(ushort (*image)[4]) +{ + int width=W, height=H; + int g1, r1, b1, u=width, indx, row, col; + + + for (row=2; row < height-2; row++) + for (col=2, indx=row*u+col; col < width-2; col++, indx++) { + + r1 = ( image[indx-1][0] + image[indx+1][0] + image[indx-u][0] + image[indx+u][0] + image[indx-u-1][0] + image[indx+u+1][0] + image[indx-u+1][0] + image[indx+u-1][0])/8.0; + g1 = ( image[indx-1][1] + image[indx+1][1] + image[indx-u][1] + image[indx+u][1] + image[indx-u-1][1] + image[indx+u+1][1] + image[indx-u+1][1] + image[indx+u-1][1])/8.0; + b1 = ( image[indx-1][2] + image[indx+1][2] + image[indx-u][2] + image[indx+u][2] + image[indx-u-1][2] + image[indx+u+1][2] + image[indx-u+1][2] + image[indx+u-1][2])/8.0; + + image[indx][0] = CLIP(r1 + ( image[indx][1] - g1 )); + image[indx][2] = CLIP(b1 + ( image[indx][1] - g1 )); + + } +} + +// interpolated green pixels are corrected using the map +// with correction +void RawImageSource::dcb_correction2(ushort (*image)[4]) +{ + int width=W, height=H; + int current, row, col, c, u=width, v=2*u, indx; + ushort (*pix)[4]; + + for (row=4; row < height-4; row++) { + for (col=4, indx=row*width+col; col < width-4; col++, indx++) { + + c = FC(row,col); + + if (c != 1) + { + current = 4*image[indx][3] + + 2*(image[indx+u][3] + image[indx-u][3] + image[indx+1][3] + image[indx-1][3]) + + image[indx+v][3] + image[indx-v][3] + image[indx+2][3] + image[indx-2][3]; + + image[indx][1] = CLIP(((16-current)*((image[indx-1][1] + image[indx+1][1])/2.0 + image[indx][c] - (image[indx+2][c] + image[indx-2][c])/2.0) + current*((image[indx-u][1] + image[indx+u][1])/2.0 + image[indx][c] - (image[indx+v][c] + image[indx-v][c])/2.0))/16.0); + } + + } + } + +} + +// restores red and blue +void RawImageSource::restore_from_buffer(ushort (*image)[4], float (*image2)[3]) +{ + int width=W, height=H; + int indx; + + for (indx=0; indx < height*width; indx++) { + image[indx][0]=image2[indx][0]; //R + image[indx][2]=image2[indx][2]; //B + } +} + +// image refinement +void RawImageSource::dcb_refinement(ushort (*image)[4]) +{ + int width=W, height=H; + int row, col, c, u=width, v=2*u, w=3*u, x=4*u, y=5*u, indx, max, min; + float f[4], g[4]; + + for (row=5; row < height-5; row++) + for (col=5+(FC(row,1)&1),indx=row*width+col,c=FC(row,col); col < u-5; col+=2,indx+=2) { + +// Cubic Spline Interpolation by Li and Randhawa, modified by Jacek Gozdz and Luis Sanz Rodríguez + f[0]=1.0/(1.0+abs(image[indx-u][c]-image[indx][c])+abs(image[indx-u][1]-image[indx][1])); + f[1]=1.0/(1.0+abs(image[indx+1][c]-image[indx][c])+abs(image[indx+1][1]-image[indx][1])); + f[2]=1.0/(1.0+abs(image[indx-1][c]-image[indx][c])+abs(image[indx-1][1]-image[indx][1])); + f[3]=1.0/(1.0+abs(image[indx+u][c]-image[indx][c])+abs(image[indx+u][1]-image[indx][1])); + +g[0]=CLIP(image[indx-u][1]+0.5*(image[indx][c]-image[indx-u][c]) + 0.25*(image[indx][c]-image[indx-v][c])); +g[1]=CLIP(image[indx+1][1]+0.5*(image[indx][c]-image[indx+1][c]) + 0.25*(image[indx][c]-image[indx+2][c])); +g[2]=CLIP(image[indx-1][1]+0.5*(image[indx][c]-image[indx-1][c]) + 0.25*(image[indx][c]-image[indx-2][c])); +g[3]=CLIP(image[indx+u][1]+0.5*(image[indx][c]-image[indx+u][c]) + 0.25*(image[indx][c]-image[indx+v][c])); + + + + image[indx][1]=CLIP(((f[0]*g[0]+f[1]*g[1]+f[2]*g[2]+f[3]*g[3])/(f[0]+f[1]+f[2]+f[3]) )); + +// get rid of the overshooted pixels + min = MIN(image[indx+1+u][1], MIN(image[indx+1-u][1], MIN(image[indx-1+u][1], MIN(image[indx-1-u][1], MIN(image[indx-1][1], MIN(image[indx+1][1], MIN(image[indx-u][1], image[indx+u][1]))))))); + + max = MAX(image[indx+1+u][1], MAX(image[indx+1-u][1], MAX(image[indx-1+u][1], MAX(image[indx-1-u][1], MAX(image[indx-1][1], MAX(image[indx+1][1], MAX(image[indx-u][1], image[indx+u][1]))))))); + + image[indx][1] = ULIM(image[indx][1], max, min); + + + } +} + +// missing colors are interpolated using high quality algorithm by Luis Sanz Rodríguez +void RawImageSource::dcb_color_full(ushort (*image)[4]) +{ + int width=W, height=H; + int row,col,c,d,i,j,u=width,v=2*u,w=3*u,indx; + float f[4],g[4],(*chroma)[2]; + + chroma = (float (*)[2]) calloc(width*height,sizeof *chroma); + //merror (chroma, "dcb_color_full()"); + + for (row=1; row < height-1; row++) + for (col=1+(FC(row,1)&1),indx=row*width+col,c=FC(row,col),d=c/2; col < u-1; col+=2,indx+=2) + chroma[indx][d]=image[indx][c]-image[indx][1]; + + for (row=3; rowsetProgressStr ("Demosaicing..."); + plistener->setProgress (0.0); + } + + image = (ushort (*)[4]) calloc (H*W, sizeof *image); + for (int ii=0; iidata[ii][jj]; + + border_interpolate(2, image); + copy_to_buffer(image2, image); + + hid(image); + dcb_color(image); + + while (i<=iterations) { + //if (verbose) fprintf (stderr,_("DCB correction pass %d...\n"), i); + hid2(image); + hid2(image); + hid2(image); + dcb_map(image); + dcb_correction(image); + if(plistener) plistener->setProgress (0.33*i/iterations); + i++; + } + if(plistener) plistener->setProgress (0.33); + + dcb_color(image); + dcb_pp(image); + hid2(image); + hid2(image); + hid2(image); + + //if (verbose) fprintf (stderr,_("finishing DCB...\n")); + if(plistener) plistener->setProgress (0.5); + + dcb_map(image); + dcb_correction2(image); + + restore_from_buffer(image, image2); + + dcb_map(image); + dcb_correction(image); + + dcb_color(image); + dcb_pp(image); + dcb_map(image); + dcb_correction(image); + + dcb_map(image); + dcb_correction(image); + + restore_from_buffer(image, image2); + dcb_color(image); + + if(plistener) plistener->setProgress (0.7); + if (dcb_enhance) { + //if (verbose) fprintf (stderr,_("optional DCB refinement...\n")); + dcb_refinement(image); + dcb_color_full(image); + } + + if(plistener) plistener->setProgress (1.0); + + free(image2); + + red = new unsigned short*[H]; + for (int i=0; i - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _RAWMETADATALOCATION_ #define _RAWMETADATALOCATION_ diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 2e561aa7f..340c485d3 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1,106 +1,106 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include int refreshmap[] = { -ALL, // EvPhotoLoaded, -ALL, // EvProfileLoaded, -ALL, // EvProfileChanged, -ALL, // EvHistoryBrowsed, -RGBCURVE, // EvBrightness, -RGBCURVE, // EvContrast, -RGBCURVE, // EvBlack, -RGBCURVE, // EvExpComp, -RGBCURVE, // EvHLCompr, -RGBCURVE, // EvSHCompr, -RGBCURVE, // EvToneCurve, -AUTOEXP, // EvAutoExp, -AUTOEXP, // EvClip, -LUMINANCECURVE, // EvLBrightness, -LUMINANCECURVE, // EvLContrast, -LUMINANCECURVE, // EvLBlack, -LUMINANCECURVE, // EvLHLCompr, -LUMINANCECURVE, // EvLSHCompr, -LUMINANCECURVE, // EvLCurve, -SHARPENING, // EvShrEnabled, -SHARPENING, // EvShrRadius, -SHARPENING, // EvShrAmount, -SHARPENING, // EvShrThresh, -SHARPENING, // EvShrEdgeOnly, -SHARPENING, // EvShrEdgeRadius, -SHARPENING, // EvShrEdgeTolerance, -SHARPENING, // EvShrHaloControl, -SHARPENING, // EvShrHaloAmount, -SHARPENING, // EvShrMethod, -SHARPENING, // EvShrDRadius, -SHARPENING, // EvShrDAmount, -SHARPENING, // EvShrDDamping, -SHARPENING, // EvShrDIterations, -COLORBOOST, // EvCBAvoidClip, -COLORBOOST, // EvCBSatLimiter, -COLORBOOST, // EvCBSatLimit, -COLORBOOST, // EvCBBoost, -WHITEBALANCE, // EvWBMethod, -WHITEBALANCE, // EvWBTemp, -WHITEBALANCE, // EvWBGreen, -COLORBOOST, // EvCShiftA, -COLORBOOST, // EvCShiftB, -LUMADENOISE, // EvLDNEnabled, -LUMADENOISE, // EvLDNRadius, -LUMADENOISE, // EvLDNEdgeTolerance, -COLORDENOISE, // EvCDNEnabled, -COLORDENOISE, // EvCDNRadius, -COLORDENOISE, // EvCDNEdgeTolerance, -COLORDENOISE, // EvCDNEdgeSensitive, -RETINEX, // EvSHEnabled, -RGBCURVE, // EvSHHighlights, -RGBCURVE, // EvSHShadows, -RGBCURVE, // EvSHHLTonalW, -RGBCURVE, // EvSHSHTonalW, -RGBCURVE, // EvSHLContrast, -RETINEX, // EvSHRadius, -ALL, // EvCTRotate, -ALL, // EvCTHFlip, -ALL, // EvCTVFlip, -TRANSFORM, // EvROTDegree, -TRANSFORM, // EvROTFill, -TRANSFORM, // EvDISTAmount, -ALL, // EvBookmarkSelected, -CROP, // EvCrop, -TRANSFORM, // EvCACorr, -ALL, // EvHREnabled, -ALL, // EvHRAmount, -ALL, // EvHRMethod, -ALL, // EvWProfile, -ALL, // EvOProfile, -ALL, // EvIProfile, -TRANSFORM, // EvVignetting, -RGBCURVE, // EvChMixer, -ALL, // EvResizeScale, -ALL, // EvResizeMethod, -EXIF, // EvExif, -IPTC, // EvIPTC -ALL, // EvResizeSpec, -ALL, // EvResizeWidth -ALL, // EvResizeHeight -ALL, // EvResizeEnabled -ALL, // EvProfileChangeNotification +ALL, // EvPhotoLoaded, +ALL, // EvProfileLoaded, +ALL, // EvProfileChanged, +ALL, // EvHistoryBrowsed, +RGBCURVE, // EvBrightness, +RGBCURVE, // EvContrast, +RGBCURVE, // EvBlack, +RGBCURVE, // EvExpComp, +RGBCURVE, // EvHLCompr, +RGBCURVE, // EvSHCompr, +RGBCURVE, // EvToneCurve, +AUTOEXP, // EvAutoExp, +AUTOEXP, // EvClip, +LUMINANCECURVE, // EvLBrightness, +LUMINANCECURVE, // EvLContrast, +LUMINANCECURVE, // EvLBlack, +LUMINANCECURVE, // EvLHLCompr, +LUMINANCECURVE, // EvLSHCompr, +LUMINANCECURVE, // EvLCurve, +SHARPENING, // EvShrEnabled, +SHARPENING, // EvShrRadius, +SHARPENING, // EvShrAmount, +SHARPENING, // EvShrThresh, +SHARPENING, // EvShrEdgeOnly, +SHARPENING, // EvShrEdgeRadius, +SHARPENING, // EvShrEdgeTolerance, +SHARPENING, // EvShrHaloControl, +SHARPENING, // EvShrHaloAmount, +SHARPENING, // EvShrMethod, +SHARPENING, // EvShrDRadius, +SHARPENING, // EvShrDAmount, +SHARPENING, // EvShrDDamping, +SHARPENING, // EvShrDIterations, +COLORBOOST, // EvCBAvoidClip, +COLORBOOST, // EvCBSatLimiter, +COLORBOOST, // EvCBSatLimit, +COLORBOOST, // EvCBBoost, +WHITEBALANCE, // EvWBMethod, +WHITEBALANCE, // EvWBTemp, +WHITEBALANCE, // EvWBGreen, +COLORBOOST, // EvCShiftA, +COLORBOOST, // EvCShiftB, +LUMADENOISE, // EvLDNEnabled, +LUMADENOISE, // EvLDNRadius, +LUMADENOISE, // EvLDNEdgeTolerance, +COLORDENOISE, // EvCDNEnabled, +COLORDENOISE, // EvCDNRadius, +COLORDENOISE, // EvCDNEdgeTolerance, +COLORDENOISE, // EvCDNEdgeSensitive, +RETINEX, // EvSHEnabled, +RGBCURVE, // EvSHHighlights, +RGBCURVE, // EvSHShadows, +RGBCURVE, // EvSHHLTonalW, +RGBCURVE, // EvSHSHTonalW, +RGBCURVE, // EvSHLContrast, +RETINEX, // EvSHRadius, +ALL, // EvCTRotate, +ALL, // EvCTHFlip, +ALL, // EvCTVFlip, +TRANSFORM, // EvROTDegree, +TRANSFORM, // EvROTFill, +TRANSFORM, // EvDISTAmount, +ALL, // EvBookmarkSelected, +CROP, // EvCrop, +TRANSFORM, // EvCACorr, +ALL, // EvHREnabled, +ALL, // EvHRAmount, +ALL, // EvHRMethod, +ALL, // EvWProfile, +ALL, // EvOProfile, +ALL, // EvIProfile, +TRANSFORM, // EvVignetting, +RGBCURVE, // EvChMixer, +ALL, // EvResizeScale, +ALL, // EvResizeMethod, +EXIF, // EvExif, +IPTC, // EvIPTC +ALL, // EvResizeSpec, +ALL, // EvResizeWidth +ALL, // EvResizeHeight +ALL, // EvResizeEnabled +ALL, // EvProfileChangeNotification RETINEX // EvShrHighQuality - }; + }; diff --git a/rtengine/refreshmap.h b/rtengine/refreshmap.h index b7daf7be0..4141072ee 100644 --- a/rtengine/refreshmap.h +++ b/rtengine/refreshmap.h @@ -1,53 +1,53 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef __REFRESHMAP__ -#define __REFRESHMAP__ - -#include - -#define NUMOFEVENTS 83 +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef __REFRESHMAP__ +#define __REFRESHMAP__ -#define FIRST 65535 -#define ALL 65535 -#define TRANSFORM 127 -#define RETINEX 63 -#define AUTOEXP 31 -#define RGBCURVE 15 -#define LUMINANCECURVE 6 -#define SHARPENING 2 -#define LUMADENOISE 2 -#define WHITEBALANCE 255 -#define COLORBOOST 1 -#define COLORDENOISE 1 -#define CROP 16384 -#define EXIF 32768 -#define IPTC 32768 -#define NONE 0 - -#define M_INIT 128 -#define M_TRANSFORM 64 -#define M_BLURMAP 32 -#define M_AUTOEXP 16 -#define M_RGBCURVE 8 -#define M_LUMACURVE 4 -#define M_LUMINANCE 2 -#define M_COLOR 1 +#include -extern int refreshmap[]; -#endif +#define NUMOFEVENTS 83 + +#define FIRST 65535 +#define ALL 65535 +#define TRANSFORM 127 +#define RETINEX 63 +#define AUTOEXP 31 +#define RGBCURVE 15 +#define LUMINANCECURVE 6 +#define SHARPENING 2 +#define LUMADENOISE 2 +#define WHITEBALANCE 255 +#define COLORBOOST 1 +#define COLORDENOISE 1 +#define CROP 16384 +#define EXIF 32768 +#define IPTC 32768 +#define NONE 0 + +#define M_INIT 128 +#define M_TRANSFORM 64 +#define M_BLURMAP 32 +#define M_AUTOEXP 16 +#define M_RGBCURVE 8 +#define M_LUMACURVE 4 +#define M_LUMINANCE 2 +#define M_COLOR 1 + +extern int refreshmap[]; +#endif diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index afd56c85f..71ff9a3a1 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _RTENGINE_ #define _RTENGINE_ diff --git a/rtengine/rtetest.cc b/rtengine/rtetest.cc index 5ee8409db..ca8e28a49 100644 --- a/rtengine/rtetest.cc +++ b/rtengine/rtetest.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include //#include diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index ed47494ee..f11daa40f 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -300,7 +300,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei buffer[i] = new unsigned short[fw]; } shmap = new SHMap (fw, fh); - double radius = sqrt (double(fw*fw+fh*fh)) / 2.0; + double radius = sqrt (double(fw*fw+fh*fh)) / 2.0; double shradius = radius / 1800.0 * params.sh.radius; shmap->update (baseImg, buffer, shradius, ipf.lumimul, params.sh.hq); if (buffer) { diff --git a/rtengine/rtthumbnail.h b/rtengine/rtthumbnail.h index f45e4c691..f9b1c9914 100644 --- a/rtengine/rtthumbnail.h +++ b/rtengine/rtthumbnail.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _THUMBPROCESSINGPARAMETERS_ #define _THUMBPROCESSINGPARAMETERS_ diff --git a/rtengine/shmap.cc b/rtengine/shmap.cc index f0e4579d4..b9531ac98 100644 --- a/rtengine/shmap.cc +++ b/rtengine/shmap.cc @@ -1,97 +1,97 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include #include - -#undef THREAD_PRIORITY_NORMAL -#define MAXVAL 0xffff -#define CLIP(a) ((a)>0?((a)0?((a)r[i][j] + lumi[1]*img->g[i][j] + lumi[2]*img->b[i][j]; - map[i][j] = CLIP(val); - } + +extern const Settings* settings; + +SHMap::SHMap (int w, int h) : W(w), H(h) { + + map = new unsigned short*[H]; + for (int i=0; ir[i][j] + lumi[1]*img->g[i][j] + lumi[2]*img->b[i][j]; + map[i][j] = CLIP(val); + } //MyTime t1,t2; //t1.set (); - if (!hq) { - - AlignedBuffer* buffer1 = new AlignedBuffer (MAX(W,H)*5); - AlignedBuffer* buffer2 = new AlignedBuffer (MAX(W,H)*5); - - // blur - if (settings->dualThreadEnabled) { - Glib::Thread *thread1 = Glib::Thread::create(sigc::bind(sigc::ptr_fun(gaussHorizontal_unsigned), map, map, buffer1, W, 0, H/2, radius), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); - Glib::Thread *thread2 = Glib::Thread::create(sigc::bind(sigc::ptr_fun(gaussHorizontal_unsigned), map, map, buffer2, W, H/2, H, radius), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); - thread1->join (); - thread2->join (); - thread1 = Glib::Thread::create(sigc::bind(sigc::ptr_fun(gaussVertical_unsigned), map, map, buffer1, H, 0, W/2, radius), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); - thread2 = Glib::Thread::create(sigc::bind(sigc::ptr_fun(gaussVertical_unsigned), map, map, buffer2, H, W/2, W, radius), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); - thread1->join (); - thread2->join (); - } - else { - gaussHorizontal_unsigned (map, map, buffer1, W, 0, H, radius); - gaussVertical_unsigned (map, map, buffer1, H, 0, W, radius); - } - - delete buffer1; - delete buffer2; - } + if (!hq) { + + AlignedBuffer* buffer1 = new AlignedBuffer (MAX(W,H)*5); + AlignedBuffer* buffer2 = new AlignedBuffer (MAX(W,H)*5); + + // blur + if (settings->dualThreadEnabled) { + Glib::Thread *thread1 = Glib::Thread::create(sigc::bind(sigc::ptr_fun(gaussHorizontal_unsigned), map, map, buffer1, W, 0, H/2, radius), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); + Glib::Thread *thread2 = Glib::Thread::create(sigc::bind(sigc::ptr_fun(gaussHorizontal_unsigned), map, map, buffer2, W, H/2, H, radius), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); + thread1->join (); + thread2->join (); + thread1 = Glib::Thread::create(sigc::bind(sigc::ptr_fun(gaussVertical_unsigned), map, map, buffer1, H, 0, W/2, radius), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); + thread2 = Glib::Thread::create(sigc::bind(sigc::ptr_fun(gaussVertical_unsigned), map, map, buffer2, H, W/2, W, radius), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); + thread1->join (); + thread2->join (); + } + else { + gaussHorizontal_unsigned (map, map, buffer1, W, 0, H, radius); + gaussVertical_unsigned (map, map, buffer1, H, 0, W, radius); + } + + delete buffer1; + delete buffer2; + } else { - if (settings->dualThreadEnabled) { + if (settings->dualThreadEnabled) { bilateralparams r1, r2; r1.row_from = 0; r1.row_to = H/2; r2.row_from = H/2; r2.row_to = H; - Glib::Thread *thread1 = Glib::Thread::create(sigc::bind(sigc::ptr_fun(bilateral_box_unsigned), map, buffer, W, H, 8000, radius, r1), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); - Glib::Thread *thread2 = Glib::Thread::create(sigc::bind(sigc::ptr_fun(bilateral_box_unsigned), map, buffer, W, H, 8000, radius, r2), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); - thread1->join (); - thread2->join (); - } - else { + Glib::Thread *thread1 = Glib::Thread::create(sigc::bind(sigc::ptr_fun(bilateral_box_unsigned), map, buffer, W, H, 8000, radius, r1), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); + Glib::Thread *thread2 = Glib::Thread::create(sigc::bind(sigc::ptr_fun(bilateral_box_unsigned), map, buffer, W, H, 8000, radius, r2), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); + thread1->join (); + thread2->join (); + } + else { bilateralparams r1; r1.row_from = 0; r1.row_to = H; @@ -103,33 +103,33 @@ void SHMap::update (Image16* img, unsigned short** buffer, double radius, double map[i][j] = (buffer[i-1][j-1]+buffer[i-1][j]+buffer[i-1][j+1]+buffer[i][j-1]+buffer[i][j]+buffer[i][j+1]+buffer[i+1][j-1]+buffer[i+1][j]+buffer[i+1][j+1])/9; else map[i][j] = buffer[i][j]; - } + } // t2.set (); // printf ("shmap: %d\n", t2.etime (t1)); - // update average, minimum, maximum - double _avg = 0; - int n = 1; - min = 65535; - max = 0; - for (int i=32; i max) - max = val; - _avg = 1.0/n * val + (1.0 - 1.0/n) * _avg; - n++; - } - avg = (int) _avg; -} - -void SHMap::forceStat (unsigned short max_, unsigned short min_, unsigned short avg_) { - - max = max_; - min = min_; - avg = avg_; -} } + // update average, minimum, maximum + double _avg = 0; + int n = 1; + min = 65535; + max = 0; + for (int i=32; i max) + max = val; + _avg = 1.0/n * val + (1.0 - 1.0/n) * _avg; + n++; + } + avg = (int) _avg; +} + +void SHMap::forceStat (unsigned short max_, unsigned short min_, unsigned short avg_) { + + max = max_; + min = min_; + avg = avg_; +}} diff --git a/rtengine/shmap.h b/rtengine/shmap.h index 1a7b6064e..03bb5b106 100644 --- a/rtengine/shmap.h +++ b/rtengine/shmap.h @@ -1,40 +1,40 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef __SHMAP__ -#define __SHMAP__ - -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef __SHMAP__ +#define __SHMAP__ + +#include namespace rtengine { - -class SHMap { - - public: - int W, H; - unsigned short** map; - unsigned short max, min, avg; - - SHMap (int w, int h); - ~SHMap (); - - void update (Image16* img, unsigned short** buffer, double radius, double lumi[3], bool hq); - void forceStat (unsigned short max_, unsigned short min_, unsigned short avg_); -}; -}; -#endif + +class SHMap { + + public: + int W, H; + unsigned short** map; + unsigned short max, min, avg; + + SHMap (int w, int h); + ~SHMap (); + + void update (Image16* img, unsigned short** buffer, double radius, double lumi[3], bool hq); + void forceStat (unsigned short max_, unsigned short min_, unsigned short avg_); +}; +}; +#endif diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index ab9dccb8f..e1846998e 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include diff --git a/rtengine/stdimagesource.cc b/rtengine/stdimagesource.cc index 5b25b6ec4..beb547684 100644 --- a/rtengine/stdimagesource.cc +++ b/rtengine/stdimagesource.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include diff --git a/rtengine/stdimagesource.h b/rtengine/stdimagesource.h index ef0c626f5..8565c5670 100644 --- a/rtengine/stdimagesource.h +++ b/rtengine/stdimagesource.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _STDIMAGESOURCE_ #define _STDIMAGESOURCE_ diff --git a/rtengine/updater.cc b/rtengine/updater.cc index cffc716d8..5a0b5a3b6 100644 --- a/rtengine/updater.cc +++ b/rtengine/updater.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include diff --git a/rtengine/updater.h b/rtengine/updater.h index 550e73f5f..54dbf1cd7 100644 --- a/rtengine/updater.h +++ b/rtengine/updater.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _UPDATER_ #define _UPDATER_ diff --git a/rtengine/utils.cc b/rtengine/utils.cc index cefd38bec..cea88e7fa 100644 --- a/rtengine/utils.cc +++ b/rtengine/utils.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include diff --git a/rtengine/utils.h b/rtengine/utils.h index 0833c24f2..d33c8dc76 100644 --- a/rtengine/utils.h +++ b/rtengine/utils.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _SIMPLEUTILS_ #define _SIMPLEUTILS_ diff --git a/rtexif/canonattribs.cc b/rtexif/canonattribs.cc index cd2eed60d..30d9b537e 100644 --- a/rtexif/canonattribs.cc +++ b/rtexif/canonattribs.cc @@ -1,859 +1,859 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _CANONATTRIBS_ -#define _CANONATTRIBS_ - -#include -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _CANONATTRIBS_ +#define _CANONATTRIBS_ + +#include +#include +#include #include -#include +#include #include - -namespace rtexif { - -class CAIntSerNumInterpreter : public Interpreter { - public: - CAIntSerNumInterpreter () {} - virtual std::string toString (Tag* t) { return ""; } -}; - -CAIntSerNumInterpreter caIntSerNumInterpreter; - -class CAFocalLengthInterpreter : public Interpreter { - public: - CAFocalLengthInterpreter () {} - virtual std::string toString (Tag* t) { - std::ostringstream str; - str << "FocalType = " << t->toInt(0,SHORT) << std::endl; - str << "FocalLength = " << t->toInt(2,SHORT) << std::endl; - str << "FocalPlaneXSize = " << t->toInt(4,SHORT) << std::endl; - str << "FocalPlaneYSize = " << t->toInt(6,SHORT); - return str.str(); - } -}; -CAFocalLengthInterpreter caFocalLengthInterpreter; - - -class CACameraSettingsInterpreter : public Interpreter { - std::map machoices; - std::map qlchoices; - std::map fmchoices; - std::map cdchoices; - std::map fochoices; - std::map rmchoices; - std::map ischoices; - std::map mmchoices; - std::map dzchoices; - std::map emchoices; - std::map frchoices; - std::map afchoices; - std::map exchoices; - std::map fcchoices; - std::map aechoices; - std::map stchoices; - std::map smchoices; - std::map pechoices; - std::map mfchoices; - std::map choices; - public: - CACameraSettingsInterpreter () { - machoices[1] = "Macro"; - machoices[2] = "Normal"; - qlchoices[1] = "Economy"; - qlchoices[2] = "Normal"; - qlchoices[3] = "Fine"; - qlchoices[4] = "RAW"; - qlchoices[5] = "Superfine"; - fmchoices[0] = "Off"; - fmchoices[1] = "Auto"; - fmchoices[2] = "On"; - fmchoices[3] = "Red-eye reduction"; - fmchoices[4] = "Slow-sync"; - fmchoices[5] = "Red-eye reduction (Auto)"; - fmchoices[6] = "Red-eye reduction (On)"; - fmchoices[16] = "External flash"; - cdchoices[0] = "Single"; - cdchoices[1] = "Continuous"; - cdchoices[2] = "Movie"; - cdchoices[3] = "Continuous, Speed Priority"; - cdchoices[4] = "Continuous, Low"; - cdchoices[5] = "Continuous, High"; - fochoices[0] = "One-shot AF"; - fochoices[1] = "AI Servo AF"; - fochoices[2] = "AI Focus AF"; - fochoices[3] = "Manual Focus"; - fochoices[4] = "Single"; - fochoices[5] = "Continuous"; - fochoices[6] = "Manual Focus"; - fochoices[16] = "Pan Focus"; - rmchoices[1] = "JPEG"; - rmchoices[2] = "CRW+THM"; - rmchoices[3] = "AVI+THM"; - rmchoices[4] = "TIF"; - rmchoices[5] = "TIF+JPEG"; - rmchoices[6] = "CR2"; - rmchoices[7] = "CR2+JPEG"; - ischoices[0] = "Large"; - ischoices[1] = "Medium"; - ischoices[2] = "Small"; - ischoices[5] = "Medium 1"; - ischoices[6] = "Medium 2"; - ischoices[7] = "Medium 3"; - ischoices[8] = "Postcard"; - ischoices[9] = "Widescreen"; - emchoices[0] = "Full auto "; - emchoices[1] = "Manual "; - emchoices[2] = "Landscape "; - emchoices[3] = "Fast shutter "; - emchoices[4] = "Slow shutter "; - emchoices[5] = "Night "; - emchoices[6] = "Gray Scale "; - emchoices[7] = "Sepia "; - emchoices[8] = "Portrait "; - emchoices[9] = "Sports "; - emchoices[10] = "Macro "; - emchoices[11] = "Black & White"; - emchoices[12] = "Pan focus"; - emchoices[13] = "Vivid"; - emchoices[14] = "Neutral"; - emchoices[15] = "Flash Off"; - emchoices[16] = "Long Shutter"; - emchoices[17] = "Super Macro"; - emchoices[18] = "Foliage"; - emchoices[19] = "Indoor"; - emchoices[20] = "Fireworks"; - emchoices[21] = "Beach"; - emchoices[22] = "Underwater"; - emchoices[23] = "Snow"; - emchoices[24] = "Kids & Pets"; - emchoices[25] = "Night Snapshot"; - emchoices[26] = "Digital Macro"; - emchoices[27] = "My Colors"; - emchoices[28] = "Still Image"; - emchoices[30] = "Color Accent"; - emchoices[31] = "Color Swap"; - emchoices[32] = "Aquarium"; - emchoices[33] = "ISO 3200"; - dzchoices[0] = "None"; - dzchoices[1] = "2x"; - dzchoices[2] = "4x"; - dzchoices[3] = "Other"; - mmchoices[0] = "Default"; - mmchoices[1] = "Spot"; - mmchoices[2] = "Average"; - mmchoices[3] = "Evaluative"; - mmchoices[4] = "Partial"; - mmchoices[5] = "Center-weighted averaging"; - frchoices[0] = "Manual"; - frchoices[1] = "Auto"; - frchoices[2] = "Not Known"; - frchoices[3] = "Macro"; - frchoices[4] = "Very Close"; - frchoices[5] = "Close"; - frchoices[6] = "Middle Range"; - frchoices[7] = "Far Range"; - frchoices[8] = "Pan Focus"; - frchoices[9] = "Super Macro"; - frchoices[10] = "Infinity"; - afchoices[0x2005] = "Manual AF point selection "; - afchoices[0x3000] = "None (MF)"; - afchoices[0x3001] = "Auto AF point selection "; - afchoices[0x3002] = "Right "; - afchoices[0x3003] = "Center "; - afchoices[0x3004] = "Left "; - afchoices[0x4001] = "Auto AF point selection "; - afchoices[0x4006] = "Face Detect"; - exchoices[0] = "Easy"; - exchoices[1] = "Program AE"; - exchoices[2] = "Shutter speed priority AE"; - exchoices[3] = "Aperture-priority AE"; - exchoices[4] = "Manual"; - exchoices[5] = "Depth-of-field AE"; - exchoices[6] = "M-Dep"; - fcchoices[0] = "Single"; - fcchoices[1] = "Continuous"; - aechoices[0] = "Normal AE"; - aechoices[1] = "Exposure Compensation"; - aechoices[2] = "AE Lock"; - aechoices[3] = "AE Lock + Exposure Comp."; - aechoices[4] = "No AE"; - stchoices[0] = "Off"; - stchoices[1] = "On"; - stchoices[2] = "On, Shot Only"; - stchoices[3] = "On, Panning"; - smchoices[0] = "Center"; - smchoices[1] = "AF Point"; - pechoices[0] = "Off"; - pechoices[1] = "Vivid"; - pechoices[2] = "Neutral"; - pechoices[3] = "Smooth"; - pechoices[4] = "Sepia"; - pechoices[5] = "B&W"; - pechoices[6] = "Custom"; - pechoices[100] = "My Color Data"; - mfchoices[0] = "N/A"; - mfchoices[0x500] = "Full"; - mfchoices[0x502] = "Medium"; - mfchoices[0x504] = "Low"; - mfchoices[0x7fff] = "N/A"; - choices[1] = "Canon EF 50mm f/1.8"; - choices[2] = "Canon EF 28mm f/2.8"; - choices[3] = "Canon EF 135mm f/2.8 Soft"; - choices[4] = "Canon EF 35-105mm f/3.5-4.5 or Sigma Lens"; - choices[5] = "Canon EF 35-70mm f/3.5-4.5"; - choices[6] = "Canon EF 28-70mm f/3.5-4.5 or Sigma or Tokina Lens"; - choices[7] = "Canon EF 100-300mm F5.6L"; - choices[8] = "Canon EF 100-300mm f/5.6 or Sigma or Tokina Lens"; - choices[9] = "Canon EF 70-210mm f/4 orSigma Lens"; - choices[10] = "Canon EF 50mm f/2.5 Macro or Sigma Lens"; - choices[11] = "Canon EF 35mm f/2"; - choices[13] = "Canon EF 15mm f/2.8"; - choices[14] = "Canon EF 50-200mm f/3.5-4.5L"; - choices[15] = "Canon EF 50-200mm f/3.5-4.5"; - choices[16] = "Canon EF 35-135mm f/3.5-4.5"; - choices[17] = "Canon EF 35-70mm f/3.5-4.5A"; - choices[18] = "Canon EF 28-70mm f/3.5-4.5"; - choices[20] = "Canon EF 100-200mm f/4.5A"; - choices[21] = "Canon EF 80-200mm f/2.8L"; - choices[22] = "Canon EF 20-35mm f/2.8L or Tokina 28-80mm F2.8"; - choices[23] = "Canon EF 35-105mm f/3.5-4.5"; - choices[24] = "Canon EF 35-80mm f/4-5.6 Power Zoom"; - choices[25] = "Canon EF 35-80mm f/4-5.6 Power Zoom"; - choices[26] = "Canon EF 100mm f/2.8 Macro or Cosina 100mm f/3.5 Macro AF or Tamron"; - choices[28] = "Tamron AF Aspherical 28-200mm f/3.8-5.6 or 28-75mm f/2.8 or 28-105mm f/2.8"; - choices[27] = "Canon EF 35-80mm f/4-5.6"; - choices[28] = "Canon EF 80-200mm f/4.5-5.6 or Tamron Lens"; - choices[29] = "Canon EF 50mm f/1.8 MkII"; - choices[30] = "Canon EF 35-105mm f/4.5-5.6"; - choices[31] = "Tamron SP AF 300mm f/2.8 LD IF"; - choices[32] = "Canon EF 24mm f/2.8 or Sigma 15mm f/2.8 EX Fisheye"; - choices[33] = "Voigtlander Ultron 40mm f/2 SLII Aspherical"; - choices[35] = "Canon EF 35-80mm f/4-5.6"; - choices[36] = "Canon EF 38-76mm f/4.5-5.6"; - choices[37] = "Canon EF 35-80mm f/4-5.6 or Tamron Lens"; - choices[38] = "Canon EF 80-200mm f/4.5-5.6"; - choices[39] = "Canon EF 75-300mm f/4-5.6"; - choices[40] = "Canon EF 28-80mm f/3.5-5.6"; - choices[41] = "Canon EF 28-90mm f/4-5.6"; - choices[42] = "Canon EF 28-200mm f/3.5-5.6 or Tamron AF 28-300mm f/3.5-6.3"; - choices[43] = "Canon EF 28-105mm f/4-5.6"; - choices[44] = "Canon EF 90-300mm f/4.5-5.6"; - choices[45] = "Canon EF-S 18-55mm f/3.5-5.6"; - choices[46] = "Canon EF 28-90mm f/4-5.6"; - choices[48] = "Canon EF-S 18-55mm f/3.5-5.6 IS"; - choices[49] = "Canon EF-S 55-250mm f/4-5.6 IS"; - choices[50] = "Canon EF-S 18-200mm f/3.5-5.6 IS"; - choices[51] = "Canon EF-S 18-135mm f/3.5-5.6 IS"; - choices[94] = "Canon TS-E 17mm f/4L"; - choices[95] = "Canon TS-E 24.0mm f/3.5 L II"; - choices[124] = "Canon MP-E 65mm f/2.8 1-5x Macro Photo"; - choices[125] = "Canon TS-E 24mm f/3.5L"; - choices[126] = "Canon TS-E 45mm f/2.8"; - choices[127] = "Canon TS-E 90mm f/2.8"; - choices[129] = "Canon EF 300mm f/2.8L"; - choices[130] = "Canon EF 50mm f/1.0L"; - choices[131] = "Canon EF 28-80mm f/2.8-4L or Sigma Lens"; - choices[132] = "Canon EF 1200mm f/5.6L"; - choices[134] = "Canon EF 600mm f/4L IS"; - choices[135] = "Canon EF 200mm f/1.8L"; - choices[136] = "Canon EF 300mm f/2.8L"; - choices[137] = "Canon EF 85mm f/1.2L or Sigma Lens"; - choices[138] = "Canon EF 28-80mm f/2.8-4L"; - choices[139] = "Canon EF 400mm f/2.8L"; - choices[140] = "Canon EF 500mm f/4.5L"; - choices[141] = "Canon EF 500mm f/4.5L"; - choices[142] = "Canon EF 300mm f/2.8L IS"; - choices[143] = "Canon EF 500mm f/4L IS"; - choices[144] = "Canon EF 35-135mm f/4-5.6 USM"; - choices[145] = "Canon EF 100-300mm f/4.5-5.6 USM"; - choices[146] = "Canon EF 70-210mm f/3.5-4.5 USM"; - choices[147] = "Canon EF 35-135mm f/4-5.6 USM"; - choices[148] = "Canon EF 28-80mm f/3.5-5.6 USM"; - choices[149] = "Canon EF 100mm f/2"; - choices[150] = "Canon EF 14mm f/2.8L or Sigma Lens"; - choices[151] = "Canon EF 200mm f/2.8L"; - choices[152] = "Canon EF 300mm f/4L IS or Sigma Lens"; - choices[153] = "Canon EF 35-350mm f/3.5-5.6L or Tamron or Sigma Lens"; - choices[154] = "Canon EF 20mm f/2.8 USM"; - choices[155] = "Canon EF 85mm f/1.8 USM"; - choices[156] = "Canon EF 28-105mm f/3.5-4.5 USM"; - choices[160] = "Canon EF 20-35mm f/3.5-4.5 USM or Tamron AF 19-35mm f/3.5-4.5"; + +namespace rtexif { + +class CAIntSerNumInterpreter : public Interpreter { + public: + CAIntSerNumInterpreter () {} + virtual std::string toString (Tag* t) { return ""; } +}; + +CAIntSerNumInterpreter caIntSerNumInterpreter; + +class CAFocalLengthInterpreter : public Interpreter { + public: + CAFocalLengthInterpreter () {} + virtual std::string toString (Tag* t) { + std::ostringstream str; + str << "FocalType = " << t->toInt(0,SHORT) << std::endl; + str << "FocalLength = " << t->toInt(2,SHORT) << std::endl; + str << "FocalPlaneXSize = " << t->toInt(4,SHORT) << std::endl; + str << "FocalPlaneYSize = " << t->toInt(6,SHORT); + return str.str(); + } +}; +CAFocalLengthInterpreter caFocalLengthInterpreter; + + +class CACameraSettingsInterpreter : public Interpreter { + std::map machoices; + std::map qlchoices; + std::map fmchoices; + std::map cdchoices; + std::map fochoices; + std::map rmchoices; + std::map ischoices; + std::map mmchoices; + std::map dzchoices; + std::map emchoices; + std::map frchoices; + std::map afchoices; + std::map exchoices; + std::map fcchoices; + std::map aechoices; + std::map stchoices; + std::map smchoices; + std::map pechoices; + std::map mfchoices; + std::map choices; + public: + CACameraSettingsInterpreter () { + machoices[1] = "Macro"; + machoices[2] = "Normal"; + qlchoices[1] = "Economy"; + qlchoices[2] = "Normal"; + qlchoices[3] = "Fine"; + qlchoices[4] = "RAW"; + qlchoices[5] = "Superfine"; + fmchoices[0] = "Off"; + fmchoices[1] = "Auto"; + fmchoices[2] = "On"; + fmchoices[3] = "Red-eye reduction"; + fmchoices[4] = "Slow-sync"; + fmchoices[5] = "Red-eye reduction (Auto)"; + fmchoices[6] = "Red-eye reduction (On)"; + fmchoices[16] = "External flash"; + cdchoices[0] = "Single"; + cdchoices[1] = "Continuous"; + cdchoices[2] = "Movie"; + cdchoices[3] = "Continuous, Speed Priority"; + cdchoices[4] = "Continuous, Low"; + cdchoices[5] = "Continuous, High"; + fochoices[0] = "One-shot AF"; + fochoices[1] = "AI Servo AF"; + fochoices[2] = "AI Focus AF"; + fochoices[3] = "Manual Focus"; + fochoices[4] = "Single"; + fochoices[5] = "Continuous"; + fochoices[6] = "Manual Focus"; + fochoices[16] = "Pan Focus"; + rmchoices[1] = "JPEG"; + rmchoices[2] = "CRW+THM"; + rmchoices[3] = "AVI+THM"; + rmchoices[4] = "TIF"; + rmchoices[5] = "TIF+JPEG"; + rmchoices[6] = "CR2"; + rmchoices[7] = "CR2+JPEG"; + ischoices[0] = "Large"; + ischoices[1] = "Medium"; + ischoices[2] = "Small"; + ischoices[5] = "Medium 1"; + ischoices[6] = "Medium 2"; + ischoices[7] = "Medium 3"; + ischoices[8] = "Postcard"; + ischoices[9] = "Widescreen"; + emchoices[0] = "Full auto "; + emchoices[1] = "Manual "; + emchoices[2] = "Landscape "; + emchoices[3] = "Fast shutter "; + emchoices[4] = "Slow shutter "; + emchoices[5] = "Night "; + emchoices[6] = "Gray Scale "; + emchoices[7] = "Sepia "; + emchoices[8] = "Portrait "; + emchoices[9] = "Sports "; + emchoices[10] = "Macro "; + emchoices[11] = "Black & White"; + emchoices[12] = "Pan focus"; + emchoices[13] = "Vivid"; + emchoices[14] = "Neutral"; + emchoices[15] = "Flash Off"; + emchoices[16] = "Long Shutter"; + emchoices[17] = "Super Macro"; + emchoices[18] = "Foliage"; + emchoices[19] = "Indoor"; + emchoices[20] = "Fireworks"; + emchoices[21] = "Beach"; + emchoices[22] = "Underwater"; + emchoices[23] = "Snow"; + emchoices[24] = "Kids & Pets"; + emchoices[25] = "Night Snapshot"; + emchoices[26] = "Digital Macro"; + emchoices[27] = "My Colors"; + emchoices[28] = "Still Image"; + emchoices[30] = "Color Accent"; + emchoices[31] = "Color Swap"; + emchoices[32] = "Aquarium"; + emchoices[33] = "ISO 3200"; + dzchoices[0] = "None"; + dzchoices[1] = "2x"; + dzchoices[2] = "4x"; + dzchoices[3] = "Other"; + mmchoices[0] = "Default"; + mmchoices[1] = "Spot"; + mmchoices[2] = "Average"; + mmchoices[3] = "Evaluative"; + mmchoices[4] = "Partial"; + mmchoices[5] = "Center-weighted averaging"; + frchoices[0] = "Manual"; + frchoices[1] = "Auto"; + frchoices[2] = "Not Known"; + frchoices[3] = "Macro"; + frchoices[4] = "Very Close"; + frchoices[5] = "Close"; + frchoices[6] = "Middle Range"; + frchoices[7] = "Far Range"; + frchoices[8] = "Pan Focus"; + frchoices[9] = "Super Macro"; + frchoices[10] = "Infinity"; + afchoices[0x2005] = "Manual AF point selection "; + afchoices[0x3000] = "None (MF)"; + afchoices[0x3001] = "Auto AF point selection "; + afchoices[0x3002] = "Right "; + afchoices[0x3003] = "Center "; + afchoices[0x3004] = "Left "; + afchoices[0x4001] = "Auto AF point selection "; + afchoices[0x4006] = "Face Detect"; + exchoices[0] = "Easy"; + exchoices[1] = "Program AE"; + exchoices[2] = "Shutter speed priority AE"; + exchoices[3] = "Aperture-priority AE"; + exchoices[4] = "Manual"; + exchoices[5] = "Depth-of-field AE"; + exchoices[6] = "M-Dep"; + fcchoices[0] = "Single"; + fcchoices[1] = "Continuous"; + aechoices[0] = "Normal AE"; + aechoices[1] = "Exposure Compensation"; + aechoices[2] = "AE Lock"; + aechoices[3] = "AE Lock + Exposure Comp."; + aechoices[4] = "No AE"; + stchoices[0] = "Off"; + stchoices[1] = "On"; + stchoices[2] = "On, Shot Only"; + stchoices[3] = "On, Panning"; + smchoices[0] = "Center"; + smchoices[1] = "AF Point"; + pechoices[0] = "Off"; + pechoices[1] = "Vivid"; + pechoices[2] = "Neutral"; + pechoices[3] = "Smooth"; + pechoices[4] = "Sepia"; + pechoices[5] = "B&W"; + pechoices[6] = "Custom"; + pechoices[100] = "My Color Data"; + mfchoices[0] = "N/A"; + mfchoices[0x500] = "Full"; + mfchoices[0x502] = "Medium"; + mfchoices[0x504] = "Low"; + mfchoices[0x7fff] = "N/A"; + choices[1] = "Canon EF 50mm f/1.8"; + choices[2] = "Canon EF 28mm f/2.8"; + choices[3] = "Canon EF 135mm f/2.8 Soft"; + choices[4] = "Canon EF 35-105mm f/3.5-4.5 or Sigma Lens"; + choices[5] = "Canon EF 35-70mm f/3.5-4.5"; + choices[6] = "Canon EF 28-70mm f/3.5-4.5 or Sigma or Tokina Lens"; + choices[7] = "Canon EF 100-300mm F5.6L"; + choices[8] = "Canon EF 100-300mm f/5.6 or Sigma or Tokina Lens"; + choices[9] = "Canon EF 70-210mm f/4 orSigma Lens"; + choices[10] = "Canon EF 50mm f/2.5 Macro or Sigma Lens"; + choices[11] = "Canon EF 35mm f/2"; + choices[13] = "Canon EF 15mm f/2.8"; + choices[14] = "Canon EF 50-200mm f/3.5-4.5L"; + choices[15] = "Canon EF 50-200mm f/3.5-4.5"; + choices[16] = "Canon EF 35-135mm f/3.5-4.5"; + choices[17] = "Canon EF 35-70mm f/3.5-4.5A"; + choices[18] = "Canon EF 28-70mm f/3.5-4.5"; + choices[20] = "Canon EF 100-200mm f/4.5A"; + choices[21] = "Canon EF 80-200mm f/2.8L"; + choices[22] = "Canon EF 20-35mm f/2.8L or Tokina 28-80mm F2.8"; + choices[23] = "Canon EF 35-105mm f/3.5-4.5"; + choices[24] = "Canon EF 35-80mm f/4-5.6 Power Zoom"; + choices[25] = "Canon EF 35-80mm f/4-5.6 Power Zoom"; + choices[26] = "Canon EF 100mm f/2.8 Macro or Cosina 100mm f/3.5 Macro AF or Tamron"; + choices[28] = "Tamron AF Aspherical 28-200mm f/3.8-5.6 or 28-75mm f/2.8 or 28-105mm f/2.8"; + choices[27] = "Canon EF 35-80mm f/4-5.6"; + choices[28] = "Canon EF 80-200mm f/4.5-5.6 or Tamron Lens"; + choices[29] = "Canon EF 50mm f/1.8 MkII"; + choices[30] = "Canon EF 35-105mm f/4.5-5.6"; + choices[31] = "Tamron SP AF 300mm f/2.8 LD IF"; + choices[32] = "Canon EF 24mm f/2.8 or Sigma 15mm f/2.8 EX Fisheye"; + choices[33] = "Voigtlander Ultron 40mm f/2 SLII Aspherical"; + choices[35] = "Canon EF 35-80mm f/4-5.6"; + choices[36] = "Canon EF 38-76mm f/4.5-5.6"; + choices[37] = "Canon EF 35-80mm f/4-5.6 or Tamron Lens"; + choices[38] = "Canon EF 80-200mm f/4.5-5.6"; + choices[39] = "Canon EF 75-300mm f/4-5.6"; + choices[40] = "Canon EF 28-80mm f/3.5-5.6"; + choices[41] = "Canon EF 28-90mm f/4-5.6"; + choices[42] = "Canon EF 28-200mm f/3.5-5.6 or Tamron AF 28-300mm f/3.5-6.3"; + choices[43] = "Canon EF 28-105mm f/4-5.6"; + choices[44] = "Canon EF 90-300mm f/4.5-5.6"; + choices[45] = "Canon EF-S 18-55mm f/3.5-5.6"; + choices[46] = "Canon EF 28-90mm f/4-5.6"; + choices[48] = "Canon EF-S 18-55mm f/3.5-5.6 IS"; + choices[49] = "Canon EF-S 55-250mm f/4-5.6 IS"; + choices[50] = "Canon EF-S 18-200mm f/3.5-5.6 IS"; + choices[51] = "Canon EF-S 18-135mm f/3.5-5.6 IS"; + choices[94] = "Canon TS-E 17mm f/4L"; + choices[95] = "Canon TS-E 24.0mm f/3.5 L II"; + choices[124] = "Canon MP-E 65mm f/2.8 1-5x Macro Photo"; + choices[125] = "Canon TS-E 24mm f/3.5L"; + choices[126] = "Canon TS-E 45mm f/2.8"; + choices[127] = "Canon TS-E 90mm f/2.8"; + choices[129] = "Canon EF 300mm f/2.8L"; + choices[130] = "Canon EF 50mm f/1.0L"; + choices[131] = "Canon EF 28-80mm f/2.8-4L or Sigma Lens"; + choices[132] = "Canon EF 1200mm f/5.6L"; + choices[134] = "Canon EF 600mm f/4L IS"; + choices[135] = "Canon EF 200mm f/1.8L"; + choices[136] = "Canon EF 300mm f/2.8L"; + choices[137] = "Canon EF 85mm f/1.2L or Sigma Lens"; + choices[138] = "Canon EF 28-80mm f/2.8-4L"; + choices[139] = "Canon EF 400mm f/2.8L"; + choices[140] = "Canon EF 500mm f/4.5L"; + choices[141] = "Canon EF 500mm f/4.5L"; + choices[142] = "Canon EF 300mm f/2.8L IS"; + choices[143] = "Canon EF 500mm f/4L IS"; + choices[144] = "Canon EF 35-135mm f/4-5.6 USM"; + choices[145] = "Canon EF 100-300mm f/4.5-5.6 USM"; + choices[146] = "Canon EF 70-210mm f/3.5-4.5 USM"; + choices[147] = "Canon EF 35-135mm f/4-5.6 USM"; + choices[148] = "Canon EF 28-80mm f/3.5-5.6 USM"; + choices[149] = "Canon EF 100mm f/2"; + choices[150] = "Canon EF 14mm f/2.8L or Sigma Lens"; + choices[151] = "Canon EF 200mm f/2.8L"; + choices[152] = "Canon EF 300mm f/4L IS or Sigma Lens"; + choices[153] = "Canon EF 35-350mm f/3.5-5.6L or Tamron or Sigma Lens"; + choices[154] = "Canon EF 20mm f/2.8 USM"; + choices[155] = "Canon EF 85mm f/1.8 USM"; + choices[156] = "Canon EF 28-105mm f/3.5-4.5 USM"; + choices[160] = "Canon EF 20-35mm f/3.5-4.5 USM or Tamron AF 19-35mm f/3.5-4.5"; choices[161] = "Canon EF 28-70mm f/2.8L or Sigma or Tamron Lens"; choices[162] = "Canon EF 200mm f/2.8L"; choices[163] = "Canon EF 300mm f/4L"; - choices[164] = "Canon EF 400mm f/5.6L"; - choices[165] = "Canon EF 70-200mm f/2.8 L"; - choices[166] = "Canon EF 70-200mm f/2.8 L + x1.4"; - choices[167] = "Canon EF 70-200mm f/2.8 L + x2"; - choices[168] = "Canon EF 28mm f/1.8 USM"; - choices[169] = "Canon EF17-35mm f/2.8L or Sigma Lens"; + choices[164] = "Canon EF 400mm f/5.6L"; + choices[165] = "Canon EF 70-200mm f/2.8 L"; + choices[166] = "Canon EF 70-200mm f/2.8 L + x1.4"; + choices[167] = "Canon EF 70-200mm f/2.8 L + x2"; + choices[168] = "Canon EF 28mm f/1.8 USM"; + choices[169] = "Canon EF17-35mm f/2.8L or Sigma Lens"; choices[170] = "Canon EF 200mm f/2.8L II"; choices[171] = "Canon EF 300mm f/4L"; - choices[172] = "Canon EF 400mm f/5.6L"; - choices[173] = "Canon EF 180mm Macro f/3.5L or Sigma 180mm F3.5 or 150mm f/2.8 Macro"; - choices[174] = "Canon EF 135mm f/2L"; - choices[175] = "Canon EF 400mm f/2.8L"; + choices[172] = "Canon EF 400mm f/5.6L"; + choices[173] = "Canon EF 180mm Macro f/3.5L or Sigma 180mm F3.5 or 150mm f/2.8 Macro"; + choices[174] = "Canon EF 135mm f/2L"; + choices[175] = "Canon EF 400mm f/2.8L"; choices[176] = "Canon EF 24-85mm f/3.5-4.5 USM"; - choices[177] = "Canon EF 300mm f/4L IS"; - choices[178] = "Canon EF 28-135mm f/3.5-5.6 IS"; - choices[179] = "Canon EF 24mm f/1.4L USM"; - choices[180] = "Canon EF 35mm f/1.4L"; - choices[181] = "Canon EF 100-400mm f/4.5-5.6L IS + x1.4"; - choices[182] = "Canon EF 100-400mm f/4.5-5.6L IS + x2"; - choices[183] = "Canon EF 100-400mm f/4.5-5.6L IS"; + choices[177] = "Canon EF 300mm f/4L IS"; + choices[178] = "Canon EF 28-135mm f/3.5-5.6 IS"; + choices[179] = "Canon EF 24mm f/1.4L USM"; + choices[180] = "Canon EF 35mm f/1.4L"; + choices[181] = "Canon EF 100-400mm f/4.5-5.6L IS + x1.4"; + choices[182] = "Canon EF 100-400mm f/4.5-5.6L IS + x2"; + choices[183] = "Canon EF 100-400mm f/4.5-5.6L IS"; choices[184] = "Canon EF 400mm f/2.8L + x2"; - choices[185] = "Canon EF 600mm f/4L IS"; + choices[185] = "Canon EF 600mm f/4L IS"; choices[186] = "Canon EF 70-200mm f/4L"; choices[187] = "Canon EF 70-200mm f/4L + 1.4x"; choices[188] = "Canon EF 70-200mm f/4L + 2x"; - choices[189] = "Canon EF 70-200mm f/4L + 2.8x"; - choices[190] = "Canon EF 100mm f/2.8 Macro"; + choices[189] = "Canon EF 70-200mm f/4L + 2.8x"; + choices[190] = "Canon EF 100mm f/2.8 Macro"; choices[191] = "Canon EF 400mm f/4 DO IS"; choices[193] = "Canon EF 35-80mm f/4-5.6 USM"; choices[194] = "Canon EF 80-200mm f/4.5-5.6 USM"; choices[195] = "Canon EF 35-105mm f/4.5-5.6 USM"; - choices[196] = "Canon EF 75-300mm f/4-5.6 USM"; - choices[197] = "Canon EF 75-300mm f/4-5.6 IS"; + choices[196] = "Canon EF 75-300mm f/4-5.6 USM"; + choices[197] = "Canon EF 75-300mm f/4-5.6 IS"; choices[198] = "Canon EF 50mm f/1.4 USM"; choices[199] = "Canon EF 28-80mm f/3.5-5.6 USM"; choices[200] = "Canon EF 75-300mm f/4-5.6 USM"; - choices[201] = "Canon EF 28-80mm f/3.5-5.6 USM"; + choices[201] = "Canon EF 28-80mm f/3.5-5.6 USM"; choices[202] = "Canon EF 28-80 f/3.5-5.6 USM IV"; choices[208] = "Canon EF 22-55mm f/4-5.6 USM"; choices[209] = "Canon EF 55-200mm f/4.5-5.6"; - choices[210] = "Canon EF 28-90mm f/4-5.6 USM"; - choices[211] = "Canon EF 28-200mm f/3.5-5.6"; - choices[212] = "Canon EF 28-105mm f/4-5.6 USM"; - choices[213] = "Canon EF 90-300mm f/4.5-5.6"; + choices[210] = "Canon EF 28-90mm f/4-5.6 USM"; + choices[211] = "Canon EF 28-200mm f/3.5-5.6"; + choices[212] = "Canon EF 28-105mm f/4-5.6 USM"; + choices[213] = "Canon EF 90-300mm f/4.5-5.6"; choices[214] = "Canon EF-S 18-55mm f/3.5-4.5 USM"; - choices[215] = "Canon EF 55-200mm f/4.5-5.6 II USM"; - choices[224] = "Canon EF 70-200mm f/2.8L IS USM"; - choices[225] = "Canon EF 70-200mm f/2.8L IS USM + x1.4"; - choices[226] = "Canon EF 70-200mm f/2.8L IS USM + x2"; - choices[227] = "Canon EF 70-200mm f/2.8L IS + 2.8x"; - choices[228] = "Canon EF 28-105mm f/3.5-4.5 USM"; - choices[229] = "Canon EF 16-35mm f/2.8L"; - choices[230] = "Canon EF 24-70mm f/2.8L"; - choices[231] = "Canon EF 17-40mm f/4L"; - choices[232] = "Canon EF 70-300mm f/4.5-5.6 DO IS USM"; - choices[233] = "Canon EF 28-300mm f/3.5-5.6L IS"; - choices[234] = "Canon EF-S 17-85mm f4-5.6 IS USM"; - choices[235] = "Canon EF-S10-22mm F3.5-4.5 USM"; - choices[236] = "Canon EF-S60mm F2.8 Macro USM"; - choices[237] = "Canon EF 24-105mm f/4L IS"; - choices[238] = "Canon EF 70-300mm f/4-5.6 IS USM"; - choices[239] = "Canon EF 85mm f/1.2L II USM"; - choices[240] = "Canon EF-S 17-55mm f/2.8 IS USM"; - choices[241] = "Canon EF 50mm f/1.2L USM"; - choices[242] = "Canon EF 70-200mm f/4L IS USM"; + choices[215] = "Canon EF 55-200mm f/4.5-5.6 II USM"; + choices[224] = "Canon EF 70-200mm f/2.8L IS USM"; + choices[225] = "Canon EF 70-200mm f/2.8L IS USM + x1.4"; + choices[226] = "Canon EF 70-200mm f/2.8L IS USM + x2"; + choices[227] = "Canon EF 70-200mm f/2.8L IS + 2.8x"; + choices[228] = "Canon EF 28-105mm f/3.5-4.5 USM"; + choices[229] = "Canon EF 16-35mm f/2.8L"; + choices[230] = "Canon EF 24-70mm f/2.8L"; + choices[231] = "Canon EF 17-40mm f/4L"; + choices[232] = "Canon EF 70-300mm f/4.5-5.6 DO IS USM"; + choices[233] = "Canon EF 28-300mm f/3.5-5.6L IS"; + choices[234] = "Canon EF-S 17-85mm f4-5.6 IS USM"; + choices[235] = "Canon EF-S10-22mm F3.5-4.5 USM"; + choices[236] = "Canon EF-S60mm F2.8 Macro USM"; + choices[237] = "Canon EF 24-105mm f/4L IS"; + choices[238] = "Canon EF 70-300mm f/4-5.6 IS USM"; + choices[239] = "Canon EF 85mm f/1.2L II USM"; + choices[240] = "Canon EF-S 17-55mm f/2.8 IS USM"; + choices[241] = "Canon EF 50mm f/1.2L USM"; + choices[242] = "Canon EF 70-200mm f/4L IS USM"; choices[243] = "Canon EF 70-200mm f/4L IS + 1.4x"; choices[244] = "Canon EF 70-200mm f/4L IS + 2x"; choices[245] = "Canon EF 70-200mm f/4L IS + 2.8x"; choices[246] = "Canon EF 16-35mm f/2.8L II"; - choices[247] = "Canon EF 14mm f/2.8L II USM"; - choices[248] = "Canon EF 200mm f/2L IS"; - choices[249] = "Canon EF 800mm f/5.6L IS"; - choices[250] = "Canon EF 24 f/1.4L II"; - choices[254] = "Canon EF 100mm f/2.8L Macro IS USM"; - choices[488] = "Canon EF-S 15-85mm f/3.5-5.6 IS USM"; + choices[247] = "Canon EF 14mm f/2.8L II USM"; + choices[248] = "Canon EF 200mm f/2L IS"; + choices[249] = "Canon EF 800mm f/5.6L IS"; + choices[250] = "Canon EF 24 f/1.4L II"; + choices[254] = "Canon EF 100mm f/2.8L Macro IS USM"; + choices[488] = "Canon EF-S 15-85mm f/3.5-5.6 IS USM"; } - virtual std::string toString (Tag* t) { - std::ostringstream str; - str << "MacroMode = " << machoices[t->toInt(2,SHORT)] << std::endl; - str << "Self-timer = " << t->toInt(4,SHORT) << std::endl; - str << "Quality = " << qlchoices[t->toInt(6,SHORT)] << std::endl; - str << "CanonFlashMode = " << fmchoices[t->toInt(8,SHORT)] << std::endl; - str << "ContinuousDrive = " << cdchoices[t->toInt(10,SHORT)] << std::endl; - str << "FocusMode = " << fochoices[t->toInt(14,SHORT)] << std::endl; - str << "RecordMode = " << rmchoices[t->toInt(18,SHORT)] << std::endl; - str << "CanonImageSize = " << ischoices[t->toInt(20,SHORT)] << std::endl; - str << "EasyMode = " << emchoices[t->toInt(22,SHORT)] << std::endl; - str << "DigitalZoom = " << dzchoices[t->toInt(24,SHORT)] << std::endl; - str << "Contrast = " << t->toInt(26,SHORT) << std::endl; - str << "Saturation = " << t->toInt(28,SHORT) << std::endl; - str << "Sharpness = " << t->toInt(30,SHORT) << std::endl; - str << "CameraISO = " << t->toInt(32,SHORT) << std::endl; - str << "MeteringMode = " << mmchoices[t->toInt(34,SHORT)] << std::endl; - str << "FocusRange = " << frchoices[t->toInt(36,SHORT)] << std::endl; - str << "AFPoint = " << afchoices[t->toInt(38,SHORT)] << std::endl; - str << "CanonExposureMode = " << exchoices[t->toInt(40,SHORT)] << std::endl; - str << "LensType = " << choices[t->toInt(44,SHORT)] << " (" << t->toInt(44,SHORT) << ")" << std::endl; - str << "LongFocal = " << (double)t->toInt(46,SHORT)/t->toInt(50,SHORT) << " mm" << std::endl; - str << "ShortFocal = " << (double)t->toInt(48,SHORT)/t->toInt(50,SHORT) << " mm" << std::endl; - str << "FocalUnits = " << t->toInt(50,SHORT) << std::endl; - str << "MaxAperture = " << pow (2, t->toInt(52,SHORT)/64.0) << std::endl; - str << "MinAperture = " << pow (2, t->toInt(54,SHORT)/64.0) << std::endl; - str << "FlashActivity = " << t->toInt(56,SHORT) << std::endl; - str << "FlashBits = "; - int f = t->toInt(58,SHORT); - if (f&1) - str << "Manual "; - if (f&2) - str << "TTL "; - if (f&4) - str << "A-TTL "; - if (f&8) - str << "E-TTL "; - if (f&16) - str << "FP sync enabled "; - if (f&(1<<7)) - str << "2nd-curtain sync used "; - if (f&(1<<11)) - str << "FP sync used "; - if (f&(1<<13)) - str << "Built-in "; - if (f&(1<<14)) - str << "External "; - str << std::endl; - str << "FocusContinuous = " << fcchoices[t->toInt(64,SHORT)] << std::endl; - str << "AESetting = " << aechoices[t->toInt(66,SHORT)] << std::endl; - str << "ImageStabilization = " << stchoices[t->toInt(68,SHORT)] << " (" << t->toInt(68,SHORT) << ")" << std::endl; - str << "DisplayAperture = " << t->toInt(70,SHORT) << std::endl; - str << "ZoomSourceWidth = " << t->toInt(72,SHORT) << std::endl; - str << "ZoomTargetWidth = " << t->toInt(74,SHORT) << std::endl; - str << "SpotMeteringMode = " << smchoices[t->toInt(78,SHORT)] << std::endl; - str << "PhotoEffect = " << pechoices[t->toInt(80,SHORT)] << std::endl; - str << "ManualFlashOutput = " << mfchoices[t->toInt(82,SHORT)] << std::endl; - str << "ColorTone = " << t->toInt(84,SHORT); - return str.str(); - } -}; -CACameraSettingsInterpreter caCameraSettingsInterpreter; - - -class CAProcessingInfoInterpreter : public Interpreter { - std::map tcchoices; - std::map sfchoices; - std::map wbchoices; - std::map pschoices; - public: - CAProcessingInfoInterpreter () { - tcchoices[0] = "Standard"; - tcchoices[1] = "Manual"; - tcchoices[2] = "Custom"; - sfchoices[0] = "N/A"; - sfchoices[1] = "Lowest"; - sfchoices[2] = "Low"; - sfchoices[3] = "Standard"; - sfchoices[4] = "High"; - sfchoices[5] = "Highest"; - wbchoices[0] = "Auto"; - wbchoices[1] = "Daylight"; - wbchoices[2] = "Cloudy"; - wbchoices[3] = "Tungsten"; - wbchoices[4] = "Fluorescent"; - wbchoices[5] = "Flash"; - wbchoices[6] = "Custom"; - wbchoices[7] = "Black & White"; - wbchoices[8] = "Shade"; - wbchoices[9] = "Manual Temperature (Kelvin)"; - wbchoices[10] = "PC Set1"; - wbchoices[11] = "PC Set2"; - wbchoices[12] = "PC Set3"; - wbchoices[14] = "Daylight Fluorescent"; - wbchoices[15] = "Custom 1"; - wbchoices[16] = "Custom 2"; - wbchoices[17] = "Underwater"; - pschoices[0] = "None"; - pschoices[1] = "Standard "; - pschoices[2] = "Set 1"; - pschoices[3] = "Set 2"; - pschoices[4] = "Set 3"; - pschoices[0x21] = "User Def. 1"; - pschoices[0x22] = "User Def. 2"; - pschoices[0x23] = "User Def. 3"; - pschoices[0x41] = "External 1"; - pschoices[0x42] = "External 2"; - pschoices[0x43] = "External 3"; - pschoices[0x81] = "Standard"; - pschoices[0x82] = "Portrait"; - pschoices[0x83] = "Landscape"; - pschoices[0x84] = "Neutral"; - pschoices[0x85] = "Faithful"; - pschoices[0x86] = "Monochrome"; - } - virtual std::string toString (Tag* t) { - std::ostringstream str; - str << "ToneCurve = " << tcchoices[t->toInt(2,SHORT)] << std::endl; - str << "Sharpness = " << t->toInt(4,SHORT) << std::endl; - str << "SharpnessFrequency = " << sfchoices[t->toInt(6,SHORT)] << std::endl; - str << "SensorRedLevel = " << t->toInt(8,SHORT) << std::endl; - str << "SensorBlueLevel = " << t->toInt(10,SHORT) << std::endl; - str << "WhiteBalanceRed = " << t->toInt(12,SHORT) << std::endl; - str << "WhiteBalanceBlue = " << t->toInt(14,SHORT) << std::endl; - str << "WhiteBalance = " << wbchoices[t->toInt(16,SHORT)] << std::endl; - str << "ColorTemperature = " << t->toInt(18,SHORT) << std::endl; - str << "PictureStyle = " << pschoices[t->toInt(20,SHORT)] << std::endl; - str << "DigitalGain = " << t->toInt(22,SHORT) << std::endl; - str << "WBShiftAB = " << t->toInt(24,SHORT) << std::endl; - str << "WBShiftGM = " << t->toInt(26,SHORT); - return str.str(); - } -}; -CAProcessingInfoInterpreter caProcessingInfoInterpreter; - -class CAShotInfoInterpreter : public Interpreter { - std::map sschoices; - std::map afchoices; - std::map aechoices; - std::map wbchoices; - std::map ctchoices; - std::map cmchoices; - std::map archoices; - std::map ndchoices; - public: - CAShotInfoInterpreter () { - sschoices[0] = "Off"; - sschoices[1] = "Night Scene"; - sschoices[2] = "On"; - sschoices[3] = "None"; - afchoices[0x3000] = "None (MF)"; - afchoices[0x3001] = "Right"; - afchoices[0x3002] = "Center"; - afchoices[0x3003] = "Center+Right"; - afchoices[0x3004] = "Left"; - afchoices[0x3005] = "Left+Right"; - afchoices[0x3006] = "Left+Center"; - afchoices[0x3007] = "All"; - wbchoices[0] = "Auto"; - wbchoices[1] = "Daylight"; - wbchoices[2] = "Cloudy"; - wbchoices[3] = "Tungsten"; - wbchoices[4] = "Fluorescent"; - wbchoices[5] = "Flash"; - wbchoices[6] = "Custom"; - wbchoices[7] = "Black & White"; - wbchoices[8] = "Shade"; - wbchoices[9] = "Manual Temperature (Kelvin)"; - wbchoices[10] = "PC Set1"; - wbchoices[11] = "PC Set2"; - wbchoices[12] = "PC Set3"; - wbchoices[14] = "Daylight Fluorescent"; - wbchoices[15] = "Custom 1"; - wbchoices[16] = "Custom 2"; - wbchoices[17] = "Underwater"; - aechoices[-1] = "On "; - aechoices[0] = "Off "; - aechoices[1] = "On (shot 1)"; - aechoices[2] = "On (shot 2)"; - aechoices[3] = "On (shot 3)"; - cmchoices[0] = "n/a"; - cmchoices[1] = "Camera Local Control"; - cmchoices[3] = "Computer Remote Control"; - ctchoices[248] = "EOS High-end"; - ctchoices[250] = "Compact"; - ctchoices[252] = "EOS Mid-end"; - ctchoices[255] = "DV Camera"; - ctchoices[0x23] = "User Def. 3"; - archoices[-1] = "Rotated by Software"; - archoices[0] = "None"; - archoices[1] = "Rotate 90 CW"; - archoices[2] = "Rotate 180"; - archoices[3] = "Rotate 270 CW"; - ndchoices[0] = "Off"; - ndchoices[1] = "On"; - } - virtual std::string toString (Tag* t) { - std::ostringstream str; - str << "AutoISO = " << t->toInt(2,SHORT) << std::endl; - str << "BaseISO = " << pow (2, t->toInt(4,SHORT)/32.0 - 4) * 50 << std::endl; - str << "MeasuredEV = " << t->toInt(6,SHORT) << std::endl; - str << "TargetAperture = " << pow (2, t->toInt(8,SHORT)/64.0) << std::endl; - str << "TargetExposureTime = " << pow (2, -t->toInt(10,SHORT)/32.0) << std::endl; - str << "ExposureCompensation = " << t->toInt(12,SHORT)/32.0 << std::endl; - str << "WhiteBalance = " << wbchoices[t->toInt(14,SHORT)] << std::endl; - str << "SlowShutter = " << sschoices[t->toInt(16,SHORT)] << std::endl; - str << "SequenceNumber = " << t->toInt(18,SHORT) << std::endl; - str << "OpticalZoomCode = " << t->toInt(20,SHORT) << std::endl; - str << "FlashGuideNumber = " << t->toInt(26,SHORT) << std::endl; - str << "AFPointsInFocus = " << afchoices[t->toInt(28,SHORT)] << std::endl; - str << "FlashExposureComp = " << t->toInt(30,SHORT) << std::endl; - str << "AutoExposureBracketing = " << afchoices[t->toInt(32,SHORT)] << std::endl; - str << "AEBBracketValue = " << t->toInt(34,SHORT) << std::endl; - str << "ControlMode = " << cmchoices[t->toInt(36,SHORT)] << std::endl; - str << "FocusDistanceUpper = " << t->toInt(38,SHORT) << std::endl; - str << "FocusDistanceLower = " << t->toInt(40,SHORT) << std::endl; - str << "FNumber = " << pow (2, t->toInt(42,SHORT)/64.0) << std::endl; - str << "ExposureTime = " << pow (2, -t->toInt(44,SHORT)/32.0) << std::endl; - str << "BulbDuration = " << t->toInt(48,SHORT) << std::endl; - str << "CameraType = " << ctchoices[t->toInt(52,SHORT)] << std::endl; - str << "AutoRotate = " << archoices[t->toInt(54,SHORT)] << std::endl; - str << "NDFilter = " << ndchoices[t->toInt(56,SHORT)] << std::endl; - str << "Self-timer2 = " << t->toInt(58,SHORT) << std::endl; - str << "FlashOutput = " << t->toInt(66,SHORT); - return str.str(); - } -}; -CAShotInfoInterpreter caShotInfoInterpreter; - - -class CAFileInfoInterpreter : public Interpreter { - std::map bmchoices; - std::map rjqchoices; - std::map rjschoices; - std::map nrchoices; - std::map wbchoices; - std::map fechoices; - std::map techoices; - public: - CAFileInfoInterpreter () { - bmchoices[0] = "Off"; - bmchoices[1] = "AEB"; - bmchoices[2] = "FEB"; - bmchoices[3] = "ISO"; - bmchoices[4] = "WB"; - - rjqchoices[1] = "Economy"; - rjqchoices[2] = "Normal"; - rjqchoices[3] = "Fine"; - rjqchoices[4] = "RAW"; - rjqchoices[5] = "Superfine"; - - rjschoices[0] = "Large"; - rjschoices[1] = "Medium"; - rjschoices[2] = "Small"; - rjschoices[5] = "Medium 1"; - rjschoices[6] = "Medium 2"; - rjschoices[7] = "Medium 3"; - rjschoices[8] = "Postcard"; - rjschoices[9] = "Widescreen"; - - nrchoices[0] = "Off"; - nrchoices[1] = "On (mode 1)"; - nrchoices[2] = "On (mode 2)"; - nrchoices[3] = "On (mode 3)"; - nrchoices[4] = "On (mode 4)"; - - wbchoices[0] = "Off"; - wbchoices[1] = "On (shift AB)"; - wbchoices[2] = "On (shift GM)"; - - fechoices[0] = "None"; - fechoices[1] = "Yellow"; - fechoices[2] = "Orange"; - fechoices[3] = "Red"; - fechoices[4] = "Green"; - - techoices[0] = "None"; - techoices[1] = "Sepia"; - techoices[2] = "Blue"; - techoices[3] = "Purple"; - techoices[4] = "Green"; - - } - virtual std::string toString (Tag* t) { - - std::ostringstream str; - str << "FileNumber = " << t->toInt(1,SHORT) << std::endl; - str << "ShutterCount = " << t->toInt(0,LONG) << std::endl; - str << "BracketMode = " << bmchoices[t->toInt(6,SHORT)] << std::endl; - str << "BracketValue = " << t->toInt(8,SHORT) << std::endl; - str << "BracketShotNumber = " << t->toInt(10,SHORT) << std::endl; - str << "RawJpgQuality = " << rjqchoices[t->toInt(12,SHORT)] << std::endl; - str << "RawJpgSize = " << rjschoices[t->toInt(14,SHORT)] << std::endl; - str << "NoiseReduction = " << nrchoices[t->toInt(16,SHORT)] << std::endl; - str << "WBBracketMode = " << t->toInt(18,SHORT) << std::endl; - str << "WBBracketValueAB = " << t->toInt(24,SHORT) << std::endl; - str << "FilterEffect = " << fechoices[t->toInt(26,SHORT)] << std::endl; - str << "ToningEffect = " << techoices[t->toInt(30,SHORT)]; - return str.str(); - } -}; -CAFileInfoInterpreter caFileInfoInterpreter; - -class CAModelIDInterpreter : public ChoiceInterpreter { - public: - CAModelIDInterpreter () { - choices[0x1010000] = "PowerShot A30"; - choices[0x1040000] = "PowerShot S300 / Digital IXUS 300 / IXY Digital 300"; - choices[0x1060000] = "PowerShot A20"; - choices[0x1080000] = "PowerShot A10"; - choices[0x1090000] = "PowerShot S110 / Digital IXUS v / IXY Digital 200"; - choices[0x1100000] = "PowerShot G2"; - choices[0x1110000] = "PowerShot S40"; - choices[0x1120000] = "PowerShot S30"; - choices[0x1130000] = "PowerShot A40"; - choices[0x1140000] = "EOS D30"; - choices[0x1150000] = "PowerShot A100"; - choices[0x1160000] = "PowerShot S200 / Digital IXUS v2 / IXY Digital 200a"; - choices[0x1170000] = "PowerShot A200"; - choices[0x1180000] = "PowerShot S330 / Digital IXUS 330 / IXY Digital 300a"; - choices[0x1190000] = "PowerShot G3"; - choices[0x1210000] = "PowerShot S45"; - choices[0x1230000] = "PowerShot SD100 / Digital IXUS II / IXY Digital 30"; - choices[0x1240000] = "PowerShot S230 / Digital IXUS v3 / IXY Digital 320"; - choices[0x1250000] = "PowerShot A70"; - choices[0x1260000] = "PowerShot A60"; - choices[0x1270000] = "PowerShot S400 / Digital IXUS 400 / IXY Digital 400"; - choices[0x1290000] = "PowerShot G5"; - choices[0x1300000] = "PowerShot A300"; - choices[0x1310000] = "PowerShot S50"; - choices[0x1340000] = "PowerShot A80"; - choices[0x1350000] = "PowerShot SD10 / Digital IXUS i / IXY Digital L"; - choices[0x1360000] = "PowerShot S1 IS"; - choices[0x1370000] = "PowerShot Pro1"; - choices[0x1380000] = "PowerShot S70"; - choices[0x1390000] = "PowerShot S60"; - choices[0x1400000] = "PowerShot G6"; - choices[0x1410000] = "PowerShot S500 / Digital IXUS 500 / IXY Digital 500"; - choices[0x1420000] = "PowerShot A75"; - choices[0x1440000] = "PowerShot SD110 / Digital IXUS IIs / IXY Digital 30a"; - choices[0x1450000] = "PowerShot A400"; - choices[0x1470000] = "PowerShot A310"; - choices[0x1490000] = "PowerShot A85"; - choices[0x1520000] = "PowerShot S410 / Digital IXUS 430 / IXY Digital 450"; - choices[0x1530000] = "PowerShot A95"; - choices[0x1540000] = "PowerShot SD300 / Digital IXUS 40 / IXY Digital 50"; - choices[0x1550000] = "PowerShot SD200 / Digital IXUS 30 / IXY Digital 40"; - choices[0x1560000] = "PowerShot A520"; - choices[0x1570000] = "PowerShot A510"; - choices[0x1590000] = "PowerShot SD20 / Digital IXUS i5 / IXY Digital L2"; - choices[0x1640000] = "PowerShot S2 IS"; - choices[0x1650000] = "PowerShot SD430 / IXUS Wireless / IXY Wireless"; - choices[0x1660000] = "PowerShot SD500 / Digital IXUS 700 / IXY Digital 600"; - choices[0x1668000] = "EOS D60"; - choices[0x1700000] = "PowerShot SD30 / Digital IXUS i zoom / IXY Digital L3"; - choices[0x1740000] = "PowerShot A430"; - choices[0x1750000] = "PowerShot A410"; - choices[0x1760000] = "PowerShot S80"; - choices[0x1780000] = "PowerShot A620"; - choices[0x1790000] = "PowerShot A610"; - choices[0x1800000] = "PowerShot SD630 / Digital IXUS 65 / IXY Digital 80"; - choices[0x1810000] = "PowerShot SD450 / Digital IXUS 55 / IXY Digital 60"; - choices[0x1820000] = "PowerShot TX1"; - choices[0x1870000] = "PowerShot SD400 / Digital IXUS 50 / IXY Digital 55"; - choices[0x1880000] = "PowerShot A420"; - choices[0x1890000] = "PowerShot SD900 / Digital IXUS 900 Ti / IXY Digital 1000"; - choices[0x1900000] = "PowerShot SD550 / Digital IXUS 750 / IXY Digital 700"; - choices[0x1920000] = "PowerShot A700"; - choices[0x1940000] = "PowerShot SD700 IS / Digital IXUS 800 IS / IXY Digital 800 IS"; - choices[0x1950000] = "PowerShot S3 IS"; - choices[0x1960000] = "PowerShot A540"; - choices[0x1970000] = "PowerShot SD600 / Digital IXUS 60 / IXY Digital 70"; - choices[0x1980000] = "PowerShot G7"; - choices[0x1990000] = "PowerShot A530"; - choices[0x2000000] = "PowerShot SD800 IS / Digital IXUS 850 IS / IXY Digital 900 IS"; - choices[0x2010000] = "PowerShot SD40 / Digital IXUS i7 / IXY Digital L4"; - choices[0x2020000] = "PowerShot A710 IS"; - choices[0x2030000] = "PowerShot A640"; - choices[0x2040000] = "PowerShot A630"; - choices[0x2090000] = "PowerShot S5 IS"; - choices[0x2100000] = "PowerShot A460"; - choices[0x2120000] = "PowerShot SD850 IS / Digital IXUS 950 IS / IXY Digital 810 IS"; - choices[0x2130000] = "PowerShot A570 IS"; - choices[0x2140000] = "PowerShot A560"; - choices[0x2150000] = "PowerShot SD750 / Digital IXUS 75 / IXY Digital 90"; - choices[0x2160000] = "PowerShot SD1000 / Digital IXUS 70 / IXY Digital 10"; - choices[0x2180000] = "PowerShot A550"; - choices[0x2190000] = "PowerShot A450"; - choices[0x2230000] = "PowerShot G9"; - choices[0x2240000] = "PowerShot A650 IS"; - choices[0x2260000] = "PowerShot A720 IS"; - choices[0x2290000] = "PowerShot SX100 IS"; - choices[0x2300000] = "PowerShot SD950 IS / Digital IXUS 960 IS / IXY Digital 2000 IS"; - choices[0x2310000] = "PowerShot SD870 IS / Digital IXUS 860 IS / IXY Digital 910 IS"; - choices[0x3010000] = "PowerShot Pro90 IS"; - choices[0x4040000] = "PowerShot G1"; - choices[0x6040000] = "PowerShot S100 / Digital IXUS / IXY Digital"; - choices[0x4007d675] = "HV10"; - choices[0x4007d777] = "iVIS DC50"; - choices[0x4007d778] = "iVIS HV20"; - choices[0x80000001] = "EOS-1D"; - choices[0x80000167] = "EOS-1DS"; - choices[0x80000168] = "EOS 10D"; - choices[0x80000169] = "EOS-1D Mark III"; - choices[0x80000170] = "EOS Digital Rebel / 300D / Kiss Digital"; - choices[0x80000174] = "EOS-1D Mark II"; - choices[0x80000175] = "EOS 20D"; - choices[0x80000188] = "EOS-1Ds Mark II"; - choices[0x80000189] = "EOS Digital Rebel XT / 350D / Kiss Digital N"; - choices[0x80000190] = "EOS 40D"; - choices[0x80000213] = "EOS 5D"; - choices[0x80000215] = "EOS-1Ds Mark III"; - choices[0x80000232] = "EOS-1D Mark II N"; - choices[0x80000234] = "EOS 30D"; + virtual std::string toString (Tag* t) { + std::ostringstream str; + str << "MacroMode = " << machoices[t->toInt(2,SHORT)] << std::endl; + str << "Self-timer = " << t->toInt(4,SHORT) << std::endl; + str << "Quality = " << qlchoices[t->toInt(6,SHORT)] << std::endl; + str << "CanonFlashMode = " << fmchoices[t->toInt(8,SHORT)] << std::endl; + str << "ContinuousDrive = " << cdchoices[t->toInt(10,SHORT)] << std::endl; + str << "FocusMode = " << fochoices[t->toInt(14,SHORT)] << std::endl; + str << "RecordMode = " << rmchoices[t->toInt(18,SHORT)] << std::endl; + str << "CanonImageSize = " << ischoices[t->toInt(20,SHORT)] << std::endl; + str << "EasyMode = " << emchoices[t->toInt(22,SHORT)] << std::endl; + str << "DigitalZoom = " << dzchoices[t->toInt(24,SHORT)] << std::endl; + str << "Contrast = " << t->toInt(26,SHORT) << std::endl; + str << "Saturation = " << t->toInt(28,SHORT) << std::endl; + str << "Sharpness = " << t->toInt(30,SHORT) << std::endl; + str << "CameraISO = " << t->toInt(32,SHORT) << std::endl; + str << "MeteringMode = " << mmchoices[t->toInt(34,SHORT)] << std::endl; + str << "FocusRange = " << frchoices[t->toInt(36,SHORT)] << std::endl; + str << "AFPoint = " << afchoices[t->toInt(38,SHORT)] << std::endl; + str << "CanonExposureMode = " << exchoices[t->toInt(40,SHORT)] << std::endl; + str << "LensType = " << choices[t->toInt(44,SHORT)] << " (" << t->toInt(44,SHORT) << ")" << std::endl; + str << "LongFocal = " << (double)t->toInt(46,SHORT)/t->toInt(50,SHORT) << " mm" << std::endl; + str << "ShortFocal = " << (double)t->toInt(48,SHORT)/t->toInt(50,SHORT) << " mm" << std::endl; + str << "FocalUnits = " << t->toInt(50,SHORT) << std::endl; + str << "MaxAperture = " << pow (2, t->toInt(52,SHORT)/64.0) << std::endl; + str << "MinAperture = " << pow (2, t->toInt(54,SHORT)/64.0) << std::endl; + str << "FlashActivity = " << t->toInt(56,SHORT) << std::endl; + str << "FlashBits = "; + int f = t->toInt(58,SHORT); + if (f&1) + str << "Manual "; + if (f&2) + str << "TTL "; + if (f&4) + str << "A-TTL "; + if (f&8) + str << "E-TTL "; + if (f&16) + str << "FP sync enabled "; + if (f&(1<<7)) + str << "2nd-curtain sync used "; + if (f&(1<<11)) + str << "FP sync used "; + if (f&(1<<13)) + str << "Built-in "; + if (f&(1<<14)) + str << "External "; + str << std::endl; + str << "FocusContinuous = " << fcchoices[t->toInt(64,SHORT)] << std::endl; + str << "AESetting = " << aechoices[t->toInt(66,SHORT)] << std::endl; + str << "ImageStabilization = " << stchoices[t->toInt(68,SHORT)] << " (" << t->toInt(68,SHORT) << ")" << std::endl; + str << "DisplayAperture = " << t->toInt(70,SHORT) << std::endl; + str << "ZoomSourceWidth = " << t->toInt(72,SHORT) << std::endl; + str << "ZoomTargetWidth = " << t->toInt(74,SHORT) << std::endl; + str << "SpotMeteringMode = " << smchoices[t->toInt(78,SHORT)] << std::endl; + str << "PhotoEffect = " << pechoices[t->toInt(80,SHORT)] << std::endl; + str << "ManualFlashOutput = " << mfchoices[t->toInt(82,SHORT)] << std::endl; + str << "ColorTone = " << t->toInt(84,SHORT); + return str.str(); + } +}; +CACameraSettingsInterpreter caCameraSettingsInterpreter; + + +class CAProcessingInfoInterpreter : public Interpreter { + std::map tcchoices; + std::map sfchoices; + std::map wbchoices; + std::map pschoices; + public: + CAProcessingInfoInterpreter () { + tcchoices[0] = "Standard"; + tcchoices[1] = "Manual"; + tcchoices[2] = "Custom"; + sfchoices[0] = "N/A"; + sfchoices[1] = "Lowest"; + sfchoices[2] = "Low"; + sfchoices[3] = "Standard"; + sfchoices[4] = "High"; + sfchoices[5] = "Highest"; + wbchoices[0] = "Auto"; + wbchoices[1] = "Daylight"; + wbchoices[2] = "Cloudy"; + wbchoices[3] = "Tungsten"; + wbchoices[4] = "Fluorescent"; + wbchoices[5] = "Flash"; + wbchoices[6] = "Custom"; + wbchoices[7] = "Black & White"; + wbchoices[8] = "Shade"; + wbchoices[9] = "Manual Temperature (Kelvin)"; + wbchoices[10] = "PC Set1"; + wbchoices[11] = "PC Set2"; + wbchoices[12] = "PC Set3"; + wbchoices[14] = "Daylight Fluorescent"; + wbchoices[15] = "Custom 1"; + wbchoices[16] = "Custom 2"; + wbchoices[17] = "Underwater"; + pschoices[0] = "None"; + pschoices[1] = "Standard "; + pschoices[2] = "Set 1"; + pschoices[3] = "Set 2"; + pschoices[4] = "Set 3"; + pschoices[0x21] = "User Def. 1"; + pschoices[0x22] = "User Def. 2"; + pschoices[0x23] = "User Def. 3"; + pschoices[0x41] = "External 1"; + pschoices[0x42] = "External 2"; + pschoices[0x43] = "External 3"; + pschoices[0x81] = "Standard"; + pschoices[0x82] = "Portrait"; + pschoices[0x83] = "Landscape"; + pschoices[0x84] = "Neutral"; + pschoices[0x85] = "Faithful"; + pschoices[0x86] = "Monochrome"; + } + virtual std::string toString (Tag* t) { + std::ostringstream str; + str << "ToneCurve = " << tcchoices[t->toInt(2,SHORT)] << std::endl; + str << "Sharpness = " << t->toInt(4,SHORT) << std::endl; + str << "SharpnessFrequency = " << sfchoices[t->toInt(6,SHORT)] << std::endl; + str << "SensorRedLevel = " << t->toInt(8,SHORT) << std::endl; + str << "SensorBlueLevel = " << t->toInt(10,SHORT) << std::endl; + str << "WhiteBalanceRed = " << t->toInt(12,SHORT) << std::endl; + str << "WhiteBalanceBlue = " << t->toInt(14,SHORT) << std::endl; + str << "WhiteBalance = " << wbchoices[t->toInt(16,SHORT)] << std::endl; + str << "ColorTemperature = " << t->toInt(18,SHORT) << std::endl; + str << "PictureStyle = " << pschoices[t->toInt(20,SHORT)] << std::endl; + str << "DigitalGain = " << t->toInt(22,SHORT) << std::endl; + str << "WBShiftAB = " << t->toInt(24,SHORT) << std::endl; + str << "WBShiftGM = " << t->toInt(26,SHORT); + return str.str(); + } +}; +CAProcessingInfoInterpreter caProcessingInfoInterpreter; + +class CAShotInfoInterpreter : public Interpreter { + std::map sschoices; + std::map afchoices; + std::map aechoices; + std::map wbchoices; + std::map ctchoices; + std::map cmchoices; + std::map archoices; + std::map ndchoices; + public: + CAShotInfoInterpreter () { + sschoices[0] = "Off"; + sschoices[1] = "Night Scene"; + sschoices[2] = "On"; + sschoices[3] = "None"; + afchoices[0x3000] = "None (MF)"; + afchoices[0x3001] = "Right"; + afchoices[0x3002] = "Center"; + afchoices[0x3003] = "Center+Right"; + afchoices[0x3004] = "Left"; + afchoices[0x3005] = "Left+Right"; + afchoices[0x3006] = "Left+Center"; + afchoices[0x3007] = "All"; + wbchoices[0] = "Auto"; + wbchoices[1] = "Daylight"; + wbchoices[2] = "Cloudy"; + wbchoices[3] = "Tungsten"; + wbchoices[4] = "Fluorescent"; + wbchoices[5] = "Flash"; + wbchoices[6] = "Custom"; + wbchoices[7] = "Black & White"; + wbchoices[8] = "Shade"; + wbchoices[9] = "Manual Temperature (Kelvin)"; + wbchoices[10] = "PC Set1"; + wbchoices[11] = "PC Set2"; + wbchoices[12] = "PC Set3"; + wbchoices[14] = "Daylight Fluorescent"; + wbchoices[15] = "Custom 1"; + wbchoices[16] = "Custom 2"; + wbchoices[17] = "Underwater"; + aechoices[-1] = "On "; + aechoices[0] = "Off "; + aechoices[1] = "On (shot 1)"; + aechoices[2] = "On (shot 2)"; + aechoices[3] = "On (shot 3)"; + cmchoices[0] = "n/a"; + cmchoices[1] = "Camera Local Control"; + cmchoices[3] = "Computer Remote Control"; + ctchoices[248] = "EOS High-end"; + ctchoices[250] = "Compact"; + ctchoices[252] = "EOS Mid-end"; + ctchoices[255] = "DV Camera"; + ctchoices[0x23] = "User Def. 3"; + archoices[-1] = "Rotated by Software"; + archoices[0] = "None"; + archoices[1] = "Rotate 90 CW"; + archoices[2] = "Rotate 180"; + archoices[3] = "Rotate 270 CW"; + ndchoices[0] = "Off"; + ndchoices[1] = "On"; + } + virtual std::string toString (Tag* t) { + std::ostringstream str; + str << "AutoISO = " << t->toInt(2,SHORT) << std::endl; + str << "BaseISO = " << pow (2, t->toInt(4,SHORT)/32.0 - 4) * 50 << std::endl; + str << "MeasuredEV = " << t->toInt(6,SHORT) << std::endl; + str << "TargetAperture = " << pow (2, t->toInt(8,SHORT)/64.0) << std::endl; + str << "TargetExposureTime = " << pow (2, -t->toInt(10,SHORT)/32.0) << std::endl; + str << "ExposureCompensation = " << t->toInt(12,SHORT)/32.0 << std::endl; + str << "WhiteBalance = " << wbchoices[t->toInt(14,SHORT)] << std::endl; + str << "SlowShutter = " << sschoices[t->toInt(16,SHORT)] << std::endl; + str << "SequenceNumber = " << t->toInt(18,SHORT) << std::endl; + str << "OpticalZoomCode = " << t->toInt(20,SHORT) << std::endl; + str << "FlashGuideNumber = " << t->toInt(26,SHORT) << std::endl; + str << "AFPointsInFocus = " << afchoices[t->toInt(28,SHORT)] << std::endl; + str << "FlashExposureComp = " << t->toInt(30,SHORT) << std::endl; + str << "AutoExposureBracketing = " << afchoices[t->toInt(32,SHORT)] << std::endl; + str << "AEBBracketValue = " << t->toInt(34,SHORT) << std::endl; + str << "ControlMode = " << cmchoices[t->toInt(36,SHORT)] << std::endl; + str << "FocusDistanceUpper = " << t->toInt(38,SHORT) << std::endl; + str << "FocusDistanceLower = " << t->toInt(40,SHORT) << std::endl; + str << "FNumber = " << pow (2, t->toInt(42,SHORT)/64.0) << std::endl; + str << "ExposureTime = " << pow (2, -t->toInt(44,SHORT)/32.0) << std::endl; + str << "BulbDuration = " << t->toInt(48,SHORT) << std::endl; + str << "CameraType = " << ctchoices[t->toInt(52,SHORT)] << std::endl; + str << "AutoRotate = " << archoices[t->toInt(54,SHORT)] << std::endl; + str << "NDFilter = " << ndchoices[t->toInt(56,SHORT)] << std::endl; + str << "Self-timer2 = " << t->toInt(58,SHORT) << std::endl; + str << "FlashOutput = " << t->toInt(66,SHORT); + return str.str(); + } +}; +CAShotInfoInterpreter caShotInfoInterpreter; + + +class CAFileInfoInterpreter : public Interpreter { + std::map bmchoices; + std::map rjqchoices; + std::map rjschoices; + std::map nrchoices; + std::map wbchoices; + std::map fechoices; + std::map techoices; + public: + CAFileInfoInterpreter () { + bmchoices[0] = "Off"; + bmchoices[1] = "AEB"; + bmchoices[2] = "FEB"; + bmchoices[3] = "ISO"; + bmchoices[4] = "WB"; + + rjqchoices[1] = "Economy"; + rjqchoices[2] = "Normal"; + rjqchoices[3] = "Fine"; + rjqchoices[4] = "RAW"; + rjqchoices[5] = "Superfine"; + + rjschoices[0] = "Large"; + rjschoices[1] = "Medium"; + rjschoices[2] = "Small"; + rjschoices[5] = "Medium 1"; + rjschoices[6] = "Medium 2"; + rjschoices[7] = "Medium 3"; + rjschoices[8] = "Postcard"; + rjschoices[9] = "Widescreen"; + + nrchoices[0] = "Off"; + nrchoices[1] = "On (mode 1)"; + nrchoices[2] = "On (mode 2)"; + nrchoices[3] = "On (mode 3)"; + nrchoices[4] = "On (mode 4)"; + + wbchoices[0] = "Off"; + wbchoices[1] = "On (shift AB)"; + wbchoices[2] = "On (shift GM)"; + + fechoices[0] = "None"; + fechoices[1] = "Yellow"; + fechoices[2] = "Orange"; + fechoices[3] = "Red"; + fechoices[4] = "Green"; + + techoices[0] = "None"; + techoices[1] = "Sepia"; + techoices[2] = "Blue"; + techoices[3] = "Purple"; + techoices[4] = "Green"; + + } + virtual std::string toString (Tag* t) { + + std::ostringstream str; + str << "FileNumber = " << t->toInt(1,SHORT) << std::endl; + str << "ShutterCount = " << t->toInt(0,LONG) << std::endl; + str << "BracketMode = " << bmchoices[t->toInt(6,SHORT)] << std::endl; + str << "BracketValue = " << t->toInt(8,SHORT) << std::endl; + str << "BracketShotNumber = " << t->toInt(10,SHORT) << std::endl; + str << "RawJpgQuality = " << rjqchoices[t->toInt(12,SHORT)] << std::endl; + str << "RawJpgSize = " << rjschoices[t->toInt(14,SHORT)] << std::endl; + str << "NoiseReduction = " << nrchoices[t->toInt(16,SHORT)] << std::endl; + str << "WBBracketMode = " << t->toInt(18,SHORT) << std::endl; + str << "WBBracketValueAB = " << t->toInt(24,SHORT) << std::endl; + str << "FilterEffect = " << fechoices[t->toInt(26,SHORT)] << std::endl; + str << "ToningEffect = " << techoices[t->toInt(30,SHORT)]; + return str.str(); + } +}; +CAFileInfoInterpreter caFileInfoInterpreter; + +class CAModelIDInterpreter : public ChoiceInterpreter { + public: + CAModelIDInterpreter () { + choices[0x1010000] = "PowerShot A30"; + choices[0x1040000] = "PowerShot S300 / Digital IXUS 300 / IXY Digital 300"; + choices[0x1060000] = "PowerShot A20"; + choices[0x1080000] = "PowerShot A10"; + choices[0x1090000] = "PowerShot S110 / Digital IXUS v / IXY Digital 200"; + choices[0x1100000] = "PowerShot G2"; + choices[0x1110000] = "PowerShot S40"; + choices[0x1120000] = "PowerShot S30"; + choices[0x1130000] = "PowerShot A40"; + choices[0x1140000] = "EOS D30"; + choices[0x1150000] = "PowerShot A100"; + choices[0x1160000] = "PowerShot S200 / Digital IXUS v2 / IXY Digital 200a"; + choices[0x1170000] = "PowerShot A200"; + choices[0x1180000] = "PowerShot S330 / Digital IXUS 330 / IXY Digital 300a"; + choices[0x1190000] = "PowerShot G3"; + choices[0x1210000] = "PowerShot S45"; + choices[0x1230000] = "PowerShot SD100 / Digital IXUS II / IXY Digital 30"; + choices[0x1240000] = "PowerShot S230 / Digital IXUS v3 / IXY Digital 320"; + choices[0x1250000] = "PowerShot A70"; + choices[0x1260000] = "PowerShot A60"; + choices[0x1270000] = "PowerShot S400 / Digital IXUS 400 / IXY Digital 400"; + choices[0x1290000] = "PowerShot G5"; + choices[0x1300000] = "PowerShot A300"; + choices[0x1310000] = "PowerShot S50"; + choices[0x1340000] = "PowerShot A80"; + choices[0x1350000] = "PowerShot SD10 / Digital IXUS i / IXY Digital L"; + choices[0x1360000] = "PowerShot S1 IS"; + choices[0x1370000] = "PowerShot Pro1"; + choices[0x1380000] = "PowerShot S70"; + choices[0x1390000] = "PowerShot S60"; + choices[0x1400000] = "PowerShot G6"; + choices[0x1410000] = "PowerShot S500 / Digital IXUS 500 / IXY Digital 500"; + choices[0x1420000] = "PowerShot A75"; + choices[0x1440000] = "PowerShot SD110 / Digital IXUS IIs / IXY Digital 30a"; + choices[0x1450000] = "PowerShot A400"; + choices[0x1470000] = "PowerShot A310"; + choices[0x1490000] = "PowerShot A85"; + choices[0x1520000] = "PowerShot S410 / Digital IXUS 430 / IXY Digital 450"; + choices[0x1530000] = "PowerShot A95"; + choices[0x1540000] = "PowerShot SD300 / Digital IXUS 40 / IXY Digital 50"; + choices[0x1550000] = "PowerShot SD200 / Digital IXUS 30 / IXY Digital 40"; + choices[0x1560000] = "PowerShot A520"; + choices[0x1570000] = "PowerShot A510"; + choices[0x1590000] = "PowerShot SD20 / Digital IXUS i5 / IXY Digital L2"; + choices[0x1640000] = "PowerShot S2 IS"; + choices[0x1650000] = "PowerShot SD430 / IXUS Wireless / IXY Wireless"; + choices[0x1660000] = "PowerShot SD500 / Digital IXUS 700 / IXY Digital 600"; + choices[0x1668000] = "EOS D60"; + choices[0x1700000] = "PowerShot SD30 / Digital IXUS i zoom / IXY Digital L3"; + choices[0x1740000] = "PowerShot A430"; + choices[0x1750000] = "PowerShot A410"; + choices[0x1760000] = "PowerShot S80"; + choices[0x1780000] = "PowerShot A620"; + choices[0x1790000] = "PowerShot A610"; + choices[0x1800000] = "PowerShot SD630 / Digital IXUS 65 / IXY Digital 80"; + choices[0x1810000] = "PowerShot SD450 / Digital IXUS 55 / IXY Digital 60"; + choices[0x1820000] = "PowerShot TX1"; + choices[0x1870000] = "PowerShot SD400 / Digital IXUS 50 / IXY Digital 55"; + choices[0x1880000] = "PowerShot A420"; + choices[0x1890000] = "PowerShot SD900 / Digital IXUS 900 Ti / IXY Digital 1000"; + choices[0x1900000] = "PowerShot SD550 / Digital IXUS 750 / IXY Digital 700"; + choices[0x1920000] = "PowerShot A700"; + choices[0x1940000] = "PowerShot SD700 IS / Digital IXUS 800 IS / IXY Digital 800 IS"; + choices[0x1950000] = "PowerShot S3 IS"; + choices[0x1960000] = "PowerShot A540"; + choices[0x1970000] = "PowerShot SD600 / Digital IXUS 60 / IXY Digital 70"; + choices[0x1980000] = "PowerShot G7"; + choices[0x1990000] = "PowerShot A530"; + choices[0x2000000] = "PowerShot SD800 IS / Digital IXUS 850 IS / IXY Digital 900 IS"; + choices[0x2010000] = "PowerShot SD40 / Digital IXUS i7 / IXY Digital L4"; + choices[0x2020000] = "PowerShot A710 IS"; + choices[0x2030000] = "PowerShot A640"; + choices[0x2040000] = "PowerShot A630"; + choices[0x2090000] = "PowerShot S5 IS"; + choices[0x2100000] = "PowerShot A460"; + choices[0x2120000] = "PowerShot SD850 IS / Digital IXUS 950 IS / IXY Digital 810 IS"; + choices[0x2130000] = "PowerShot A570 IS"; + choices[0x2140000] = "PowerShot A560"; + choices[0x2150000] = "PowerShot SD750 / Digital IXUS 75 / IXY Digital 90"; + choices[0x2160000] = "PowerShot SD1000 / Digital IXUS 70 / IXY Digital 10"; + choices[0x2180000] = "PowerShot A550"; + choices[0x2190000] = "PowerShot A450"; + choices[0x2230000] = "PowerShot G9"; + choices[0x2240000] = "PowerShot A650 IS"; + choices[0x2260000] = "PowerShot A720 IS"; + choices[0x2290000] = "PowerShot SX100 IS"; + choices[0x2300000] = "PowerShot SD950 IS / Digital IXUS 960 IS / IXY Digital 2000 IS"; + choices[0x2310000] = "PowerShot SD870 IS / Digital IXUS 860 IS / IXY Digital 910 IS"; + choices[0x3010000] = "PowerShot Pro90 IS"; + choices[0x4040000] = "PowerShot G1"; + choices[0x6040000] = "PowerShot S100 / Digital IXUS / IXY Digital"; + choices[0x4007d675] = "HV10"; + choices[0x4007d777] = "iVIS DC50"; + choices[0x4007d778] = "iVIS HV20"; + choices[0x80000001] = "EOS-1D"; + choices[0x80000167] = "EOS-1DS"; + choices[0x80000168] = "EOS 10D"; + choices[0x80000169] = "EOS-1D Mark III"; + choices[0x80000170] = "EOS Digital Rebel / 300D / Kiss Digital"; + choices[0x80000174] = "EOS-1D Mark II"; + choices[0x80000175] = "EOS 20D"; + choices[0x80000188] = "EOS-1Ds Mark II"; + choices[0x80000189] = "EOS Digital Rebel XT / 350D / Kiss Digital N"; + choices[0x80000190] = "EOS 40D"; + choices[0x80000213] = "EOS 5D"; + choices[0x80000215] = "EOS-1Ds Mark III"; + choices[0x80000232] = "EOS-1D Mark II N"; + choices[0x80000234] = "EOS 30D"; choices[0x80000236] = "EOS Digital Rebel XTi / 400D / Kiss Digital X"; choices[0x80000254] = "EOS Rebel XS / 1000D / Kiss F"; - choices[0x80000261] = "EOS 50D"; - } -}; - -CAModelIDInterpreter caModelIDInterpreter; - - -const TagAttrib canonAttribs[] = { - 0, 1, 0, 0, 0x0001, "CanonCameraSettings", &caCameraSettingsInterpreter, - 0, 1, 0, 0, 0x0002, "CanonFocalLength", &caFocalLengthInterpreter, - 0, 1, 0, 0, 0x0003, "CanonFlashInfo", &stdInterpreter, - 0, 1, 0, 0, 0x0004, "CanonShotInfo", &caShotInfoInterpreter, - 0, 1, 0, 0, 0x0005, "CanonPanorama", &stdInterpreter, - 0, 1, 0, 0, 0x0006, "CanonImageType", &stdInterpreter, - 0, 1, 0, 0, 0x0007, "CanonFirmwareVersion", &stdInterpreter, - 0, 1, 0, 0, 0x0008, "FileNumber", &stdInterpreter, - 0, 1, 0, 0, 0x0009, "OwnerName", &stdInterpreter, - 0, 1, 0, 0, 0x000a, "ColorInfoD30", &stdInterpreter, - 0, 1, 0, 0, 0x000c, "SerialNumber", &stdInterpreter, - 0, 1, 0, 0, 0x000d, "CanonCameraInfo", &stdInterpreter, - 0, 1, 0, 0, 0x000e, "CanonFileLength", &stdInterpreter, - 0, 1, 0, 0, 0x000f, "CustomFunctions", &stdInterpreter, - 0, 1, 0, 0, 0x0010, "CanonModelID", &caModelIDInterpreter, - 0, 1, 0, 0, 0x0012, "CanonAFInfo", &stdInterpreter, - 0, 1, 0, 0, 0x0015, "SerialNumberFormat", &stdInterpreter, - 0, 1, 0, 0, 0x001c, "DateStampMode", &stdInterpreter, - 0, 1, 0, 0, 0x001d, "MyColors", &stdInterpreter, - 0, 1, 0, 0, 0x001e, "FirmwareRevision", &stdInterpreter, - 0, 3, 0, 0, 0x0024, "FaceDetect1", &stdInterpreter, - 0, 3, 0, 0, 0x0025, "FaceDetect2", &stdInterpreter, - 0, 1, 0, 0, 0x0026, "CanonAFInfo2", &stdInterpreter, - 0, 1, 0, 0, 0x0083, "OriginalDecisionData", &stdInterpreter, - 0, 1, 0, 0, 0x0090, "CustomFunctions1D", &stdInterpreter, - 0, 1, 0, 0, 0x0091, "PersonalFunctions", &stdInterpreter, - 0, 1, 0, 0, 0x0092, "PersonalFunctionValues", &stdInterpreter, - 0, 1, 0, 0, 0x0093, "CanonFileInfo", &caFileInfoInterpreter, - 0, 1, 0, 0, 0x0094, "AFPointsInFocus1D", &stdInterpreter, - 0, 1, 0, 0, 0x0095, "LensType", &stdInterpreter, - 0, 1, 0, 0, 0x0096, "InternalSerialNumber", &caIntSerNumInterpreter, - 0, 1, 0, 0, 0x0097, "DustRemovalData", &stdInterpreter, - 0, 1, 0, 0, 0x0099, "CustomFunctions2", &stdInterpreter, - 0, 1, 0, 0, 0x00a0, "ProccessingInfo", &caProcessingInfoInterpreter, - 0, 1, 0, 0, 0x00a1, "ToneCurveTable", &stdInterpreter, - 0, 1, 0, 0, 0x00a2, "SharpnessTable", &stdInterpreter, - 0, 1, 0, 0, 0x00a3, "SharpnessFreqTable", &stdInterpreter, - 0, 1, 0, 0, 0x00a4, "WhiteBalanceTable", &stdInterpreter, - 0, 1, 0, 0, 0x00a9, "ColorBalance", &stdInterpreter, - 0, 1, 0, 0, 0x00ae, "ColorTemperature", &stdInterpreter, - 0, 3, 0, 0, 0x00b0, "CanonFlags", &stdInterpreter, - 0, 1, 0, 0, 0x00b1, "ModifiedInfo", &stdInterpreter, - 0, 1, 0, 0, 0x00b2, "ToneCurveMatching", &stdInterpreter, - 0, 1, 0, 0, 0x00b3, "WhiteBalanceMatching", &stdInterpreter, - 0, 1, 0, 0, 0x00b4, "ColorSpace", &stdInterpreter, - 1, 1, 0, 0, 0x00b6, "PreviewImageInfo", &stdInterpreter, - 0, 1, 0, 0, 0x00d0, "VRDOffset", &stdInterpreter, - 0, 1, 0, 0, 0x00e0, "SensorInfo", &stdInterpreter, - 0, 1, 0, 0, 0x4001, "ColorBalance", &stdInterpreter, - 0, 1, 0, 0, 0x4002, "UnknownBlock1", &stdInterpreter, - 0, 1, 0, 0, 0x4003, "ColorInfo", &stdInterpreter, - 1, 1, 0, 0, 0x4005, "UnknownBlock2", &stdInterpreter, - 1, 1, 0, 0, 0x4008, "BlackLevel", &stdInterpreter, - -1, 0, 0, 0, 0, "", NULL}; - -}; - #endif + choices[0x80000261] = "EOS 50D"; + } +}; + +CAModelIDInterpreter caModelIDInterpreter; + + +const TagAttrib canonAttribs[] = { + 0, 1, 0, 0, 0x0001, "CanonCameraSettings", &caCameraSettingsInterpreter, + 0, 1, 0, 0, 0x0002, "CanonFocalLength", &caFocalLengthInterpreter, + 0, 1, 0, 0, 0x0003, "CanonFlashInfo", &stdInterpreter, + 0, 1, 0, 0, 0x0004, "CanonShotInfo", &caShotInfoInterpreter, + 0, 1, 0, 0, 0x0005, "CanonPanorama", &stdInterpreter, + 0, 1, 0, 0, 0x0006, "CanonImageType", &stdInterpreter, + 0, 1, 0, 0, 0x0007, "CanonFirmwareVersion", &stdInterpreter, + 0, 1, 0, 0, 0x0008, "FileNumber", &stdInterpreter, + 0, 1, 0, 0, 0x0009, "OwnerName", &stdInterpreter, + 0, 1, 0, 0, 0x000a, "ColorInfoD30", &stdInterpreter, + 0, 1, 0, 0, 0x000c, "SerialNumber", &stdInterpreter, + 0, 1, 0, 0, 0x000d, "CanonCameraInfo", &stdInterpreter, + 0, 1, 0, 0, 0x000e, "CanonFileLength", &stdInterpreter, + 0, 1, 0, 0, 0x000f, "CustomFunctions", &stdInterpreter, + 0, 1, 0, 0, 0x0010, "CanonModelID", &caModelIDInterpreter, + 0, 1, 0, 0, 0x0012, "CanonAFInfo", &stdInterpreter, + 0, 1, 0, 0, 0x0015, "SerialNumberFormat", &stdInterpreter, + 0, 1, 0, 0, 0x001c, "DateStampMode", &stdInterpreter, + 0, 1, 0, 0, 0x001d, "MyColors", &stdInterpreter, + 0, 1, 0, 0, 0x001e, "FirmwareRevision", &stdInterpreter, + 0, 3, 0, 0, 0x0024, "FaceDetect1", &stdInterpreter, + 0, 3, 0, 0, 0x0025, "FaceDetect2", &stdInterpreter, + 0, 1, 0, 0, 0x0026, "CanonAFInfo2", &stdInterpreter, + 0, 1, 0, 0, 0x0083, "OriginalDecisionData", &stdInterpreter, + 0, 1, 0, 0, 0x0090, "CustomFunctions1D", &stdInterpreter, + 0, 1, 0, 0, 0x0091, "PersonalFunctions", &stdInterpreter, + 0, 1, 0, 0, 0x0092, "PersonalFunctionValues", &stdInterpreter, + 0, 1, 0, 0, 0x0093, "CanonFileInfo", &caFileInfoInterpreter, + 0, 1, 0, 0, 0x0094, "AFPointsInFocus1D", &stdInterpreter, + 0, 1, 0, 0, 0x0095, "LensType", &stdInterpreter, + 0, 1, 0, 0, 0x0096, "InternalSerialNumber", &caIntSerNumInterpreter, + 0, 1, 0, 0, 0x0097, "DustRemovalData", &stdInterpreter, + 0, 1, 0, 0, 0x0099, "CustomFunctions2", &stdInterpreter, + 0, 1, 0, 0, 0x00a0, "ProccessingInfo", &caProcessingInfoInterpreter, + 0, 1, 0, 0, 0x00a1, "ToneCurveTable", &stdInterpreter, + 0, 1, 0, 0, 0x00a2, "SharpnessTable", &stdInterpreter, + 0, 1, 0, 0, 0x00a3, "SharpnessFreqTable", &stdInterpreter, + 0, 1, 0, 0, 0x00a4, "WhiteBalanceTable", &stdInterpreter, + 0, 1, 0, 0, 0x00a9, "ColorBalance", &stdInterpreter, + 0, 1, 0, 0, 0x00ae, "ColorTemperature", &stdInterpreter, + 0, 3, 0, 0, 0x00b0, "CanonFlags", &stdInterpreter, + 0, 1, 0, 0, 0x00b1, "ModifiedInfo", &stdInterpreter, + 0, 1, 0, 0, 0x00b2, "ToneCurveMatching", &stdInterpreter, + 0, 1, 0, 0, 0x00b3, "WhiteBalanceMatching", &stdInterpreter, + 0, 1, 0, 0, 0x00b4, "ColorSpace", &stdInterpreter, + 1, 1, 0, 0, 0x00b6, "PreviewImageInfo", &stdInterpreter, + 0, 1, 0, 0, 0x00d0, "VRDOffset", &stdInterpreter, + 0, 1, 0, 0, 0x00e0, "SensorInfo", &stdInterpreter, + 0, 1, 0, 0, 0x4001, "ColorBalance", &stdInterpreter, + 0, 1, 0, 0, 0x4002, "UnknownBlock1", &stdInterpreter, + 0, 1, 0, 0, 0x4003, "ColorInfo", &stdInterpreter, + 1, 1, 0, 0, 0x4005, "UnknownBlock2", &stdInterpreter, + 1, 1, 0, 0, 0x4008, "BlackLevel", &stdInterpreter, + -1, 0, 0, 0, 0, "", NULL}; + +}; +#endif diff --git a/rtexif/fujiattribs.cc b/rtexif/fujiattribs.cc index 9f946dd03..1dbedb984 100644 --- a/rtexif/fujiattribs.cc +++ b/rtexif/fujiattribs.cc @@ -1,263 +1,263 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _FUJIATTRIBS_ -#define _FUJIATTRIBS_ - -#include -#include -#include -#include -#include -#include - -namespace rtexif { - -class FAOnOffInterpreter : public ChoiceInterpreter { - public: - FAOnOffInterpreter () { - choices[0] = "Off"; - choices[1] = "On"; - } -}; -FAOnOffInterpreter faOnOffInterpreter; - -class FASharpnessInterpreter : public ChoiceInterpreter { - public: - FASharpnessInterpreter () { - choices[1] = "Soft"; - choices[2] = "Soft2"; - choices[3] = "Normal"; - choices[4] = "Hard"; - choices[5] = "Hard2"; - choices[0x82] = "Medium Soft"; - choices[0x84] = "Medium Hard"; - choices[0x8000] = "Film Simulation"; - choices[0xffff] = "n/a"; - } -}; -FASharpnessInterpreter faSharpnessInterpreter; - -class FAWhiteBalanceInterpreter : public ChoiceInterpreter { - public: - FAWhiteBalanceInterpreter () { - choices[0] = "Auto"; - choices[0x100] = "Daylight"; - choices[0x200] = "Cloudy"; - choices[0x300] = "Daylight Fluorescent"; - choices[0x301] = "Day White Fluorescent"; - choices[0x302] = "White Fluorescent"; - choices[0x303] = "Warm White Fluorescent"; - choices[0x304] = "Living Room Warm White Fluorescent"; - choices[0x400] = "Incandescent"; - choices[0x500] = "Flash"; - choices[0xf00] = "Custom"; - choices[0xf01] = "Custom2"; - choices[0xf02] = "Custom3"; - choices[0xf03] = "Custom4"; - choices[0xf04] = "Custom5"; - choices[0xff0] = "Kelvin"; - } -}; -FAWhiteBalanceInterpreter faWhiteBalanceInterpreter; - -class FASaturationInterpreter : public ChoiceInterpreter { - public: - FASaturationInterpreter () { - choices[0] = "Normal"; - choices[0x80] = "Medium High"; - choices[0x100] = "High"; - choices[0x180] = "Medium Low"; - choices[0x200] = "Low"; - choices[0x300] = "None (B&W)"; - choices[0x8000] = "Film Simulation"; - } -}; -FASaturationInterpreter faSaturationInterpreter; - -class FAContrastInterpreter : public ChoiceInterpreter { - public: - FAContrastInterpreter () { - choices[0] = "Normal"; - choices[0x80] = "Medium High"; - choices[0x100] = "High"; - choices[0x180] = "Medium Low"; - choices[0x200] = "Low"; - choices[0x8000] = "Film Simulation"; - } -}; -FAContrastInterpreter faContrastInterpreter; - -class FAContrast2Interpreter : public ChoiceInterpreter { - public: - FAContrast2Interpreter () { - choices[0] = "Normal"; - choices[0x100] = "High"; - choices[0x300] = "Low"; - } -}; -FAContrast2Interpreter faContrast2Interpreter; - -class FANoiseReductionInterpreter : public ChoiceInterpreter { - public: - FANoiseReductionInterpreter () { - choices[0x40] = "Low"; - choices[0x80] = "Normal"; - } -}; -FANoiseReductionInterpreter faNoiseReductionInterpreter; - -class FAFlashInterpreter : public ChoiceInterpreter { - public: - FAFlashInterpreter () { - choices[0] = "Auto"; - choices[1] = "On"; - choices[2] = "Off"; - choices[3] = "Red-eye reduction"; - choices[4] = "External"; - } -}; -FAFlashInterpreter faFlashInterpreter; - -class FAFocusModeInterpreter : public ChoiceInterpreter { - public: - FAFocusModeInterpreter () { - choices[0] = "Auto"; - choices[1] = "Manual"; - } -}; -FAFocusModeInterpreter faFocusModeInterpreter; - -class FAColorModeInterpreter : public ChoiceInterpreter { - public: - FAColorModeInterpreter () { - choices[0] = "Standard"; - choices[0x10] = "Chrome"; - choices[0x30] = "B & W"; - } -}; -FAColorModeInterpreter faColorModeInterpreter; - -class FADynamicRangeInterpreter : public ChoiceInterpreter { - public: - FADynamicRangeInterpreter () { - choices[1] = "Standard"; - choices[3] = "Wide"; - } -}; -FADynamicRangeInterpreter faDynamicRangeInterpreter; - -class FAFilmModeInterpreter : public ChoiceInterpreter { - public: - FAFilmModeInterpreter () { - choices[0] = "F0/Standard"; - choices[0x100] = "F1/Studio Portrait"; - choices[0x110] = "F1a/Studio Portrait Enhanced Saturation"; - choices[0x120] = "F1b/Studio Portrait Smooth Skin Tone"; - choices[0x130] = "F1c/Studio Portrait Increased Sharpness "; - choices[0x200] = "F2/Fujichrome"; - choices[0x300] = "F3/Studio Portrait Ex"; - choices[0x400] = "F4/Velvia"; - } -}; -FAFilmModeInterpreter faFilmModeInterpreter; - -class FADRSettingInterpreter : public ChoiceInterpreter { - public: - FADRSettingInterpreter () { - choices[0] = "Auto (100-400%)"; - choices[0x1] = "RAW"; - choices[0x100] = "Standard (100%)"; - choices[0x200] = "Wide1 (230%)"; - choices[0x201] = "Wide2 (400%)"; - choices[0x8000] = "Film Simulation"; - } -}; -FADRSettingInterpreter faDRSettingInterpreter; - -class FAPictureModeInterpreter : public ChoiceInterpreter { - public: - FAPictureModeInterpreter () { - choices[0] = "Auto"; - choices[1] = "Portrait"; - choices[2] = "Landscape"; - choices[3] = "Macro"; - choices[4] = "Sports"; - choices[5] = "Night Scene"; - choices[6] = "Program AE"; - choices[7] = "Natural Light"; - choices[8] = "Anti-blur"; - choices[9] = "Beach & Snow"; - choices[10] = "Sunset"; - choices[11] = "Museum"; - choices[12] = "Party"; - choices[13] = "Flower"; - choices[14] = "Text"; - choices[15] = "Natural Light & Flash"; - choices[16] = "Beach"; - choices[17] = "Fireworks"; - choices[18] = "Underwater"; - choices[0x100] = "Aperture-priority AE"; - choices[0x200] = "Shutter speed priority AE"; - choices[0x300] = "Manual"; - } -}; -FAPictureModeInterpreter faPictureModeInterpreter; - - - -const TagAttrib fujiAttribs[] = { - 0, 1, 0, 0, 0x0000, "Version", &stdInterpreter, - 0, 1, 0, 0, 0x0010, "InternalSerialNumber", &stdInterpreter, - 0, 1, 0, 0, 0x1000, "Quality", &stdInterpreter, - 0, 1, 0, 0, 0x1001, "Sharpness", &faSharpnessInterpreter, - 0, 1, 0, 0, 0x1002, "WhiteBalance", &faWhiteBalanceInterpreter, - 0, 1, 0, 0, 0x1003, "Saturation", &faSaturationInterpreter, - 0, 1, 0, 0, 0x1004, "Contrast", &faContrastInterpreter, - 0, 1, 0, 0, 0x1005, "ColorTemperature", &stdInterpreter, - 0, 1, 0, 0, 0x1006, "Contrast2", &faContrast2Interpreter, - 0, 1, 0, 0, 0x100a, "WhiteBalanceFineTune", &stdInterpreter, - 0, 1, 0, 0, 0x100b, "NoiseReduction", &faNoiseReductionInterpreter, - 0, 1, 0, 0, 0x100b, "FujiFlashMode", &faFlashInterpreter, - 0, 1, 0, 0, 0x1011, "FlashExposureComp", &stdInterpreter, - 0, 1, 0, 0, 0x1020, "Macro", &faOnOffInterpreter, - 0, 1, 0, 0, 0x1021, "FocusMode", &faFocusModeInterpreter, - 0, 1, 0, 0, 0x1023, "FocusPixel", &stdInterpreter, - 0, 1, 0, 0, 0x1030, "SlowSync", &faOnOffInterpreter, - 0, 1, 0, 0, 0x1031, "PictureMode", &faPictureModeInterpreter, - 0, 1, 0, 0, 0x1100, "AutoBracketing", &faOnOffInterpreter, - 0, 1, 0, 0, 0x1101, "SequenceNumber", &stdInterpreter, - 0, 1, 0, 0, 0x1210, "ColorMode", &faColorModeInterpreter, - 0, 1, 0, 0, 0x1300, "BlurWarning", &faOnOffInterpreter, - 0, 1, 0, 0, 0x1301, "FocusWarning", &faOnOffInterpreter, - 0, 1, 0, 0, 0x1302, "ExposureWarning", &faOnOffInterpreter, - 0, 1, 0, 0, 0x1400, "DynamicRange", &faDynamicRangeInterpreter, - 0, 1, 0, 0, 0x1401, "FilmMode", &faFilmModeInterpreter, - 0, 1, 0, 0, 0x1402, "DynamicRangeSetting", &faDRSettingInterpreter, - 0, 1, 0, 0, 0x1403, "DevelopmentDynamicRange", &stdInterpreter, - 0, 1, 0, 0, 0x1404, "MinFocalLength", &stdInterpreter, - 0, 1, 0, 0, 0x1405, "MaxFocalLength", &stdInterpreter, - 0, 1, 0, 0, 0x1406, "MaxApertureAtMinFocal", &stdInterpreter, - 0, 1, 0, 0, 0x1407, "MaxApertureAtMaxFocal", &stdInterpreter, - 0, 1, 0, 0, 0x8000, "FileSource", &stdInterpreter, - 0, 1, 0, 0, 0x8002, "OrderNumber", &stdInterpreter, - 0, 1, 0, 0, 0x8003, "FrameNumber", &stdInterpreter, - -1, 0, 0, 0, 0, "", NULL}; -}; - #endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _FUJIATTRIBS_ +#define _FUJIATTRIBS_ + +#include +#include +#include +#include +#include +#include + +namespace rtexif { + +class FAOnOffInterpreter : public ChoiceInterpreter { + public: + FAOnOffInterpreter () { + choices[0] = "Off"; + choices[1] = "On"; + } +}; +FAOnOffInterpreter faOnOffInterpreter; + +class FASharpnessInterpreter : public ChoiceInterpreter { + public: + FASharpnessInterpreter () { + choices[1] = "Soft"; + choices[2] = "Soft2"; + choices[3] = "Normal"; + choices[4] = "Hard"; + choices[5] = "Hard2"; + choices[0x82] = "Medium Soft"; + choices[0x84] = "Medium Hard"; + choices[0x8000] = "Film Simulation"; + choices[0xffff] = "n/a"; + } +}; +FASharpnessInterpreter faSharpnessInterpreter; + +class FAWhiteBalanceInterpreter : public ChoiceInterpreter { + public: + FAWhiteBalanceInterpreter () { + choices[0] = "Auto"; + choices[0x100] = "Daylight"; + choices[0x200] = "Cloudy"; + choices[0x300] = "Daylight Fluorescent"; + choices[0x301] = "Day White Fluorescent"; + choices[0x302] = "White Fluorescent"; + choices[0x303] = "Warm White Fluorescent"; + choices[0x304] = "Living Room Warm White Fluorescent"; + choices[0x400] = "Incandescent"; + choices[0x500] = "Flash"; + choices[0xf00] = "Custom"; + choices[0xf01] = "Custom2"; + choices[0xf02] = "Custom3"; + choices[0xf03] = "Custom4"; + choices[0xf04] = "Custom5"; + choices[0xff0] = "Kelvin"; + } +}; +FAWhiteBalanceInterpreter faWhiteBalanceInterpreter; + +class FASaturationInterpreter : public ChoiceInterpreter { + public: + FASaturationInterpreter () { + choices[0] = "Normal"; + choices[0x80] = "Medium High"; + choices[0x100] = "High"; + choices[0x180] = "Medium Low"; + choices[0x200] = "Low"; + choices[0x300] = "None (B&W)"; + choices[0x8000] = "Film Simulation"; + } +}; +FASaturationInterpreter faSaturationInterpreter; + +class FAContrastInterpreter : public ChoiceInterpreter { + public: + FAContrastInterpreter () { + choices[0] = "Normal"; + choices[0x80] = "Medium High"; + choices[0x100] = "High"; + choices[0x180] = "Medium Low"; + choices[0x200] = "Low"; + choices[0x8000] = "Film Simulation"; + } +}; +FAContrastInterpreter faContrastInterpreter; + +class FAContrast2Interpreter : public ChoiceInterpreter { + public: + FAContrast2Interpreter () { + choices[0] = "Normal"; + choices[0x100] = "High"; + choices[0x300] = "Low"; + } +}; +FAContrast2Interpreter faContrast2Interpreter; + +class FANoiseReductionInterpreter : public ChoiceInterpreter { + public: + FANoiseReductionInterpreter () { + choices[0x40] = "Low"; + choices[0x80] = "Normal"; + } +}; +FANoiseReductionInterpreter faNoiseReductionInterpreter; + +class FAFlashInterpreter : public ChoiceInterpreter { + public: + FAFlashInterpreter () { + choices[0] = "Auto"; + choices[1] = "On"; + choices[2] = "Off"; + choices[3] = "Red-eye reduction"; + choices[4] = "External"; + } +}; +FAFlashInterpreter faFlashInterpreter; + +class FAFocusModeInterpreter : public ChoiceInterpreter { + public: + FAFocusModeInterpreter () { + choices[0] = "Auto"; + choices[1] = "Manual"; + } +}; +FAFocusModeInterpreter faFocusModeInterpreter; + +class FAColorModeInterpreter : public ChoiceInterpreter { + public: + FAColorModeInterpreter () { + choices[0] = "Standard"; + choices[0x10] = "Chrome"; + choices[0x30] = "B & W"; + } +}; +FAColorModeInterpreter faColorModeInterpreter; + +class FADynamicRangeInterpreter : public ChoiceInterpreter { + public: + FADynamicRangeInterpreter () { + choices[1] = "Standard"; + choices[3] = "Wide"; + } +}; +FADynamicRangeInterpreter faDynamicRangeInterpreter; + +class FAFilmModeInterpreter : public ChoiceInterpreter { + public: + FAFilmModeInterpreter () { + choices[0] = "F0/Standard"; + choices[0x100] = "F1/Studio Portrait"; + choices[0x110] = "F1a/Studio Portrait Enhanced Saturation"; + choices[0x120] = "F1b/Studio Portrait Smooth Skin Tone"; + choices[0x130] = "F1c/Studio Portrait Increased Sharpness "; + choices[0x200] = "F2/Fujichrome"; + choices[0x300] = "F3/Studio Portrait Ex"; + choices[0x400] = "F4/Velvia"; + } +}; +FAFilmModeInterpreter faFilmModeInterpreter; + +class FADRSettingInterpreter : public ChoiceInterpreter { + public: + FADRSettingInterpreter () { + choices[0] = "Auto (100-400%)"; + choices[0x1] = "RAW"; + choices[0x100] = "Standard (100%)"; + choices[0x200] = "Wide1 (230%)"; + choices[0x201] = "Wide2 (400%)"; + choices[0x8000] = "Film Simulation"; + } +}; +FADRSettingInterpreter faDRSettingInterpreter; + +class FAPictureModeInterpreter : public ChoiceInterpreter { + public: + FAPictureModeInterpreter () { + choices[0] = "Auto"; + choices[1] = "Portrait"; + choices[2] = "Landscape"; + choices[3] = "Macro"; + choices[4] = "Sports"; + choices[5] = "Night Scene"; + choices[6] = "Program AE"; + choices[7] = "Natural Light"; + choices[8] = "Anti-blur"; + choices[9] = "Beach & Snow"; + choices[10] = "Sunset"; + choices[11] = "Museum"; + choices[12] = "Party"; + choices[13] = "Flower"; + choices[14] = "Text"; + choices[15] = "Natural Light & Flash"; + choices[16] = "Beach"; + choices[17] = "Fireworks"; + choices[18] = "Underwater"; + choices[0x100] = "Aperture-priority AE"; + choices[0x200] = "Shutter speed priority AE"; + choices[0x300] = "Manual"; + } +}; +FAPictureModeInterpreter faPictureModeInterpreter; + + + +const TagAttrib fujiAttribs[] = { + 0, 1, 0, 0, 0x0000, "Version", &stdInterpreter, + 0, 1, 0, 0, 0x0010, "InternalSerialNumber", &stdInterpreter, + 0, 1, 0, 0, 0x1000, "Quality", &stdInterpreter, + 0, 1, 0, 0, 0x1001, "Sharpness", &faSharpnessInterpreter, + 0, 1, 0, 0, 0x1002, "WhiteBalance", &faWhiteBalanceInterpreter, + 0, 1, 0, 0, 0x1003, "Saturation", &faSaturationInterpreter, + 0, 1, 0, 0, 0x1004, "Contrast", &faContrastInterpreter, + 0, 1, 0, 0, 0x1005, "ColorTemperature", &stdInterpreter, + 0, 1, 0, 0, 0x1006, "Contrast2", &faContrast2Interpreter, + 0, 1, 0, 0, 0x100a, "WhiteBalanceFineTune", &stdInterpreter, + 0, 1, 0, 0, 0x100b, "NoiseReduction", &faNoiseReductionInterpreter, + 0, 1, 0, 0, 0x100b, "FujiFlashMode", &faFlashInterpreter, + 0, 1, 0, 0, 0x1011, "FlashExposureComp", &stdInterpreter, + 0, 1, 0, 0, 0x1020, "Macro", &faOnOffInterpreter, + 0, 1, 0, 0, 0x1021, "FocusMode", &faFocusModeInterpreter, + 0, 1, 0, 0, 0x1023, "FocusPixel", &stdInterpreter, + 0, 1, 0, 0, 0x1030, "SlowSync", &faOnOffInterpreter, + 0, 1, 0, 0, 0x1031, "PictureMode", &faPictureModeInterpreter, + 0, 1, 0, 0, 0x1100, "AutoBracketing", &faOnOffInterpreter, + 0, 1, 0, 0, 0x1101, "SequenceNumber", &stdInterpreter, + 0, 1, 0, 0, 0x1210, "ColorMode", &faColorModeInterpreter, + 0, 1, 0, 0, 0x1300, "BlurWarning", &faOnOffInterpreter, + 0, 1, 0, 0, 0x1301, "FocusWarning", &faOnOffInterpreter, + 0, 1, 0, 0, 0x1302, "ExposureWarning", &faOnOffInterpreter, + 0, 1, 0, 0, 0x1400, "DynamicRange", &faDynamicRangeInterpreter, + 0, 1, 0, 0, 0x1401, "FilmMode", &faFilmModeInterpreter, + 0, 1, 0, 0, 0x1402, "DynamicRangeSetting", &faDRSettingInterpreter, + 0, 1, 0, 0, 0x1403, "DevelopmentDynamicRange", &stdInterpreter, + 0, 1, 0, 0, 0x1404, "MinFocalLength", &stdInterpreter, + 0, 1, 0, 0, 0x1405, "MaxFocalLength", &stdInterpreter, + 0, 1, 0, 0, 0x1406, "MaxApertureAtMinFocal", &stdInterpreter, + 0, 1, 0, 0, 0x1407, "MaxApertureAtMaxFocal", &stdInterpreter, + 0, 1, 0, 0, 0x8000, "FileSource", &stdInterpreter, + 0, 1, 0, 0, 0x8002, "OrderNumber", &stdInterpreter, + 0, 1, 0, 0, 0x8003, "FrameNumber", &stdInterpreter, + -1, 0, 0, 0, 0, "", NULL}; +}; +#endif diff --git a/rtexif/nikonattribs.cc b/rtexif/nikonattribs.cc index 905089714..43760590a 100644 --- a/rtexif/nikonattribs.cc +++ b/rtexif/nikonattribs.cc @@ -1,718 +1,718 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _NIKONATTRIBS_ -#define _NIKONATTRIBS_ - -#include -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _NIKONATTRIBS_ +#define _NIKONATTRIBS_ + +#include +#include +#include #include -#include +#include #include #include - -namespace rtexif { - -class NAISOInterpreter : public Interpreter { - public: - NAISOInterpreter () {} - virtual std::string toString (Tag* t) { - sprintf (buffer, "%d", t->toInt(2)); - return buffer; - } -}; -NAISOInterpreter naISOInterpreter; - -class NALensTypeInterpreter : public Interpreter { - public: - NALensTypeInterpreter () {} - virtual std::string toString (Tag* t) { - int a = t->toInt(); - std::ostringstream str; - str << "MF = " << (a&1 ? "Yes" : "No") << std::endl; - str << "D = " << (a&2 ? "Yes" : "No") << std::endl; - str << "G = " << (a&4 ? "Yes" : "No") << std::endl; - str << "VR = " << (a&8 ? "Yes" : "No"); - return str.str(); - } -}; -NALensTypeInterpreter naLensTypeInterpreter; - -class NAFlashModeInterpreter : public ChoiceInterpreter { - public: - NAFlashModeInterpreter () { - choices[0] = "Did Not Fire"; - choices[1] = "Fired, Manual"; - choices[7] = "Fired, External"; - choices[8] = "Fired, Commander Mode"; - choices[9] = "Fired, TTL Mode"; - } -}; -NAFlashModeInterpreter naFlashModeInterpreter; - -class NAHiISONRInterpreter : public ChoiceInterpreter { - public: - NAHiISONRInterpreter () { - choices[0] = "Off"; - choices[1] = "Minimal"; - choices[2] = "Low"; - choices[4] = "Normal"; - choices[6] = "High"; - } -}; -NAHiISONRInterpreter naHiISONRInterpreter; - -class NAShootingModeInterpreter : public Interpreter { - public: - NAShootingModeInterpreter () {} - virtual std::string toString (Tag* t) { - int a = t->toInt(); - std::ostringstream str; - str << "Continuous = " << (a&1 ? "Yes" : "No") << std::endl; - str << "Delay = " << (a&2 ? "Yes" : "No") << std::endl; - str << "PC Control = " << (a&4 ? "Yes" : "No") << std::endl; - str << "Exposure Bracketing = " << (a&8 ? "Yes" : "No") << std::endl; - str << "Auto ISO = " << (a&16 ? "Yes" : "No") << std::endl; - str << "White-Balance Bracketing = " << (a&32 ? "Yes" : "No") << std::endl; - str << "IR Control = " << (a&64 ? "Yes" : "No"); - return str.str(); - } -}; -NAShootingModeInterpreter naShootingModeInterpreter; - -class NAAFInfoInterpreter : public Interpreter { - std::map amchoices; - std::map afpchoices; - public: - NAAFInfoInterpreter () { - amchoices[0] = "Single Area"; - amchoices[1] = "Dynamic Area"; - amchoices[2] = "Dynamic Area, Closest Subject"; - amchoices[3] = "Group Dynamic"; - amchoices[4] = "Single Area (wide)"; - amchoices[5] = "Dynamic Area (wide)"; - afpchoices[0] = "Center"; - afpchoices[1] = "Top"; - afpchoices[2] = "Bottom"; - afpchoices[3] = "Left"; - afpchoices[4] = "Right"; - afpchoices[5] = "Upper-left"; - afpchoices[6] = "Upper-right"; - afpchoices[7] = "Lower-left"; - afpchoices[8] = "Lower-right"; - afpchoices[9] = "Far Left"; - afpchoices[10] = "Far Right"; - } - virtual std::string toString (Tag* t) { - int am = t->toInt (0, BYTE); - int afp = t->toInt (1, BYTE); - int aff = t->toInt (2, SHORT); - std::ostringstream str; - str << "AFAreaMode = " << amchoices[am] << std::endl; - str << "AFAreaMode = " << afpchoices[afp] << std::endl; - - std::ostringstream af; - if (aff&1) - if (af.str()=="") af << "Center"; - else af << ", Center"; - else if (aff&2) - if (af.str()=="") af << "Top"; - else af << ", Top"; - else if (aff&4) - if (af.str()=="") af << "Bottom"; - else af << ", Bottom"; - else if (aff&8) - if (af.str()=="") af << "Left"; - else af << ", Left"; - else if (aff&16) - if (af.str()=="") af << "Right"; - else af << ", Right"; - else if (aff&32) - if (af.str()=="") af << "Upper-left"; - else af << ", Upper-left"; - else if (aff&64) - if (af.str()=="") af << "Upper-right"; - else af << ", Upper-right"; - else if (aff&128) - if (af.str()=="") af << " Lower-left"; - else af << ", Lower-left"; - else if (aff&256) - if (af.str()=="") af << "Lower-right"; - else af << ", Lower-right"; - else if (aff&512) - if (af.str()=="") af << "Far Left"; - else af << ", Far Left"; - else if (aff&1024) - if (af.str()=="") af << "Far Right"; - else af << ", Far Right"; - - str << "AFPointsInFocus = " << af.str(); - return str.str(); - } -}; -NAAFInfoInterpreter naAFInfoInterpreter; - -class NALensDataInterpreter : public Interpreter { - std::map lenses; - public: - NALensDataInterpreter () { - lenses["00 00 00 00 00 00 00 01"] = "Manual Lens No CPU "; - lenses["00 00 00 00 00 00 E1 12"] = "TC-17E II "; - lenses["00 00 00 00 00 00 F1 0C"] = "TC-14E [II] or Sigma APO Tele Converter 1.4x EX DG or Kenko Teleplus PRO 300 DG 1.4x"; - lenses["00 00 00 00 00 00 F2 18"] = "TC-20E [II] or Sigma APO Tele Converter 2x EX DG or Kenko Teleplus PRO 300 DG 2.0x"; - lenses["00 36 1C 2D 34 3C 00 06"] = "Tamron SP AF11-18mm f/4.5-5.6 Di II LD Aspherical (IF)"; - lenses["00 3C 1F 37 30 30 00 06"] = "Tokina AT-X 124 AF PRO DX - AF 12-24mm F4"; - lenses["00 3E 80 A0 38 3F 00 02"] = "Tamron SP AF200-500mm f/5-6.3 Di LD (IF)"; - lenses["00 3F 2D 80 2B 40 00 06"] = "Tamron AF18-200mm f/3.5-6.3 XR Di II LD Aspherical (IF)"; - lenses["00 3F 2D 80 2C 40 00 06"] = "Tamron AF18-200mm f/3.5-6.3 XR Di II LD Aspherical (IF) Macro"; - lenses["00 3F 80 A0 38 3F 00 02"] = "Tamron SP AF200-500mm f/5-6.3 Di"; - lenses["00 40 18 2B 2C 34 00 06"] = "Tokina AT-X 107 DX Fish-Eye - AF 10-17mm F3.5-4.5"; - lenses["00 40 2A 72 2C 3C 00 06"] = "Tokina AT-X 16.5-135 DX (AF 16.5-135mm F3.5-5.6)"; - lenses["00 40 2B 2B 2C 2C 00 02"] = "Tokina AT-X 17 AF PRO - AF 17mm F3.5"; - lenses["00 40 2D 80 2C 40 00 06"] = "Tamron AF 18-200mm f/3.5-6.3 XR Di II LD Aspherical (IF) Macro (A14NII)"; - lenses["00 40 2D 88 2C 40 00 06"] = "Tamron AF 18-250mm f/3.5-6.3 Di II LD Aspherical (IF) Macro (A18NII)"; - lenses["00 40 2D 88 2C 40 62 06"] = "Tamron AF 18-250mm f/3.5-6.3 Di II LD Aspherical (IF) Macro (A18)"; - lenses["00 40 31 31 2C 2C 00 00"] = "Voigtlander Color Skopar 20mm F3.5 SLII Aspherical"; - lenses["00 44 60 98 34 3C 00 02"] = "Tokina AT-X 840D 80-400mm F4.5-5.6"; - lenses["00 47 10 10 24 24 00 00"] = "Fisheye Nikkor 8mm f/2.8 AiS"; - lenses["00 47 44 44 24 24 00 06"] = "Tokina AT-X M35 PRO DX (AF 35mm f/2.8 Macro)"; - lenses["00 47 53 80 30 3C 00 06"] = "Tamron AF55-200mm f/4-5.6 Di II LD"; - lenses["00 48 1C 29 24 24 00 06"] = "Tokina AT-X 116 PRO DX (AF 11-16mm f/2.8)"; - lenses["00 48 29 50 24 24 00 06"] = "Tokina AT-X 165 PRO DX - AF 16-50mm F2.8"; - lenses["00 48 3C 60 24 24 00 02"] = "Tokina AT-X 280 AF PRO 28-80mm F2.8 Aspherical"; - lenses["00 48 3C 6A 24 24 00 02"] = "Tamron SP AF28-105mm f/2.8"; - lenses["00 48 50 50 18 18 00 00"] = "Nikkor H 50mm f/2"; - lenses["00 48 50 72 24 24 00 06"] = "Tokina AT-X 535 PRO DX - AF 50-135mm F2.8"; - lenses["00 48 5C 8E 30 3C 00 06"] = "Tamron AF 70-300mm f/4-5.6 Di LD Macro 1:2 (A17)"; - lenses["00 48 68 68 24 24 00 00"] = "Series E 100mm f/2.8"; - lenses["00 48 80 80 30 30 00 00"] = "Nikkor 200mm f/4 AiS"; - lenses["00 49 30 48 22 2B 00 02"] = "Tamron SP AF20-40mm f/2.7-3.5"; - lenses["00 4C 6A 6A 20 20 00 00"] = "Nikkor 105mm f/2.5 AiS"; - lenses["00 4C 7C 7C 2C 2C 00 02"] = "Tamron SP AF180mm f/3.5 Di Model B01"; - lenses["00 53 2B 50 24 24 00 06"] = "Tamron SP AF17-50mm f/2.8 (A16)"; - lenses["00 54 2B 50 24 24 00 06"] = "Tamron SP AF 17-50mm f/2.8 XR Di II LD Aspherical (IF) (A16NII)"; - lenses["00 54 44 44 0C 0C 00 00"] = "Nikkor 35mm f/1.4 AiS"; - lenses["00 54 48 48 18 18 00 00"] = "Voigtlander Ultron 40mm F2 SLII Aspherical"; - lenses["00 54 55 55 0C 0C 00 00"] = "Voigtlander Nokton 58mm F1.4 SLII"; - lenses["00 54 56 56 30 30 00 00"] = "Coastal Optical Systems 60mm 1:4 UV-VIS-IR Macro Apo"; - lenses["00 54 68 68 24 24 00 02"] = "Tokina AT-X M100 PRO D - 100mm F2.8"; - lenses["00 54 8E 8E 24 24 00 02"] = "Tokina AT-X 300 AF PRO 300mm F2.8"; - lenses["01 00 00 00 00 00 02 00"] = "AF Teleconverter TC-16A 1.6x"; - lenses["01 00 00 00 00 00 08 00"] = "AF Teleconverter TC-16A 1.6x"; - lenses["01 58 50 50 14 14 02 00"] = "AF Nikkor 50mm f/1.8"; - lenses["02 2F 98 98 3D 3D 02 00"] = "Sigma 400mm F5.6 APO"; - lenses["02 37 5E 8E 35 3D 02 00"] = "Sigma 75-300mm F4.5-5.6 APO"; - lenses["02 37 A0 A0 34 34 02 00"] = "Sigma APO 500mm F4.5"; - lenses["02 3A 5E 8E 32 3D 02 00"] = "Sigma 75-300mm F4.0-5.6"; - lenses["02 3B 44 61 30 3D 02 00"] = "Sigma 35-80mm F4-5.6"; - lenses["02 3F 24 24 2C 2C 02 00"] = "Sigma 14mm F3.5"; - lenses["02 3F 3C 5C 2D 35 02 00"] = "Sigma 28-70mm F3.5-4.5 UC"; - lenses["02 40 44 73 2B 36 02 00"] = "Sigma 35-135mm F3.5-4.5 a"; - lenses["02 42 44 5C 2A 34 02 00"] = "AF Zoom-Nikkor 35-70mm f/3.3-4.5"; - lenses["02 42 44 5C 2A 34 08 00"] = "AF Zoom-Nikkor 35-70mm f/3.3-4.5"; - lenses["02 46 37 37 25 25 02 00"] = "Sigma 24mm F2.8 Macro"; - lenses["02 46 3C 5C 25 25 02 00"] = "Sigma 28-70mm F2.8"; - lenses["02 46 5C 82 25 25 02 00"] = "Sigma 70-210mm F2.8 APO"; - lenses["02 48 65 65 24 24 02 00"] = "Sigma 90mm F2.8 Macro"; - lenses["03 43 5C 81 35 35 02 00"] = "Soligor AF C/D ZOOM UMCS 70-210mm 1:4.5"; - lenses["03 48 5C 81 30 30 02 00"] = "AF Zoom-Nikkor 70-210mm f/4"; - lenses["04 48 3C 3C 24 24 03 00"] = "AF Nikkor 28mm f/2.8"; - lenses["05 54 50 50 0C 0C 04 00"] = "AF Nikkor 50mm f/1.4"; - lenses["06 3F 68 68 2C 2C 06 00"] = "Cosina 100mm f/3.5 Macro"; - lenses["06 54 53 53 24 24 06 00"] = "AF Micro-Nikkor 55mm f/2.8"; - lenses["07 36 3D 5F 2C 3C 03 00"] = "Cosina AF Zoom 28-80mm F3.5-5.6 MC Macro"; - lenses["07 3E 30 43 2D 35 03 00"] = "Soligor AF Zoom 19-35mm 1:3.5-4.5 MC"; - lenses["07 40 2F 44 2C 34 03 02"] = "Tamron AF19-35mm f/3.5-4.5 N"; - lenses["07 40 30 45 2D 35 03 02"] = "Tamron AF19-35mm f/3.5-4.5"; - lenses["07 40 3C 62 2C 34 03 00"] = "AF Zoom-Nikkor 28-85mm f/3.5-4.5"; - lenses["07 46 2B 44 24 30 03 02"] = "Tamron SP AF17-35mm f/2.8-4 Di LD Aspherical (IF)"; - lenses["07 46 3D 6A 25 2F 03 00"] = "Cosina AF Zoom 28-105mm F2.8-3.8 MC"; - lenses["07 47 3C 5C 25 35 03 00"] = "Tokina AF 287 SD (AF 28-70mm f/2.8-4.5)"; - lenses["07 48 3C 5C 24 24 03 00"] = "Tokina AT-X 287 AF (AF 28-70mm f/2.8)"; - lenses["08 40 44 6A 2C 34 04 00"] = "AF Zoom-Nikkor 35-105mm f/3.5-4.5"; - lenses["09 48 37 37 24 24 04 00"] = "AF Nikkor 24mm f/2.8"; - lenses["0A 48 8E 8E 24 24 03 00"] = "AF Nikkor 300mm f/2.8 IF-ED"; - lenses["0B 3E 3D 7F 2F 3D 0E 00"] = "Tamron AF28-200mm f/3.8-5.6"; - lenses["0B 3E 3D 7F 2F 3D 0E 02"] = "Tamron AF28-200mm f/3.8-5.6D"; - lenses["0B 48 7C 7C 24 24 05 00"] = "AF Nikkor 180mm f/2.8 IF-ED"; - lenses["0D 40 44 72 2C 34 07 00"] = "AF Zoom-Nikkor 35-135mm f/3.5-4.5"; - lenses["0E 48 5C 81 30 30 05 00"] = "AF Zoom-Nikkor 70-210mm f/4"; - lenses["0E 4A 31 48 23 2D 0E 02"] = "Tamron SP AF20-40mm f/2.7-3.5"; - lenses["0F 58 50 50 14 14 05 00"] = "AF Nikkor 50mm f/1.8 N"; - lenses["10 3D 3C 60 2C 3C D2 02"] = "Tamron AF28-80mm f/3.5-5.6 Aspherical"; - lenses["10 48 8E 8E 30 30 08 00"] = "AF Nikkor 300mm f/4 IF-ED"; - lenses["11 48 44 5C 24 24 08 00"] = "AF Zoom-Nikkor 35-70mm f/2.8"; - lenses["12 36 5C 81 35 3D 09 00"] = "Cosina AF Zoom 70-210mm F4.5-5.6 MC Macro"; - lenses["12 39 5C 8E 34 3D 08 02"] = "Cosina AF Zoom 70-300mm F4.5-5.6 MC Macro"; - lenses["12 3B 68 8D 3D 43 09 02"] = "Unknown 100-290mm f/5.6-6.7"; - lenses["12 3D 3C 80 2E 3C DF 02"] = "Tamron AF 28-200mm f/3.8-5.6 AF Aspherical LD (IF) (271D)"; - lenses["12 48 5C 81 30 3C 09 00"] = "AF Nikkor 70-210mm f/4-5.6"; - lenses["12 4A 5C 81 31 3D 09 00"] = "Soligor AF C/D Auto Zoom+Macro 70-210mm 1:4-5.6 UMCS"; - lenses["13 42 37 50 2A 34 0B 00"] = "AF Zoom-Nikkor 24-50mm f/3.3-4.5"; - lenses["14 48 60 80 24 24 0B 00"] = "AF Zoom-Nikkor 80-200mm f/2.8 ED"; - lenses["14 48 68 8E 30 30 0B 00"] = "Tokina AT-X 340 AF II 100-300mm F4"; - lenses["14 54 60 80 24 24 0B 00"] = "Tokina AT-X 828 AF 80-200mm F2.8"; - lenses["15 4C 62 62 14 14 0C 00"] = "AF Nikkor 85mm f/1.8"; - lenses["17 3C A0 A0 30 30 0F 00"] = "Nikkor 500mm f/4 P ED IF"; - lenses["17 3C A0 A0 30 30 11 00"] = "Nikkor 500mm f/4 P ED IF"; - lenses["18 40 44 72 2C 34 0E 00"] = "AF Zoom-Nikkor 35-135mm f/3.5-4.5 N"; - lenses["1A 54 44 44 18 18 11 00"] = "AF Nikkor 35mm f/2"; - lenses["1B 44 5E 8E 34 3C 10 00"] = "AF Zoom-Nikkor 75-300mm f/4.5-5.6"; - lenses["1C 48 30 30 24 24 12 00"] = "AF Nikkor 20mm f/2.8"; - lenses["1D 42 44 5C 2A 34 12 00"] = "AF Zoom-Nikkor 35-70mm f/3.3-4.5 N"; - lenses["1E 54 56 56 24 24 13 00"] = "AF Micro-Nikkor 60mm f/2.8"; - lenses["1E 5D 64 64 20 20 13 00"] = "Unknown 90mm f/2.5"; - lenses["1F 54 6A 6A 24 24 14 00"] = "AF Micro-Nikkor 105mm f/2.8"; - lenses["20 3C 80 98 3D 3D 1E 02"] = "Tamron AF200-400mm f/5.6 LD IF"; - lenses["20 48 60 80 24 24 15 00"] = "AF Zoom-Nikkor ED 80-200mm f/2.8"; - lenses["21 40 3C 5C 2C 34 16 00"] = "AF Zoom-Nikkor 28-70mm f/3.5-4.5"; - lenses["22 48 72 72 18 18 16 00"] = "AF DC-Nikkor 135mm f/2"; - lenses["23 30 BE CA 3C 48 17 00"] = "Zoom-Nikkor 1200-1700mm f/5.6-8 P ED IF"; - lenses["24 44 60 98 34 3C 1A 02"] = "Tokina AT-X 840 AF II 80-400mm F4.5-5.6"; - lenses["24 48 60 80 24 24 1A 02"] = "AF Zoom-Nikkor ED 80-200mm f/2.8D"; - lenses["25 48 3C 5C 24 24 1B 02"] = "Tokina AT-X 287 AF PRO SV 28-70mm F2.8"; - lenses["25 48 44 5C 24 24 1B 02"] = "AF Zoom-Nikkor 35-70mm f/2.8D"; - lenses["25 48 44 5C 24 24 52 02"] = "AF Zoom-Nikkor 35-70mm f/2.8D"; - lenses["26 3C 54 80 30 3C 1C 06"] = "Sigma 55-200mm F4-5.6 DC"; - lenses["26 3C 5C 82 30 3C 1C 02"] = "Sigma 70-210mm F4-5.6 UC-II"; - lenses["26 3C 5C 8E 30 3C 1C 02"] = "Sigma 70-300mm F4-5.6 DG Macro"; - lenses["26 3D 3C 80 2F 3D 1C 02"] = "Sigma 28-300mm F3.8-5.6 Aspherical"; - lenses["26 3E 3C 6A 2E 3C 1C 02"] = "Sigma 28-105mm F3.8-5.6 UC-III Aspherical IF"; - lenses["26 40 27 3F 2C 34 1C 02"] = "Sigma 15-30mm F3.5-4.5 EX Aspherical DG DF"; - lenses["26 40 2D 44 2B 34 1C 02"] = "Sigma 18-35 F3.5-4.5 Aspherical"; - lenses["26 40 2D 50 2C 3C 1C 06"] = "Sigma 18-50mm F3.5-5.6 DC"; - lenses["26 40 2D 70 2B 3C 1C 06"] = "Sigma 18-125mm F3.5-5.6 DC"; - lenses["26 40 2D 80 2C 40 1C 06"] = "Sigma 18-200mm F3.5-6.3 DC"; - lenses["26 40 37 5C 2C 3C 1C 02"] = "Sigma 24-70mm F3.5-5.6 Aspherical HF"; - lenses["26 40 3C 60 2C 3C 1C 02"] = "Sigma 28-80mm F3.5-5.6 Mini Zoom Macro II Aspherical"; - lenses["26 40 3C 65 2C 3C 1C 02"] = "Sigma 28-90mm F3.5-5.6 Macro"; - lenses["26 40 3C 80 2B 3C 1C 02"] = "Sigma 28-200mm F3.5-5.6 Compact Aspherical Hyperzoom Macro"; - lenses["26 40 3C 80 2C 3C 1C 02"] = "Sigma 28-200mm F3.5-5.6 Compact Aspherical Hyperzoom Macro"; - lenses["26 40 3C 8E 2C 40 1C 02"] = "Sigma 28-300mm F3.5-6.3 Macro"; - lenses["26 40 7B A0 34 40 1C 02"] = "Sigma APO 170-500mm F5-6.3 Aspherical RF"; - lenses["26 41 3C 8E 2C 40 1C 02"] = "Sigma 28-300mm F3.5-6.3 DG Macro"; - lenses["26 44 73 98 34 3C 1C 02"] = "Sigma 135-400mm F4.5-5.6 APO Aspherical"; - lenses["26 48 11 11 30 30 1C 02"] = "Sigma 8mm F4 EX Circular Fisheye"; - lenses["26 48 27 27 24 24 1C 02"] = "Sigma 15mm F2.8 EX Diagonal Fish-Eye"; - lenses["26 48 2D 50 24 24 1C 06"] = "Sigma 18-50mm F2.8 EX DC"; - lenses["26 48 31 49 24 24 1C 02"] = "Sigma 20-40mm F2.8"; - lenses["26 48 37 56 24 24 1C 02"] = "Sigma 24-60mm F2.8 EX DG"; - lenses["26 48 3C 5C 24 24 1C 06"] = "Sigma 28-70mm F2.8 EX DG"; - lenses["26 48 3C 5C 24 30 1C 02"] = "Sigma 28-70mm F2.8-4 High Speed Zoom"; - lenses["26 48 3C 6A 24 30 1C 02"] = "Sigma 28-105mm F2.8-4 Aspherical"; - lenses["26 48 8E 8E 30 30 1C 02"] = "Sigma APO TELE MACRO 300mm F4"; - lenses["26 54 2B 44 24 30 1C 02"] = "Sigma 17-35mm F2.8-4 EX Aspherical"; - lenses["26 54 37 5C 24 24 1C 02"] = "Sigma 24-70mm F2.8 EX DG Macro"; - lenses["26 54 37 73 24 34 1C 02"] = "Sigma 24-135mm F2.8-4.5"; - lenses["26 54 3C 5C 24 24 1C 02"] = "Sigma 28-70mm F2.8 EX"; - lenses["26 58 31 31 14 14 1C 02"] = "Sigma 20mm F1.8 EX Aspherical DG DF RF"; - lenses["26 58 37 37 14 14 1C 02"] = "Sigma 24mm F1.8 EX Aspherical DG DF MACRO"; - lenses["26 58 3C 3C 14 14 1C 02"] = "Sigma 28mm F1.8 EX DG DF"; - lenses["27 48 8E 8E 24 24 1D 02"] = "AF-I Nikkor 300mm f/2.8D IF-ED"; - lenses["27 48 8E 8E 24 24 E1 02"] = "AF-I Nikkor 300mm f/2.8D IF-ED + TC-17E"; - lenses["27 48 8E 8E 24 24 F1 02"] = "AF-I Nikkor 300mm f/2.8D IF-ED + TC-14E"; - lenses["27 48 8E 8E 24 24 F2 02"] = "AF-I Nikkor 300mm f/2.8D IF-ED + TC-20E"; - lenses["28 3C A6 A6 30 30 1D 02"] = "AF-I Nikkor 600mm f/4D IF-ED"; - lenses["28 3C A6 A6 30 30 E1 02"] = "AF-I Nikkor 600mm f/4D IF-ED + TC-17E"; - lenses["28 3C A6 A6 30 30 F1 02"] = "AF-I Nikkor 600mm f/4D IF-ED + TC-14E"; - lenses["28 3C A6 A6 30 30 F2 02"] = "AF-I Nikkor 600mm f/4D IF-ED + TC-20E"; - lenses["2A 54 3C 3C 0C 0C 26 02"] = "AF Nikkor 28mm f/1.4D"; - lenses["2B 3C 44 60 30 3C 1F 02"] = "AF Zoom-Nikkor 35-80mm f/4-5.6D"; - lenses["2C 48 6A 6A 18 18 27 02"] = "AF DC-Nikkor 105mm f/2D"; - lenses["2D 48 80 80 30 30 21 02"] = "AF Micro-Nikkor 200mm f/4D IF-ED"; - lenses["2E 48 5C 82 30 3C 28 02"] = "AF Nikkor 70-210mm f/4-5.6D"; - lenses["2F 40 30 44 2C 34 29 02"] = "Unknown 20-35mm f/3.5-4.5D"; - lenses["2F 48 30 44 24 24 29 02"] = "Tokina AT-X 235 AF PRO - AF 20-35mm f/2.8"; - lenses["30 48 98 98 24 24 24 02"] = "AF-I Nikkor 400mm f/2.8D IF-ED"; - lenses["30 48 98 98 24 24 E1 02"] = "AF-I Nikkor 400mm f/2.8D IF-ED + TC-17E"; - lenses["30 48 98 98 24 24 F1 02"] = "AF-I Nikkor 400mm f/2.8D IF-ED + TC-14E"; - lenses["30 48 98 98 24 24 F2 02"] = "AF-I Nikkor 400mm f/2.8D IF-ED + TC-20E"; - lenses["31 54 56 56 24 24 25 02"] = "AF Micro-Nikkor 60mm f/2.8D"; - lenses["32 53 64 64 24 24 35 02"] = "Tamron SP AF90mm f/2.8 Di Macro 1:2 (272E)"; - lenses["32 54 50 50 24 24 35 02"] = "Sigma 50mm F2.8 EX DG Macro"; - lenses["32 54 6A 6A 24 24 35 02"] = "AF Micro-Nikkor 105mm f/2.8D"; - lenses["33 48 2D 2D 24 24 31 02"] = "AF Nikkor 18mm f/2.8D"; - lenses["33 54 3C 5E 24 24 62 02"] = "Tamron SP AF28-75mm f/2.8 XR Di LD Aspherical (IF) Macro"; - lenses["34 48 29 29 24 24 32 02"] = "AF Fisheye Nikkor 16mm f/2.8D"; - lenses["35 3C A0 A0 30 30 33 02"] = "AF-I Nikkor 500mm f/4D IF-ED"; - lenses["35 3C A0 A0 30 30 E1 02"] = "AF-I Nikkor 500mm f/4D IF-ED + TC-17E"; - lenses["35 3C A0 A0 30 30 F1 02"] = "AF-I Nikkor 500mm f/4D IF-ED + TC-14E"; - lenses["35 3C A0 A0 30 30 F2 02"] = "AF-I Nikkor 500mm f/4D IF-ED + TC-20E"; - lenses["36 48 37 37 24 24 34 02"] = "AF Nikkor 24mm f/2.8D"; - lenses["37 48 30 30 24 24 36 02"] = "AF Nikkor 20mm f/2.8D"; - lenses["38 4C 62 62 14 14 37 02"] = "AF Nikkor 85mm f/1.8D"; - lenses["3A 40 3C 5C 2C 34 39 02"] = "AF Zoom-Nikkor 28-70mm f/3.5-4.5D"; - lenses["3B 48 44 5C 24 24 3A 02"] = "AF Zoom-Nikkor 35-70mm f/2.8D N"; - lenses["3C 48 60 80 24 24 3B 02"] = "AF Zoom-Nikkor 80-200mm f/2.8D ED"; - lenses["3D 3C 44 60 30 3C 3E 02"] = "AF Zoom-Nikkor 35-80mm f/4-5.6D"; - lenses["3E 48 3C 3C 24 24 3D 02"] = "AF Nikkor 28mm f/2.8D"; - lenses["3F 40 44 6A 2C 34 45 02"] = "AF Zoom-Nikkor 35-105mm f/3.5-4.5D"; - lenses["41 48 7C 7C 24 24 43 02"] = "AF Nikkor 180mm f/2.8D IF-ED"; - lenses["42 54 44 44 18 18 44 02"] = "AF Nikkor 35mm f/2D"; - lenses["43 54 50 50 0C 0C 46 02"] = "AF Nikkor 50mm f/1.4D"; - lenses["44 44 60 80 34 3C 47 02"] = "AF Zoom-Nikkor 80-200mm f/4.5-5.6D "; - lenses["45 3D 3C 60 2C 3C 48 02"] = "Tamron AF28-80mm f/3.5-5.6 Aspherical"; - lenses["45 40 3C 60 2C 3C 48 02"] = "AF Zoom-Nikkor 28-80mm F/3.5-5.6D"; - lenses["45 41 37 72 2C 3C 48 02"] = "Tamron SP AF24-135mm f/3.5-5.6 AD Aspherical (IF) Macro"; - lenses["46 3C 44 60 30 3C 49 02"] = "AF Zoom-Nikkor 35-80mm f/4-5.6D N"; - lenses["47 42 37 50 2A 34 4A 02"] = "AF Zoom-Nikkor 24-50mm f/3.3-4.5D"; - lenses["48 38 1F 37 34 3C 4B 06"] = "Sigma 12-24mm F4.5-5.6 EX Aspherical DG HSM"; - lenses["48 3C 19 31 30 3C 4B 06"] = "Sigma 10-20mm F4-5.6 EX DC HSM"; - lenses["48 3C 50 A0 30 40 4B 02"] = "Sigma 50-500mm F4-6.3 EX APO RF HSM"; - lenses["48 3C 8E B0 3C 3C 4B 02"] = "Sigma APO 300-800 F5.6 EX DG HSM"; - lenses["48 3C B0 B0 3C 3C 4B 02"] = "Sigma APO 800mm F5.6 EX HSM"; - lenses["48 44 A0 A0 34 34 4B 02"] = "Sigma APO 500mm F4.5 EX HSM"; - lenses["48 48 24 24 24 24 4B 02"] = "Sigma 14mm F2.8 EX Aspherical HSM"; - lenses["48 48 2B 44 24 30 4B 06"] = "Sigma 17-35mm F2.8-4 EX DG Aspherical HSM"; - lenses["48 48 68 8E 30 30 4B 02"] = "Sigma 100-300mm F4 EX IF HSM"; - lenses["48 48 76 76 24 24 4B 06"] = "Sigma 150mm F2.8 EX DG APO Macro HSM"; - lenses["48 48 8E 8E 24 24 4B 02"] = "AF-S Nikkor 300mm f/2.8D IF-ED"; - lenses["48 48 8E 8E 24 24 E1 02"] = "AF-S Nikkor 300mm f/2.8D IF-ED + TC-17E"; - lenses["48 48 8E 8E 24 24 F1 02"] = "AF-S Nikkor 300mm f/2.8D IF-ED + TC-14E"; - lenses["48 48 8E 8E 24 24 F2 02"] = "AF-S Nikkor 300mm f/2.8D IF-ED + TC-20E"; - lenses["48 4C 7C 7C 2C 2C 4B 02"] = "Sigma 180mm F3.5 EX DG Macro"; - lenses["48 4C 7D 7D 2C 2C 4B 02"] = "Sigma APO MACRO 180mm F3.5 EX DG HSM"; - lenses["48 54 3E 3E 0C 0C 4B 06"] = "Sigma 30mm F1.4 EX DC HSM"; - lenses["48 54 5C 80 24 24 4B 02"] = "Sigma 70-200mm F2.8 EX APO IF HSM"; - lenses["48 54 6F 8E 24 24 4B 02"] = "Sigma APO 120-300mm F2.8 EX DG HSM"; - lenses["48 54 8E 8E 24 24 4B 02"] = "Sigma APO 300mm F2.8 EX DG HSM"; - lenses["49 3C A6 A6 30 30 4C 02"] = "AF-S Nikkor 600mm f/4D IF-ED"; - lenses["49 3C A6 A6 30 30 E1 02"] = "AF-S Nikkor 600mm f/4D IF-ED + TC-17E"; - lenses["49 3C A6 A6 30 30 F1 02"] = "AF-S Nikkor 600mm f/4D IF-ED + TC-14E"; - lenses["49 3C A6 A6 30 30 F2 02"] = "AF-S Nikkor 600mm f/4D IF-ED + TC-20E"; - lenses["4A 54 62 62 0C 0C 4D 02"] = "AF Nikkor 85mm f/1.4D IF"; - lenses["4B 3C A0 A0 30 30 4E 02"] = "AF-S Nikkor 500mm f/4D IF-ED"; - lenses["4B 3C A0 A0 30 30 E1 02"] = "AF-S Nikkor 500mm f/4D IF-ED + TC-17E"; - lenses["4B 3C A0 A0 30 30 F1 02"] = "AF-S Nikkor 500mm f/4D IF-ED + TC-14E"; - lenses["4B 3C A0 A0 30 30 F2 02"] = "AF-S Nikkor 500mm f/4D IF-ED + TC-20E"; - lenses["4C 40 37 6E 2C 3C 4F 02"] = "AF Zoom-Nikkor 24-120mm f/3.5-5.6D IF"; - lenses["4D 40 3C 80 2C 3C 62 02"] = "AF Zoom-Nikkor 28-200mm f/3.5-5.6D IF"; - lenses["4D 41 3C 8E 2B 40 62 02"] = "Tamron AF28-300mm f/3.5-6.3 XR Di LD Aspherical (IF)"; - lenses["4D 41 3C 8E 2C 40 62 02"] = "Tamron AF28-300mm f/3.5-6.3 XR LD Aspherical (IF)"; - lenses["4E 48 72 72 18 18 51 02"] = "AF DC-Nikkor 135mm f/2D"; - lenses["4F 40 37 5C 2C 3C 53 06"] = "IX-Nikkor 24-70mm f/3.5-5.6"; - lenses["50 48 56 7C 30 3C 54 06"] = "IX-Nikkor 60-180mm f/4-5.6"; - lenses["53 48 60 80 24 24 57 02"] = "AF Zoom-Nikkor 80-200mm f/2.8D ED"; - lenses["53 48 60 80 24 24 60 02"] = "AF Zoom-Nikkor 80-200mm f/2.8D ED"; - lenses["54 44 5C 7C 34 3C 58 02"] = "AF Zoom-Micro Nikkor 70-180mm f/4.5-5.6D ED"; - lenses["56 3C 5C 8E 30 3C 1C 02"] = "Sigma 70-300mm F4-5.6 APO Macro Super II"; - lenses["56 48 5C 8E 30 3C 5A 02"] = "AF Zoom-Nikkor 70-300mm f/4-5.6D ED"; - lenses["59 48 98 98 24 24 5D 02"] = "AF-S Nikkor 400mm f/2.8D IF-ED"; - lenses["59 48 98 98 24 24 E1 02"] = "AF-S Nikkor 400mm f/2.8D IF-ED + TC-17E"; - lenses["59 48 98 98 24 24 F1 02"] = "AF-S Nikkor 400mm f/2.8D IF-ED + TC-14E"; - lenses["59 48 98 98 24 24 F2 02"] = "AF-S Nikkor 400mm f/2.8D IF-ED + TC-20E"; - lenses["5A 3C 3E 56 30 3C 5E 06"] = "IX-Nikkor 30-60mm f/4-5.6"; - lenses["5B 44 56 7C 34 3C 5F 06"] = "IX-Nikkor 60-180mm f/4.5-5.6"; - lenses["5D 48 3C 5C 24 24 63 02"] = "AF-S Zoom-Nikkor 28-70mm f/2.8D IF-ED"; - lenses["5E 48 60 80 24 24 64 02"] = "AF-S Zoom-Nikkor 80-200mm f/2.8D IF-ED"; - lenses["5F 40 3C 6A 2C 34 65 02"] = "AF Zoom-Nikkor 28-105mm f/3.5-4.5D IF"; - lenses["60 40 3C 60 2C 3C 66 02"] = "AF Zoom-Nikkor 28-80mm f/3.5-5.6D"; - lenses["61 44 5E 86 34 3C 67 02"] = "AF Zoom-Nikkor 75-240mm f/4.5-5.6D"; - lenses["63 48 2B 44 24 24 68 02"] = "AF-S Nikkor 17-35mm f/2.8D IF-ED"; - lenses["64 00 62 62 24 24 6A 02"] = "PC Micro-Nikkor 85mm f/2.8D"; - lenses["65 44 60 98 34 3C 6B 0A"] = "AF VR Zoom-Nikkor 80-400mm f/4.5-5.6D ED"; - lenses["66 40 2D 44 2C 34 6C 02"] = "AF Zoom-Nikkor 18-35mm f/3.5-4.5D IF-ED"; - lenses["67 48 37 62 24 30 6D 02"] = "AF Zoom-Nikkor 24-85mm f/2.8-4D IF"; - lenses["67 54 37 5C 24 24 1C 02"] = "Sigma 24-70mm F2.8 EX DG Macro"; - lenses["68 42 3C 60 2A 3C 6E 06"] = "AF Zoom-Nikkor 28-80mm f/3.3-5.6G"; - lenses["69 48 5C 8E 30 3C 6F 02"] = "Tamron AF70-300mm f/4-5.6 LD Macro 1:2"; - lenses["69 48 5C 8E 30 3C 6F 06"] = "AF Zoom-Nikkor 70-300mm f/4-5.6G"; - lenses["6A 48 8E 8E 30 30 70 02"] = "AF-S Nikkor 300mm f/4D IF-ED"; - lenses["6B 48 24 24 24 24 71 02"] = "AF Nikkor ED 14mm f/2.8D"; - lenses["6D 48 8E 8E 24 24 73 02"] = "AF-S Nikkor 300mm f/2.8D IF-ED II"; - lenses["6E 48 98 98 24 24 74 02"] = "AF-S Nikkor 400mm f/2.8D IF-ED II"; - lenses["6F 3C A0 A0 30 30 75 02"] = "AF-S Nikkor 500mm f/4D IF-ED II"; - lenses["70 3C A6 A6 30 30 76 02"] = "AF-S Nikkor 600mm f/4D IF-ED II"; - lenses["72 48 4C 4C 24 24 77 00"] = "Nikkor 45mm f/2.8 P"; - lenses["74 40 37 62 2C 34 78 06"] = "AF-S Zoom-Nikkor 24-85mm f/3.5-4.5G IF-ED"; - lenses["75 40 3C 68 2C 3C 79 06"] = "AF Zoom-Nikkor 28-100mm f/3.5-5.6G"; - lenses["76 58 50 50 14 14 7A 02"] = "AF Nikkor 50mm f/1.8D"; - lenses["77 44 61 98 34 3C 7B 0E"] = "Sigma 80-400mm f4.5-5.6 EX OS"; - lenses["77 48 5C 80 24 24 7B 0E"] = "AF-S VR Zoom-Nikkor 70-200mm f/2.8G IF-ED"; - lenses["78 40 37 6E 2C 3C 7C 0E"] = "AF-S VR Zoom-Nikkor 24-120mm f/3.5-5.6G IF-ED"; - lenses["79 40 11 11 2C 2C 1C 06"] = "Sigma 8mm F3.5 EX"; - lenses["79 40 3C 80 2C 3C 7F 06"] = "AF Zoom-Nikkor 28-200mm f/3.5-5.6G IF-ED"; - lenses["79 48 5C 5C 24 24 1C 06"] = "Sigma 70mm F2.8 EX DG Macro"; - lenses["7A 3B 53 80 30 3C 4B 06"] = "Sigma 55-200mm F4-5.6 DC HSM"; - lenses["7A 3C 1F 37 30 30 7E 06"] = "AF-S DX Zoom-Nikkor 12-24mm f/4G IF-ED"; - lenses["7A 40 2D 50 2C 3C 4B 06"] = "Sigma 18-50mm F3.5-5.6 DC HSM"; - lenses["7A 47 2B 5C 24 34 4B 06"] = "Sigma 17-70mm F2.8-4.5 DC Macro Asp. IF HSM"; - lenses["7A 47 50 76 24 24 4B 06"] = "Sigma APO 50-150mm F2.8 EX DC HSM"; - lenses["7A 48 2B 5C 24 34 4B 06"] = "Sigma 17-70mm F2.8-4.5 DC Macro Asp. IF HSM"; - lenses["7A 48 2D 50 24 24 4B 06"] = "Sigma 18-50mm F2.8 EX DC HSM"; - lenses["7A 48 5C 80 24 24 4B 06"] = "Sigma 70-200mm F2.8 EX APO DG Macro HSM II"; - lenses["7A 54 6E 8E 24 24 4B 02"] = "Sigma APO 120-300mm F2.8 EX DG HSM"; - lenses["7B 48 80 98 30 30 80 0E"] = "AF-S VR Zoom-Nikkor 200-400mm f/4G IF-ED"; - lenses["7D 48 2B 53 24 24 82 06"] = "AF-S DX Zoom-Nikkor 17-55mm f/2.8G IF-ED"; - lenses["7F 40 2D 5C 2C 34 84 06"] = "AF-S DX Zoom-Nikkor 18-70mm f/3.5-4.5G IF-ED"; - lenses["7F 48 2B 5C 24 34 1C 06"] = "Sigma 17-70mm F2.8-4.5 DC Macro Asp. IF"; - lenses["7F 48 2D 50 24 24 1C 06"] = "Sigma 18-50mm F2.8 EX DC Macro"; - lenses["80 48 1A 1A 24 24 85 06"] = "AF DX Fisheye-Nikkor 10.5mm f/2.8G ED"; - lenses["81 54 80 80 18 18 86 0E"] = "AF-S VR Nikkor 200mm f/2G IF-ED"; - lenses["82 48 8E 8E 24 24 87 0E"] = "AF-S VR Nikkor 300mm f/2.8G IF-ED"; - lenses["89 3C 53 80 30 3C 8B 06"] = "AF-S DX Zoom-Nikkor 55-200mm f/4-5.6G ED"; - lenses["8A 54 6A 6A 24 24 8C 0E"] = "AF-S VR Micro-Nikkor 105mm f/2.8G IF-ED"; - lenses["8B 40 2D 80 2C 3C 8D 0E"] = "AF-S DX VR Zoom-Nikkor 18-200mm f/3.5-5.6G IF-ED"; - lenses["8B 40 2D 80 2C 3C FD 0E"] = "AF-S DX VR Zoom-Nikkor 18-200mm f/3.5-5.6G IF-ED"; - lenses["8C 40 2D 53 2C 3C 8E 06"] = "AF-S DX Zoom-Nikkor 18-55mm f/3.5-5.6G ED"; - lenses["8D 44 5C 8E 34 3C 8F 0E"] = "AF-S VR Zoom-Nikkor 70-300mm f/4.5-5.6G IF-ED"; - lenses["8F 40 2D 72 2C 3C 91 06"] = "AF-S DX Zoom-Nikkor 18-135mm f/3.5-5.6G IF-ED"; - lenses["90 3B 53 80 30 3C 92 0E"] = "AF-S DX VR Zoom-Nikkor 55-200mm f/4-5.6G IF-ED"; - lenses["92 48 24 37 24 24 94 06"] = "AF-S Zoom-Nikkor 14-24mm f/2.8G ED"; - lenses["93 48 37 5C 24 24 95 06"] = "AF-S Zoom-Nikkor 24-70mm f/2.8G ED"; + +namespace rtexif { + +class NAISOInterpreter : public Interpreter { + public: + NAISOInterpreter () {} + virtual std::string toString (Tag* t) { + sprintf (buffer, "%d", t->toInt(2)); + return buffer; + } +}; +NAISOInterpreter naISOInterpreter; + +class NALensTypeInterpreter : public Interpreter { + public: + NALensTypeInterpreter () {} + virtual std::string toString (Tag* t) { + int a = t->toInt(); + std::ostringstream str; + str << "MF = " << (a&1 ? "Yes" : "No") << std::endl; + str << "D = " << (a&2 ? "Yes" : "No") << std::endl; + str << "G = " << (a&4 ? "Yes" : "No") << std::endl; + str << "VR = " << (a&8 ? "Yes" : "No"); + return str.str(); + } +}; +NALensTypeInterpreter naLensTypeInterpreter; + +class NAFlashModeInterpreter : public ChoiceInterpreter { + public: + NAFlashModeInterpreter () { + choices[0] = "Did Not Fire"; + choices[1] = "Fired, Manual"; + choices[7] = "Fired, External"; + choices[8] = "Fired, Commander Mode"; + choices[9] = "Fired, TTL Mode"; + } +}; +NAFlashModeInterpreter naFlashModeInterpreter; + +class NAHiISONRInterpreter : public ChoiceInterpreter { + public: + NAHiISONRInterpreter () { + choices[0] = "Off"; + choices[1] = "Minimal"; + choices[2] = "Low"; + choices[4] = "Normal"; + choices[6] = "High"; + } +}; +NAHiISONRInterpreter naHiISONRInterpreter; + +class NAShootingModeInterpreter : public Interpreter { + public: + NAShootingModeInterpreter () {} + virtual std::string toString (Tag* t) { + int a = t->toInt(); + std::ostringstream str; + str << "Continuous = " << (a&1 ? "Yes" : "No") << std::endl; + str << "Delay = " << (a&2 ? "Yes" : "No") << std::endl; + str << "PC Control = " << (a&4 ? "Yes" : "No") << std::endl; + str << "Exposure Bracketing = " << (a&8 ? "Yes" : "No") << std::endl; + str << "Auto ISO = " << (a&16 ? "Yes" : "No") << std::endl; + str << "White-Balance Bracketing = " << (a&32 ? "Yes" : "No") << std::endl; + str << "IR Control = " << (a&64 ? "Yes" : "No"); + return str.str(); + } +}; +NAShootingModeInterpreter naShootingModeInterpreter; + +class NAAFInfoInterpreter : public Interpreter { + std::map amchoices; + std::map afpchoices; + public: + NAAFInfoInterpreter () { + amchoices[0] = "Single Area"; + amchoices[1] = "Dynamic Area"; + amchoices[2] = "Dynamic Area, Closest Subject"; + amchoices[3] = "Group Dynamic"; + amchoices[4] = "Single Area (wide)"; + amchoices[5] = "Dynamic Area (wide)"; + afpchoices[0] = "Center"; + afpchoices[1] = "Top"; + afpchoices[2] = "Bottom"; + afpchoices[3] = "Left"; + afpchoices[4] = "Right"; + afpchoices[5] = "Upper-left"; + afpchoices[6] = "Upper-right"; + afpchoices[7] = "Lower-left"; + afpchoices[8] = "Lower-right"; + afpchoices[9] = "Far Left"; + afpchoices[10] = "Far Right"; + } + virtual std::string toString (Tag* t) { + int am = t->toInt (0, BYTE); + int afp = t->toInt (1, BYTE); + int aff = t->toInt (2, SHORT); + std::ostringstream str; + str << "AFAreaMode = " << amchoices[am] << std::endl; + str << "AFAreaMode = " << afpchoices[afp] << std::endl; + + std::ostringstream af; + if (aff&1) + if (af.str()=="") af << "Center"; + else af << ", Center"; + else if (aff&2) + if (af.str()=="") af << "Top"; + else af << ", Top"; + else if (aff&4) + if (af.str()=="") af << "Bottom"; + else af << ", Bottom"; + else if (aff&8) + if (af.str()=="") af << "Left"; + else af << ", Left"; + else if (aff&16) + if (af.str()=="") af << "Right"; + else af << ", Right"; + else if (aff&32) + if (af.str()=="") af << "Upper-left"; + else af << ", Upper-left"; + else if (aff&64) + if (af.str()=="") af << "Upper-right"; + else af << ", Upper-right"; + else if (aff&128) + if (af.str()=="") af << " Lower-left"; + else af << ", Lower-left"; + else if (aff&256) + if (af.str()=="") af << "Lower-right"; + else af << ", Lower-right"; + else if (aff&512) + if (af.str()=="") af << "Far Left"; + else af << ", Far Left"; + else if (aff&1024) + if (af.str()=="") af << "Far Right"; + else af << ", Far Right"; + + str << "AFPointsInFocus = " << af.str(); + return str.str(); + } +}; +NAAFInfoInterpreter naAFInfoInterpreter; + +class NALensDataInterpreter : public Interpreter { + std::map lenses; + public: + NALensDataInterpreter () { + lenses["00 00 00 00 00 00 00 01"] = "Manual Lens No CPU "; + lenses["00 00 00 00 00 00 E1 12"] = "TC-17E II "; + lenses["00 00 00 00 00 00 F1 0C"] = "TC-14E [II] or Sigma APO Tele Converter 1.4x EX DG or Kenko Teleplus PRO 300 DG 1.4x"; + lenses["00 00 00 00 00 00 F2 18"] = "TC-20E [II] or Sigma APO Tele Converter 2x EX DG or Kenko Teleplus PRO 300 DG 2.0x"; + lenses["00 36 1C 2D 34 3C 00 06"] = "Tamron SP AF11-18mm f/4.5-5.6 Di II LD Aspherical (IF)"; + lenses["00 3C 1F 37 30 30 00 06"] = "Tokina AT-X 124 AF PRO DX - AF 12-24mm F4"; + lenses["00 3E 80 A0 38 3F 00 02"] = "Tamron SP AF200-500mm f/5-6.3 Di LD (IF)"; + lenses["00 3F 2D 80 2B 40 00 06"] = "Tamron AF18-200mm f/3.5-6.3 XR Di II LD Aspherical (IF)"; + lenses["00 3F 2D 80 2C 40 00 06"] = "Tamron AF18-200mm f/3.5-6.3 XR Di II LD Aspherical (IF) Macro"; + lenses["00 3F 80 A0 38 3F 00 02"] = "Tamron SP AF200-500mm f/5-6.3 Di"; + lenses["00 40 18 2B 2C 34 00 06"] = "Tokina AT-X 107 DX Fish-Eye - AF 10-17mm F3.5-4.5"; + lenses["00 40 2A 72 2C 3C 00 06"] = "Tokina AT-X 16.5-135 DX (AF 16.5-135mm F3.5-5.6)"; + lenses["00 40 2B 2B 2C 2C 00 02"] = "Tokina AT-X 17 AF PRO - AF 17mm F3.5"; + lenses["00 40 2D 80 2C 40 00 06"] = "Tamron AF 18-200mm f/3.5-6.3 XR Di II LD Aspherical (IF) Macro (A14NII)"; + lenses["00 40 2D 88 2C 40 00 06"] = "Tamron AF 18-250mm f/3.5-6.3 Di II LD Aspherical (IF) Macro (A18NII)"; + lenses["00 40 2D 88 2C 40 62 06"] = "Tamron AF 18-250mm f/3.5-6.3 Di II LD Aspherical (IF) Macro (A18)"; + lenses["00 40 31 31 2C 2C 00 00"] = "Voigtlander Color Skopar 20mm F3.5 SLII Aspherical"; + lenses["00 44 60 98 34 3C 00 02"] = "Tokina AT-X 840D 80-400mm F4.5-5.6"; + lenses["00 47 10 10 24 24 00 00"] = "Fisheye Nikkor 8mm f/2.8 AiS"; + lenses["00 47 44 44 24 24 00 06"] = "Tokina AT-X M35 PRO DX (AF 35mm f/2.8 Macro)"; + lenses["00 47 53 80 30 3C 00 06"] = "Tamron AF55-200mm f/4-5.6 Di II LD"; + lenses["00 48 1C 29 24 24 00 06"] = "Tokina AT-X 116 PRO DX (AF 11-16mm f/2.8)"; + lenses["00 48 29 50 24 24 00 06"] = "Tokina AT-X 165 PRO DX - AF 16-50mm F2.8"; + lenses["00 48 3C 60 24 24 00 02"] = "Tokina AT-X 280 AF PRO 28-80mm F2.8 Aspherical"; + lenses["00 48 3C 6A 24 24 00 02"] = "Tamron SP AF28-105mm f/2.8"; + lenses["00 48 50 50 18 18 00 00"] = "Nikkor H 50mm f/2"; + lenses["00 48 50 72 24 24 00 06"] = "Tokina AT-X 535 PRO DX - AF 50-135mm F2.8"; + lenses["00 48 5C 8E 30 3C 00 06"] = "Tamron AF 70-300mm f/4-5.6 Di LD Macro 1:2 (A17)"; + lenses["00 48 68 68 24 24 00 00"] = "Series E 100mm f/2.8"; + lenses["00 48 80 80 30 30 00 00"] = "Nikkor 200mm f/4 AiS"; + lenses["00 49 30 48 22 2B 00 02"] = "Tamron SP AF20-40mm f/2.7-3.5"; + lenses["00 4C 6A 6A 20 20 00 00"] = "Nikkor 105mm f/2.5 AiS"; + lenses["00 4C 7C 7C 2C 2C 00 02"] = "Tamron SP AF180mm f/3.5 Di Model B01"; + lenses["00 53 2B 50 24 24 00 06"] = "Tamron SP AF17-50mm f/2.8 (A16)"; + lenses["00 54 2B 50 24 24 00 06"] = "Tamron SP AF 17-50mm f/2.8 XR Di II LD Aspherical (IF) (A16NII)"; + lenses["00 54 44 44 0C 0C 00 00"] = "Nikkor 35mm f/1.4 AiS"; + lenses["00 54 48 48 18 18 00 00"] = "Voigtlander Ultron 40mm F2 SLII Aspherical"; + lenses["00 54 55 55 0C 0C 00 00"] = "Voigtlander Nokton 58mm F1.4 SLII"; + lenses["00 54 56 56 30 30 00 00"] = "Coastal Optical Systems 60mm 1:4 UV-VIS-IR Macro Apo"; + lenses["00 54 68 68 24 24 00 02"] = "Tokina AT-X M100 PRO D - 100mm F2.8"; + lenses["00 54 8E 8E 24 24 00 02"] = "Tokina AT-X 300 AF PRO 300mm F2.8"; + lenses["01 00 00 00 00 00 02 00"] = "AF Teleconverter TC-16A 1.6x"; + lenses["01 00 00 00 00 00 08 00"] = "AF Teleconverter TC-16A 1.6x"; + lenses["01 58 50 50 14 14 02 00"] = "AF Nikkor 50mm f/1.8"; + lenses["02 2F 98 98 3D 3D 02 00"] = "Sigma 400mm F5.6 APO"; + lenses["02 37 5E 8E 35 3D 02 00"] = "Sigma 75-300mm F4.5-5.6 APO"; + lenses["02 37 A0 A0 34 34 02 00"] = "Sigma APO 500mm F4.5"; + lenses["02 3A 5E 8E 32 3D 02 00"] = "Sigma 75-300mm F4.0-5.6"; + lenses["02 3B 44 61 30 3D 02 00"] = "Sigma 35-80mm F4-5.6"; + lenses["02 3F 24 24 2C 2C 02 00"] = "Sigma 14mm F3.5"; + lenses["02 3F 3C 5C 2D 35 02 00"] = "Sigma 28-70mm F3.5-4.5 UC"; + lenses["02 40 44 73 2B 36 02 00"] = "Sigma 35-135mm F3.5-4.5 a"; + lenses["02 42 44 5C 2A 34 02 00"] = "AF Zoom-Nikkor 35-70mm f/3.3-4.5"; + lenses["02 42 44 5C 2A 34 08 00"] = "AF Zoom-Nikkor 35-70mm f/3.3-4.5"; + lenses["02 46 37 37 25 25 02 00"] = "Sigma 24mm F2.8 Macro"; + lenses["02 46 3C 5C 25 25 02 00"] = "Sigma 28-70mm F2.8"; + lenses["02 46 5C 82 25 25 02 00"] = "Sigma 70-210mm F2.8 APO"; + lenses["02 48 65 65 24 24 02 00"] = "Sigma 90mm F2.8 Macro"; + lenses["03 43 5C 81 35 35 02 00"] = "Soligor AF C/D ZOOM UMCS 70-210mm 1:4.5"; + lenses["03 48 5C 81 30 30 02 00"] = "AF Zoom-Nikkor 70-210mm f/4"; + lenses["04 48 3C 3C 24 24 03 00"] = "AF Nikkor 28mm f/2.8"; + lenses["05 54 50 50 0C 0C 04 00"] = "AF Nikkor 50mm f/1.4"; + lenses["06 3F 68 68 2C 2C 06 00"] = "Cosina 100mm f/3.5 Macro"; + lenses["06 54 53 53 24 24 06 00"] = "AF Micro-Nikkor 55mm f/2.8"; + lenses["07 36 3D 5F 2C 3C 03 00"] = "Cosina AF Zoom 28-80mm F3.5-5.6 MC Macro"; + lenses["07 3E 30 43 2D 35 03 00"] = "Soligor AF Zoom 19-35mm 1:3.5-4.5 MC"; + lenses["07 40 2F 44 2C 34 03 02"] = "Tamron AF19-35mm f/3.5-4.5 N"; + lenses["07 40 30 45 2D 35 03 02"] = "Tamron AF19-35mm f/3.5-4.5"; + lenses["07 40 3C 62 2C 34 03 00"] = "AF Zoom-Nikkor 28-85mm f/3.5-4.5"; + lenses["07 46 2B 44 24 30 03 02"] = "Tamron SP AF17-35mm f/2.8-4 Di LD Aspherical (IF)"; + lenses["07 46 3D 6A 25 2F 03 00"] = "Cosina AF Zoom 28-105mm F2.8-3.8 MC"; + lenses["07 47 3C 5C 25 35 03 00"] = "Tokina AF 287 SD (AF 28-70mm f/2.8-4.5)"; + lenses["07 48 3C 5C 24 24 03 00"] = "Tokina AT-X 287 AF (AF 28-70mm f/2.8)"; + lenses["08 40 44 6A 2C 34 04 00"] = "AF Zoom-Nikkor 35-105mm f/3.5-4.5"; + lenses["09 48 37 37 24 24 04 00"] = "AF Nikkor 24mm f/2.8"; + lenses["0A 48 8E 8E 24 24 03 00"] = "AF Nikkor 300mm f/2.8 IF-ED"; + lenses["0B 3E 3D 7F 2F 3D 0E 00"] = "Tamron AF28-200mm f/3.8-5.6"; + lenses["0B 3E 3D 7F 2F 3D 0E 02"] = "Tamron AF28-200mm f/3.8-5.6D"; + lenses["0B 48 7C 7C 24 24 05 00"] = "AF Nikkor 180mm f/2.8 IF-ED"; + lenses["0D 40 44 72 2C 34 07 00"] = "AF Zoom-Nikkor 35-135mm f/3.5-4.5"; + lenses["0E 48 5C 81 30 30 05 00"] = "AF Zoom-Nikkor 70-210mm f/4"; + lenses["0E 4A 31 48 23 2D 0E 02"] = "Tamron SP AF20-40mm f/2.7-3.5"; + lenses["0F 58 50 50 14 14 05 00"] = "AF Nikkor 50mm f/1.8 N"; + lenses["10 3D 3C 60 2C 3C D2 02"] = "Tamron AF28-80mm f/3.5-5.6 Aspherical"; + lenses["10 48 8E 8E 30 30 08 00"] = "AF Nikkor 300mm f/4 IF-ED"; + lenses["11 48 44 5C 24 24 08 00"] = "AF Zoom-Nikkor 35-70mm f/2.8"; + lenses["12 36 5C 81 35 3D 09 00"] = "Cosina AF Zoom 70-210mm F4.5-5.6 MC Macro"; + lenses["12 39 5C 8E 34 3D 08 02"] = "Cosina AF Zoom 70-300mm F4.5-5.6 MC Macro"; + lenses["12 3B 68 8D 3D 43 09 02"] = "Unknown 100-290mm f/5.6-6.7"; + lenses["12 3D 3C 80 2E 3C DF 02"] = "Tamron AF 28-200mm f/3.8-5.6 AF Aspherical LD (IF) (271D)"; + lenses["12 48 5C 81 30 3C 09 00"] = "AF Nikkor 70-210mm f/4-5.6"; + lenses["12 4A 5C 81 31 3D 09 00"] = "Soligor AF C/D Auto Zoom+Macro 70-210mm 1:4-5.6 UMCS"; + lenses["13 42 37 50 2A 34 0B 00"] = "AF Zoom-Nikkor 24-50mm f/3.3-4.5"; + lenses["14 48 60 80 24 24 0B 00"] = "AF Zoom-Nikkor 80-200mm f/2.8 ED"; + lenses["14 48 68 8E 30 30 0B 00"] = "Tokina AT-X 340 AF II 100-300mm F4"; + lenses["14 54 60 80 24 24 0B 00"] = "Tokina AT-X 828 AF 80-200mm F2.8"; + lenses["15 4C 62 62 14 14 0C 00"] = "AF Nikkor 85mm f/1.8"; + lenses["17 3C A0 A0 30 30 0F 00"] = "Nikkor 500mm f/4 P ED IF"; + lenses["17 3C A0 A0 30 30 11 00"] = "Nikkor 500mm f/4 P ED IF"; + lenses["18 40 44 72 2C 34 0E 00"] = "AF Zoom-Nikkor 35-135mm f/3.5-4.5 N"; + lenses["1A 54 44 44 18 18 11 00"] = "AF Nikkor 35mm f/2"; + lenses["1B 44 5E 8E 34 3C 10 00"] = "AF Zoom-Nikkor 75-300mm f/4.5-5.6"; + lenses["1C 48 30 30 24 24 12 00"] = "AF Nikkor 20mm f/2.8"; + lenses["1D 42 44 5C 2A 34 12 00"] = "AF Zoom-Nikkor 35-70mm f/3.3-4.5 N"; + lenses["1E 54 56 56 24 24 13 00"] = "AF Micro-Nikkor 60mm f/2.8"; + lenses["1E 5D 64 64 20 20 13 00"] = "Unknown 90mm f/2.5"; + lenses["1F 54 6A 6A 24 24 14 00"] = "AF Micro-Nikkor 105mm f/2.8"; + lenses["20 3C 80 98 3D 3D 1E 02"] = "Tamron AF200-400mm f/5.6 LD IF"; + lenses["20 48 60 80 24 24 15 00"] = "AF Zoom-Nikkor ED 80-200mm f/2.8"; + lenses["21 40 3C 5C 2C 34 16 00"] = "AF Zoom-Nikkor 28-70mm f/3.5-4.5"; + lenses["22 48 72 72 18 18 16 00"] = "AF DC-Nikkor 135mm f/2"; + lenses["23 30 BE CA 3C 48 17 00"] = "Zoom-Nikkor 1200-1700mm f/5.6-8 P ED IF"; + lenses["24 44 60 98 34 3C 1A 02"] = "Tokina AT-X 840 AF II 80-400mm F4.5-5.6"; + lenses["24 48 60 80 24 24 1A 02"] = "AF Zoom-Nikkor ED 80-200mm f/2.8D"; + lenses["25 48 3C 5C 24 24 1B 02"] = "Tokina AT-X 287 AF PRO SV 28-70mm F2.8"; + lenses["25 48 44 5C 24 24 1B 02"] = "AF Zoom-Nikkor 35-70mm f/2.8D"; + lenses["25 48 44 5C 24 24 52 02"] = "AF Zoom-Nikkor 35-70mm f/2.8D"; + lenses["26 3C 54 80 30 3C 1C 06"] = "Sigma 55-200mm F4-5.6 DC"; + lenses["26 3C 5C 82 30 3C 1C 02"] = "Sigma 70-210mm F4-5.6 UC-II"; + lenses["26 3C 5C 8E 30 3C 1C 02"] = "Sigma 70-300mm F4-5.6 DG Macro"; + lenses["26 3D 3C 80 2F 3D 1C 02"] = "Sigma 28-300mm F3.8-5.6 Aspherical"; + lenses["26 3E 3C 6A 2E 3C 1C 02"] = "Sigma 28-105mm F3.8-5.6 UC-III Aspherical IF"; + lenses["26 40 27 3F 2C 34 1C 02"] = "Sigma 15-30mm F3.5-4.5 EX Aspherical DG DF"; + lenses["26 40 2D 44 2B 34 1C 02"] = "Sigma 18-35 F3.5-4.5 Aspherical"; + lenses["26 40 2D 50 2C 3C 1C 06"] = "Sigma 18-50mm F3.5-5.6 DC"; + lenses["26 40 2D 70 2B 3C 1C 06"] = "Sigma 18-125mm F3.5-5.6 DC"; + lenses["26 40 2D 80 2C 40 1C 06"] = "Sigma 18-200mm F3.5-6.3 DC"; + lenses["26 40 37 5C 2C 3C 1C 02"] = "Sigma 24-70mm F3.5-5.6 Aspherical HF"; + lenses["26 40 3C 60 2C 3C 1C 02"] = "Sigma 28-80mm F3.5-5.6 Mini Zoom Macro II Aspherical"; + lenses["26 40 3C 65 2C 3C 1C 02"] = "Sigma 28-90mm F3.5-5.6 Macro"; + lenses["26 40 3C 80 2B 3C 1C 02"] = "Sigma 28-200mm F3.5-5.6 Compact Aspherical Hyperzoom Macro"; + lenses["26 40 3C 80 2C 3C 1C 02"] = "Sigma 28-200mm F3.5-5.6 Compact Aspherical Hyperzoom Macro"; + lenses["26 40 3C 8E 2C 40 1C 02"] = "Sigma 28-300mm F3.5-6.3 Macro"; + lenses["26 40 7B A0 34 40 1C 02"] = "Sigma APO 170-500mm F5-6.3 Aspherical RF"; + lenses["26 41 3C 8E 2C 40 1C 02"] = "Sigma 28-300mm F3.5-6.3 DG Macro"; + lenses["26 44 73 98 34 3C 1C 02"] = "Sigma 135-400mm F4.5-5.6 APO Aspherical"; + lenses["26 48 11 11 30 30 1C 02"] = "Sigma 8mm F4 EX Circular Fisheye"; + lenses["26 48 27 27 24 24 1C 02"] = "Sigma 15mm F2.8 EX Diagonal Fish-Eye"; + lenses["26 48 2D 50 24 24 1C 06"] = "Sigma 18-50mm F2.8 EX DC"; + lenses["26 48 31 49 24 24 1C 02"] = "Sigma 20-40mm F2.8"; + lenses["26 48 37 56 24 24 1C 02"] = "Sigma 24-60mm F2.8 EX DG"; + lenses["26 48 3C 5C 24 24 1C 06"] = "Sigma 28-70mm F2.8 EX DG"; + lenses["26 48 3C 5C 24 30 1C 02"] = "Sigma 28-70mm F2.8-4 High Speed Zoom"; + lenses["26 48 3C 6A 24 30 1C 02"] = "Sigma 28-105mm F2.8-4 Aspherical"; + lenses["26 48 8E 8E 30 30 1C 02"] = "Sigma APO TELE MACRO 300mm F4"; + lenses["26 54 2B 44 24 30 1C 02"] = "Sigma 17-35mm F2.8-4 EX Aspherical"; + lenses["26 54 37 5C 24 24 1C 02"] = "Sigma 24-70mm F2.8 EX DG Macro"; + lenses["26 54 37 73 24 34 1C 02"] = "Sigma 24-135mm F2.8-4.5"; + lenses["26 54 3C 5C 24 24 1C 02"] = "Sigma 28-70mm F2.8 EX"; + lenses["26 58 31 31 14 14 1C 02"] = "Sigma 20mm F1.8 EX Aspherical DG DF RF"; + lenses["26 58 37 37 14 14 1C 02"] = "Sigma 24mm F1.8 EX Aspherical DG DF MACRO"; + lenses["26 58 3C 3C 14 14 1C 02"] = "Sigma 28mm F1.8 EX DG DF"; + lenses["27 48 8E 8E 24 24 1D 02"] = "AF-I Nikkor 300mm f/2.8D IF-ED"; + lenses["27 48 8E 8E 24 24 E1 02"] = "AF-I Nikkor 300mm f/2.8D IF-ED + TC-17E"; + lenses["27 48 8E 8E 24 24 F1 02"] = "AF-I Nikkor 300mm f/2.8D IF-ED + TC-14E"; + lenses["27 48 8E 8E 24 24 F2 02"] = "AF-I Nikkor 300mm f/2.8D IF-ED + TC-20E"; + lenses["28 3C A6 A6 30 30 1D 02"] = "AF-I Nikkor 600mm f/4D IF-ED"; + lenses["28 3C A6 A6 30 30 E1 02"] = "AF-I Nikkor 600mm f/4D IF-ED + TC-17E"; + lenses["28 3C A6 A6 30 30 F1 02"] = "AF-I Nikkor 600mm f/4D IF-ED + TC-14E"; + lenses["28 3C A6 A6 30 30 F2 02"] = "AF-I Nikkor 600mm f/4D IF-ED + TC-20E"; + lenses["2A 54 3C 3C 0C 0C 26 02"] = "AF Nikkor 28mm f/1.4D"; + lenses["2B 3C 44 60 30 3C 1F 02"] = "AF Zoom-Nikkor 35-80mm f/4-5.6D"; + lenses["2C 48 6A 6A 18 18 27 02"] = "AF DC-Nikkor 105mm f/2D"; + lenses["2D 48 80 80 30 30 21 02"] = "AF Micro-Nikkor 200mm f/4D IF-ED"; + lenses["2E 48 5C 82 30 3C 28 02"] = "AF Nikkor 70-210mm f/4-5.6D"; + lenses["2F 40 30 44 2C 34 29 02"] = "Unknown 20-35mm f/3.5-4.5D"; + lenses["2F 48 30 44 24 24 29 02"] = "Tokina AT-X 235 AF PRO - AF 20-35mm f/2.8"; + lenses["30 48 98 98 24 24 24 02"] = "AF-I Nikkor 400mm f/2.8D IF-ED"; + lenses["30 48 98 98 24 24 E1 02"] = "AF-I Nikkor 400mm f/2.8D IF-ED + TC-17E"; + lenses["30 48 98 98 24 24 F1 02"] = "AF-I Nikkor 400mm f/2.8D IF-ED + TC-14E"; + lenses["30 48 98 98 24 24 F2 02"] = "AF-I Nikkor 400mm f/2.8D IF-ED + TC-20E"; + lenses["31 54 56 56 24 24 25 02"] = "AF Micro-Nikkor 60mm f/2.8D"; + lenses["32 53 64 64 24 24 35 02"] = "Tamron SP AF90mm f/2.8 Di Macro 1:2 (272E)"; + lenses["32 54 50 50 24 24 35 02"] = "Sigma 50mm F2.8 EX DG Macro"; + lenses["32 54 6A 6A 24 24 35 02"] = "AF Micro-Nikkor 105mm f/2.8D"; + lenses["33 48 2D 2D 24 24 31 02"] = "AF Nikkor 18mm f/2.8D"; + lenses["33 54 3C 5E 24 24 62 02"] = "Tamron SP AF28-75mm f/2.8 XR Di LD Aspherical (IF) Macro"; + lenses["34 48 29 29 24 24 32 02"] = "AF Fisheye Nikkor 16mm f/2.8D"; + lenses["35 3C A0 A0 30 30 33 02"] = "AF-I Nikkor 500mm f/4D IF-ED"; + lenses["35 3C A0 A0 30 30 E1 02"] = "AF-I Nikkor 500mm f/4D IF-ED + TC-17E"; + lenses["35 3C A0 A0 30 30 F1 02"] = "AF-I Nikkor 500mm f/4D IF-ED + TC-14E"; + lenses["35 3C A0 A0 30 30 F2 02"] = "AF-I Nikkor 500mm f/4D IF-ED + TC-20E"; + lenses["36 48 37 37 24 24 34 02"] = "AF Nikkor 24mm f/2.8D"; + lenses["37 48 30 30 24 24 36 02"] = "AF Nikkor 20mm f/2.8D"; + lenses["38 4C 62 62 14 14 37 02"] = "AF Nikkor 85mm f/1.8D"; + lenses["3A 40 3C 5C 2C 34 39 02"] = "AF Zoom-Nikkor 28-70mm f/3.5-4.5D"; + lenses["3B 48 44 5C 24 24 3A 02"] = "AF Zoom-Nikkor 35-70mm f/2.8D N"; + lenses["3C 48 60 80 24 24 3B 02"] = "AF Zoom-Nikkor 80-200mm f/2.8D ED"; + lenses["3D 3C 44 60 30 3C 3E 02"] = "AF Zoom-Nikkor 35-80mm f/4-5.6D"; + lenses["3E 48 3C 3C 24 24 3D 02"] = "AF Nikkor 28mm f/2.8D"; + lenses["3F 40 44 6A 2C 34 45 02"] = "AF Zoom-Nikkor 35-105mm f/3.5-4.5D"; + lenses["41 48 7C 7C 24 24 43 02"] = "AF Nikkor 180mm f/2.8D IF-ED"; + lenses["42 54 44 44 18 18 44 02"] = "AF Nikkor 35mm f/2D"; + lenses["43 54 50 50 0C 0C 46 02"] = "AF Nikkor 50mm f/1.4D"; + lenses["44 44 60 80 34 3C 47 02"] = "AF Zoom-Nikkor 80-200mm f/4.5-5.6D "; + lenses["45 3D 3C 60 2C 3C 48 02"] = "Tamron AF28-80mm f/3.5-5.6 Aspherical"; + lenses["45 40 3C 60 2C 3C 48 02"] = "AF Zoom-Nikkor 28-80mm F/3.5-5.6D"; + lenses["45 41 37 72 2C 3C 48 02"] = "Tamron SP AF24-135mm f/3.5-5.6 AD Aspherical (IF) Macro"; + lenses["46 3C 44 60 30 3C 49 02"] = "AF Zoom-Nikkor 35-80mm f/4-5.6D N"; + lenses["47 42 37 50 2A 34 4A 02"] = "AF Zoom-Nikkor 24-50mm f/3.3-4.5D"; + lenses["48 38 1F 37 34 3C 4B 06"] = "Sigma 12-24mm F4.5-5.6 EX Aspherical DG HSM"; + lenses["48 3C 19 31 30 3C 4B 06"] = "Sigma 10-20mm F4-5.6 EX DC HSM"; + lenses["48 3C 50 A0 30 40 4B 02"] = "Sigma 50-500mm F4-6.3 EX APO RF HSM"; + lenses["48 3C 8E B0 3C 3C 4B 02"] = "Sigma APO 300-800 F5.6 EX DG HSM"; + lenses["48 3C B0 B0 3C 3C 4B 02"] = "Sigma APO 800mm F5.6 EX HSM"; + lenses["48 44 A0 A0 34 34 4B 02"] = "Sigma APO 500mm F4.5 EX HSM"; + lenses["48 48 24 24 24 24 4B 02"] = "Sigma 14mm F2.8 EX Aspherical HSM"; + lenses["48 48 2B 44 24 30 4B 06"] = "Sigma 17-35mm F2.8-4 EX DG Aspherical HSM"; + lenses["48 48 68 8E 30 30 4B 02"] = "Sigma 100-300mm F4 EX IF HSM"; + lenses["48 48 76 76 24 24 4B 06"] = "Sigma 150mm F2.8 EX DG APO Macro HSM"; + lenses["48 48 8E 8E 24 24 4B 02"] = "AF-S Nikkor 300mm f/2.8D IF-ED"; + lenses["48 48 8E 8E 24 24 E1 02"] = "AF-S Nikkor 300mm f/2.8D IF-ED + TC-17E"; + lenses["48 48 8E 8E 24 24 F1 02"] = "AF-S Nikkor 300mm f/2.8D IF-ED + TC-14E"; + lenses["48 48 8E 8E 24 24 F2 02"] = "AF-S Nikkor 300mm f/2.8D IF-ED + TC-20E"; + lenses["48 4C 7C 7C 2C 2C 4B 02"] = "Sigma 180mm F3.5 EX DG Macro"; + lenses["48 4C 7D 7D 2C 2C 4B 02"] = "Sigma APO MACRO 180mm F3.5 EX DG HSM"; + lenses["48 54 3E 3E 0C 0C 4B 06"] = "Sigma 30mm F1.4 EX DC HSM"; + lenses["48 54 5C 80 24 24 4B 02"] = "Sigma 70-200mm F2.8 EX APO IF HSM"; + lenses["48 54 6F 8E 24 24 4B 02"] = "Sigma APO 120-300mm F2.8 EX DG HSM"; + lenses["48 54 8E 8E 24 24 4B 02"] = "Sigma APO 300mm F2.8 EX DG HSM"; + lenses["49 3C A6 A6 30 30 4C 02"] = "AF-S Nikkor 600mm f/4D IF-ED"; + lenses["49 3C A6 A6 30 30 E1 02"] = "AF-S Nikkor 600mm f/4D IF-ED + TC-17E"; + lenses["49 3C A6 A6 30 30 F1 02"] = "AF-S Nikkor 600mm f/4D IF-ED + TC-14E"; + lenses["49 3C A6 A6 30 30 F2 02"] = "AF-S Nikkor 600mm f/4D IF-ED + TC-20E"; + lenses["4A 54 62 62 0C 0C 4D 02"] = "AF Nikkor 85mm f/1.4D IF"; + lenses["4B 3C A0 A0 30 30 4E 02"] = "AF-S Nikkor 500mm f/4D IF-ED"; + lenses["4B 3C A0 A0 30 30 E1 02"] = "AF-S Nikkor 500mm f/4D IF-ED + TC-17E"; + lenses["4B 3C A0 A0 30 30 F1 02"] = "AF-S Nikkor 500mm f/4D IF-ED + TC-14E"; + lenses["4B 3C A0 A0 30 30 F2 02"] = "AF-S Nikkor 500mm f/4D IF-ED + TC-20E"; + lenses["4C 40 37 6E 2C 3C 4F 02"] = "AF Zoom-Nikkor 24-120mm f/3.5-5.6D IF"; + lenses["4D 40 3C 80 2C 3C 62 02"] = "AF Zoom-Nikkor 28-200mm f/3.5-5.6D IF"; + lenses["4D 41 3C 8E 2B 40 62 02"] = "Tamron AF28-300mm f/3.5-6.3 XR Di LD Aspherical (IF)"; + lenses["4D 41 3C 8E 2C 40 62 02"] = "Tamron AF28-300mm f/3.5-6.3 XR LD Aspherical (IF)"; + lenses["4E 48 72 72 18 18 51 02"] = "AF DC-Nikkor 135mm f/2D"; + lenses["4F 40 37 5C 2C 3C 53 06"] = "IX-Nikkor 24-70mm f/3.5-5.6"; + lenses["50 48 56 7C 30 3C 54 06"] = "IX-Nikkor 60-180mm f/4-5.6"; + lenses["53 48 60 80 24 24 57 02"] = "AF Zoom-Nikkor 80-200mm f/2.8D ED"; + lenses["53 48 60 80 24 24 60 02"] = "AF Zoom-Nikkor 80-200mm f/2.8D ED"; + lenses["54 44 5C 7C 34 3C 58 02"] = "AF Zoom-Micro Nikkor 70-180mm f/4.5-5.6D ED"; + lenses["56 3C 5C 8E 30 3C 1C 02"] = "Sigma 70-300mm F4-5.6 APO Macro Super II"; + lenses["56 48 5C 8E 30 3C 5A 02"] = "AF Zoom-Nikkor 70-300mm f/4-5.6D ED"; + lenses["59 48 98 98 24 24 5D 02"] = "AF-S Nikkor 400mm f/2.8D IF-ED"; + lenses["59 48 98 98 24 24 E1 02"] = "AF-S Nikkor 400mm f/2.8D IF-ED + TC-17E"; + lenses["59 48 98 98 24 24 F1 02"] = "AF-S Nikkor 400mm f/2.8D IF-ED + TC-14E"; + lenses["59 48 98 98 24 24 F2 02"] = "AF-S Nikkor 400mm f/2.8D IF-ED + TC-20E"; + lenses["5A 3C 3E 56 30 3C 5E 06"] = "IX-Nikkor 30-60mm f/4-5.6"; + lenses["5B 44 56 7C 34 3C 5F 06"] = "IX-Nikkor 60-180mm f/4.5-5.6"; + lenses["5D 48 3C 5C 24 24 63 02"] = "AF-S Zoom-Nikkor 28-70mm f/2.8D IF-ED"; + lenses["5E 48 60 80 24 24 64 02"] = "AF-S Zoom-Nikkor 80-200mm f/2.8D IF-ED"; + lenses["5F 40 3C 6A 2C 34 65 02"] = "AF Zoom-Nikkor 28-105mm f/3.5-4.5D IF"; + lenses["60 40 3C 60 2C 3C 66 02"] = "AF Zoom-Nikkor 28-80mm f/3.5-5.6D"; + lenses["61 44 5E 86 34 3C 67 02"] = "AF Zoom-Nikkor 75-240mm f/4.5-5.6D"; + lenses["63 48 2B 44 24 24 68 02"] = "AF-S Nikkor 17-35mm f/2.8D IF-ED"; + lenses["64 00 62 62 24 24 6A 02"] = "PC Micro-Nikkor 85mm f/2.8D"; + lenses["65 44 60 98 34 3C 6B 0A"] = "AF VR Zoom-Nikkor 80-400mm f/4.5-5.6D ED"; + lenses["66 40 2D 44 2C 34 6C 02"] = "AF Zoom-Nikkor 18-35mm f/3.5-4.5D IF-ED"; + lenses["67 48 37 62 24 30 6D 02"] = "AF Zoom-Nikkor 24-85mm f/2.8-4D IF"; + lenses["67 54 37 5C 24 24 1C 02"] = "Sigma 24-70mm F2.8 EX DG Macro"; + lenses["68 42 3C 60 2A 3C 6E 06"] = "AF Zoom-Nikkor 28-80mm f/3.3-5.6G"; + lenses["69 48 5C 8E 30 3C 6F 02"] = "Tamron AF70-300mm f/4-5.6 LD Macro 1:2"; + lenses["69 48 5C 8E 30 3C 6F 06"] = "AF Zoom-Nikkor 70-300mm f/4-5.6G"; + lenses["6A 48 8E 8E 30 30 70 02"] = "AF-S Nikkor 300mm f/4D IF-ED"; + lenses["6B 48 24 24 24 24 71 02"] = "AF Nikkor ED 14mm f/2.8D"; + lenses["6D 48 8E 8E 24 24 73 02"] = "AF-S Nikkor 300mm f/2.8D IF-ED II"; + lenses["6E 48 98 98 24 24 74 02"] = "AF-S Nikkor 400mm f/2.8D IF-ED II"; + lenses["6F 3C A0 A0 30 30 75 02"] = "AF-S Nikkor 500mm f/4D IF-ED II"; + lenses["70 3C A6 A6 30 30 76 02"] = "AF-S Nikkor 600mm f/4D IF-ED II"; + lenses["72 48 4C 4C 24 24 77 00"] = "Nikkor 45mm f/2.8 P"; + lenses["74 40 37 62 2C 34 78 06"] = "AF-S Zoom-Nikkor 24-85mm f/3.5-4.5G IF-ED"; + lenses["75 40 3C 68 2C 3C 79 06"] = "AF Zoom-Nikkor 28-100mm f/3.5-5.6G"; + lenses["76 58 50 50 14 14 7A 02"] = "AF Nikkor 50mm f/1.8D"; + lenses["77 44 61 98 34 3C 7B 0E"] = "Sigma 80-400mm f4.5-5.6 EX OS"; + lenses["77 48 5C 80 24 24 7B 0E"] = "AF-S VR Zoom-Nikkor 70-200mm f/2.8G IF-ED"; + lenses["78 40 37 6E 2C 3C 7C 0E"] = "AF-S VR Zoom-Nikkor 24-120mm f/3.5-5.6G IF-ED"; + lenses["79 40 11 11 2C 2C 1C 06"] = "Sigma 8mm F3.5 EX"; + lenses["79 40 3C 80 2C 3C 7F 06"] = "AF Zoom-Nikkor 28-200mm f/3.5-5.6G IF-ED"; + lenses["79 48 5C 5C 24 24 1C 06"] = "Sigma 70mm F2.8 EX DG Macro"; + lenses["7A 3B 53 80 30 3C 4B 06"] = "Sigma 55-200mm F4-5.6 DC HSM"; + lenses["7A 3C 1F 37 30 30 7E 06"] = "AF-S DX Zoom-Nikkor 12-24mm f/4G IF-ED"; + lenses["7A 40 2D 50 2C 3C 4B 06"] = "Sigma 18-50mm F3.5-5.6 DC HSM"; + lenses["7A 47 2B 5C 24 34 4B 06"] = "Sigma 17-70mm F2.8-4.5 DC Macro Asp. IF HSM"; + lenses["7A 47 50 76 24 24 4B 06"] = "Sigma APO 50-150mm F2.8 EX DC HSM"; + lenses["7A 48 2B 5C 24 34 4B 06"] = "Sigma 17-70mm F2.8-4.5 DC Macro Asp. IF HSM"; + lenses["7A 48 2D 50 24 24 4B 06"] = "Sigma 18-50mm F2.8 EX DC HSM"; + lenses["7A 48 5C 80 24 24 4B 06"] = "Sigma 70-200mm F2.8 EX APO DG Macro HSM II"; + lenses["7A 54 6E 8E 24 24 4B 02"] = "Sigma APO 120-300mm F2.8 EX DG HSM"; + lenses["7B 48 80 98 30 30 80 0E"] = "AF-S VR Zoom-Nikkor 200-400mm f/4G IF-ED"; + lenses["7D 48 2B 53 24 24 82 06"] = "AF-S DX Zoom-Nikkor 17-55mm f/2.8G IF-ED"; + lenses["7F 40 2D 5C 2C 34 84 06"] = "AF-S DX Zoom-Nikkor 18-70mm f/3.5-4.5G IF-ED"; + lenses["7F 48 2B 5C 24 34 1C 06"] = "Sigma 17-70mm F2.8-4.5 DC Macro Asp. IF"; + lenses["7F 48 2D 50 24 24 1C 06"] = "Sigma 18-50mm F2.8 EX DC Macro"; + lenses["80 48 1A 1A 24 24 85 06"] = "AF DX Fisheye-Nikkor 10.5mm f/2.8G ED"; + lenses["81 54 80 80 18 18 86 0E"] = "AF-S VR Nikkor 200mm f/2G IF-ED"; + lenses["82 48 8E 8E 24 24 87 0E"] = "AF-S VR Nikkor 300mm f/2.8G IF-ED"; + lenses["89 3C 53 80 30 3C 8B 06"] = "AF-S DX Zoom-Nikkor 55-200mm f/4-5.6G ED"; + lenses["8A 54 6A 6A 24 24 8C 0E"] = "AF-S VR Micro-Nikkor 105mm f/2.8G IF-ED"; + lenses["8B 40 2D 80 2C 3C 8D 0E"] = "AF-S DX VR Zoom-Nikkor 18-200mm f/3.5-5.6G IF-ED"; + lenses["8B 40 2D 80 2C 3C FD 0E"] = "AF-S DX VR Zoom-Nikkor 18-200mm f/3.5-5.6G IF-ED"; + lenses["8C 40 2D 53 2C 3C 8E 06"] = "AF-S DX Zoom-Nikkor 18-55mm f/3.5-5.6G ED"; + lenses["8D 44 5C 8E 34 3C 8F 0E"] = "AF-S VR Zoom-Nikkor 70-300mm f/4.5-5.6G IF-ED"; + lenses["8F 40 2D 72 2C 3C 91 06"] = "AF-S DX Zoom-Nikkor 18-135mm f/3.5-5.6G IF-ED"; + lenses["90 3B 53 80 30 3C 92 0E"] = "AF-S DX VR Zoom-Nikkor 55-200mm f/4-5.6G IF-ED"; + lenses["92 48 24 37 24 24 94 06"] = "AF-S Zoom-Nikkor 14-24mm f/2.8G ED"; + lenses["93 48 37 5C 24 24 95 06"] = "AF-S Zoom-Nikkor 24-70mm f/2.8G ED"; lenses["94 40 2D 53 2C 3C 96 06"] = "AF-S DX Zoom-Nikkor 18-55mm f/3.5-5.6G ED II"; lenses["95 00 37 37 2C 2C 97 06"] = "PC-E Nikkor 24mm f/3.5D ED"; - lenses["95 4C 37 37 2C 2C 97 02"] = "PC-E Nikkor 24mm f/3.5D ED"; - lenses["96 48 98 98 24 24 98 0E"] = "AF-S VR Nikkor 400mm f/2.8G ED"; - lenses["97 3C A0 A0 30 30 99 0E"] = "AF-S VR Nikkor 500mm f/4G ED"; + lenses["95 4C 37 37 2C 2C 97 02"] = "PC-E Nikkor 24mm f/3.5D ED"; + lenses["96 48 98 98 24 24 98 0E"] = "AF-S VR Nikkor 400mm f/2.8G ED"; + lenses["97 3C A0 A0 30 30 99 0E"] = "AF-S VR Nikkor 500mm f/4G ED"; lenses["98 3C A6 A6 30 30 9A 0E"] = "AF-S VR Nikkor 600mm f/4G ED"; lenses["99 40 29 62 2C 3C 9B 0E"] = "AF-S DX VR Zoom-Nikkor 16-85mm f/3.5-5.6G ED"; - lenses["9A 40 2D 53 2C 3C 9C 0E"] = "AF-S DX VR Zoom-Nikkor 18-55mm f/3.5-5.6G"; - lenses["9B 00 4C 4C 24 24 9D 06"] = "PC-E Micro Nikkor 45mm f/2.8D ED"; - lenses["9B 54 4C 4C 24 24 9D 02"] = "PC-E Micro Nikkor 45mm f/2.8D ED"; - lenses["9C 54 56 56 24 24 9E 06"] = "AF-S Micro Nikkor 60mm f/2.8G ED"; - lenses["9D 00 62 62 24 24 9F 06"] = "PC-E Micro Nikkor 85mm f/2.8D"; + lenses["9A 40 2D 53 2C 3C 9C 0E"] = "AF-S DX VR Zoom-Nikkor 18-55mm f/3.5-5.6G"; + lenses["9B 00 4C 4C 24 24 9D 06"] = "PC-E Micro Nikkor 45mm f/2.8D ED"; + lenses["9B 54 4C 4C 24 24 9D 02"] = "PC-E Micro Nikkor 45mm f/2.8D ED"; + lenses["9C 54 56 56 24 24 9E 06"] = "AF-S Micro Nikkor 60mm f/2.8G ED"; + lenses["9D 00 62 62 24 24 9F 06"] = "PC-E Micro Nikkor 85mm f/2.8D"; lenses["9D 54 62 62 24 24 9F 02"] = "PC-E Micro Nikkor 85mm f/2.8D"; - lenses["9E 40 2D 6A 2C 3C A0 0E"] = "AF-S DX VR Zoom-Nikkor 18-105mm f/3.5-5.6G ED"; - lenses["9F 58 44 44 14 14 A1 06"] = "AF-S DX Nikkor 35mm f/1.8G"; - lenses["A0 54 50 50 0C 0C A2 06"] = "AF-S Nikkor 50mm f/1.4G"; - lenses["A1 40 18 37 2C 34 A3 06"] = "AF-S DX Nikkor 10-24mm f/3.5-4.5G ED"; - lenses["A1 41 19 31 2C 2C 4B 06"] = "Sigma 10-20mm F3.5 EX DC HSM"; - lenses["A2 48 5C 80 24 24 A4 0E"] = "AF-S Nikkor 70-200mm f/2.8G ED VR II"; - lenses["A5 40 2D 88 2C 40 4B 0E"] = "Sigma 18-250mm F3.5-6.3 DC OS HSM"; - lenses["A6 48 37 5C 24 24 4B 06"] = "Sigma 24-70mm F2.8 IF EX DG HSM"; - lenses["B6 48 37 56 24 24 1C 02"] = "Sigma 24-60mm F2.8 EX DG"; + lenses["9E 40 2D 6A 2C 3C A0 0E"] = "AF-S DX VR Zoom-Nikkor 18-105mm f/3.5-5.6G ED"; + lenses["9F 58 44 44 14 14 A1 06"] = "AF-S DX Nikkor 35mm f/1.8G"; + lenses["A0 54 50 50 0C 0C A2 06"] = "AF-S Nikkor 50mm f/1.4G"; + lenses["A1 40 18 37 2C 34 A3 06"] = "AF-S DX Nikkor 10-24mm f/3.5-4.5G ED"; + lenses["A1 41 19 31 2C 2C 4B 06"] = "Sigma 10-20mm F3.5 EX DC HSM"; + lenses["A2 48 5C 80 24 24 A4 0E"] = "AF-S Nikkor 70-200mm f/2.8G ED VR II"; + lenses["A5 40 2D 88 2C 40 4B 0E"] = "Sigma 18-250mm F3.5-6.3 DC OS HSM"; + lenses["A6 48 37 5C 24 24 4B 06"] = "Sigma 24-70mm F2.8 IF EX DG HSM"; + lenses["B6 48 37 56 24 24 1C 02"] = "Sigma 24-60mm F2.8 EX DG"; lenses["CD 3D 2D 70 2E 3C 4B 0E"] = "Sigma 18-125mm F3.8-5.6 DC OS HSM"; - lenses["CE 34 76 A0 38 40 4B 0E"] = "Sigma 150-500mm F5-6.3 DG OS APO HSM"; - lenses["CF 38 6E 98 34 3C 4B 0E"] = "Sigma APO 120-400mm F4.5-5.6 DG OS HSM"; - lenses["DC 48 19 19 24 24 4B 06"] = "Sigma 10mm F2.8 EX DC HSM Fisheye"; - lenses["DE 54 50 50 0C 0C 4B 06"] = "Sigma 50mm F1.4 EX DG HSM"; - lenses["E0 3C 5C 8E 30 3C 4B 06"] = "Sigma 70-300mm F4-5.6 APO DG Macro HSM"; - lenses["E1 58 37 37 14 14 1C 02"] = "Sigma 24mm F1.8 EX DG Aspherical Macro"; - lenses["E5 54 6A 6A 24 24 35 02"] = "Sigma Macro 105mm F2.8 EX DG"; - lenses["E9 54 37 5C 24 24 1C 02"] = "Sigma 24-70mm F2.8 EX DG Macro"; + lenses["CE 34 76 A0 38 40 4B 0E"] = "Sigma 150-500mm F5-6.3 DG OS APO HSM"; + lenses["CF 38 6E 98 34 3C 4B 0E"] = "Sigma APO 120-400mm F4.5-5.6 DG OS HSM"; + lenses["DC 48 19 19 24 24 4B 06"] = "Sigma 10mm F2.8 EX DC HSM Fisheye"; + lenses["DE 54 50 50 0C 0C 4B 06"] = "Sigma 50mm F1.4 EX DG HSM"; + lenses["E0 3C 5C 8E 30 3C 4B 06"] = "Sigma 70-300mm F4-5.6 APO DG Macro HSM"; + lenses["E1 58 37 37 14 14 1C 02"] = "Sigma 24mm F1.8 EX DG Aspherical Macro"; + lenses["E5 54 6A 6A 24 24 35 02"] = "Sigma Macro 105mm F2.8 EX DG"; + lenses["E9 54 37 5C 24 24 1C 02"] = "Sigma 24-70mm F2.8 EX DG Macro"; lenses["ED 40 2D 80 2C 40 4B 0E"] = "Sigma 18-200mm F3.5-6.3 DC OS HSM"; - lenses["EE 48 5C 80 24 24 4B 06"] = "Sigma 70-200mm F2.8 EX APO DG Macro HSM II"; - lenses["F0 38 1F 37 34 3C 4B 06"] = "Sigma 12-24mm F4.5-5.6 EX DG Aspherical HSM"; - lenses["F3 54 2B 50 24 24 84 0E"] = "Tamron SP AF 17-50mm F/2.8 XR Di II VC LD Aspherical (IF) (B005)"; - lenses["F4 54 56 56 18 18 84 06"] = "Tamron SP AF 60mm f/2.0 Di II Macro 1:1 (G005)"; + lenses["EE 48 5C 80 24 24 4B 06"] = "Sigma 70-200mm F2.8 EX APO DG Macro HSM II"; + lenses["F0 38 1F 37 34 3C 4B 06"] = "Sigma 12-24mm F4.5-5.6 EX DG Aspherical HSM"; + lenses["F3 54 2B 50 24 24 84 0E"] = "Tamron SP AF 17-50mm F/2.8 XR Di II VC LD Aspherical (IF) (B005)"; + lenses["F4 54 56 56 18 18 84 06"] = "Tamron SP AF 60mm f/2.0 Di II Macro 1:1 (G005)"; lenses["F5 40 2C 8A 2C 40 40 0E"] = "Tamron AF 18-270mm f/3.5-6.3 Di II VC LD Aspherical (IF) Macro (B003)"; - lenses["F5 48 76 76 24 24 4B 06"] = "Sigma 150mm F2.8 EX DG APO Macro HSM"; - lenses["F6 3F 18 37 2C 34 84 06"] = "Tamron SP AF 10-24mm f/3.5-4.5 Di II LD Aspherical (IF) (B001)"; - lenses["F7 53 5C 80 24 24 84 06"] = "Tamron SP AF 70-200mm f/2.8 Di LD (IF) Macro (A001)"; - lenses["F8 54 3E 3E 0C 0C 4B 06"] = "Sigma 30mm F1.4 EX DC HSM"; + lenses["F5 48 76 76 24 24 4B 06"] = "Sigma 150mm F2.8 EX DG APO Macro HSM"; + lenses["F6 3F 18 37 2C 34 84 06"] = "Tamron SP AF 10-24mm f/3.5-4.5 Di II LD Aspherical (IF) (B001)"; + lenses["F7 53 5C 80 24 24 84 06"] = "Tamron SP AF 70-200mm f/2.8 Di LD (IF) Macro (A001)"; + lenses["F8 54 3E 3E 0C 0C 4B 06"] = "Sigma 30mm F1.4 EX DC HSM"; lenses["F8 55 64 64 24 24 84 06"] = "Tamron SP AF 90mm f/2.8 Di Macro 1:1 (272NII)"; - lenses["F9 3C 19 31 30 3C 4B 06"] = "Sigma 10-20mm F4-5.6 EX DC HSM"; - lenses["F9 40 3C 8E 2C 40 40 0E"] = "Tamron AF 28-300mm f/3.5-6.3 XR Di VC LD Aspherical (IF) Macro (A20)"; - lenses["FA 54 3C 5E 24 24 84 06"] = "Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical (IF) Macro (A09NII)"; - lenses["FB 54 8E 8E 24 24 4B 02"] = "Sigma APO 300mm F2.8 EX DG HSM"; - lenses["FD 47 50 76 24 24 4B 06"] = "Sigma 50-150mm F2.8 EX APO DC HSM II"; - lenses["FE 47 00 00 24 24 4B 06"] = "Sigma 4.5mm F2.8 EX DC Circular Fisheye HSM"; - } - virtual std::string toString (Tag* t) { - - static const unsigned char xlat[2][256] = { - { 0xc1,0xbf,0x6d,0x0d,0x59,0xc5,0x13,0x9d,0x83,0x61,0x6b,0x4f,0xc7,0x7f,0x3d,0x3d, - 0x53,0x59,0xe3,0xc7,0xe9,0x2f,0x95,0xa7,0x95,0x1f,0xdf,0x7f,0x2b,0x29,0xc7,0x0d, - 0xdf,0x07,0xef,0x71,0x89,0x3d,0x13,0x3d,0x3b,0x13,0xfb,0x0d,0x89,0xc1,0x65,0x1f, - 0xb3,0x0d,0x6b,0x29,0xe3,0xfb,0xef,0xa3,0x6b,0x47,0x7f,0x95,0x35,0xa7,0x47,0x4f, - 0xc7,0xf1,0x59,0x95,0x35,0x11,0x29,0x61,0xf1,0x3d,0xb3,0x2b,0x0d,0x43,0x89,0xc1, - 0x9d,0x9d,0x89,0x65,0xf1,0xe9,0xdf,0xbf,0x3d,0x7f,0x53,0x97,0xe5,0xe9,0x95,0x17, - 0x1d,0x3d,0x8b,0xfb,0xc7,0xe3,0x67,0xa7,0x07,0xf1,0x71,0xa7,0x53,0xb5,0x29,0x89, - 0xe5,0x2b,0xa7,0x17,0x29,0xe9,0x4f,0xc5,0x65,0x6d,0x6b,0xef,0x0d,0x89,0x49,0x2f, - 0xb3,0x43,0x53,0x65,0x1d,0x49,0xa3,0x13,0x89,0x59,0xef,0x6b,0xef,0x65,0x1d,0x0b, - 0x59,0x13,0xe3,0x4f,0x9d,0xb3,0x29,0x43,0x2b,0x07,0x1d,0x95,0x59,0x59,0x47,0xfb, - 0xe5,0xe9,0x61,0x47,0x2f,0x35,0x7f,0x17,0x7f,0xef,0x7f,0x95,0x95,0x71,0xd3,0xa3, - 0x0b,0x71,0xa3,0xad,0x0b,0x3b,0xb5,0xfb,0xa3,0xbf,0x4f,0x83,0x1d,0xad,0xe9,0x2f, - 0x71,0x65,0xa3,0xe5,0x07,0x35,0x3d,0x0d,0xb5,0xe9,0xe5,0x47,0x3b,0x9d,0xef,0x35, - 0xa3,0xbf,0xb3,0xdf,0x53,0xd3,0x97,0x53,0x49,0x71,0x07,0x35,0x61,0x71,0x2f,0x43, - 0x2f,0x11,0xdf,0x17,0x97,0xfb,0x95,0x3b,0x7f,0x6b,0xd3,0x25,0xbf,0xad,0xc7,0xc5, - 0xc5,0xb5,0x8b,0xef,0x2f,0xd3,0x07,0x6b,0x25,0x49,0x95,0x25,0x49,0x6d,0x71,0xc7 }, - { 0xa7,0xbc,0xc9,0xad,0x91,0xdf,0x85,0xe5,0xd4,0x78,0xd5,0x17,0x46,0x7c,0x29,0x4c, - 0x4d,0x03,0xe9,0x25,0x68,0x11,0x86,0xb3,0xbd,0xf7,0x6f,0x61,0x22,0xa2,0x26,0x34, - 0x2a,0xbe,0x1e,0x46,0x14,0x68,0x9d,0x44,0x18,0xc2,0x40,0xf4,0x7e,0x5f,0x1b,0xad, - 0x0b,0x94,0xb6,0x67,0xb4,0x0b,0xe1,0xea,0x95,0x9c,0x66,0xdc,0xe7,0x5d,0x6c,0x05, - 0xda,0xd5,0xdf,0x7a,0xef,0xf6,0xdb,0x1f,0x82,0x4c,0xc0,0x68,0x47,0xa1,0xbd,0xee, - 0x39,0x50,0x56,0x4a,0xdd,0xdf,0xa5,0xf8,0xc6,0xda,0xca,0x90,0xca,0x01,0x42,0x9d, - 0x8b,0x0c,0x73,0x43,0x75,0x05,0x94,0xde,0x24,0xb3,0x80,0x34,0xe5,0x2c,0xdc,0x9b, - 0x3f,0xca,0x33,0x45,0xd0,0xdb,0x5f,0xf5,0x52,0xc3,0x21,0xda,0xe2,0x22,0x72,0x6b, - 0x3e,0xd0,0x5b,0xa8,0x87,0x8c,0x06,0x5d,0x0f,0xdd,0x09,0x19,0x93,0xd0,0xb9,0xfc, - 0x8b,0x0f,0x84,0x60,0x33,0x1c,0x9b,0x45,0xf1,0xf0,0xa3,0x94,0x3a,0x12,0x77,0x33, - 0x4d,0x44,0x78,0x28,0x3c,0x9e,0xfd,0x65,0x57,0x16,0x94,0x6b,0xfb,0x59,0xd0,0xc8, - 0x22,0x36,0xdb,0xd2,0x63,0x98,0x43,0xa1,0x04,0x87,0x86,0xf7,0xa6,0x26,0xbb,0xd6, - 0x59,0x4d,0xbf,0x6a,0x2e,0xaa,0x2b,0xef,0xe6,0x78,0xb6,0x4e,0xe0,0x2f,0xdc,0x7c, - 0xbe,0x57,0x19,0x32,0x7e,0x2a,0xd0,0xb8,0xba,0x29,0x00,0x3c,0x52,0x7d,0xa8,0x49, - 0x3b,0x2d,0xeb,0x25,0x49,0xfa,0xa3,0xaa,0x39,0xa7,0xc5,0xa7,0x50,0x11,0x36,0xfb, - 0xc6,0x67,0x4a,0xf5,0xa5,0x12,0x65,0x7e,0xb0,0xdf,0xaf,0x4e,0xb3,0x61,0x7f,0x2f } }; - - int ver = (t->toInt (0, BYTE) - '0') * 1000 + (t->toInt (1, BYTE) - '0') * 100 + (t->toInt (2, BYTE) - '0') * 10 + (t->toInt (3, BYTE) - '0'); - - std::ostringstream ld; - ld << "Version = " << ver << std::endl; - - int lenstype = t->getParent()->getTag(0x0083)->toInt(0,BYTE); - - std::ostringstream lid; - lid.setf (std::ios_base::hex, std::ios_base::basefield); - lid.setf (std::ios_base::uppercase); - - std::string model = t->getParent()->getParent()->getParent()->getTag(0x0110)->valueToString(); - int lidoffs = 7; - bool d100 = false; - if (model.substr(0,10)=="NIKON D100" || model.substr(0,9)=="NIKON D1X") { - lidoffs = 0; - d100 = true; - } - - unsigned char buffer[15]; - if (d100) - memcpy (buffer, t->getValue()+6, 7); - else - memcpy (buffer, t->getValue()+4, 15); - - if (ver>=201) { - const unsigned char* serval = t->getParent()->getTag(0x001d)->getValue (); - int serial = 0; - for (int i=0; serval[i]; i++) - serial = serial*10 + (isdigit(serval[i]) ? serval[i] - '0' : serval[i] % 10); - const unsigned char* scval = t->getParent()->getTag(0x00a7)->getValue (); - int key = 0; - for (int i=0; i<4; i++) - key ^= scval[i]; - - unsigned char ci = xlat[0][serial & 0xff]; - unsigned char cj = xlat[1][key]; - unsigned char ck = 0x60; - for (int i=0; i < 15; i++) - buffer[i] ^= (cj += ci * ck++); - } - - if (!d100) { - ld << "ExitPupilPosition = " << (int) buffer[0] << std::endl; - ld << "AFAperture = " << (int) buffer[1] << std::endl; - ld << "FocusPosition = " << (int) buffer[4] << std::endl; - ld << "FocusDistance = " << (int) buffer[5] << std::endl; - ld << "FocalLength = " << (int) buffer[6] << std::endl; - ld << "EffectiveMaxAperture = " << (int) buffer[14] << std::endl; - } - - for (int i=0; i<7; i++) - lid << std::setw(2) << std::setfill('0') << (int)buffer[lidoffs+i] << ' '; - lid << std::setw(2) << std::setfill('0') << lenstype; - - std::map::iterator r = lenses.find (lid.str()); - if (r!=lenses.end()) - ld << "Lens = " << r->second; - else - ld << "Lens = Unknown, ID=" << lid.str(); - - return ld.str(); - } - -}; -NALensDataInterpreter naLensDataInterpreter; - -const TagAttrib nikon2Attribs[] = { - 0, 1, 0, 0, 0x0002, "Unknown", &stdInterpreter, - 0, 1, 0, 0, 0x0003, "Quality", &stdInterpreter, - 0, 1, 0, 0, 0x0004, "ColorMode", &stdInterpreter, - 0, 1, 0, 0, 0x0005, "ImageAdjustment", &stdInterpreter, - 0, 1, 0, 0, 0x0006, "ISOSpeed", &naISOInterpreter, - 0, 1, 0, 0, 0x0007, "WhiteBalance", &stdInterpreter, - 0, 1, 0, 0, 0x0008, "Focus", &stdInterpreter, - 0, 1, 0, 0, 0x0009, "Unknown", &stdInterpreter, - 0, 1, 0, 0, 0x000a, "DigitalZoom", &stdInterpreter, - 0, 1, 0, 0, 0x000b, "AuxiliaryLens", &stdInterpreter, - 0, 1, 0, 0, 0x0f00, "Unknown", &stdInterpreter, - -1, 0, 0, 0, 0, "", NULL}; - -const TagAttrib nikon3Attribs[] = { - 0, 1, 0, 0, 0x0001, "MakerNoteVersion", &stdInterpreter, - 0, 1, 0, 0, 0x0002, "ISOSpeed", &naISOInterpreter, - 0, 1, 0, 0, 0x0003, "ColorMode", &stdInterpreter, - 0, 1, 0, 0, 0x0004, "Quality", &stdInterpreter, - 0, 1, 0, 0, 0x0005, "WhiteBalance", &stdInterpreter, - 0, 1, 0, 0, 0x0006, "Sharpness", &stdInterpreter, - 0, 1, 0, 0, 0x0007, "FocusMode", &stdInterpreter, - 0, 1, 0, 0, 0x0008, "FlashSetting", &stdInterpreter, - 0, 1, 0, 0, 0x0009, "FlashType", &stdInterpreter, - 0, 1, 0, 0, 0x000b, "WhiteBalanceFineTune", &stdInterpreter, - 0, 3, 0, 0, 0x000c, "ColorBalance1", &stdInterpreter, - 0, 1, 0, 0, 0x000d, "ProgramShift", &stdInterpreter, - 0, 1, 0, 0, 0x000e, "ExposureDifference", &stdInterpreter, - 0, 1, 0, 0, 0x000f, "ISOSelection", &naISOInterpreter, - 0, 1, 0, 0, 0x0010, "DataDump", &stdInterpreter, - 1, 1, 0, 0, 0x0011, "NikonPreview", &stdInterpreter, - 0, 1, 0, 0, 0x0012, "FlashExposureComp", &stdInterpreter, - 0, 1, 0, 0, 0x0013, "ISOSetting", &stdInterpreter, - 0, 1, 0, 0, 0x0016, "ImageBoundary", &stdInterpreter, - 0, 1, 0, 0, 0x0018, "FlashExposureBracketValue", &stdInterpreter, - 0, 1, 0, 0, 0x0019, "ExposureBracketValue", &stdInterpreter, - 0, 1, 0, 0, 0x001a, "ImageProcessing", &stdInterpreter, - 0, 1, 0, 0, 0x001b, "CropHiSpeed", &stdInterpreter, - 0, 1, 0, 0, 0x001d, "SerialNumber", &stdInterpreter, - 0, 1, 0, 0, 0x001e, "ColorSpace", &stdInterpreter, - 0, 1, 0, 0, 0x0020, "ImageAuthentication", &stdInterpreter, - 0, 1, 0, 0, 0x0080, "ImageAdjustment", &stdInterpreter, - 0, 1, 0, 0, 0x0081, "ToneComp", &stdInterpreter, - 0, 1, 0, 0, 0x0082, "AuxiliaryLens", &stdInterpreter, - 0, 1, 0, 0, 0x0083, "LensType", &naLensTypeInterpreter, - 0, 1, 0, 0, 0x0084, "Lens", &stdInterpreter, - 0, 1, 0, 0, 0x0085, "ManualFocusDistance", &stdInterpreter, - 0, 1, 0, 0, 0x0086, "DigitalZoom", &stdInterpreter, - 0, 1, 0, 0, 0x0087, "FlashMode", &naFlashModeInterpreter, - 0, 1, 0, 0, 0x0088, "AFInfo", &naAFInfoInterpreter, - 0, 1, 0, 0, 0x0089, "ShootingMode", &naShootingModeInterpreter, - 0, 1, 0, 0, 0x008a, "AutoBracketRelease", &stdInterpreter, - 0, 1, 0, 0, 0x008b, "LensFStops", &stdInterpreter, - 0, 1, 0, 0, 0x008c, "NEFCurve1", &stdInterpreter, - 0, 1, 0, 0, 0x008d, "ColorHue", &stdInterpreter, - 0, 1, 0, 0, 0x008f, "SceneMode", &stdInterpreter, - 0, 1, 0, 0, 0x0090, "LightSource", &stdInterpreter, - 0, 1, 0, 0, 0x0091, "ShotInfo", &stdInterpreter, - 0, 1, 0, 0, 0x0092, "HueAdjustment", &stdInterpreter, - 0, 1, 0, 0, 0x0094, "Saturation", &stdInterpreter, - 0, 1, 0, 0, 0x0095, "NoiseReduction", &stdInterpreter, - 0, 1, 0, 0, 0x0096, "NEFCurve2", &stdInterpreter, - 0, 3, 0, 0, 0x0097, "ColorBalance", &stdInterpreter, - 0, 1, 0, 0, 0x0098, "LensData", &naLensDataInterpreter, - 0, 1, 0, 0, 0x0099, "RawImageCenter", &stdInterpreter, - 0, 1, 0, 0, 0x009a, "SensorPixelSize", &stdInterpreter, - 0, 1, 0, 0, 0x00a0, "SerialNumber", &stdInterpreter, - 0, 1, 0, 0, 0x00a2, "ImageDataSize", &stdInterpreter, - 0, 1, 0, 0, 0x00a5, "ImageCount", &stdInterpreter, - 0, 1, 0, 0, 0x00a6, "DeletedImageCount", &stdInterpreter, - 0, 1, 0, 0, 0x00a7, "ShutterCount", &stdInterpreter, - 0, 1, 0, 0, 0x00a9, "ImageOptimization", &stdInterpreter, - 0, 1, 0, 0, 0x00aa, "Saturation", &stdInterpreter, - 0, 1, 0, 0, 0x00ab, "VariProgram", &stdInterpreter, - 0, 1, 0, 0, 0x00ac, "ImageStabilization", &stdInterpreter, - 0, 1, 0, 0, 0x00ad, "AFResponse", &stdInterpreter, - 0, 1, 0, 0, 0x00b0, "MultiExposure", &stdInterpreter, - 0, 1, 0, 0, 0x00b1, "HighISONoiseReduction", &naHiISONRInterpreter, - 0, 1, 0, 0, 0x0e00, "PrintIM", &stdInterpreter, - 0, 0, 0, 0, 0x0e01, "NikonCaptureData", &stdInterpreter, - 0, 0, 0, 0, 0x0e09, "NikonCaptureVersion", &stdInterpreter, - 0, 0, 0, 0, 0x0e0e, "NikonCaptureOffsets", &stdInterpreter, - 0, 0, 0, 0, 0x0e10, "NikonScanIFD", &stdInterpreter, - -1, 0, 0, 0, 0, "", NULL}; - -} + lenses["F9 3C 19 31 30 3C 4B 06"] = "Sigma 10-20mm F4-5.6 EX DC HSM"; + lenses["F9 40 3C 8E 2C 40 40 0E"] = "Tamron AF 28-300mm f/3.5-6.3 XR Di VC LD Aspherical (IF) Macro (A20)"; + lenses["FA 54 3C 5E 24 24 84 06"] = "Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical (IF) Macro (A09NII)"; + lenses["FB 54 8E 8E 24 24 4B 02"] = "Sigma APO 300mm F2.8 EX DG HSM"; + lenses["FD 47 50 76 24 24 4B 06"] = "Sigma 50-150mm F2.8 EX APO DC HSM II"; + lenses["FE 47 00 00 24 24 4B 06"] = "Sigma 4.5mm F2.8 EX DC Circular Fisheye HSM"; + } + virtual std::string toString (Tag* t) { + + static const unsigned char xlat[2][256] = { + { 0xc1,0xbf,0x6d,0x0d,0x59,0xc5,0x13,0x9d,0x83,0x61,0x6b,0x4f,0xc7,0x7f,0x3d,0x3d, + 0x53,0x59,0xe3,0xc7,0xe9,0x2f,0x95,0xa7,0x95,0x1f,0xdf,0x7f,0x2b,0x29,0xc7,0x0d, + 0xdf,0x07,0xef,0x71,0x89,0x3d,0x13,0x3d,0x3b,0x13,0xfb,0x0d,0x89,0xc1,0x65,0x1f, + 0xb3,0x0d,0x6b,0x29,0xe3,0xfb,0xef,0xa3,0x6b,0x47,0x7f,0x95,0x35,0xa7,0x47,0x4f, + 0xc7,0xf1,0x59,0x95,0x35,0x11,0x29,0x61,0xf1,0x3d,0xb3,0x2b,0x0d,0x43,0x89,0xc1, + 0x9d,0x9d,0x89,0x65,0xf1,0xe9,0xdf,0xbf,0x3d,0x7f,0x53,0x97,0xe5,0xe9,0x95,0x17, + 0x1d,0x3d,0x8b,0xfb,0xc7,0xe3,0x67,0xa7,0x07,0xf1,0x71,0xa7,0x53,0xb5,0x29,0x89, + 0xe5,0x2b,0xa7,0x17,0x29,0xe9,0x4f,0xc5,0x65,0x6d,0x6b,0xef,0x0d,0x89,0x49,0x2f, + 0xb3,0x43,0x53,0x65,0x1d,0x49,0xa3,0x13,0x89,0x59,0xef,0x6b,0xef,0x65,0x1d,0x0b, + 0x59,0x13,0xe3,0x4f,0x9d,0xb3,0x29,0x43,0x2b,0x07,0x1d,0x95,0x59,0x59,0x47,0xfb, + 0xe5,0xe9,0x61,0x47,0x2f,0x35,0x7f,0x17,0x7f,0xef,0x7f,0x95,0x95,0x71,0xd3,0xa3, + 0x0b,0x71,0xa3,0xad,0x0b,0x3b,0xb5,0xfb,0xa3,0xbf,0x4f,0x83,0x1d,0xad,0xe9,0x2f, + 0x71,0x65,0xa3,0xe5,0x07,0x35,0x3d,0x0d,0xb5,0xe9,0xe5,0x47,0x3b,0x9d,0xef,0x35, + 0xa3,0xbf,0xb3,0xdf,0x53,0xd3,0x97,0x53,0x49,0x71,0x07,0x35,0x61,0x71,0x2f,0x43, + 0x2f,0x11,0xdf,0x17,0x97,0xfb,0x95,0x3b,0x7f,0x6b,0xd3,0x25,0xbf,0xad,0xc7,0xc5, + 0xc5,0xb5,0x8b,0xef,0x2f,0xd3,0x07,0x6b,0x25,0x49,0x95,0x25,0x49,0x6d,0x71,0xc7 }, + { 0xa7,0xbc,0xc9,0xad,0x91,0xdf,0x85,0xe5,0xd4,0x78,0xd5,0x17,0x46,0x7c,0x29,0x4c, + 0x4d,0x03,0xe9,0x25,0x68,0x11,0x86,0xb3,0xbd,0xf7,0x6f,0x61,0x22,0xa2,0x26,0x34, + 0x2a,0xbe,0x1e,0x46,0x14,0x68,0x9d,0x44,0x18,0xc2,0x40,0xf4,0x7e,0x5f,0x1b,0xad, + 0x0b,0x94,0xb6,0x67,0xb4,0x0b,0xe1,0xea,0x95,0x9c,0x66,0xdc,0xe7,0x5d,0x6c,0x05, + 0xda,0xd5,0xdf,0x7a,0xef,0xf6,0xdb,0x1f,0x82,0x4c,0xc0,0x68,0x47,0xa1,0xbd,0xee, + 0x39,0x50,0x56,0x4a,0xdd,0xdf,0xa5,0xf8,0xc6,0xda,0xca,0x90,0xca,0x01,0x42,0x9d, + 0x8b,0x0c,0x73,0x43,0x75,0x05,0x94,0xde,0x24,0xb3,0x80,0x34,0xe5,0x2c,0xdc,0x9b, + 0x3f,0xca,0x33,0x45,0xd0,0xdb,0x5f,0xf5,0x52,0xc3,0x21,0xda,0xe2,0x22,0x72,0x6b, + 0x3e,0xd0,0x5b,0xa8,0x87,0x8c,0x06,0x5d,0x0f,0xdd,0x09,0x19,0x93,0xd0,0xb9,0xfc, + 0x8b,0x0f,0x84,0x60,0x33,0x1c,0x9b,0x45,0xf1,0xf0,0xa3,0x94,0x3a,0x12,0x77,0x33, + 0x4d,0x44,0x78,0x28,0x3c,0x9e,0xfd,0x65,0x57,0x16,0x94,0x6b,0xfb,0x59,0xd0,0xc8, + 0x22,0x36,0xdb,0xd2,0x63,0x98,0x43,0xa1,0x04,0x87,0x86,0xf7,0xa6,0x26,0xbb,0xd6, + 0x59,0x4d,0xbf,0x6a,0x2e,0xaa,0x2b,0xef,0xe6,0x78,0xb6,0x4e,0xe0,0x2f,0xdc,0x7c, + 0xbe,0x57,0x19,0x32,0x7e,0x2a,0xd0,0xb8,0xba,0x29,0x00,0x3c,0x52,0x7d,0xa8,0x49, + 0x3b,0x2d,0xeb,0x25,0x49,0xfa,0xa3,0xaa,0x39,0xa7,0xc5,0xa7,0x50,0x11,0x36,0xfb, + 0xc6,0x67,0x4a,0xf5,0xa5,0x12,0x65,0x7e,0xb0,0xdf,0xaf,0x4e,0xb3,0x61,0x7f,0x2f } }; + + int ver = (t->toInt (0, BYTE) - '0') * 1000 + (t->toInt (1, BYTE) - '0') * 100 + (t->toInt (2, BYTE) - '0') * 10 + (t->toInt (3, BYTE) - '0'); + + std::ostringstream ld; + ld << "Version = " << ver << std::endl; + + int lenstype = t->getParent()->getTag(0x0083)->toInt(0,BYTE); + + std::ostringstream lid; + lid.setf (std::ios_base::hex, std::ios_base::basefield); + lid.setf (std::ios_base::uppercase); + + std::string model = t->getParent()->getParent()->getParent()->getTag(0x0110)->valueToString(); + int lidoffs = 7; + bool d100 = false; + if (model.substr(0,10)=="NIKON D100" || model.substr(0,9)=="NIKON D1X") { + lidoffs = 0; + d100 = true; + } + + unsigned char buffer[15]; + if (d100) + memcpy (buffer, t->getValue()+6, 7); + else + memcpy (buffer, t->getValue()+4, 15); + + if (ver>=201) { + const unsigned char* serval = t->getParent()->getTag(0x001d)->getValue (); + int serial = 0; + for (int i=0; serval[i]; i++) + serial = serial*10 + (isdigit(serval[i]) ? serval[i] - '0' : serval[i] % 10); + const unsigned char* scval = t->getParent()->getTag(0x00a7)->getValue (); + int key = 0; + for (int i=0; i<4; i++) + key ^= scval[i]; + + unsigned char ci = xlat[0][serial & 0xff]; + unsigned char cj = xlat[1][key]; + unsigned char ck = 0x60; + for (int i=0; i < 15; i++) + buffer[i] ^= (cj += ci * ck++); + } + + if (!d100) { + ld << "ExitPupilPosition = " << (int) buffer[0] << std::endl; + ld << "AFAperture = " << (int) buffer[1] << std::endl; + ld << "FocusPosition = " << (int) buffer[4] << std::endl; + ld << "FocusDistance = " << (int) buffer[5] << std::endl; + ld << "FocalLength = " << (int) buffer[6] << std::endl; + ld << "EffectiveMaxAperture = " << (int) buffer[14] << std::endl; + } + + for (int i=0; i<7; i++) + lid << std::setw(2) << std::setfill('0') << (int)buffer[lidoffs+i] << ' '; + lid << std::setw(2) << std::setfill('0') << lenstype; + + std::map::iterator r = lenses.find (lid.str()); + if (r!=lenses.end()) + ld << "Lens = " << r->second; + else + ld << "Lens = Unknown, ID=" << lid.str(); + + return ld.str(); + } + +}; +NALensDataInterpreter naLensDataInterpreter; + +const TagAttrib nikon2Attribs[] = { + 0, 1, 0, 0, 0x0002, "Unknown", &stdInterpreter, + 0, 1, 0, 0, 0x0003, "Quality", &stdInterpreter, + 0, 1, 0, 0, 0x0004, "ColorMode", &stdInterpreter, + 0, 1, 0, 0, 0x0005, "ImageAdjustment", &stdInterpreter, + 0, 1, 0, 0, 0x0006, "ISOSpeed", &naISOInterpreter, + 0, 1, 0, 0, 0x0007, "WhiteBalance", &stdInterpreter, + 0, 1, 0, 0, 0x0008, "Focus", &stdInterpreter, + 0, 1, 0, 0, 0x0009, "Unknown", &stdInterpreter, + 0, 1, 0, 0, 0x000a, "DigitalZoom", &stdInterpreter, + 0, 1, 0, 0, 0x000b, "AuxiliaryLens", &stdInterpreter, + 0, 1, 0, 0, 0x0f00, "Unknown", &stdInterpreter, + -1, 0, 0, 0, 0, "", NULL}; + +const TagAttrib nikon3Attribs[] = { + 0, 1, 0, 0, 0x0001, "MakerNoteVersion", &stdInterpreter, + 0, 1, 0, 0, 0x0002, "ISOSpeed", &naISOInterpreter, + 0, 1, 0, 0, 0x0003, "ColorMode", &stdInterpreter, + 0, 1, 0, 0, 0x0004, "Quality", &stdInterpreter, + 0, 1, 0, 0, 0x0005, "WhiteBalance", &stdInterpreter, + 0, 1, 0, 0, 0x0006, "Sharpness", &stdInterpreter, + 0, 1, 0, 0, 0x0007, "FocusMode", &stdInterpreter, + 0, 1, 0, 0, 0x0008, "FlashSetting", &stdInterpreter, + 0, 1, 0, 0, 0x0009, "FlashType", &stdInterpreter, + 0, 1, 0, 0, 0x000b, "WhiteBalanceFineTune", &stdInterpreter, + 0, 3, 0, 0, 0x000c, "ColorBalance1", &stdInterpreter, + 0, 1, 0, 0, 0x000d, "ProgramShift", &stdInterpreter, + 0, 1, 0, 0, 0x000e, "ExposureDifference", &stdInterpreter, + 0, 1, 0, 0, 0x000f, "ISOSelection", &naISOInterpreter, + 0, 1, 0, 0, 0x0010, "DataDump", &stdInterpreter, + 1, 1, 0, 0, 0x0011, "NikonPreview", &stdInterpreter, + 0, 1, 0, 0, 0x0012, "FlashExposureComp", &stdInterpreter, + 0, 1, 0, 0, 0x0013, "ISOSetting", &stdInterpreter, + 0, 1, 0, 0, 0x0016, "ImageBoundary", &stdInterpreter, + 0, 1, 0, 0, 0x0018, "FlashExposureBracketValue", &stdInterpreter, + 0, 1, 0, 0, 0x0019, "ExposureBracketValue", &stdInterpreter, + 0, 1, 0, 0, 0x001a, "ImageProcessing", &stdInterpreter, + 0, 1, 0, 0, 0x001b, "CropHiSpeed", &stdInterpreter, + 0, 1, 0, 0, 0x001d, "SerialNumber", &stdInterpreter, + 0, 1, 0, 0, 0x001e, "ColorSpace", &stdInterpreter, + 0, 1, 0, 0, 0x0020, "ImageAuthentication", &stdInterpreter, + 0, 1, 0, 0, 0x0080, "ImageAdjustment", &stdInterpreter, + 0, 1, 0, 0, 0x0081, "ToneComp", &stdInterpreter, + 0, 1, 0, 0, 0x0082, "AuxiliaryLens", &stdInterpreter, + 0, 1, 0, 0, 0x0083, "LensType", &naLensTypeInterpreter, + 0, 1, 0, 0, 0x0084, "Lens", &stdInterpreter, + 0, 1, 0, 0, 0x0085, "ManualFocusDistance", &stdInterpreter, + 0, 1, 0, 0, 0x0086, "DigitalZoom", &stdInterpreter, + 0, 1, 0, 0, 0x0087, "FlashMode", &naFlashModeInterpreter, + 0, 1, 0, 0, 0x0088, "AFInfo", &naAFInfoInterpreter, + 0, 1, 0, 0, 0x0089, "ShootingMode", &naShootingModeInterpreter, + 0, 1, 0, 0, 0x008a, "AutoBracketRelease", &stdInterpreter, + 0, 1, 0, 0, 0x008b, "LensFStops", &stdInterpreter, + 0, 1, 0, 0, 0x008c, "NEFCurve1", &stdInterpreter, + 0, 1, 0, 0, 0x008d, "ColorHue", &stdInterpreter, + 0, 1, 0, 0, 0x008f, "SceneMode", &stdInterpreter, + 0, 1, 0, 0, 0x0090, "LightSource", &stdInterpreter, + 0, 1, 0, 0, 0x0091, "ShotInfo", &stdInterpreter, + 0, 1, 0, 0, 0x0092, "HueAdjustment", &stdInterpreter, + 0, 1, 0, 0, 0x0094, "Saturation", &stdInterpreter, + 0, 1, 0, 0, 0x0095, "NoiseReduction", &stdInterpreter, + 0, 1, 0, 0, 0x0096, "NEFCurve2", &stdInterpreter, + 0, 3, 0, 0, 0x0097, "ColorBalance", &stdInterpreter, + 0, 1, 0, 0, 0x0098, "LensData", &naLensDataInterpreter, + 0, 1, 0, 0, 0x0099, "RawImageCenter", &stdInterpreter, + 0, 1, 0, 0, 0x009a, "SensorPixelSize", &stdInterpreter, + 0, 1, 0, 0, 0x00a0, "SerialNumber", &stdInterpreter, + 0, 1, 0, 0, 0x00a2, "ImageDataSize", &stdInterpreter, + 0, 1, 0, 0, 0x00a5, "ImageCount", &stdInterpreter, + 0, 1, 0, 0, 0x00a6, "DeletedImageCount", &stdInterpreter, + 0, 1, 0, 0, 0x00a7, "ShutterCount", &stdInterpreter, + 0, 1, 0, 0, 0x00a9, "ImageOptimization", &stdInterpreter, + 0, 1, 0, 0, 0x00aa, "Saturation", &stdInterpreter, + 0, 1, 0, 0, 0x00ab, "VariProgram", &stdInterpreter, + 0, 1, 0, 0, 0x00ac, "ImageStabilization", &stdInterpreter, + 0, 1, 0, 0, 0x00ad, "AFResponse", &stdInterpreter, + 0, 1, 0, 0, 0x00b0, "MultiExposure", &stdInterpreter, + 0, 1, 0, 0, 0x00b1, "HighISONoiseReduction", &naHiISONRInterpreter, + 0, 1, 0, 0, 0x0e00, "PrintIM", &stdInterpreter, + 0, 0, 0, 0, 0x0e01, "NikonCaptureData", &stdInterpreter, + 0, 0, 0, 0, 0x0e09, "NikonCaptureVersion", &stdInterpreter, + 0, 0, 0, 0, 0x0e0e, "NikonCaptureOffsets", &stdInterpreter, + 0, 0, 0, 0, 0x0e10, "NikonScanIFD", &stdInterpreter, + -1, 0, 0, 0, 0, "", NULL}; + +} #endif diff --git a/rtexif/olympusattribs.cc b/rtexif/olympusattribs.cc index 079c8c259..5be3c548a 100644 --- a/rtexif/olympusattribs.cc +++ b/rtexif/olympusattribs.cc @@ -1,673 +1,673 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _OLYMPUSATTRIBS_ -#define _OLYMPUSATTRIBS_ - -#include -#include -#include -#include -#include -#include - -namespace rtexif { - -class OLOnOffInterpreter : public Interpreter { - public: - OLOnOffInterpreter () {} - virtual std::string toString (Tag* t) { - if (t->toInt()==0) - return "Off"; - else - return "On"; - } -}; -OLOnOffInterpreter olOnOffInterpreter; - -class OLYesNoInterpreter : public Interpreter { - public: - OLYesNoInterpreter () {} - virtual std::string toString (Tag* t) { - if (t->toInt()==0) - return "No"; - else - return "Yes"; - } -}; -OLYesNoInterpreter olYesNoInterpreter; - -class OLApertureInterpreter : public Interpreter { - public: - OLApertureInterpreter () {} - virtual std::string toString (Tag* t) { - std::ostringstream str; - str.precision(2); - str << pow(2, t->toInt() / 512.0); - return str.str(); - } -}; -OLApertureInterpreter olApertureInterpreter; - -class OLLensTypeInterpreter : public Interpreter { - std::map lenses; - public: - OLLensTypeInterpreter () { - lenses[1] = "Zuiko Digital ED 50mm F2.0 Macro"; - lenses[1 +65536] = "Zuiko Digital 40-150mm F3.5-4.5"; - lenses[2] = "Zuiko Digital ED 150mm F2.0"; - lenses[3] = "Zuiko Digital ED 300mm F2.8"; - lenses[5] = "Zuiko Digital 14-54mm F2.8-3.5"; - lenses[5 +65536] = "Zuiko Digital Pro ED 90-250mm F2.8"; - lenses[6] = "Zuiko Digital ED 50-200mm F2.8-3.5"; - lenses[6 +65536] = "Zuiko Digital ED 8mm F3.5 Fisheye"; - lenses[7] = "Zuiko Digital 11-22mm F2.8-3.5"; - lenses[7 +65536] = "Zuiko Digital 18-180mm F3.5-6.3"; - lenses[8] = "Zuiko Digital 70-300mm F4.0-5.6"; - lenses[21] = "Zuiko Digital ED 7-14mm F4.0"; - lenses[23] = "Zuiko Digital Pro ED 35-100mm F2.0"; - lenses[24] = "Zuiko Digital 14-45mm F3.5-5.6"; - lenses[32] = "Zuiko Digital 35mm F3.5 Macro"; - lenses[34] = "Zuiko Digital 17.5-45mm F3.5-5.6"; - lenses[35] = "Zuiko Digital ED 14-42mm F3.5-5.6"; - lenses[36] = "Zuiko Digital ED 40-150mm F4.0-5.6"; - lenses[48] = "Zuiko Digital ED 50-200mm SWD F2.8-3.5"; - lenses[49] = "Zuiko Digital ED 12-60mm SWD F2.8-4.0"; - lenses[256+ 1] = "18-50mm F3.5-5.6"; - lenses[256+ 2] = "55-200mm F4.0-5.6 DC"; - lenses[256+ 3] = "18-125mm F3.5-5.6 DC"; - lenses[256+ 4] = "18-125mm F3.5-5.6"; - lenses[256+ 5] = "30mm F1.4"; - lenses[256+ 6] = "50-500mm F4.0-6.3 EX DG APO HSM RF"; - lenses[256+ 7] = "105mm F2.8 DG"; - lenses[256+ 8] = "150mm F2.8 DG HSM"; - lenses[256+ 17] = "135-400mm F4.5-5.6 DG ASP APO RF"; - lenses[256+ 18] = "300-800mm F5.6 EX DG APO"; - lenses[512+ 1] = "D Vario Elmarit 14-50mm, F2.8-3.5 Asph."; - lenses[512+ 2] = "D Summilux 25mm, F1.4 Asph."; - lenses[512+ 4] = "Vario Elmar 14-150mm f3.5-5.6"; - lenses[768+ 1] = "D Vario Elmarit 14-50mm, F2.8-3.5 Asph."; - lenses[768+ 2] = "D Summilux 25mm, F1.4 Asph."; - } - virtual std::string toString (Tag* t) { - int make = t->toInt(0); - int model = t->toInt(2); - int add = 0; - if (make==0 && (model==1 || model==5 || model==7 || model==6)) - add += 65536 * t->toInt(3); - return lenses [256 * make + model + add]; - } -}; -OLLensTypeInterpreter olLensTypeInterpreter; - -class OLFlashTypeInterpreter : public ChoiceInterpreter { - public: - OLFlashTypeInterpreter () { - choices[0] = "None"; - choices[2] = "Simple E-System"; - choices[3] = "E-System"; - } -}; -OLFlashTypeInterpreter olFlashTypeInterpreter; - -class OLExposureModeInterpreter : public ChoiceInterpreter { - public: - OLExposureModeInterpreter () { - choices[1] = "Manual"; - choices[2] = "Program"; - choices[3] = "Aperture-priority AE"; - choices[4] = "Shutter speed priority AE"; - choices[5] = "Program-shift"; - } -}; -OLExposureModeInterpreter olExposureModeInterpreter; - -class OLMeteringModeInterpreter : public ChoiceInterpreter { - public: - OLMeteringModeInterpreter () { - choices[2] = "Center-weighted average"; - choices[3] = "Spot"; - choices[5] = "ESP"; - choices[261] = "Pattern+AF"; - choices[515] = "Spot+Highlight control"; - choices[1027] = "Spot+Shadow control"; - } -}; -OLMeteringModeInterpreter olMeteringModeInterpreter; - -class OLFocusModeInterpreter : public ChoiceInterpreter { - public: - OLFocusModeInterpreter () { - choices[0] = "Single AF"; - choices[1] = "Sequential shooting AF"; - choices[2] = "Continuous AF"; - choices[3] = "Multi AF"; - choices[10] = "MF"; - } -}; -OLFocusModeInterpreter olFocusModeInterpreter; - -class OLWhitebalance2Interpreter : public ChoiceInterpreter { - public: - OLWhitebalance2Interpreter () { - choices[0] = "Auto"; - choices[16] = "7500K (Fine Weather with Shade)"; - choices[17] = "6000K (Cloudy)"; - choices[18] = "5300K (Fine Weather)"; - choices[20] = "3000K (Tungsten light)"; - choices[21] = "3600K (Tungsten light-like)"; - choices[33] = "6600K (Daylight fluorescent)"; - choices[34] = "4500K (Neutral white fluorescent)"; - choices[35] = "4000K (Cool white fluorescent)"; - choices[48] = "3600K (Tungsten light-like)"; - choices[256] = "Custom WB 1"; - choices[257] = "Custom WB 2"; - choices[258] = "Custom WB 3"; - choices[259] = "Custom WB 4"; - choices[512] = "Custom WB 5400K"; - choices[513] = "Custom WB 2900K"; - choices[514] = "Custom WB 8000K"; - } -}; -OLWhitebalance2Interpreter olWhitebalance2Interpreter; - -class OLSceneModeInterpreter : public ChoiceInterpreter { - public: - OLSceneModeInterpreter () { - choices[0] = "Standard"; - choices[6] = "Auto"; - choices[7] = "Sport"; - choices[8] = "Portrait"; - choices[9] = "Landscape+Portrait"; - choices[10] = "Landscape"; - choices[11] = "Night Scene"; - choices[12] = "Self Portrait"; - choices[13] = "Panorama"; - choices[14] = "2 in 1"; - choices[15] = "Movie"; - choices[16] = "Landscape+Portrait"; - choices[17] = "Night+Portrait"; - choices[18] = "Indoor"; - choices[19] = "Fireworks"; - choices[20] = "Sunset"; - choices[22] = "Macro"; - choices[23] = "Super Macro"; - choices[24] = "Food"; - choices[25] = "Documents"; - choices[26] = "Museum"; - choices[27] = "Shoot & Select"; - choices[28] = "Beach & Snow"; - choices[29] = "Self Protrait+Timer"; - choices[30] = "Candle"; - choices[31] = "Available Light"; - choices[32] = "Behind Glass"; - choices[33] = "My Mode"; - choices[34] = "Pet"; - choices[35] = "Underwater Wide1"; - choices[36] = "Underwater Macro"; - choices[37] = "Shoot & Select1"; - choices[38] = "Shoot & Select2"; - choices[39] = "High Key"; - choices[40] = "Digital Image Stabilization"; - choices[41] = "Auction"; - choices[42] = "Beach"; - choices[43] = "Snow"; - choices[44] = "Underwater Wide2"; - choices[45] = "Low Key"; - choices[46] = "Children"; - choices[47] = "Vivid"; - choices[48] = "Nature Macro"; - choices[49] = "Underwater Snapshot"; - choices[50] = "Shooting Guide"; - } -}; -OLSceneModeInterpreter olSceneModeInterpreter; - -class OLPictureModeBWFilterInterpreter : public ChoiceInterpreter { - public: - OLPictureModeBWFilterInterpreter () { - choices[0] = "n/a"; - choices[1] = "Neutral"; - choices[2] = "Yellow"; - choices[3] = "Orange"; - choices[4] = "Red"; - choices[5] = "Green"; - } -}; -OLPictureModeBWFilterInterpreter olPictureModeBWFilterInterpreter; - -class OLPictureModeToneInterpreter : public ChoiceInterpreter { - public: - OLPictureModeToneInterpreter () { - choices[0] = "n/a"; - choices[1] = "Neutral"; - choices[2] = "Sepia"; - choices[3] = "Blue"; - choices[4] = "Purple"; - choices[5] = "Green"; - } -}; -OLPictureModeToneInterpreter olPictureModeToneInterpreter; - -class OLImageQuality2Interpreter : public ChoiceInterpreter { - public: - OLImageQuality2Interpreter () { - choices[1] = "SQ"; - choices[2] = "HQ"; - choices[3] = "SHQ"; - choices[4] = "RAW"; - } -}; -OLImageQuality2Interpreter olImageQuality2Interpreter; - -class OLDevEngineInterpreter : public ChoiceInterpreter { - public: - OLDevEngineInterpreter () { - choices[0] = "High Speed"; - choices[1] = "High Function"; - choices[2] = "Advanced High Speed"; - choices[3] = "Advanced High Function"; - } -}; -OLDevEngineInterpreter olDevEngineInterpreter; - -class OLPictureModeInterpreter : public ChoiceInterpreter { - public: - OLPictureModeInterpreter () { - choices[1] = "Vivid"; - choices[2] = "Natural"; - choices[3] = "Muted"; - choices[4] = "Portrait"; - choices[256] = "Monotone"; - choices[512] = "Sepia"; - } -}; -OLPictureModeInterpreter olPictureModeInterpreter; - -class OLColorSpaceInterpreter : public ChoiceInterpreter { - public: - OLColorSpaceInterpreter () { - choices[0] = "sRGB"; - choices[1] = "Adobe RGB"; - choices[2] = "Pro Photo RGB"; - } -}; -OLColorSpaceInterpreter olColorSpaceInterpreter; - -class OLNoiseFilterInterpreter : public Interpreter { - public: - OLNoiseFilterInterpreter () {} - virtual std::string toString (Tag* t) { - int a = t->toInt (0); - int b = t->toInt (2); - int c = t->toInt (4); - if (a==-1 && b==-2 && c==1) - return "Low"; - else if (a==-2 && b==-2 && c==1) - return "Off"; - else if (a==0 && b==-2 && c==1) - return "Standard"; - else if (a==1 && b==-2 && c==1) - return "High"; - else return "Unknown"; - } -}; -OLNoiseFilterInterpreter olNoiseFilterInterpreter; - -class OLFlashModeInterpreter : public Interpreter { - public: - OLFlashModeInterpreter () {} - virtual std::string toString (Tag* t) { - std::ostringstream str; - int a = t->toInt (); - str << "Flash Used = " << ((a&1) ? "Yes" : "No") << std::endl; - str << "Fill-in = " << ((a&2) ? "On" : "Off") << std::endl; - str << "Red-eye = " << ((a&4) ? "On" : "Off") << std::endl; - str << "Slow-sync = " << ((a&8) ? "On" : "Off") << std::endl; - str << "Forced On = " << ((a&16) ? "On" : "Off") << std::endl; - str << "2nd Curtain = " << ((a&32) ? "On" : "Off"); - return str.str(); - } -}; -OLFlashModeInterpreter olFlashModeInterpreter; - -class OLNoiseReductionInterpreter : public Interpreter { - public: - OLNoiseReductionInterpreter () {} - virtual std::string toString (Tag* t) { - std::ostringstream str; - int a = t->toInt (); - str << "Noise Reduction = " << ((a&1) ? "On" : "Off") << std::endl; - str << "Noise Filter = " << ((a&2) ? "On" : "Off") << std::endl; - str << "Noise Filter (ISO Boost) = " << ((a&4) ? "On" : "Off"); - return str.str(); - } -}; -OLNoiseReductionInterpreter olNoiseReductionInterpreter; - -class OLFlashModelInterpreter : public ChoiceInterpreter { - public: - OLFlashModelInterpreter () { - choices[0] = "None"; - choices[1] = "FL-20"; - choices[2] = "FL-50"; - choices[3] = "RF-11"; - choices[4] = "TF-22"; - choices[5] = "FL-36"; - choices[6] = "FL-50R"; - choices[7] = "FL-36R"; - } -}; -OLFlashModelInterpreter olFlashModelInterpreter; - -const TagAttrib olyFocusInfoAttribs[] = { - 0, 1, 0, 0, 0x0000, "FocusInfoVersion", &stdInterpreter, - 0, 1, 0, 0, 0x0209, "AutoFocus", &olOnOffInterpreter, - 0, 1, 0, 0, 0x0210, "SceneDetect", &stdInterpreter, - 0, 1, 0, 0, 0x0211, "SceneArea", &stdInterpreter, - 0, 1, 0, 0, 0x0212, "SceneDetectData", &stdInterpreter, - 0, 1, 0, 0, 0x0300, "ZoomStepCount", &stdInterpreter, - 0, 1, 0, 0, 0x0301, "FocusStepCount", &stdInterpreter, - 0, 1, 0, 0, 0x0303, "FocusStepInfinity", &stdInterpreter, - 0, 1, 0, 0, 0x0304, "FocusStepNear", &stdInterpreter, - 0, 1, 0, 0, 0x0305, "FocusDistance", &stdInterpreter, - 0, 1, 0, 0, 0x0308, "AFPoint", &stdInterpreter, - 0, 1, 0, 0, 0x1201, "ExternalFlash", &olOnOffInterpreter, - 0, 1, 0, 0, 0x1203, "ExternalFlashGuideNumber", &stdInterpreter, - 0, 1, 0, 0, 0x1204, "ExternalFlashBounce", &stdInterpreter, - 0, 1, 0, 0, 0x1205, "ExternalFlashZoom", &stdInterpreter, - 0, 1, 0, 0, 0x1208, "InternalFlash", &olOnOffInterpreter, - 0, 1, 0, 0, 0x1209, "ManualFlash", &olOnOffInterpreter, - 0, 1, 0, 0, 0x1500, "SensorTemperature", &stdInterpreter, - 0, 1, 0, 0, 0x1600, "ImageStabilization", &stdInterpreter, --1, 0, 0, 0, 0, "", NULL}; - -const TagAttrib olyImageProcessingAttribs[] = { - 0, 1, 0, 0, 0x0000, "ImageProcessingVersion", &stdInterpreter, - 0, 1, 0, 0, 0x0100, "WB_RBLevels", &stdInterpreter, - 0, 1, 0, 0, 0x0102, "WB_RBLevels3000K", &stdInterpreter, - 0, 1, 0, 0, 0x0103, "WB_RBLevels3300K", &stdInterpreter, - 0, 1, 0, 0, 0x0104, "WB_RBLevels3600K", &stdInterpreter, - 0, 1, 0, 0, 0x0105, "WB_RBLevels3900K", &stdInterpreter, - 0, 1, 0, 0, 0x0106, "WB_RBLevels4000K", &stdInterpreter, - 0, 1, 0, 0, 0x0107, "WB_RBLevels4300K", &stdInterpreter, - 0, 1, 0, 0, 0x0108, "WB_RBLevels4500K", &stdInterpreter, - 0, 1, 0, 0, 0x0109, "WB_RBLevels4800K", &stdInterpreter, - 0, 1, 0, 0, 0x010a, "WB_RBLevels5300K", &stdInterpreter, - 0, 1, 0, 0, 0x010b, "WB_RBLevels6000K", &stdInterpreter, - 0, 1, 0, 0, 0x010c, "WB_RBLevels6600K", &stdInterpreter, - 0, 1, 0, 0, 0x010d, "WB_RBLevels7500K", &stdInterpreter, - 0, 1, 0, 0, 0x010e, "WB_RBLevelsCWB1", &stdInterpreter, - 0, 1, 0, 0, 0x010f, "WB_RBLevelsCWB2", &stdInterpreter, - 0, 1, 0, 0, 0x0110, "WB_RBLevelsCWB3", &stdInterpreter, - 0, 1, 0, 0, 0x0111, "WB_RBLevelsCWB4", &stdInterpreter, - 0, 1, 0, 0, 0x0113, "WB_GLevel3000K", &stdInterpreter, - 0, 1, 0, 0, 0x0114, "WB_GLevel3300K", &stdInterpreter, - 0, 1, 0, 0, 0x0115, "WB_GLevel3600K", &stdInterpreter, - 0, 1, 0, 0, 0x0116, "WB_GLevel3900K", &stdInterpreter, - 0, 1, 0, 0, 0x0117, "WB_GLevel4000K", &stdInterpreter, - 0, 1, 0, 0, 0x0118, "WB_GLevel4300K", &stdInterpreter, - 0, 1, 0, 0, 0x0119, "WB_GLevel4500K", &stdInterpreter, - 0, 1, 0, 0, 0x011a, "WB_GLevel4800K", &stdInterpreter, - 0, 1, 0, 0, 0x011b, "WB_GLevel5300K", &stdInterpreter, - 0, 1, 0, 0, 0x011c, "WB_GLevel6000K", &stdInterpreter, - 0, 1, 0, 0, 0x011d, "WB_GLevel6600K", &stdInterpreter, - 0, 1, 0, 0, 0x011e, "WB_GLevel7500K", &stdInterpreter, - 0, 1, 0, 0, 0x011f, "WB_GLevel", &stdInterpreter, - 0, 1, 0, 0, 0x0200, "ColorMatrix", &stdInterpreter, - 0, 1, 0, 0, 0x0300, "Enhancer", &stdInterpreter, - 0, 1, 0, 0, 0x0301, "EnhancerValues", &stdInterpreter, - 0, 1, 0, 0, 0x0310, "CoringFilter", &stdInterpreter, - 0, 1, 0, 0, 0x0311, "CoringValues", &stdInterpreter, - 0, 1, 0, 0, 0x0600, "BlackLevel2", &stdInterpreter, - 0, 1, 0, 0, 0x0610, "GainBase", &stdInterpreter, - 0, 1, 0, 0, 0x0611, "ValidBits", &stdInterpreter, - 0, 1, 0, 0, 0x0612, "CropLeft", &stdInterpreter, - 0, 1, 0, 0, 0x0613, "CropTop", &stdInterpreter, - 0, 1, 0, 0, 0x0614, "CropWidth", &stdInterpreter, - 0, 1, 0, 0, 0x0615, "CropHeight", &stdInterpreter, - 0, 1, 0, 0, 0x1010, "NoiseReduction2", &stdInterpreter, - 0, 1, 0, 0, 0x1011, "DistortionCorrection2", &olOnOffInterpreter, - 0, 1, 0, 0, 0x1012, "ShadingCompensation2", &olOnOffInterpreter, - 1, 1, 0, 0, 0x1103, "UnknownBlock", &stdInterpreter, - 0, 1, 0, 0, 0x1200, "FaceDetect", &olOnOffInterpreter, - 0, 1, 0, 0, 0x1201, "FaceDetectArea", &stdInterpreter, --1, 0, 0, 0, 0, "", NULL}; - -const TagAttrib olyRawDevelopmentAttribs[] = { - 0, 1, 0, 0, 0x0000, "RawDevVersion", &stdInterpreter, - 0, 1, 0, 0, 0x0100, "RawDevExposureBiasValue", &stdInterpreter, - 0, 1, 0, 0, 0x0101, "RawDevWhiteBalanceValue", &stdInterpreter, - 0, 1, 0, 0, 0x0102, "RawDevWBFineAdjustment", &stdInterpreter, - 0, 1, 0, 0, 0x0103, "RawDevGrayPoint", &stdInterpreter, - 0, 1, 0, 0, 0x0104, "RawDevSaturationEmphasis", &stdInterpreter, - 0, 1, 0, 0, 0x0105, "RawDevMemoryColorEmphasis", &stdInterpreter, - 0, 1, 0, 0, 0x0106, "RawDevContrastValue", &stdInterpreter, - 0, 1, 0, 0, 0x0107, "RawDevSharpnessValue", &stdInterpreter, - 0, 1, 0, 0, 0x0108, "RawDevColorSpace", &olColorSpaceInterpreter, - 0, 1, 0, 0, 0x0109, "RawDevEngine", &olDevEngineInterpreter, - 0, 1, 0, 0, 0x010a, "RawDevNoiseReduction", &olNoiseReductionInterpreter, - 0, 1, 0, 0, 0x010b, "RawDevEditStatus", &stdInterpreter, - 0, 1, 0, 0, 0x010c, "RawDevSettings", &stdInterpreter, --1, 0, 0, 0, 0, "", NULL}; - -const TagAttrib olyRawDevelopment2Attribs[] = { - 0, 1, 0, 0, 0x0000, "RawDevVersion", &stdInterpreter, - 0, 1, 0, 0, 0x0100, "RawDevExposureBiasValue", &stdInterpreter, - 0, 1, 0, 0, 0x0101, "RawDevWhiteBalance", &stdInterpreter, - 0, 1, 0, 0, 0x0102, "RawDevWhiteBalanceValue", &stdInterpreter, - 0, 1, 0, 0, 0x0103, "RawDevWBFineAdjustment", &stdInterpreter, - 0, 1, 0, 0, 0x0104, "RawDevGrayPoint", &stdInterpreter, - 0, 1, 0, 0, 0x0105, "RawDevContrastValue", &stdInterpreter, - 0, 1, 0, 0, 0x0106, "RawDevSharpnessValue", &stdInterpreter, - 0, 1, 0, 0, 0x0107, "RawDevSaturationEmphasis", &stdInterpreter, - 0, 1, 0, 0, 0x0108, "RawDevMemoryColorEmphasis", &stdInterpreter, - 0, 1, 0, 0, 0x0109, "RawDevColorSpace", &olColorSpaceInterpreter, - 0, 1, 0, 0, 0x010a, "RawDevNoiseReduction", &olNoiseReductionInterpreter, - 0, 1, 0, 0, 0x010b, "RawDevEngine", &olDevEngineInterpreter, - 0, 1, 0, 0, 0x010c, "RawDevPictureMode", &olPictureModeInterpreter, - 0, 1, 0, 0, 0x010d, "RawDevPMSaturation", &stdInterpreter, - 0, 1, 0, 0, 0x010e, "RawDevPMContrast", &stdInterpreter, - 0, 1, 0, 0, 0x010f, "RawDevPMSharpness", &stdInterpreter, - 0, 1, 0, 0, 0x0110, "RawDevPM_BWFilter", &olPictureModeBWFilterInterpreter, - 0, 1, 0, 0, 0x0111, "RawDevPMPictureTone", &olPictureModeToneInterpreter, - 0, 1, 0, 0, 0x0112, "RawDevGradation", &stdInterpreter, - 0, 1, 0, 0, 0x0113, "RawDevSaturation3", &stdInterpreter, - 0, 1, 0, 0, 0x0119, "RawDevAutoGradation", &olOnOffInterpreter, - 0, 1, 0, 0, 0x0120, "RawDevPMNoiseFilter", &stdInterpreter, --1, 0, 0, 0, 0, "", NULL}; - -const TagAttrib olyCameraSettingsAttribs[] = { - 0, 1, 0, 0, 0x0000, "CameraSettingsVersion", &stdInterpreter, - 1, 1, 0, 0, 0x0100, "PreviewImageValid", &olYesNoInterpreter, - 1, 1, 0, 0, 0x0101, "PreviewImageStart", &stdInterpreter, - 1, 1, 0, 0, 0x0102, "PreviewImageLength", &stdInterpreter, - 0, 1, 0, 0, 0x0200, "ExposureMode", &olExposureModeInterpreter, - 0, 1, 0, 0, 0x0201, "AELock", &olOnOffInterpreter, - 0, 1, 0, 0, 0x0202, "MeteringMode", &olMeteringModeInterpreter, - 0, 1, 0, 0, 0x0300, "MacroMode", &olOnOffInterpreter, - 0, 1, 0, 0, 0x0301, "FocusMode", &olFocusModeInterpreter, - 0, 1, 0, 0, 0x0302, "FocusProcess", &stdInterpreter, - 0, 1, 0, 0, 0x0303, "AFSearch", &stdInterpreter, - 0, 1, 0, 0, 0x0304, "AFAreas", &stdInterpreter, - 0, 1, 0, 0, 0x0400, "FlashMode", &stdInterpreter, - 0, 1, 0, 0, 0x0401, "FlashExposureComp", &stdInterpreter, - 0, 1, 0, 0, 0x0500, "WhiteBalance2", &olWhitebalance2Interpreter, - 0, 1, 0, 0, 0x0501, "WhiteBalanceTemperature", &stdInterpreter, - 0, 1, 0, 0, 0x0502, "WhiteBalanceBracket", &stdInterpreter, - 0, 1, 0, 0, 0x0503, "CustomSaturation", &stdInterpreter, - 0, 1, 0, 0, 0x0504, "ModifiedSaturation", &stdInterpreter, - 0, 1, 0, 0, 0x0505, "ContrastSetting", &stdInterpreter, - 0, 1, 0, 0, 0x0506, "SharpnessSetting", &stdInterpreter, - 0, 1, 0, 0, 0x0507, "ColorSpace", &olColorSpaceInterpreter, - 0, 1, 0, 0, 0x0509, "SceneMode", &olSceneModeInterpreter, - 0, 1, 0, 0, 0x050a, "NoiseReduction", &olNoiseReductionInterpreter, - 0, 1, 0, 0, 0x050b, "DistortionCorrection", &olOnOffInterpreter, - 0, 1, 0, 0, 0x050c, "ShadingCompensation", &olOnOffInterpreter, - 0, 1, 0, 0, 0x050d, "CompressionFactor", &stdInterpreter, - 0, 1, 0, 0, 0x050f, "Gradation", &stdInterpreter, - 0, 1, 0, 0, 0x0520, "PictureMode", &olPictureModeInterpreter, - 0, 1, 0, 0, 0x0521, "PictureModeSaturation", &stdInterpreter, - 0, 1, 0, 0, 0x0522, "PictureModeHue", &stdInterpreter, - 0, 1, 0, 0, 0x0523, "PictureModeContrast", &stdInterpreter, - 0, 1, 0, 0, 0x0524, "PictureModeSharpness", &stdInterpreter, - 0, 1, 0, 0, 0x0525, "PictureModeBWFilter", &olPictureModeBWFilterInterpreter, - 0, 1, 0, 0, 0x0526, "PictureModeTone", &olPictureModeToneInterpreter, - 0, 1, 0, 0, 0x0527, "NoiseFilter", &olNoiseFilterInterpreter, - 0, 1, 0, 0, 0x0600, "DriveMode", &stdInterpreter, - 0, 1, 0, 0, 0x0601, "PanoramaMode", &stdInterpreter, - 0, 1, 0, 0, 0x0603, "ImageQuality2", &olImageQuality2Interpreter, - 0, 1, 0, 0, 0x0900, "ManometerPressure", &stdInterpreter, - 0, 1, 0, 0, 0x0901, "ManometerReading", &stdInterpreter, - 0, 1, 0, 0, 0x0902, "ExtendedWBDetect", &olOnOffInterpreter, - -1, 0, 0, 0, 0, "", NULL}; - -const TagAttrib olyEquipmentAttribs[] = { - 0, 1, 0, 0, 0x0000, "EquipmentVersion", &stdInterpreter, - 0, 1, 0, 0, 0x0100, "CameraType2", &stdInterpreter, - 0, 1, 0, 0, 0x0101, "SerialNumber", &stdInterpreter, - 0, 1, 0, 0, 0x0102, "InternalSerialNumber", &stdInterpreter, - 0, 1, 0, 0, 0x0103, "FocalPlaneDiagonal", &stdInterpreter, - 0, 1, 0, 0, 0x0104, "BodyFirmwareVersion", &stdInterpreter, - 0, 1, 0, 0, 0x0201, "LensType", &olLensTypeInterpreter, - 0, 1, 0, 0, 0x0202, "LensSerialNumber", &stdInterpreter, - 0, 1, 0, 0, 0x0204, "LensFirmwareVersion", &stdInterpreter, - 0, 1, 0, 0, 0x0205, "MaxApertureAtMinFocal", &olApertureInterpreter, - 0, 1, 0, 0, 0x0206, "MaxApertureAtMaxFocal", &olApertureInterpreter, - 0, 1, 0, 0, 0x0207, "MinFocalLength", &stdInterpreter, - 0, 1, 0, 0, 0x0208, "MaxFocalLength", &stdInterpreter, - 0, 1, 0, 0, 0x020a, "MaxApertureAtCurrentFocal", &olApertureInterpreter, - 0, 1, 0, 0, 0x020b, "LensProperties", &stdInterpreter, - 0, 1, 0, 0, 0x0301, "Extender", &stdInterpreter, - 0, 1, 0, 0, 0x0302, "ExtenderSerialNumber", &stdInterpreter, - 0, 1, 0, 0, 0x0303, "ExtenderModel", &stdInterpreter, - 0, 1, 0, 0, 0x0304, "ExtenderFirmwareVersion", &stdInterpreter, - 0, 1, 0, 0, 0x1000, "FlashType", &olFlashTypeInterpreter, - 0, 1, 0, 0, 0x1001, "FlashModel", &olFlashModelInterpreter, - 0, 1, 0, 0, 0x1002, "FlashFirmwareVersion", &stdInterpreter, - 0, 1, 0, 0, 0x1003, "FlashSerialNumber", &stdInterpreter, - -1, 0, 0, 0, 0, "", NULL}; - -const TagAttrib olympusAttribs[] = { - 0, 1, 0, 0, 0x0104, "BodyFirmwareVersion", &stdInterpreter, - 0, 1, 0, 0, 0x0200, "SpecialMode", &stdInterpreter, - 0, 1, 0, 0, 0x0201, "Quality", &stdInterpreter, - 0, 1, 0, 0, 0x0202, "Macro", &olOnOffInterpreter, - 0, 1, 0, 0, 0x0203, "BWMode", &olOnOffInterpreter, - 0, 1, 0, 0, 0x0204, "DigitalZoom", &stdInterpreter, - 0, 1, 0, 0, 0x0205, "FocalPlaneDiagonal", &stdInterpreter, - 0, 1, 0, 0, 0x0206, "LensDistortionParams", &stdInterpreter, - 0, 1, 0, 0, 0x0207, "CameraType", &stdInterpreter, - 1, 1, 0, 0, 0x0208, "TextInfo", &stdInterpreter, - 0, 1, 0, 0, 0x0209, "CameraID", &stdInterpreter, - 0, 1, 0, 0, 0x020b, "EpsonImageWidth", &stdInterpreter, - 0, 1, 0, 0, 0x020c, "EpsonImageHeight", &stdInterpreter, - 0, 1, 0, 0, 0x020d, "EpsonSoftware", &stdInterpreter, - 0, 2, 0, 0, 0x0280, "PreviewImage", &stdInterpreter, - 0, 1, 0, 0, 0x0300, "PreCaptureFrames", &stdInterpreter, - 0, 1, 0, 0, 0x0301, "WhiteBoard", &stdInterpreter, - 0, 1, 0, 0, 0x0302, "OneTouchWB", &olOnOffInterpreter, - 0, 1, 0, 0, 0x0303, "WhiteBalanceBracket", &stdInterpreter, - 0, 1, 0, 0, 0x0304, "WhiteBalanceBias", &stdInterpreter, - 0, 1, 0, 0, 0x0403, "SceneMode", &stdInterpreter, - 0, 1, 0, 0, 0x0404, "SerialNumber", &stdInterpreter, - 0, 1, 0, 0, 0x0405, "Firmware", &stdInterpreter, - 1, 1, 0, 0, 0x0e00, "PrintIM", &stdInterpreter, - 0, 1, 0, 0, 0x0f00, "DataDump", &stdInterpreter, - 0, 1, 0, 0, 0x0f01, "DataDump2", &stdInterpreter, - 0, 1, 0, 0, 0x1000, "ShutterSpeedValue", &stdInterpreter, - 0, 1, 0, 0, 0x1001, "ISOValue", &stdInterpreter, - 0, 1, 0, 0, 0x1002, "ApertureValue", &stdInterpreter, - 0, 1, 0, 0, 0x1003, "BrightnessValue", &stdInterpreter, - 0, 1, 0, 0, 0x1004, "FlashMode", &stdInterpreter, - 0, 1, 0, 0, 0x1005, "FlashDevice", &stdInterpreter, - 0, 1, 0, 0, 0x1006, "ExposureCompensation", &stdInterpreter, - 0, 1, 0, 0, 0x1007, "SensorTemperature", &stdInterpreter, - 0, 1, 0, 0, 0x1008, "LensTemperature", &stdInterpreter, - 0, 1, 0, 0, 0x1009, "LightCondition", &stdInterpreter, - 0, 1, 0, 0, 0x100a, "FocusRange", &stdInterpreter, - 0, 1, 0, 0, 0x100b, "FocusMode", &stdInterpreter, - 0, 1, 0, 0, 0x100c, "ManualFocusDistance", &stdInterpreter, - 0, 1, 0, 0, 0x100d, "ZoomStepCount", &stdInterpreter, - 0, 1, 0, 0, 0x100e, "FocusStepCount", &stdInterpreter, - 0, 1, 0, 0, 0x100f, "Sharpness", &stdInterpreter, - 0, 1, 0, 0, 0x1010, "FlashChargeLevel", &stdInterpreter, - 0, 1, 0, 0, 0x1011, "ColorMatrix", &stdInterpreter, - 0, 1, 0, 0, 0x1012, "BlackLevel", &stdInterpreter, - 0, 1, 0, 0, 0x1013, "ColorTemperatureBG", &stdInterpreter, - 0, 1, 0, 0, 0x1014, "ColorTemperatureRG", &stdInterpreter, - 0, 1, 0, 0, 0x1015, "WBMode", &stdInterpreter, - 0, 1, 0, 0, 0x1017, "RedBalance", &stdInterpreter, - 0, 1, 0, 0, 0x1018, "BlueBalance", &stdInterpreter, - 0, 1, 0, 0, 0x1019, "ColorMatrixNumber", &stdInterpreter, - 0, 1, 0, 0, 0x101a, "SerialNumber", &stdInterpreter, - 0, 1, 0, 0, 0x101b, "ExternalFlashAE1_0", &stdInterpreter, - 0, 1, 0, 0, 0x101c, "ExternalFlashAE2_0", &stdInterpreter, - 0, 1, 0, 0, 0x101d, "InternalFlashAE1_0", &stdInterpreter, - 0, 1, 0, 0, 0x101e, "InternalFlashAE2_0", &stdInterpreter, - 0, 1, 0, 0, 0x101f, "ExternalFlashAE1", &stdInterpreter, - 0, 1, 0, 0, 0x1020, "ExternalFlashAE2", &stdInterpreter, - 0, 1, 0, 0, 0x1021, "InternalFlashAE1", &stdInterpreter, - 0, 1, 0, 0, 0x1022, "InternalFlashAE2", &stdInterpreter, - 0, 1, 0, 0, 0x1023, "FlashExposureComp", &stdInterpreter, - 0, 1, 0, 0, 0x1024, "InternalFlashTable", &stdInterpreter, - 0, 1, 0, 0, 0x1025, "ExternalFlashGValue", &stdInterpreter, - 0, 1, 0, 0, 0x1026, "ExternalFlashBounce", &olYesNoInterpreter, - 0, 1, 0, 0, 0x1027, "ExternalFlashZoom", &stdInterpreter, - 0, 1, 0, 0, 0x1028, "ExternalFlashMode", &stdInterpreter, - 0, 1, 0, 0, 0x1029, "Contrast", &stdInterpreter, - 0, 1, 0, 0, 0x102a, "SharpnessFactor", &stdInterpreter, - 0, 1, 0, 0, 0x102b, "ColorControl", &stdInterpreter, - 0, 1, 0, 0, 0x102c, "ValidBits", &stdInterpreter, - 0, 1, 0, 0, 0x102d, "CoringFilter", &stdInterpreter, - 0, 1, 0, 0, 0x102e, "OlympusImageWidth", &stdInterpreter, - 0, 1, 0, 0, 0x102f, "OlympusImageHeight", &stdInterpreter, - 0, 1, 0, 0, 0x1030, "SceneDetect", &stdInterpreter, - 0, 1, 0, 0, 0x1031, "SceneArea", &stdInterpreter, - 0, 1, 0, 0, 0x1033, "SceneDetectData", &stdInterpreter, - 0, 1, 0, 0, 0x1034, "CompressionRatio", &stdInterpreter, - 1, 1, 0, 0, 0x1035, "PreviewImageValid", &olYesNoInterpreter, - 1, 1, 0, 0, 0x1036, "PreviewImageStart", &stdInterpreter, - 1, 1, 0, 0, 0x1037, "PreviewImageLength", &stdInterpreter, - 0, 1, 0, 0, 0x1038, "AFResult", &stdInterpreter, - 0, 1, 0, 0, 0x1039, "CCDScanMode", &stdInterpreter, - 0, 1, 0, 0, 0x103a, "NoiseReduction", &olOnOffInterpreter, - 0, 1, 0, 0, 0x103b, "InfinityLensStep", &stdInterpreter, - 0, 1, 0, 0, 0x103c, "NearLensStep", &stdInterpreter, - 0, 1, 0, 0, 0x103d, "LightValueCenter", &stdInterpreter, - 0, 1, 0, 0, 0x103e, "LightValuePeriphery", &stdInterpreter, - 0, 1, 0, 0, 0x103f, "FieldCount", &stdInterpreter, - 0, 1, 0, olyEquipmentAttribs, 0x2010, "Equipment", &stdInterpreter, - 0, 1, 0, olyCameraSettingsAttribs, 0x2020, "CameraSettings", &stdInterpreter, - 0, 1, 0, olyRawDevelopmentAttribs, 0x2030, "RawDevelopment", &stdInterpreter, - 0, 1, 0, olyRawDevelopment2Attribs, 0x2031, "RawDev2", &stdInterpreter, - 0, 1, 0, olyImageProcessingAttribs, 0x2040, "ImageProcessing", &stdInterpreter, - 0, 1, 0, olyFocusInfoAttribs, 0x2050, "FocusInfo", &stdInterpreter, - 1, 1, 0, 0, 0x2100, "Olympus2100", &stdInterpreter, - 1, 1, 0, 0, 0x2300, "Olympus2300", &stdInterpreter, - 1, 1, 0, 0, 0x2400, "Olympus2400", &stdInterpreter, - 1, 1, 0, 0, 0x2500, "Olympus2500", &stdInterpreter, - 1, 1, 0, 0, 0x2600, "Olympus2600", &stdInterpreter, - 1, 1, 0, 0, 0x2700, "Olympus2700", &stdInterpreter, - 1, 1, 0, 0, 0x2800, "Olympus2800", &stdInterpreter, - 1, 1, 0, 0, 0x2900, "Olympus2900", &stdInterpreter, - 0, 1, 0, 0, 0x3000, "RawInfo", &stdInterpreter, - -1, 0, 0, 0, 0, "", NULL}; -}; - #endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _OLYMPUSATTRIBS_ +#define _OLYMPUSATTRIBS_ + +#include +#include +#include +#include +#include +#include + +namespace rtexif { + +class OLOnOffInterpreter : public Interpreter { + public: + OLOnOffInterpreter () {} + virtual std::string toString (Tag* t) { + if (t->toInt()==0) + return "Off"; + else + return "On"; + } +}; +OLOnOffInterpreter olOnOffInterpreter; + +class OLYesNoInterpreter : public Interpreter { + public: + OLYesNoInterpreter () {} + virtual std::string toString (Tag* t) { + if (t->toInt()==0) + return "No"; + else + return "Yes"; + } +}; +OLYesNoInterpreter olYesNoInterpreter; + +class OLApertureInterpreter : public Interpreter { + public: + OLApertureInterpreter () {} + virtual std::string toString (Tag* t) { + std::ostringstream str; + str.precision(2); + str << pow(2, t->toInt() / 512.0); + return str.str(); + } +}; +OLApertureInterpreter olApertureInterpreter; + +class OLLensTypeInterpreter : public Interpreter { + std::map lenses; + public: + OLLensTypeInterpreter () { + lenses[1] = "Zuiko Digital ED 50mm F2.0 Macro"; + lenses[1 +65536] = "Zuiko Digital 40-150mm F3.5-4.5"; + lenses[2] = "Zuiko Digital ED 150mm F2.0"; + lenses[3] = "Zuiko Digital ED 300mm F2.8"; + lenses[5] = "Zuiko Digital 14-54mm F2.8-3.5"; + lenses[5 +65536] = "Zuiko Digital Pro ED 90-250mm F2.8"; + lenses[6] = "Zuiko Digital ED 50-200mm F2.8-3.5"; + lenses[6 +65536] = "Zuiko Digital ED 8mm F3.5 Fisheye"; + lenses[7] = "Zuiko Digital 11-22mm F2.8-3.5"; + lenses[7 +65536] = "Zuiko Digital 18-180mm F3.5-6.3"; + lenses[8] = "Zuiko Digital 70-300mm F4.0-5.6"; + lenses[21] = "Zuiko Digital ED 7-14mm F4.0"; + lenses[23] = "Zuiko Digital Pro ED 35-100mm F2.0"; + lenses[24] = "Zuiko Digital 14-45mm F3.5-5.6"; + lenses[32] = "Zuiko Digital 35mm F3.5 Macro"; + lenses[34] = "Zuiko Digital 17.5-45mm F3.5-5.6"; + lenses[35] = "Zuiko Digital ED 14-42mm F3.5-5.6"; + lenses[36] = "Zuiko Digital ED 40-150mm F4.0-5.6"; + lenses[48] = "Zuiko Digital ED 50-200mm SWD F2.8-3.5"; + lenses[49] = "Zuiko Digital ED 12-60mm SWD F2.8-4.0"; + lenses[256+ 1] = "18-50mm F3.5-5.6"; + lenses[256+ 2] = "55-200mm F4.0-5.6 DC"; + lenses[256+ 3] = "18-125mm F3.5-5.6 DC"; + lenses[256+ 4] = "18-125mm F3.5-5.6"; + lenses[256+ 5] = "30mm F1.4"; + lenses[256+ 6] = "50-500mm F4.0-6.3 EX DG APO HSM RF"; + lenses[256+ 7] = "105mm F2.8 DG"; + lenses[256+ 8] = "150mm F2.8 DG HSM"; + lenses[256+ 17] = "135-400mm F4.5-5.6 DG ASP APO RF"; + lenses[256+ 18] = "300-800mm F5.6 EX DG APO"; + lenses[512+ 1] = "D Vario Elmarit 14-50mm, F2.8-3.5 Asph."; + lenses[512+ 2] = "D Summilux 25mm, F1.4 Asph."; + lenses[512+ 4] = "Vario Elmar 14-150mm f3.5-5.6"; + lenses[768+ 1] = "D Vario Elmarit 14-50mm, F2.8-3.5 Asph."; + lenses[768+ 2] = "D Summilux 25mm, F1.4 Asph."; + } + virtual std::string toString (Tag* t) { + int make = t->toInt(0); + int model = t->toInt(2); + int add = 0; + if (make==0 && (model==1 || model==5 || model==7 || model==6)) + add += 65536 * t->toInt(3); + return lenses [256 * make + model + add]; + } +}; +OLLensTypeInterpreter olLensTypeInterpreter; + +class OLFlashTypeInterpreter : public ChoiceInterpreter { + public: + OLFlashTypeInterpreter () { + choices[0] = "None"; + choices[2] = "Simple E-System"; + choices[3] = "E-System"; + } +}; +OLFlashTypeInterpreter olFlashTypeInterpreter; + +class OLExposureModeInterpreter : public ChoiceInterpreter { + public: + OLExposureModeInterpreter () { + choices[1] = "Manual"; + choices[2] = "Program"; + choices[3] = "Aperture-priority AE"; + choices[4] = "Shutter speed priority AE"; + choices[5] = "Program-shift"; + } +}; +OLExposureModeInterpreter olExposureModeInterpreter; + +class OLMeteringModeInterpreter : public ChoiceInterpreter { + public: + OLMeteringModeInterpreter () { + choices[2] = "Center-weighted average"; + choices[3] = "Spot"; + choices[5] = "ESP"; + choices[261] = "Pattern+AF"; + choices[515] = "Spot+Highlight control"; + choices[1027] = "Spot+Shadow control"; + } +}; +OLMeteringModeInterpreter olMeteringModeInterpreter; + +class OLFocusModeInterpreter : public ChoiceInterpreter { + public: + OLFocusModeInterpreter () { + choices[0] = "Single AF"; + choices[1] = "Sequential shooting AF"; + choices[2] = "Continuous AF"; + choices[3] = "Multi AF"; + choices[10] = "MF"; + } +}; +OLFocusModeInterpreter olFocusModeInterpreter; + +class OLWhitebalance2Interpreter : public ChoiceInterpreter { + public: + OLWhitebalance2Interpreter () { + choices[0] = "Auto"; + choices[16] = "7500K (Fine Weather with Shade)"; + choices[17] = "6000K (Cloudy)"; + choices[18] = "5300K (Fine Weather)"; + choices[20] = "3000K (Tungsten light)"; + choices[21] = "3600K (Tungsten light-like)"; + choices[33] = "6600K (Daylight fluorescent)"; + choices[34] = "4500K (Neutral white fluorescent)"; + choices[35] = "4000K (Cool white fluorescent)"; + choices[48] = "3600K (Tungsten light-like)"; + choices[256] = "Custom WB 1"; + choices[257] = "Custom WB 2"; + choices[258] = "Custom WB 3"; + choices[259] = "Custom WB 4"; + choices[512] = "Custom WB 5400K"; + choices[513] = "Custom WB 2900K"; + choices[514] = "Custom WB 8000K"; + } +}; +OLWhitebalance2Interpreter olWhitebalance2Interpreter; + +class OLSceneModeInterpreter : public ChoiceInterpreter { + public: + OLSceneModeInterpreter () { + choices[0] = "Standard"; + choices[6] = "Auto"; + choices[7] = "Sport"; + choices[8] = "Portrait"; + choices[9] = "Landscape+Portrait"; + choices[10] = "Landscape"; + choices[11] = "Night Scene"; + choices[12] = "Self Portrait"; + choices[13] = "Panorama"; + choices[14] = "2 in 1"; + choices[15] = "Movie"; + choices[16] = "Landscape+Portrait"; + choices[17] = "Night+Portrait"; + choices[18] = "Indoor"; + choices[19] = "Fireworks"; + choices[20] = "Sunset"; + choices[22] = "Macro"; + choices[23] = "Super Macro"; + choices[24] = "Food"; + choices[25] = "Documents"; + choices[26] = "Museum"; + choices[27] = "Shoot & Select"; + choices[28] = "Beach & Snow"; + choices[29] = "Self Protrait+Timer"; + choices[30] = "Candle"; + choices[31] = "Available Light"; + choices[32] = "Behind Glass"; + choices[33] = "My Mode"; + choices[34] = "Pet"; + choices[35] = "Underwater Wide1"; + choices[36] = "Underwater Macro"; + choices[37] = "Shoot & Select1"; + choices[38] = "Shoot & Select2"; + choices[39] = "High Key"; + choices[40] = "Digital Image Stabilization"; + choices[41] = "Auction"; + choices[42] = "Beach"; + choices[43] = "Snow"; + choices[44] = "Underwater Wide2"; + choices[45] = "Low Key"; + choices[46] = "Children"; + choices[47] = "Vivid"; + choices[48] = "Nature Macro"; + choices[49] = "Underwater Snapshot"; + choices[50] = "Shooting Guide"; + } +}; +OLSceneModeInterpreter olSceneModeInterpreter; + +class OLPictureModeBWFilterInterpreter : public ChoiceInterpreter { + public: + OLPictureModeBWFilterInterpreter () { + choices[0] = "n/a"; + choices[1] = "Neutral"; + choices[2] = "Yellow"; + choices[3] = "Orange"; + choices[4] = "Red"; + choices[5] = "Green"; + } +}; +OLPictureModeBWFilterInterpreter olPictureModeBWFilterInterpreter; + +class OLPictureModeToneInterpreter : public ChoiceInterpreter { + public: + OLPictureModeToneInterpreter () { + choices[0] = "n/a"; + choices[1] = "Neutral"; + choices[2] = "Sepia"; + choices[3] = "Blue"; + choices[4] = "Purple"; + choices[5] = "Green"; + } +}; +OLPictureModeToneInterpreter olPictureModeToneInterpreter; + +class OLImageQuality2Interpreter : public ChoiceInterpreter { + public: + OLImageQuality2Interpreter () { + choices[1] = "SQ"; + choices[2] = "HQ"; + choices[3] = "SHQ"; + choices[4] = "RAW"; + } +}; +OLImageQuality2Interpreter olImageQuality2Interpreter; + +class OLDevEngineInterpreter : public ChoiceInterpreter { + public: + OLDevEngineInterpreter () { + choices[0] = "High Speed"; + choices[1] = "High Function"; + choices[2] = "Advanced High Speed"; + choices[3] = "Advanced High Function"; + } +}; +OLDevEngineInterpreter olDevEngineInterpreter; + +class OLPictureModeInterpreter : public ChoiceInterpreter { + public: + OLPictureModeInterpreter () { + choices[1] = "Vivid"; + choices[2] = "Natural"; + choices[3] = "Muted"; + choices[4] = "Portrait"; + choices[256] = "Monotone"; + choices[512] = "Sepia"; + } +}; +OLPictureModeInterpreter olPictureModeInterpreter; + +class OLColorSpaceInterpreter : public ChoiceInterpreter { + public: + OLColorSpaceInterpreter () { + choices[0] = "sRGB"; + choices[1] = "Adobe RGB"; + choices[2] = "Pro Photo RGB"; + } +}; +OLColorSpaceInterpreter olColorSpaceInterpreter; + +class OLNoiseFilterInterpreter : public Interpreter { + public: + OLNoiseFilterInterpreter () {} + virtual std::string toString (Tag* t) { + int a = t->toInt (0); + int b = t->toInt (2); + int c = t->toInt (4); + if (a==-1 && b==-2 && c==1) + return "Low"; + else if (a==-2 && b==-2 && c==1) + return "Off"; + else if (a==0 && b==-2 && c==1) + return "Standard"; + else if (a==1 && b==-2 && c==1) + return "High"; + else return "Unknown"; + } +}; +OLNoiseFilterInterpreter olNoiseFilterInterpreter; + +class OLFlashModeInterpreter : public Interpreter { + public: + OLFlashModeInterpreter () {} + virtual std::string toString (Tag* t) { + std::ostringstream str; + int a = t->toInt (); + str << "Flash Used = " << ((a&1) ? "Yes" : "No") << std::endl; + str << "Fill-in = " << ((a&2) ? "On" : "Off") << std::endl; + str << "Red-eye = " << ((a&4) ? "On" : "Off") << std::endl; + str << "Slow-sync = " << ((a&8) ? "On" : "Off") << std::endl; + str << "Forced On = " << ((a&16) ? "On" : "Off") << std::endl; + str << "2nd Curtain = " << ((a&32) ? "On" : "Off"); + return str.str(); + } +}; +OLFlashModeInterpreter olFlashModeInterpreter; + +class OLNoiseReductionInterpreter : public Interpreter { + public: + OLNoiseReductionInterpreter () {} + virtual std::string toString (Tag* t) { + std::ostringstream str; + int a = t->toInt (); + str << "Noise Reduction = " << ((a&1) ? "On" : "Off") << std::endl; + str << "Noise Filter = " << ((a&2) ? "On" : "Off") << std::endl; + str << "Noise Filter (ISO Boost) = " << ((a&4) ? "On" : "Off"); + return str.str(); + } +}; +OLNoiseReductionInterpreter olNoiseReductionInterpreter; + +class OLFlashModelInterpreter : public ChoiceInterpreter { + public: + OLFlashModelInterpreter () { + choices[0] = "None"; + choices[1] = "FL-20"; + choices[2] = "FL-50"; + choices[3] = "RF-11"; + choices[4] = "TF-22"; + choices[5] = "FL-36"; + choices[6] = "FL-50R"; + choices[7] = "FL-36R"; + } +}; +OLFlashModelInterpreter olFlashModelInterpreter; + +const TagAttrib olyFocusInfoAttribs[] = { + 0, 1, 0, 0, 0x0000, "FocusInfoVersion", &stdInterpreter, + 0, 1, 0, 0, 0x0209, "AutoFocus", &olOnOffInterpreter, + 0, 1, 0, 0, 0x0210, "SceneDetect", &stdInterpreter, + 0, 1, 0, 0, 0x0211, "SceneArea", &stdInterpreter, + 0, 1, 0, 0, 0x0212, "SceneDetectData", &stdInterpreter, + 0, 1, 0, 0, 0x0300, "ZoomStepCount", &stdInterpreter, + 0, 1, 0, 0, 0x0301, "FocusStepCount", &stdInterpreter, + 0, 1, 0, 0, 0x0303, "FocusStepInfinity", &stdInterpreter, + 0, 1, 0, 0, 0x0304, "FocusStepNear", &stdInterpreter, + 0, 1, 0, 0, 0x0305, "FocusDistance", &stdInterpreter, + 0, 1, 0, 0, 0x0308, "AFPoint", &stdInterpreter, + 0, 1, 0, 0, 0x1201, "ExternalFlash", &olOnOffInterpreter, + 0, 1, 0, 0, 0x1203, "ExternalFlashGuideNumber", &stdInterpreter, + 0, 1, 0, 0, 0x1204, "ExternalFlashBounce", &stdInterpreter, + 0, 1, 0, 0, 0x1205, "ExternalFlashZoom", &stdInterpreter, + 0, 1, 0, 0, 0x1208, "InternalFlash", &olOnOffInterpreter, + 0, 1, 0, 0, 0x1209, "ManualFlash", &olOnOffInterpreter, + 0, 1, 0, 0, 0x1500, "SensorTemperature", &stdInterpreter, + 0, 1, 0, 0, 0x1600, "ImageStabilization", &stdInterpreter, +-1, 0, 0, 0, 0, "", NULL}; + +const TagAttrib olyImageProcessingAttribs[] = { + 0, 1, 0, 0, 0x0000, "ImageProcessingVersion", &stdInterpreter, + 0, 1, 0, 0, 0x0100, "WB_RBLevels", &stdInterpreter, + 0, 1, 0, 0, 0x0102, "WB_RBLevels3000K", &stdInterpreter, + 0, 1, 0, 0, 0x0103, "WB_RBLevels3300K", &stdInterpreter, + 0, 1, 0, 0, 0x0104, "WB_RBLevels3600K", &stdInterpreter, + 0, 1, 0, 0, 0x0105, "WB_RBLevels3900K", &stdInterpreter, + 0, 1, 0, 0, 0x0106, "WB_RBLevels4000K", &stdInterpreter, + 0, 1, 0, 0, 0x0107, "WB_RBLevels4300K", &stdInterpreter, + 0, 1, 0, 0, 0x0108, "WB_RBLevels4500K", &stdInterpreter, + 0, 1, 0, 0, 0x0109, "WB_RBLevels4800K", &stdInterpreter, + 0, 1, 0, 0, 0x010a, "WB_RBLevels5300K", &stdInterpreter, + 0, 1, 0, 0, 0x010b, "WB_RBLevels6000K", &stdInterpreter, + 0, 1, 0, 0, 0x010c, "WB_RBLevels6600K", &stdInterpreter, + 0, 1, 0, 0, 0x010d, "WB_RBLevels7500K", &stdInterpreter, + 0, 1, 0, 0, 0x010e, "WB_RBLevelsCWB1", &stdInterpreter, + 0, 1, 0, 0, 0x010f, "WB_RBLevelsCWB2", &stdInterpreter, + 0, 1, 0, 0, 0x0110, "WB_RBLevelsCWB3", &stdInterpreter, + 0, 1, 0, 0, 0x0111, "WB_RBLevelsCWB4", &stdInterpreter, + 0, 1, 0, 0, 0x0113, "WB_GLevel3000K", &stdInterpreter, + 0, 1, 0, 0, 0x0114, "WB_GLevel3300K", &stdInterpreter, + 0, 1, 0, 0, 0x0115, "WB_GLevel3600K", &stdInterpreter, + 0, 1, 0, 0, 0x0116, "WB_GLevel3900K", &stdInterpreter, + 0, 1, 0, 0, 0x0117, "WB_GLevel4000K", &stdInterpreter, + 0, 1, 0, 0, 0x0118, "WB_GLevel4300K", &stdInterpreter, + 0, 1, 0, 0, 0x0119, "WB_GLevel4500K", &stdInterpreter, + 0, 1, 0, 0, 0x011a, "WB_GLevel4800K", &stdInterpreter, + 0, 1, 0, 0, 0x011b, "WB_GLevel5300K", &stdInterpreter, + 0, 1, 0, 0, 0x011c, "WB_GLevel6000K", &stdInterpreter, + 0, 1, 0, 0, 0x011d, "WB_GLevel6600K", &stdInterpreter, + 0, 1, 0, 0, 0x011e, "WB_GLevel7500K", &stdInterpreter, + 0, 1, 0, 0, 0x011f, "WB_GLevel", &stdInterpreter, + 0, 1, 0, 0, 0x0200, "ColorMatrix", &stdInterpreter, + 0, 1, 0, 0, 0x0300, "Enhancer", &stdInterpreter, + 0, 1, 0, 0, 0x0301, "EnhancerValues", &stdInterpreter, + 0, 1, 0, 0, 0x0310, "CoringFilter", &stdInterpreter, + 0, 1, 0, 0, 0x0311, "CoringValues", &stdInterpreter, + 0, 1, 0, 0, 0x0600, "BlackLevel2", &stdInterpreter, + 0, 1, 0, 0, 0x0610, "GainBase", &stdInterpreter, + 0, 1, 0, 0, 0x0611, "ValidBits", &stdInterpreter, + 0, 1, 0, 0, 0x0612, "CropLeft", &stdInterpreter, + 0, 1, 0, 0, 0x0613, "CropTop", &stdInterpreter, + 0, 1, 0, 0, 0x0614, "CropWidth", &stdInterpreter, + 0, 1, 0, 0, 0x0615, "CropHeight", &stdInterpreter, + 0, 1, 0, 0, 0x1010, "NoiseReduction2", &stdInterpreter, + 0, 1, 0, 0, 0x1011, "DistortionCorrection2", &olOnOffInterpreter, + 0, 1, 0, 0, 0x1012, "ShadingCompensation2", &olOnOffInterpreter, + 1, 1, 0, 0, 0x1103, "UnknownBlock", &stdInterpreter, + 0, 1, 0, 0, 0x1200, "FaceDetect", &olOnOffInterpreter, + 0, 1, 0, 0, 0x1201, "FaceDetectArea", &stdInterpreter, +-1, 0, 0, 0, 0, "", NULL}; + +const TagAttrib olyRawDevelopmentAttribs[] = { + 0, 1, 0, 0, 0x0000, "RawDevVersion", &stdInterpreter, + 0, 1, 0, 0, 0x0100, "RawDevExposureBiasValue", &stdInterpreter, + 0, 1, 0, 0, 0x0101, "RawDevWhiteBalanceValue", &stdInterpreter, + 0, 1, 0, 0, 0x0102, "RawDevWBFineAdjustment", &stdInterpreter, + 0, 1, 0, 0, 0x0103, "RawDevGrayPoint", &stdInterpreter, + 0, 1, 0, 0, 0x0104, "RawDevSaturationEmphasis", &stdInterpreter, + 0, 1, 0, 0, 0x0105, "RawDevMemoryColorEmphasis", &stdInterpreter, + 0, 1, 0, 0, 0x0106, "RawDevContrastValue", &stdInterpreter, + 0, 1, 0, 0, 0x0107, "RawDevSharpnessValue", &stdInterpreter, + 0, 1, 0, 0, 0x0108, "RawDevColorSpace", &olColorSpaceInterpreter, + 0, 1, 0, 0, 0x0109, "RawDevEngine", &olDevEngineInterpreter, + 0, 1, 0, 0, 0x010a, "RawDevNoiseReduction", &olNoiseReductionInterpreter, + 0, 1, 0, 0, 0x010b, "RawDevEditStatus", &stdInterpreter, + 0, 1, 0, 0, 0x010c, "RawDevSettings", &stdInterpreter, +-1, 0, 0, 0, 0, "", NULL}; + +const TagAttrib olyRawDevelopment2Attribs[] = { + 0, 1, 0, 0, 0x0000, "RawDevVersion", &stdInterpreter, + 0, 1, 0, 0, 0x0100, "RawDevExposureBiasValue", &stdInterpreter, + 0, 1, 0, 0, 0x0101, "RawDevWhiteBalance", &stdInterpreter, + 0, 1, 0, 0, 0x0102, "RawDevWhiteBalanceValue", &stdInterpreter, + 0, 1, 0, 0, 0x0103, "RawDevWBFineAdjustment", &stdInterpreter, + 0, 1, 0, 0, 0x0104, "RawDevGrayPoint", &stdInterpreter, + 0, 1, 0, 0, 0x0105, "RawDevContrastValue", &stdInterpreter, + 0, 1, 0, 0, 0x0106, "RawDevSharpnessValue", &stdInterpreter, + 0, 1, 0, 0, 0x0107, "RawDevSaturationEmphasis", &stdInterpreter, + 0, 1, 0, 0, 0x0108, "RawDevMemoryColorEmphasis", &stdInterpreter, + 0, 1, 0, 0, 0x0109, "RawDevColorSpace", &olColorSpaceInterpreter, + 0, 1, 0, 0, 0x010a, "RawDevNoiseReduction", &olNoiseReductionInterpreter, + 0, 1, 0, 0, 0x010b, "RawDevEngine", &olDevEngineInterpreter, + 0, 1, 0, 0, 0x010c, "RawDevPictureMode", &olPictureModeInterpreter, + 0, 1, 0, 0, 0x010d, "RawDevPMSaturation", &stdInterpreter, + 0, 1, 0, 0, 0x010e, "RawDevPMContrast", &stdInterpreter, + 0, 1, 0, 0, 0x010f, "RawDevPMSharpness", &stdInterpreter, + 0, 1, 0, 0, 0x0110, "RawDevPM_BWFilter", &olPictureModeBWFilterInterpreter, + 0, 1, 0, 0, 0x0111, "RawDevPMPictureTone", &olPictureModeToneInterpreter, + 0, 1, 0, 0, 0x0112, "RawDevGradation", &stdInterpreter, + 0, 1, 0, 0, 0x0113, "RawDevSaturation3", &stdInterpreter, + 0, 1, 0, 0, 0x0119, "RawDevAutoGradation", &olOnOffInterpreter, + 0, 1, 0, 0, 0x0120, "RawDevPMNoiseFilter", &stdInterpreter, +-1, 0, 0, 0, 0, "", NULL}; + +const TagAttrib olyCameraSettingsAttribs[] = { + 0, 1, 0, 0, 0x0000, "CameraSettingsVersion", &stdInterpreter, + 1, 1, 0, 0, 0x0100, "PreviewImageValid", &olYesNoInterpreter, + 1, 1, 0, 0, 0x0101, "PreviewImageStart", &stdInterpreter, + 1, 1, 0, 0, 0x0102, "PreviewImageLength", &stdInterpreter, + 0, 1, 0, 0, 0x0200, "ExposureMode", &olExposureModeInterpreter, + 0, 1, 0, 0, 0x0201, "AELock", &olOnOffInterpreter, + 0, 1, 0, 0, 0x0202, "MeteringMode", &olMeteringModeInterpreter, + 0, 1, 0, 0, 0x0300, "MacroMode", &olOnOffInterpreter, + 0, 1, 0, 0, 0x0301, "FocusMode", &olFocusModeInterpreter, + 0, 1, 0, 0, 0x0302, "FocusProcess", &stdInterpreter, + 0, 1, 0, 0, 0x0303, "AFSearch", &stdInterpreter, + 0, 1, 0, 0, 0x0304, "AFAreas", &stdInterpreter, + 0, 1, 0, 0, 0x0400, "FlashMode", &stdInterpreter, + 0, 1, 0, 0, 0x0401, "FlashExposureComp", &stdInterpreter, + 0, 1, 0, 0, 0x0500, "WhiteBalance2", &olWhitebalance2Interpreter, + 0, 1, 0, 0, 0x0501, "WhiteBalanceTemperature", &stdInterpreter, + 0, 1, 0, 0, 0x0502, "WhiteBalanceBracket", &stdInterpreter, + 0, 1, 0, 0, 0x0503, "CustomSaturation", &stdInterpreter, + 0, 1, 0, 0, 0x0504, "ModifiedSaturation", &stdInterpreter, + 0, 1, 0, 0, 0x0505, "ContrastSetting", &stdInterpreter, + 0, 1, 0, 0, 0x0506, "SharpnessSetting", &stdInterpreter, + 0, 1, 0, 0, 0x0507, "ColorSpace", &olColorSpaceInterpreter, + 0, 1, 0, 0, 0x0509, "SceneMode", &olSceneModeInterpreter, + 0, 1, 0, 0, 0x050a, "NoiseReduction", &olNoiseReductionInterpreter, + 0, 1, 0, 0, 0x050b, "DistortionCorrection", &olOnOffInterpreter, + 0, 1, 0, 0, 0x050c, "ShadingCompensation", &olOnOffInterpreter, + 0, 1, 0, 0, 0x050d, "CompressionFactor", &stdInterpreter, + 0, 1, 0, 0, 0x050f, "Gradation", &stdInterpreter, + 0, 1, 0, 0, 0x0520, "PictureMode", &olPictureModeInterpreter, + 0, 1, 0, 0, 0x0521, "PictureModeSaturation", &stdInterpreter, + 0, 1, 0, 0, 0x0522, "PictureModeHue", &stdInterpreter, + 0, 1, 0, 0, 0x0523, "PictureModeContrast", &stdInterpreter, + 0, 1, 0, 0, 0x0524, "PictureModeSharpness", &stdInterpreter, + 0, 1, 0, 0, 0x0525, "PictureModeBWFilter", &olPictureModeBWFilterInterpreter, + 0, 1, 0, 0, 0x0526, "PictureModeTone", &olPictureModeToneInterpreter, + 0, 1, 0, 0, 0x0527, "NoiseFilter", &olNoiseFilterInterpreter, + 0, 1, 0, 0, 0x0600, "DriveMode", &stdInterpreter, + 0, 1, 0, 0, 0x0601, "PanoramaMode", &stdInterpreter, + 0, 1, 0, 0, 0x0603, "ImageQuality2", &olImageQuality2Interpreter, + 0, 1, 0, 0, 0x0900, "ManometerPressure", &stdInterpreter, + 0, 1, 0, 0, 0x0901, "ManometerReading", &stdInterpreter, + 0, 1, 0, 0, 0x0902, "ExtendedWBDetect", &olOnOffInterpreter, + -1, 0, 0, 0, 0, "", NULL}; + +const TagAttrib olyEquipmentAttribs[] = { + 0, 1, 0, 0, 0x0000, "EquipmentVersion", &stdInterpreter, + 0, 1, 0, 0, 0x0100, "CameraType2", &stdInterpreter, + 0, 1, 0, 0, 0x0101, "SerialNumber", &stdInterpreter, + 0, 1, 0, 0, 0x0102, "InternalSerialNumber", &stdInterpreter, + 0, 1, 0, 0, 0x0103, "FocalPlaneDiagonal", &stdInterpreter, + 0, 1, 0, 0, 0x0104, "BodyFirmwareVersion", &stdInterpreter, + 0, 1, 0, 0, 0x0201, "LensType", &olLensTypeInterpreter, + 0, 1, 0, 0, 0x0202, "LensSerialNumber", &stdInterpreter, + 0, 1, 0, 0, 0x0204, "LensFirmwareVersion", &stdInterpreter, + 0, 1, 0, 0, 0x0205, "MaxApertureAtMinFocal", &olApertureInterpreter, + 0, 1, 0, 0, 0x0206, "MaxApertureAtMaxFocal", &olApertureInterpreter, + 0, 1, 0, 0, 0x0207, "MinFocalLength", &stdInterpreter, + 0, 1, 0, 0, 0x0208, "MaxFocalLength", &stdInterpreter, + 0, 1, 0, 0, 0x020a, "MaxApertureAtCurrentFocal", &olApertureInterpreter, + 0, 1, 0, 0, 0x020b, "LensProperties", &stdInterpreter, + 0, 1, 0, 0, 0x0301, "Extender", &stdInterpreter, + 0, 1, 0, 0, 0x0302, "ExtenderSerialNumber", &stdInterpreter, + 0, 1, 0, 0, 0x0303, "ExtenderModel", &stdInterpreter, + 0, 1, 0, 0, 0x0304, "ExtenderFirmwareVersion", &stdInterpreter, + 0, 1, 0, 0, 0x1000, "FlashType", &olFlashTypeInterpreter, + 0, 1, 0, 0, 0x1001, "FlashModel", &olFlashModelInterpreter, + 0, 1, 0, 0, 0x1002, "FlashFirmwareVersion", &stdInterpreter, + 0, 1, 0, 0, 0x1003, "FlashSerialNumber", &stdInterpreter, + -1, 0, 0, 0, 0, "", NULL}; + +const TagAttrib olympusAttribs[] = { + 0, 1, 0, 0, 0x0104, "BodyFirmwareVersion", &stdInterpreter, + 0, 1, 0, 0, 0x0200, "SpecialMode", &stdInterpreter, + 0, 1, 0, 0, 0x0201, "Quality", &stdInterpreter, + 0, 1, 0, 0, 0x0202, "Macro", &olOnOffInterpreter, + 0, 1, 0, 0, 0x0203, "BWMode", &olOnOffInterpreter, + 0, 1, 0, 0, 0x0204, "DigitalZoom", &stdInterpreter, + 0, 1, 0, 0, 0x0205, "FocalPlaneDiagonal", &stdInterpreter, + 0, 1, 0, 0, 0x0206, "LensDistortionParams", &stdInterpreter, + 0, 1, 0, 0, 0x0207, "CameraType", &stdInterpreter, + 1, 1, 0, 0, 0x0208, "TextInfo", &stdInterpreter, + 0, 1, 0, 0, 0x0209, "CameraID", &stdInterpreter, + 0, 1, 0, 0, 0x020b, "EpsonImageWidth", &stdInterpreter, + 0, 1, 0, 0, 0x020c, "EpsonImageHeight", &stdInterpreter, + 0, 1, 0, 0, 0x020d, "EpsonSoftware", &stdInterpreter, + 0, 2, 0, 0, 0x0280, "PreviewImage", &stdInterpreter, + 0, 1, 0, 0, 0x0300, "PreCaptureFrames", &stdInterpreter, + 0, 1, 0, 0, 0x0301, "WhiteBoard", &stdInterpreter, + 0, 1, 0, 0, 0x0302, "OneTouchWB", &olOnOffInterpreter, + 0, 1, 0, 0, 0x0303, "WhiteBalanceBracket", &stdInterpreter, + 0, 1, 0, 0, 0x0304, "WhiteBalanceBias", &stdInterpreter, + 0, 1, 0, 0, 0x0403, "SceneMode", &stdInterpreter, + 0, 1, 0, 0, 0x0404, "SerialNumber", &stdInterpreter, + 0, 1, 0, 0, 0x0405, "Firmware", &stdInterpreter, + 1, 1, 0, 0, 0x0e00, "PrintIM", &stdInterpreter, + 0, 1, 0, 0, 0x0f00, "DataDump", &stdInterpreter, + 0, 1, 0, 0, 0x0f01, "DataDump2", &stdInterpreter, + 0, 1, 0, 0, 0x1000, "ShutterSpeedValue", &stdInterpreter, + 0, 1, 0, 0, 0x1001, "ISOValue", &stdInterpreter, + 0, 1, 0, 0, 0x1002, "ApertureValue", &stdInterpreter, + 0, 1, 0, 0, 0x1003, "BrightnessValue", &stdInterpreter, + 0, 1, 0, 0, 0x1004, "FlashMode", &stdInterpreter, + 0, 1, 0, 0, 0x1005, "FlashDevice", &stdInterpreter, + 0, 1, 0, 0, 0x1006, "ExposureCompensation", &stdInterpreter, + 0, 1, 0, 0, 0x1007, "SensorTemperature", &stdInterpreter, + 0, 1, 0, 0, 0x1008, "LensTemperature", &stdInterpreter, + 0, 1, 0, 0, 0x1009, "LightCondition", &stdInterpreter, + 0, 1, 0, 0, 0x100a, "FocusRange", &stdInterpreter, + 0, 1, 0, 0, 0x100b, "FocusMode", &stdInterpreter, + 0, 1, 0, 0, 0x100c, "ManualFocusDistance", &stdInterpreter, + 0, 1, 0, 0, 0x100d, "ZoomStepCount", &stdInterpreter, + 0, 1, 0, 0, 0x100e, "FocusStepCount", &stdInterpreter, + 0, 1, 0, 0, 0x100f, "Sharpness", &stdInterpreter, + 0, 1, 0, 0, 0x1010, "FlashChargeLevel", &stdInterpreter, + 0, 1, 0, 0, 0x1011, "ColorMatrix", &stdInterpreter, + 0, 1, 0, 0, 0x1012, "BlackLevel", &stdInterpreter, + 0, 1, 0, 0, 0x1013, "ColorTemperatureBG", &stdInterpreter, + 0, 1, 0, 0, 0x1014, "ColorTemperatureRG", &stdInterpreter, + 0, 1, 0, 0, 0x1015, "WBMode", &stdInterpreter, + 0, 1, 0, 0, 0x1017, "RedBalance", &stdInterpreter, + 0, 1, 0, 0, 0x1018, "BlueBalance", &stdInterpreter, + 0, 1, 0, 0, 0x1019, "ColorMatrixNumber", &stdInterpreter, + 0, 1, 0, 0, 0x101a, "SerialNumber", &stdInterpreter, + 0, 1, 0, 0, 0x101b, "ExternalFlashAE1_0", &stdInterpreter, + 0, 1, 0, 0, 0x101c, "ExternalFlashAE2_0", &stdInterpreter, + 0, 1, 0, 0, 0x101d, "InternalFlashAE1_0", &stdInterpreter, + 0, 1, 0, 0, 0x101e, "InternalFlashAE2_0", &stdInterpreter, + 0, 1, 0, 0, 0x101f, "ExternalFlashAE1", &stdInterpreter, + 0, 1, 0, 0, 0x1020, "ExternalFlashAE2", &stdInterpreter, + 0, 1, 0, 0, 0x1021, "InternalFlashAE1", &stdInterpreter, + 0, 1, 0, 0, 0x1022, "InternalFlashAE2", &stdInterpreter, + 0, 1, 0, 0, 0x1023, "FlashExposureComp", &stdInterpreter, + 0, 1, 0, 0, 0x1024, "InternalFlashTable", &stdInterpreter, + 0, 1, 0, 0, 0x1025, "ExternalFlashGValue", &stdInterpreter, + 0, 1, 0, 0, 0x1026, "ExternalFlashBounce", &olYesNoInterpreter, + 0, 1, 0, 0, 0x1027, "ExternalFlashZoom", &stdInterpreter, + 0, 1, 0, 0, 0x1028, "ExternalFlashMode", &stdInterpreter, + 0, 1, 0, 0, 0x1029, "Contrast", &stdInterpreter, + 0, 1, 0, 0, 0x102a, "SharpnessFactor", &stdInterpreter, + 0, 1, 0, 0, 0x102b, "ColorControl", &stdInterpreter, + 0, 1, 0, 0, 0x102c, "ValidBits", &stdInterpreter, + 0, 1, 0, 0, 0x102d, "CoringFilter", &stdInterpreter, + 0, 1, 0, 0, 0x102e, "OlympusImageWidth", &stdInterpreter, + 0, 1, 0, 0, 0x102f, "OlympusImageHeight", &stdInterpreter, + 0, 1, 0, 0, 0x1030, "SceneDetect", &stdInterpreter, + 0, 1, 0, 0, 0x1031, "SceneArea", &stdInterpreter, + 0, 1, 0, 0, 0x1033, "SceneDetectData", &stdInterpreter, + 0, 1, 0, 0, 0x1034, "CompressionRatio", &stdInterpreter, + 1, 1, 0, 0, 0x1035, "PreviewImageValid", &olYesNoInterpreter, + 1, 1, 0, 0, 0x1036, "PreviewImageStart", &stdInterpreter, + 1, 1, 0, 0, 0x1037, "PreviewImageLength", &stdInterpreter, + 0, 1, 0, 0, 0x1038, "AFResult", &stdInterpreter, + 0, 1, 0, 0, 0x1039, "CCDScanMode", &stdInterpreter, + 0, 1, 0, 0, 0x103a, "NoiseReduction", &olOnOffInterpreter, + 0, 1, 0, 0, 0x103b, "InfinityLensStep", &stdInterpreter, + 0, 1, 0, 0, 0x103c, "NearLensStep", &stdInterpreter, + 0, 1, 0, 0, 0x103d, "LightValueCenter", &stdInterpreter, + 0, 1, 0, 0, 0x103e, "LightValuePeriphery", &stdInterpreter, + 0, 1, 0, 0, 0x103f, "FieldCount", &stdInterpreter, + 0, 1, 0, olyEquipmentAttribs, 0x2010, "Equipment", &stdInterpreter, + 0, 1, 0, olyCameraSettingsAttribs, 0x2020, "CameraSettings", &stdInterpreter, + 0, 1, 0, olyRawDevelopmentAttribs, 0x2030, "RawDevelopment", &stdInterpreter, + 0, 1, 0, olyRawDevelopment2Attribs, 0x2031, "RawDev2", &stdInterpreter, + 0, 1, 0, olyImageProcessingAttribs, 0x2040, "ImageProcessing", &stdInterpreter, + 0, 1, 0, olyFocusInfoAttribs, 0x2050, "FocusInfo", &stdInterpreter, + 1, 1, 0, 0, 0x2100, "Olympus2100", &stdInterpreter, + 1, 1, 0, 0, 0x2300, "Olympus2300", &stdInterpreter, + 1, 1, 0, 0, 0x2400, "Olympus2400", &stdInterpreter, + 1, 1, 0, 0, 0x2500, "Olympus2500", &stdInterpreter, + 1, 1, 0, 0, 0x2600, "Olympus2600", &stdInterpreter, + 1, 1, 0, 0, 0x2700, "Olympus2700", &stdInterpreter, + 1, 1, 0, 0, 0x2800, "Olympus2800", &stdInterpreter, + 1, 1, 0, 0, 0x2900, "Olympus2900", &stdInterpreter, + 0, 1, 0, 0, 0x3000, "RawInfo", &stdInterpreter, + -1, 0, 0, 0, 0, "", NULL}; +}; +#endif diff --git a/rtexif/pentaxattribs.cc b/rtexif/pentaxattribs.cc index 5c86d637f..0844dc1b5 100644 --- a/rtexif/pentaxattribs.cc +++ b/rtexif/pentaxattribs.cc @@ -1,459 +1,459 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _PENTAXATTRIBS_ -#define _PENTAXATTRIBS_ - -#include -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _PENTAXATTRIBS_ +#define _PENTAXATTRIBS_ + +#include +#include +#include #include -#include +#include #include - -namespace rtexif { - - -class PAQualityInterpreter : public ChoiceInterpreter { - public: - PAQualityInterpreter () { - choices[0] = "Good"; - choices[1] = "Better"; - choices[2] = "Best"; - choices[3] = "TIFF"; - choices[4] = "RAW"; - choices[5] = "Premium"; - } -}; -PAQualityInterpreter paQualityInterpreter; - -class PAOnOffInterpreter : public ChoiceInterpreter { - public: - PAOnOffInterpreter () { - choices[0] = "Off"; - choices[1] = "On"; - } -}; -PAOnOffInterpreter paOnOffInterpreter; - -class PAPictureModeInterpreter : public ChoiceInterpreter { - public: - PAPictureModeInterpreter () { - choices[0] = "Program"; - choices[1] = "Shutter Speed Priority"; - choices[2] = "Program AE"; - choices[3] = "Manual"; - choices[5] = "Portrait"; - choices[6] = "Landscape"; - choices[8] = "Sport"; - choices[9] = "Night Scene"; - choices[11] = "Soft"; - choices[12] = "Surf & Snow"; - choices[13] = "Candlelight"; - choices[14] = "Autumn"; - choices[15] = "Macro"; - choices[17] = "Fireworks"; - choices[18] = "Text"; - choices[19] = "Panorama"; - choices[30] = "Self Portrait"; - choices[31] = "Illustrations"; - choices[33] = "Digital Filter"; - choices[35] = "Night Scene Portrait"; - choices[37] = "Museum"; - choices[38] = "Food"; - choices[39] = "Underwater"; - choices[40] = "Green Mode"; - choices[49] = "Light Pet"; - choices[50] = "Dark Pet"; - choices[51] = "Medium Pet"; - choices[53] = "Underwater"; - choices[54] = "Candlelight"; - choices[55] = "Natural Skin Tone"; - choices[56] = "Synchro Sound Record"; - choices[58] = "Frame Composite"; - choices[59] = "Report"; - choices[60] = "Kids"; - choices[61] = "Blur Reduction"; - choices[65] = "Half-length Portrait"; - } -}; -PAPictureModeInterpreter paPictureModeInterpreter; - -class PAFlashModeInterpreter : public ChoiceInterpreter { - public: - PAFlashModeInterpreter () { - choices[0x0] = "Auto, Did not fire"; - choices[0x1] = "Off"; - choices[0x2] = "On, Did not fire"; - choices[0x3] = "Auto, Did not fire, Red-eye reduction"; - choices[0x100] = "Auto, Fired"; - choices[0x102] = "On"; - choices[0x103] = "Auto, Fired, Red-eye reduction"; - choices[0x104] = "On, Red-eye reduction"; - choices[0x105] = "On, Wireless (Master)"; - choices[0x106] = "On, Wireless (Control)"; - choices[0x108] = "On, Soft"; - choices[0x109] = "On, Slow-sync"; - choices[0x10a] = "On, Slow-sync, Red-eye reduction"; - choices[0x10b] = "On, Trailing-curtain Sync"; - } -}; -PAFlashModeInterpreter paFlashModeInterpreter; - -class PAFocusModeInterpreter : public ChoiceInterpreter { - public: - PAFocusModeInterpreter () { - choices[0] = "Normal"; - choices[1] = "Macro"; - choices[2] = "Infinity"; - choices[3] = "Manual"; - choices[4] = "Super Macro"; - choices[5] = "Pan Focus"; - choices[16] = "AF-S"; - choices[17] = "AF-C"; - choices[18] = "AF-A"; - } -}; -PAFocusModeInterpreter paFocusModeInterpreter; - -class PAAFPointInterpreter : public ChoiceInterpreter { - public: - PAAFPointInterpreter () { - choices[1] = "Upper-left"; - choices[2] = "Top"; - choices[3] = "Upper-right"; - choices[4] = "Left"; - choices[5] = "Mid-left"; - choices[6] = "Center"; - choices[7] = "Mid-right"; - choices[8] = "Right"; - choices[9] = "Lower-left"; - choices[10] = "Bottom"; - choices[11] = "Lower-right"; - choices[65532] = "Face Recognition AF"; - choices[65533] = "Automatic Tracking AF"; - choices[65534] = "Fixed Center"; - choices[65535] = "Auto"; - } -}; -PAAFPointInterpreter paAFPointInterpreter; - -class PAAFFocusInterpreter : public ChoiceInterpreter { - public: - PAAFFocusInterpreter () { - choices[0x0] = "Fixed Center or Multiple"; - choices[0x1] = "Top-left"; - choices[0x2] = "Top-center"; - choices[0x3] = "Top-right"; - choices[0x4] = "Left"; - choices[0x5] = "Center"; - choices[0x6] = "Right"; - choices[0x7] = "Bottom-left"; - choices[0x8] = "Bottom-center"; - choices[0x9] = "Bottom-right"; - choices[0xffff] = "None"; - } -}; -PAAFFocusInterpreter paAFFocusInterpreter; - -class PAISOInterpreter : public ChoiceInterpreter { - public: - PAISOInterpreter () { - choices[3] = "50"; - choices[4] = "64"; - choices[5] = "80"; - choices[6] = "100"; - choices[7] = "125"; - choices[8] = "160"; - choices[9] = "200"; - choices[10] = "250"; - choices[11] = "320"; - choices[12] = "400"; - choices[13] = "500"; - choices[14] = "640"; - choices[15] = "800"; - choices[16] = "1000"; - choices[17] = "1250"; - choices[18] = "1600"; - choices[19] = "2000"; - choices[20] = "2500"; - choices[21] = "3200"; - choices[50] = "50"; - choices[100] = "100"; - choices[200] = "200"; - choices[258] = "50"; - choices[259] = "70"; - choices[260] = "100"; - choices[261] = "140"; - choices[262] = "200"; - choices[263] = "280"; - choices[264] = "400"; - choices[265] = "560"; - choices[266] = "800"; - choices[267] = "1100"; - choices[268] = "1600"; - choices[269] = "2200"; - choices[270] = "3200"; - choices[400] = "400"; - choices[800] = "800"; - choices[1600] = "1600"; - choices[3200] = "320"; - } -}; -PAISOInterpreter paISOInterpreter; - -class PAMeteringModeInterpreter : public ChoiceInterpreter { - public: - PAMeteringModeInterpreter () { - choices[0] = "Multi-segment"; - choices[1] = "Center-weighted average"; - choices[2] = "Spot"; - } -}; -PAMeteringModeInterpreter paMeteringModeInterpreter; - -class PAWhiteBalanceInterpreter : public ChoiceInterpreter { - public: - PAWhiteBalanceInterpreter () { - choices[0] = "Auto"; - choices[1] = "Daylight"; - choices[2] = "Shade"; - choices[3] = "Fluorescent"; - choices[4] = "Tungsten"; - choices[5] = "Manual"; - choices[6] = "DaylightFluorescent"; - choices[7] = "DaywhiteFluorescent"; - choices[8] = "WhiteFluorescent"; - choices[9] = "Flash"; - choices[10] = "Cloudy"; - choices[17] = "Kelvin"; - choices[65534] = "Unknown"; - choices[65535] = "User Selected"; - } -}; -PAWhiteBalanceInterpreter paWhiteBalanceInterpreter; - -class PAWhiteBalanceModeInterpreter : public ChoiceInterpreter { - public: - PAWhiteBalanceModeInterpreter () { - choices[1] = "Auto (Daylight)"; - choices[2] = "Auto (Shade)"; - choices[3] = "Auto (Flash)"; - choices[4] = "Auto (Tungsten)"; - choices[6] = "Auto (DaylightFluorescent)"; - choices[7] = "Auto (DaywhiteFluorescent)"; - choices[8] = "Auto (WhiteFluorescent)"; - choices[10] = "Auto (Cloudy)"; - choices[65534] = "Preset (Fireworks?)"; - choices[65535] = "User-Selected"; - } -}; -PAWhiteBalanceModeInterpreter paWhiteBalanceModeInterpreter; - -class PASaturationInterpreter : public ChoiceInterpreter { - public: - PASaturationInterpreter () { - choices[0] = "Low"; - choices[1] = "Normal"; - choices[2] = "High"; - choices[3] = "Med Low"; - choices[4] = "Med High"; - choices[5] = "Very Low"; - choices[6] = "Very High"; - } -}; -PASaturationInterpreter paSaturationInterpreter; - -class PAContrastInterpreter : public ChoiceInterpreter { - public: - PAContrastInterpreter () { - choices[0] = "Low"; - choices[1] = "Normal"; - choices[2] = "High"; - choices[3] = "Med Low"; - choices[4] = "Med High"; - choices[5] = "Very Low"; - choices[6] = "Very High"; - } -}; -PAContrastInterpreter paContrastInterpreter; - -class PASharpnessInterpreter : public ChoiceInterpreter { - public: - PASharpnessInterpreter () { - choices[0] = "Soft"; - choices[1] = "Normal"; - choices[2] = "Hard"; - choices[3] = "Med Soft"; - choices[4] = "Med Hard"; - choices[5] = "Very Soft"; - choices[6] = "Very Hard"; - } -}; -PASharpnessInterpreter paSharpnessInterpreter; - -class PALensTypeInterpreter : public ChoiceInterpreter { - public: - PALensTypeInterpreter () { - choices[256*0+ 0] = "M-42 or No Lens"; - choices[256*1+ 0] = "K,M Lens"; - choices[256*2+ 0] = "A Series Lens"; - choices[256*3+ 0] = "SIGMA"; - choices[256*3+ 17] = "smc PENTAX-FA SOFT 85mm F2.8"; - choices[256*3+ 18] = "smc PENTAX-F 1.7X AF ADAPTER"; - choices[256*3+ 19] = "smc PENTAX-F 24-50mm F4"; - choices[256*3+ 20] = "smc PENTAX-F 35-80mm F4-5.6"; - choices[256*3+ 21] = "smc PENTAX-F 80-200mm F4.7-5.6"; - choices[256*3+ 22] = "smc PENTAX-F FISH-EYE 17-28mm F3.5-4.5"; - choices[256*3+ 23] = "smc PENTAX-F 100-300mm F4.5-5.6"; - choices[256*3+ 24] = "smc PENTAX-F 35-135mm F3.5-4.5"; - choices[256*3+ 25] = "smc PENTAX-F 35-105mm F4-5.6 or SIGMA or Tokina"; - choices[256*3+ 26] = "smc PENTAX-F* 250-600mm F5.6 ED[IF]"; - choices[256*3+ 27] = "smc PENTAX-F 28-80mm F3.5-4.5"; - choices[256*3+ 28] = "smc PENTAX-F 35-70mm F3.5-4.5"; - choices[256*3+ 29] = "PENTAX-F 28-80mm F3.5-4.5 or SIGMA AF 18-125mm F3.5-5.6 DC"; - choices[256*3+ 30] = "PENTAX-F 70-200mm F4-5.6"; - choices[256*3+ 31] = "smc PENTAX-F 70-210mm F4-5.6"; - choices[256*3+ 32] = "smc PENTAX-F 50mm F1.4"; - choices[256*3+ 33] = "smc PENTAX-F 50mm F1.7"; - choices[256*3+ 34] = "smc PENTAX-F 135mm F2.8 [IF]"; - choices[256*3+ 35] = "smc PENTAX-F 28mm F2.8"; - choices[256*3+ 36] = "SIGMA 20mm F1.8 EX DG ASPHERICAL RF"; - choices[256*3+ 38] = "smc PENTAX-F* 300mm F4.5 ED[IF]"; - choices[256*3+ 39] = "smc PENTAX-F* 600mm F4 ED[IF]"; - choices[256*3+ 40] = "smc PENTAX-F MACRO 100mm F2.8"; - choices[256*3+ 41] = "smc PENTAX-F MACRO 50mm F2.8 or Sigma 50mm F2,8 MACRO"; - choices[256*3+ 44] = "Tamron 35-90mm F4 AF or various SIGMA models"; - choices[256*3+ 46] = "SIGMA APO 70-200mm F2.8 EX"; - choices[256*3+ 50] = "smc PENTAX-FA 28-70 F4 AL"; - choices[256*3+ 51] = "SIGMA 28mm F1.8 EX DG ASPHERICAL MACRO"; - choices[256*3+ 52] = "smc PENTAX-FA 28-200mm F3.8-5.6 AL[IF]"; - choices[256*3+ 53] = "smc PENTAX-FA 28-80mm F3.5-5.6 AL"; - choices[256*3+ 247] = "smc PENTAX-DA FISH-EYE 10-17mm F3.5-4.5 ED[IF]"; - choices[256*3+ 248] = "smc PENTAX-DA 12-24mm F4 ED AL[IF]"; - choices[256*3+ 250] = "smc PENTAX-DA 50-200mm F4-5.6 ED"; - choices[256*3+ 251] = "smc PENTAX-DA 40mm F2.8 Limited"; - choices[256*3+ 252] = "smc PENTAX-DA 18-55mm F3.5-5.6 AL"; - choices[256*3+ 253] = "smc PENTAX-DA 14mm F2.8 ED[IF]"; - choices[256*3+ 254] = "smc PENTAX-DA 16-45mm F4 ED AL"; - choices[256*3+ 255] = "SIGMA"; - choices[256*4+ 1] = "smc PENTAX-FA SOFT 28mm F2.8"; - choices[256*4+ 2] = "smc PENTAX-FA 80-320mm F4.5-5.6"; - choices[256*4+ 3] = "smc PENTAX-FA 43mm F1.9 Limited"; - choices[256*4+ 6] = "smc PENTAX-FA 35-80mm F4-5.6"; - choices[256*4+ 12] = "smc PENTAX-FA 50mm F1.4"; - choices[256*4+ 15] = "smc PENTAX-FA 28-105mm F4-5.6 [IF]"; - choices[256*4+ 16] = "TAMRON AF 80-210mm F4-5.6 (178D)"; - choices[256*4+ 19] = "TAMRON SP AF 90mm F2.8 (172E)"; - choices[256*4+ 20] = "smc PENTAX-FA 28-80mm F3.5-5.6"; - choices[256*4+ 21] = "Cosina AF 100-300mm F5.6-6.7"; - choices[256*4+ 22] = "TOKINA 28-80mm F3.5-5.6"; - choices[256*4+ 23] = "smc PENTAX-FA 20-35mm F4 AL"; - choices[256*4+ 24] = "smc PENTAX-FA 77mm F1.8 Limited"; - choices[256*4+ 25] = "TAMRON SP AF 14mm F2.8"; - choices[256*4+ 26] = "smc PENTAX-FA MACRO 100mm F3.5"; - choices[256*4+ 27] = "TAMRON AF28-300mm F/3.5-6.3 LD Aspherical[IF] MACRO (285D)"; - choices[256*4+ 28] = "smc PENTAX-FA 35mm F2 AL"; - choices[256*4+ 29] = "TAMRON AF 28-200mm F/3.8-5.6 LD Super II MACRO (371D)"; - choices[256*4+ 34] = "smc PENTAX-FA 24-90mm F3.5-4.5 AL[IF]"; - choices[256*4+ 35] = "smc PENTAX-FA 100-300mm F4.7-5.8"; - choices[256*4+ 36] = "TAMRON AF70-300mm F/4-5.6 LD MACRO"; - choices[256*4+ 37] = "TAMRON SP AF 24-135mm F3.5-5.6 AD AL (190D)"; - choices[256*4+ 38] = "smc PENTAX-FA 28-105mm F3.2-4.5 AL[IF]"; - choices[256*4+ 39] = "smc PENTAX-FA 31mm F1.8AL Limited"; - choices[256*4+ 41] = "TAMRON AF 28-200mm Super Zoom F3.8-5.6 Aspherical XR [IF] MACRO (A03)"; - choices[256*4+ 43] = "smc PENTAX-FA 28-90mm F3.5-5.6"; - choices[256*4+ 44] = "smc PENTAX-FA J 75-300mm F4.5-5.8 AL"; - choices[256*4+ 45] = "TAMRON 28-300mm F3.5-6.3 Ultra zoom XR"; - choices[256*4+ 46] = "smc PENTAX-FA J 28-80mm F3.5-5.6 AL"; - choices[256*4+ 47] = "smc PENTAX-FA J 18-35mm F4-5.6 AL"; - choices[256*4+ 49] = "TAMRON SP AF 28-75mm F2.8 XR Di (A09)"; - choices[256*4+ 51] = "smc PENTAX-D FA 50mm F2.8 MACRO"; - choices[256*4+ 52] = "smc PENTAX-D FA 100mm F2.8 MACRO"; - choices[256*4+ 75] = "TAMRON SP AF 70-200 F2.8 Di LD [IF] Macro (A001)"; - choices[256*4+ 229] = "smc PENTAX-DA 18-55mm F3.5-5.6 AL II"; - choices[256*4+ 230] = "TAMRON SP AF 17-50mm F2.8 XR Di II"; - choices[256*4+ 231] = "smc PENTAX-DA 18-250mm F3.5-6.3 ED AL [IF]"; - choices[256*4+ 237] = "Samsung/Schneider D-XENOGON 10-17mm F3.5-4.5"; - choices[256*4+ 239] = "Samsung D-XENON 12-24mm F4 ED AL [IF]"; - choices[256*4+ 243] = "smc PENTAX-DA 70mm F2.4 Limited"; - choices[256*4+ 244] = "smc PENTAX-DA 21mm F3.2 AL Limited"; - choices[256*4+ 245] = "Schneider D-XENON 50-200mm"; - choices[256*4+ 246] = "Schneider D-XENON 18-55mm"; - choices[256*4+ 247] = "smc PENTAX-DA 10-17mm F3.5-4.5 ED [IF] Fisheye zoom"; - choices[256*4+ 248] = "smc PENTAX-DA 12-24mm F4 ED AL [IF]"; - choices[256*4+ 249] = "TAMRON XR DiII 18-200mm F3.5-6.3 (A14)"; - choices[256*4+ 250] = "smc PENTAX-DA 50-200mm F4-5.6 ED"; - choices[256*4+ 251] = "smc PENTAX-DA 40mm F2.8 Limited"; - choices[256*4+ 252] = "smc PENTAX-DA 18-55mm F3.5-5.6 AL"; - choices[256*4+ 253] = "smc PENTAX-DA 14mm F2.8 ED[IF]"; - choices[256*4+ 254] = "smc PENTAX-DA 16-45mm F4 ED AL"; - choices[256*5+ 1] = "smc PENTAX-FA* 24mm F2 AL[IF]"; - choices[256*5+ 2] = "smc PENTAX-FA 28mm F2.8 AL"; - choices[256*5+ 3] = "smc PENTAX-FA 50mm F1.7"; - choices[256*5+ 4] = "smc PENTAX-FA 50mm F1.4"; - choices[256*5+ 5] = "smc PENTAX-FA* 600mm F4 ED[IF]"; - choices[256*5+ 6] = "smc PENTAX-FA* 300mm F4.5 ED[IF]"; - choices[256*5+ 7] = "smc PENTAX-FA 135mm F2.8 [IF]"; - choices[256*5+ 8] = "smc PENTAX-FA MACRO 50mm F2.8"; - choices[256*5+ 9] = "smc PENTAX-FA MACRO 100mm F2.8"; - choices[256*5+ 10] = "smc PENTAX-FA* 85mm F1.4 [IF]"; - choices[256*5+ 11] = "smc PENTAX-FA* 200mm F2.8 ED[IF]"; - choices[256*5+ 12] = "smc PENTAX-FA 28-80mm F3.5-4.7"; - choices[256*5+ 13] = "smc PENTAX-FA 70-200mm F4-5.6"; - choices[256*5+ 14] = "smc PENTAX-FA* 250-600mm F5.6 ED[IF]"; - choices[256*5+ 15] = "smc PENTAX-FA 28-105mm F4-5.6"; - choices[256*5+ 16] = "smc PENTAX-FA 100-300mm F4.5-5.6"; - choices[256*5+ 98] = "smc PENTAX-FA 100-300mm F4.5-5.6"; - choices[256*6+ 1] = "smc PENTAX-FA* 85mm F1.4 [IF]"; - choices[256*6+ 2] = "smc PENTAX-FA* 200mm F2.8 ED[IF]"; - choices[256*6+ 3] = "smc PENTAX-FA* 300mm F2.8 ED[IF]"; - choices[256*6+ 4] = "smc PENTAX-FA* 28-70mm F2.8 AL"; - choices[256*6+ 5] = "smc PENTAX-FA* 80-200mm F2.8 ED[IF]"; - choices[256*6+ 6] = "smc PENTAX-FA* 28-70mm F2.8 AL"; - choices[256*6+ 7] = "smc PENTAX-FA* 80-200mm F2.8 ED[IF]"; - choices[256*6+ 8] = "smc PENTAX-FA 28-70mm F4AL"; - choices[256*6+ 9] = "smc PENTAX-FA 20mm F2.8"; - choices[256*6+ 10] = "smc PENTAX-FA* 400mm F5.6 ED[IF]"; - choices[256*6+ 13] = "smc PENTAX-FA* 400mm F5.6 ED[IF]"; - choices[256*6+ 14] = "smc PENTAX-FA* MACRO 200mm F4 ED[IF]"; - choices[256*7+ 0] = "smc PENTAX-DA 21mm F3.2 AL Limited"; - choices[256*7+ 75] = "TAMRON SP AF 70-200mm F2.8 Di LD [IF] Macro (A001)"; - choices[256*7+ 217] = "smc PENTAX-DA 50-200mm F4-5.6 ED WR"; - choices[256*7+ 218] = "smc PENTAX-DA 18-55mm F3.5-5.6 AL WR"; - choices[256*7+ 220] = "TAMRON SP AF 10-24mm F3.5-4.5 Di II LD Aspherical [IF]"; - choices[256*7+ 222] = "smc PENTAX-DA 18-55mm F3.5-5.6 AL II"; - choices[256*7+ 223] = "Samsung D-XENON 18-55mm F3.5-5.6 II"; - choices[256*7+ 224] = "smc PENTAX-DA 15mm F4 ED AL Limited"; - choices[256*7+ 225] = "Samsung D-XENON 18-250mm F3.5-6.3"; - choices[256*7+ 229] = "smc PENTAX-DA 18-55mm F3.5-5.6 AL II"; - choices[256*7+ 230] = "TAMRON AF 17-50mm F2.8 XR Di-II LD (Model A16)"; - choices[256*7+ 231] = "smc PENTAX-DA 18-250mm F3.5-6.3 ED AL [IF]"; - choices[256*7+ 233] = "smc PENTAX-DA 35mm F2.8 Macro Limited"; - choices[256*7+ 234] = "smc PENTAX-DA* 300mm F4 ED [IF] SDM (SDM unused)"; - choices[256*7+ 235] = "smc PENTAX-DA* 200mm F2.8 ED [IF] SDM (SDM unused)"; - choices[256*7+ 236] = "smc PENTAX-DA 55-300mm F4-5.8 ED"; - choices[256*7+ 238] = "TAMRON AF 18-250mm F3.5-6.3 Di II LD Aspherical [IF] MACRO"; - choices[256*7+ 241] = "smc PENTAX-DA* 50-135mm F2.8 ED [IF] SDM (SDM unused)"; - choices[256*7+ 242] = "smc PENTAX-DA* 16-50mm F2.8 ED AL [IF] SDM (SDM unused)"; - choices[256*7+ 243] = "smc PENTAX-DA 70mm F2.4 Limited"; - choices[256*7+ 244] = "smc PENTAX-DA 21mm F3.2 AL Limited"; - choices[256*8+ 226] = "smc PENTAX-DA* 55mm F1.4 SDM"; + +namespace rtexif { + + +class PAQualityInterpreter : public ChoiceInterpreter { + public: + PAQualityInterpreter () { + choices[0] = "Good"; + choices[1] = "Better"; + choices[2] = "Best"; + choices[3] = "TIFF"; + choices[4] = "RAW"; + choices[5] = "Premium"; + } +}; +PAQualityInterpreter paQualityInterpreter; + +class PAOnOffInterpreter : public ChoiceInterpreter { + public: + PAOnOffInterpreter () { + choices[0] = "Off"; + choices[1] = "On"; + } +}; +PAOnOffInterpreter paOnOffInterpreter; + +class PAPictureModeInterpreter : public ChoiceInterpreter { + public: + PAPictureModeInterpreter () { + choices[0] = "Program"; + choices[1] = "Shutter Speed Priority"; + choices[2] = "Program AE"; + choices[3] = "Manual"; + choices[5] = "Portrait"; + choices[6] = "Landscape"; + choices[8] = "Sport"; + choices[9] = "Night Scene"; + choices[11] = "Soft"; + choices[12] = "Surf & Snow"; + choices[13] = "Candlelight"; + choices[14] = "Autumn"; + choices[15] = "Macro"; + choices[17] = "Fireworks"; + choices[18] = "Text"; + choices[19] = "Panorama"; + choices[30] = "Self Portrait"; + choices[31] = "Illustrations"; + choices[33] = "Digital Filter"; + choices[35] = "Night Scene Portrait"; + choices[37] = "Museum"; + choices[38] = "Food"; + choices[39] = "Underwater"; + choices[40] = "Green Mode"; + choices[49] = "Light Pet"; + choices[50] = "Dark Pet"; + choices[51] = "Medium Pet"; + choices[53] = "Underwater"; + choices[54] = "Candlelight"; + choices[55] = "Natural Skin Tone"; + choices[56] = "Synchro Sound Record"; + choices[58] = "Frame Composite"; + choices[59] = "Report"; + choices[60] = "Kids"; + choices[61] = "Blur Reduction"; + choices[65] = "Half-length Portrait"; + } +}; +PAPictureModeInterpreter paPictureModeInterpreter; + +class PAFlashModeInterpreter : public ChoiceInterpreter { + public: + PAFlashModeInterpreter () { + choices[0x0] = "Auto, Did not fire"; + choices[0x1] = "Off"; + choices[0x2] = "On, Did not fire"; + choices[0x3] = "Auto, Did not fire, Red-eye reduction"; + choices[0x100] = "Auto, Fired"; + choices[0x102] = "On"; + choices[0x103] = "Auto, Fired, Red-eye reduction"; + choices[0x104] = "On, Red-eye reduction"; + choices[0x105] = "On, Wireless (Master)"; + choices[0x106] = "On, Wireless (Control)"; + choices[0x108] = "On, Soft"; + choices[0x109] = "On, Slow-sync"; + choices[0x10a] = "On, Slow-sync, Red-eye reduction"; + choices[0x10b] = "On, Trailing-curtain Sync"; + } +}; +PAFlashModeInterpreter paFlashModeInterpreter; + +class PAFocusModeInterpreter : public ChoiceInterpreter { + public: + PAFocusModeInterpreter () { + choices[0] = "Normal"; + choices[1] = "Macro"; + choices[2] = "Infinity"; + choices[3] = "Manual"; + choices[4] = "Super Macro"; + choices[5] = "Pan Focus"; + choices[16] = "AF-S"; + choices[17] = "AF-C"; + choices[18] = "AF-A"; + } +}; +PAFocusModeInterpreter paFocusModeInterpreter; + +class PAAFPointInterpreter : public ChoiceInterpreter { + public: + PAAFPointInterpreter () { + choices[1] = "Upper-left"; + choices[2] = "Top"; + choices[3] = "Upper-right"; + choices[4] = "Left"; + choices[5] = "Mid-left"; + choices[6] = "Center"; + choices[7] = "Mid-right"; + choices[8] = "Right"; + choices[9] = "Lower-left"; + choices[10] = "Bottom"; + choices[11] = "Lower-right"; + choices[65532] = "Face Recognition AF"; + choices[65533] = "Automatic Tracking AF"; + choices[65534] = "Fixed Center"; + choices[65535] = "Auto"; + } +}; +PAAFPointInterpreter paAFPointInterpreter; + +class PAAFFocusInterpreter : public ChoiceInterpreter { + public: + PAAFFocusInterpreter () { + choices[0x0] = "Fixed Center or Multiple"; + choices[0x1] = "Top-left"; + choices[0x2] = "Top-center"; + choices[0x3] = "Top-right"; + choices[0x4] = "Left"; + choices[0x5] = "Center"; + choices[0x6] = "Right"; + choices[0x7] = "Bottom-left"; + choices[0x8] = "Bottom-center"; + choices[0x9] = "Bottom-right"; + choices[0xffff] = "None"; + } +}; +PAAFFocusInterpreter paAFFocusInterpreter; + +class PAISOInterpreter : public ChoiceInterpreter { + public: + PAISOInterpreter () { + choices[3] = "50"; + choices[4] = "64"; + choices[5] = "80"; + choices[6] = "100"; + choices[7] = "125"; + choices[8] = "160"; + choices[9] = "200"; + choices[10] = "250"; + choices[11] = "320"; + choices[12] = "400"; + choices[13] = "500"; + choices[14] = "640"; + choices[15] = "800"; + choices[16] = "1000"; + choices[17] = "1250"; + choices[18] = "1600"; + choices[19] = "2000"; + choices[20] = "2500"; + choices[21] = "3200"; + choices[50] = "50"; + choices[100] = "100"; + choices[200] = "200"; + choices[258] = "50"; + choices[259] = "70"; + choices[260] = "100"; + choices[261] = "140"; + choices[262] = "200"; + choices[263] = "280"; + choices[264] = "400"; + choices[265] = "560"; + choices[266] = "800"; + choices[267] = "1100"; + choices[268] = "1600"; + choices[269] = "2200"; + choices[270] = "3200"; + choices[400] = "400"; + choices[800] = "800"; + choices[1600] = "1600"; + choices[3200] = "320"; + } +}; +PAISOInterpreter paISOInterpreter; + +class PAMeteringModeInterpreter : public ChoiceInterpreter { + public: + PAMeteringModeInterpreter () { + choices[0] = "Multi-segment"; + choices[1] = "Center-weighted average"; + choices[2] = "Spot"; + } +}; +PAMeteringModeInterpreter paMeteringModeInterpreter; + +class PAWhiteBalanceInterpreter : public ChoiceInterpreter { + public: + PAWhiteBalanceInterpreter () { + choices[0] = "Auto"; + choices[1] = "Daylight"; + choices[2] = "Shade"; + choices[3] = "Fluorescent"; + choices[4] = "Tungsten"; + choices[5] = "Manual"; + choices[6] = "DaylightFluorescent"; + choices[7] = "DaywhiteFluorescent"; + choices[8] = "WhiteFluorescent"; + choices[9] = "Flash"; + choices[10] = "Cloudy"; + choices[17] = "Kelvin"; + choices[65534] = "Unknown"; + choices[65535] = "User Selected"; + } +}; +PAWhiteBalanceInterpreter paWhiteBalanceInterpreter; + +class PAWhiteBalanceModeInterpreter : public ChoiceInterpreter { + public: + PAWhiteBalanceModeInterpreter () { + choices[1] = "Auto (Daylight)"; + choices[2] = "Auto (Shade)"; + choices[3] = "Auto (Flash)"; + choices[4] = "Auto (Tungsten)"; + choices[6] = "Auto (DaylightFluorescent)"; + choices[7] = "Auto (DaywhiteFluorescent)"; + choices[8] = "Auto (WhiteFluorescent)"; + choices[10] = "Auto (Cloudy)"; + choices[65534] = "Preset (Fireworks?)"; + choices[65535] = "User-Selected"; + } +}; +PAWhiteBalanceModeInterpreter paWhiteBalanceModeInterpreter; + +class PASaturationInterpreter : public ChoiceInterpreter { + public: + PASaturationInterpreter () { + choices[0] = "Low"; + choices[1] = "Normal"; + choices[2] = "High"; + choices[3] = "Med Low"; + choices[4] = "Med High"; + choices[5] = "Very Low"; + choices[6] = "Very High"; + } +}; +PASaturationInterpreter paSaturationInterpreter; + +class PAContrastInterpreter : public ChoiceInterpreter { + public: + PAContrastInterpreter () { + choices[0] = "Low"; + choices[1] = "Normal"; + choices[2] = "High"; + choices[3] = "Med Low"; + choices[4] = "Med High"; + choices[5] = "Very Low"; + choices[6] = "Very High"; + } +}; +PAContrastInterpreter paContrastInterpreter; + +class PASharpnessInterpreter : public ChoiceInterpreter { + public: + PASharpnessInterpreter () { + choices[0] = "Soft"; + choices[1] = "Normal"; + choices[2] = "Hard"; + choices[3] = "Med Soft"; + choices[4] = "Med Hard"; + choices[5] = "Very Soft"; + choices[6] = "Very Hard"; + } +}; +PASharpnessInterpreter paSharpnessInterpreter; + +class PALensTypeInterpreter : public ChoiceInterpreter { + public: + PALensTypeInterpreter () { + choices[256*0+ 0] = "M-42 or No Lens"; + choices[256*1+ 0] = "K,M Lens"; + choices[256*2+ 0] = "A Series Lens"; + choices[256*3+ 0] = "SIGMA"; + choices[256*3+ 17] = "smc PENTAX-FA SOFT 85mm F2.8"; + choices[256*3+ 18] = "smc PENTAX-F 1.7X AF ADAPTER"; + choices[256*3+ 19] = "smc PENTAX-F 24-50mm F4"; + choices[256*3+ 20] = "smc PENTAX-F 35-80mm F4-5.6"; + choices[256*3+ 21] = "smc PENTAX-F 80-200mm F4.7-5.6"; + choices[256*3+ 22] = "smc PENTAX-F FISH-EYE 17-28mm F3.5-4.5"; + choices[256*3+ 23] = "smc PENTAX-F 100-300mm F4.5-5.6"; + choices[256*3+ 24] = "smc PENTAX-F 35-135mm F3.5-4.5"; + choices[256*3+ 25] = "smc PENTAX-F 35-105mm F4-5.6 or SIGMA or Tokina"; + choices[256*3+ 26] = "smc PENTAX-F* 250-600mm F5.6 ED[IF]"; + choices[256*3+ 27] = "smc PENTAX-F 28-80mm F3.5-4.5"; + choices[256*3+ 28] = "smc PENTAX-F 35-70mm F3.5-4.5"; + choices[256*3+ 29] = "PENTAX-F 28-80mm F3.5-4.5 or SIGMA AF 18-125mm F3.5-5.6 DC"; + choices[256*3+ 30] = "PENTAX-F 70-200mm F4-5.6"; + choices[256*3+ 31] = "smc PENTAX-F 70-210mm F4-5.6"; + choices[256*3+ 32] = "smc PENTAX-F 50mm F1.4"; + choices[256*3+ 33] = "smc PENTAX-F 50mm F1.7"; + choices[256*3+ 34] = "smc PENTAX-F 135mm F2.8 [IF]"; + choices[256*3+ 35] = "smc PENTAX-F 28mm F2.8"; + choices[256*3+ 36] = "SIGMA 20mm F1.8 EX DG ASPHERICAL RF"; + choices[256*3+ 38] = "smc PENTAX-F* 300mm F4.5 ED[IF]"; + choices[256*3+ 39] = "smc PENTAX-F* 600mm F4 ED[IF]"; + choices[256*3+ 40] = "smc PENTAX-F MACRO 100mm F2.8"; + choices[256*3+ 41] = "smc PENTAX-F MACRO 50mm F2.8 or Sigma 50mm F2,8 MACRO"; + choices[256*3+ 44] = "Tamron 35-90mm F4 AF or various SIGMA models"; + choices[256*3+ 46] = "SIGMA APO 70-200mm F2.8 EX"; + choices[256*3+ 50] = "smc PENTAX-FA 28-70 F4 AL"; + choices[256*3+ 51] = "SIGMA 28mm F1.8 EX DG ASPHERICAL MACRO"; + choices[256*3+ 52] = "smc PENTAX-FA 28-200mm F3.8-5.6 AL[IF]"; + choices[256*3+ 53] = "smc PENTAX-FA 28-80mm F3.5-5.6 AL"; + choices[256*3+ 247] = "smc PENTAX-DA FISH-EYE 10-17mm F3.5-4.5 ED[IF]"; + choices[256*3+ 248] = "smc PENTAX-DA 12-24mm F4 ED AL[IF]"; + choices[256*3+ 250] = "smc PENTAX-DA 50-200mm F4-5.6 ED"; + choices[256*3+ 251] = "smc PENTAX-DA 40mm F2.8 Limited"; + choices[256*3+ 252] = "smc PENTAX-DA 18-55mm F3.5-5.6 AL"; + choices[256*3+ 253] = "smc PENTAX-DA 14mm F2.8 ED[IF]"; + choices[256*3+ 254] = "smc PENTAX-DA 16-45mm F4 ED AL"; + choices[256*3+ 255] = "SIGMA"; + choices[256*4+ 1] = "smc PENTAX-FA SOFT 28mm F2.8"; + choices[256*4+ 2] = "smc PENTAX-FA 80-320mm F4.5-5.6"; + choices[256*4+ 3] = "smc PENTAX-FA 43mm F1.9 Limited"; + choices[256*4+ 6] = "smc PENTAX-FA 35-80mm F4-5.6"; + choices[256*4+ 12] = "smc PENTAX-FA 50mm F1.4"; + choices[256*4+ 15] = "smc PENTAX-FA 28-105mm F4-5.6 [IF]"; + choices[256*4+ 16] = "TAMRON AF 80-210mm F4-5.6 (178D)"; + choices[256*4+ 19] = "TAMRON SP AF 90mm F2.8 (172E)"; + choices[256*4+ 20] = "smc PENTAX-FA 28-80mm F3.5-5.6"; + choices[256*4+ 21] = "Cosina AF 100-300mm F5.6-6.7"; + choices[256*4+ 22] = "TOKINA 28-80mm F3.5-5.6"; + choices[256*4+ 23] = "smc PENTAX-FA 20-35mm F4 AL"; + choices[256*4+ 24] = "smc PENTAX-FA 77mm F1.8 Limited"; + choices[256*4+ 25] = "TAMRON SP AF 14mm F2.8"; + choices[256*4+ 26] = "smc PENTAX-FA MACRO 100mm F3.5"; + choices[256*4+ 27] = "TAMRON AF28-300mm F/3.5-6.3 LD Aspherical[IF] MACRO (285D)"; + choices[256*4+ 28] = "smc PENTAX-FA 35mm F2 AL"; + choices[256*4+ 29] = "TAMRON AF 28-200mm F/3.8-5.6 LD Super II MACRO (371D)"; + choices[256*4+ 34] = "smc PENTAX-FA 24-90mm F3.5-4.5 AL[IF]"; + choices[256*4+ 35] = "smc PENTAX-FA 100-300mm F4.7-5.8"; + choices[256*4+ 36] = "TAMRON AF70-300mm F/4-5.6 LD MACRO"; + choices[256*4+ 37] = "TAMRON SP AF 24-135mm F3.5-5.6 AD AL (190D)"; + choices[256*4+ 38] = "smc PENTAX-FA 28-105mm F3.2-4.5 AL[IF]"; + choices[256*4+ 39] = "smc PENTAX-FA 31mm F1.8AL Limited"; + choices[256*4+ 41] = "TAMRON AF 28-200mm Super Zoom F3.8-5.6 Aspherical XR [IF] MACRO (A03)"; + choices[256*4+ 43] = "smc PENTAX-FA 28-90mm F3.5-5.6"; + choices[256*4+ 44] = "smc PENTAX-FA J 75-300mm F4.5-5.8 AL"; + choices[256*4+ 45] = "TAMRON 28-300mm F3.5-6.3 Ultra zoom XR"; + choices[256*4+ 46] = "smc PENTAX-FA J 28-80mm F3.5-5.6 AL"; + choices[256*4+ 47] = "smc PENTAX-FA J 18-35mm F4-5.6 AL"; + choices[256*4+ 49] = "TAMRON SP AF 28-75mm F2.8 XR Di (A09)"; + choices[256*4+ 51] = "smc PENTAX-D FA 50mm F2.8 MACRO"; + choices[256*4+ 52] = "smc PENTAX-D FA 100mm F2.8 MACRO"; + choices[256*4+ 75] = "TAMRON SP AF 70-200 F2.8 Di LD [IF] Macro (A001)"; + choices[256*4+ 229] = "smc PENTAX-DA 18-55mm F3.5-5.6 AL II"; + choices[256*4+ 230] = "TAMRON SP AF 17-50mm F2.8 XR Di II"; + choices[256*4+ 231] = "smc PENTAX-DA 18-250mm F3.5-6.3 ED AL [IF]"; + choices[256*4+ 237] = "Samsung/Schneider D-XENOGON 10-17mm F3.5-4.5"; + choices[256*4+ 239] = "Samsung D-XENON 12-24mm F4 ED AL [IF]"; + choices[256*4+ 243] = "smc PENTAX-DA 70mm F2.4 Limited"; + choices[256*4+ 244] = "smc PENTAX-DA 21mm F3.2 AL Limited"; + choices[256*4+ 245] = "Schneider D-XENON 50-200mm"; + choices[256*4+ 246] = "Schneider D-XENON 18-55mm"; + choices[256*4+ 247] = "smc PENTAX-DA 10-17mm F3.5-4.5 ED [IF] Fisheye zoom"; + choices[256*4+ 248] = "smc PENTAX-DA 12-24mm F4 ED AL [IF]"; + choices[256*4+ 249] = "TAMRON XR DiII 18-200mm F3.5-6.3 (A14)"; + choices[256*4+ 250] = "smc PENTAX-DA 50-200mm F4-5.6 ED"; + choices[256*4+ 251] = "smc PENTAX-DA 40mm F2.8 Limited"; + choices[256*4+ 252] = "smc PENTAX-DA 18-55mm F3.5-5.6 AL"; + choices[256*4+ 253] = "smc PENTAX-DA 14mm F2.8 ED[IF]"; + choices[256*4+ 254] = "smc PENTAX-DA 16-45mm F4 ED AL"; + choices[256*5+ 1] = "smc PENTAX-FA* 24mm F2 AL[IF]"; + choices[256*5+ 2] = "smc PENTAX-FA 28mm F2.8 AL"; + choices[256*5+ 3] = "smc PENTAX-FA 50mm F1.7"; + choices[256*5+ 4] = "smc PENTAX-FA 50mm F1.4"; + choices[256*5+ 5] = "smc PENTAX-FA* 600mm F4 ED[IF]"; + choices[256*5+ 6] = "smc PENTAX-FA* 300mm F4.5 ED[IF]"; + choices[256*5+ 7] = "smc PENTAX-FA 135mm F2.8 [IF]"; + choices[256*5+ 8] = "smc PENTAX-FA MACRO 50mm F2.8"; + choices[256*5+ 9] = "smc PENTAX-FA MACRO 100mm F2.8"; + choices[256*5+ 10] = "smc PENTAX-FA* 85mm F1.4 [IF]"; + choices[256*5+ 11] = "smc PENTAX-FA* 200mm F2.8 ED[IF]"; + choices[256*5+ 12] = "smc PENTAX-FA 28-80mm F3.5-4.7"; + choices[256*5+ 13] = "smc PENTAX-FA 70-200mm F4-5.6"; + choices[256*5+ 14] = "smc PENTAX-FA* 250-600mm F5.6 ED[IF]"; + choices[256*5+ 15] = "smc PENTAX-FA 28-105mm F4-5.6"; + choices[256*5+ 16] = "smc PENTAX-FA 100-300mm F4.5-5.6"; + choices[256*5+ 98] = "smc PENTAX-FA 100-300mm F4.5-5.6"; + choices[256*6+ 1] = "smc PENTAX-FA* 85mm F1.4 [IF]"; + choices[256*6+ 2] = "smc PENTAX-FA* 200mm F2.8 ED[IF]"; + choices[256*6+ 3] = "smc PENTAX-FA* 300mm F2.8 ED[IF]"; + choices[256*6+ 4] = "smc PENTAX-FA* 28-70mm F2.8 AL"; + choices[256*6+ 5] = "smc PENTAX-FA* 80-200mm F2.8 ED[IF]"; + choices[256*6+ 6] = "smc PENTAX-FA* 28-70mm F2.8 AL"; + choices[256*6+ 7] = "smc PENTAX-FA* 80-200mm F2.8 ED[IF]"; + choices[256*6+ 8] = "smc PENTAX-FA 28-70mm F4AL"; + choices[256*6+ 9] = "smc PENTAX-FA 20mm F2.8"; + choices[256*6+ 10] = "smc PENTAX-FA* 400mm F5.6 ED[IF]"; + choices[256*6+ 13] = "smc PENTAX-FA* 400mm F5.6 ED[IF]"; + choices[256*6+ 14] = "smc PENTAX-FA* MACRO 200mm F4 ED[IF]"; + choices[256*7+ 0] = "smc PENTAX-DA 21mm F3.2 AL Limited"; + choices[256*7+ 75] = "TAMRON SP AF 70-200mm F2.8 Di LD [IF] Macro (A001)"; + choices[256*7+ 217] = "smc PENTAX-DA 50-200mm F4-5.6 ED WR"; + choices[256*7+ 218] = "smc PENTAX-DA 18-55mm F3.5-5.6 AL WR"; + choices[256*7+ 220] = "TAMRON SP AF 10-24mm F3.5-4.5 Di II LD Aspherical [IF]"; + choices[256*7+ 222] = "smc PENTAX-DA 18-55mm F3.5-5.6 AL II"; + choices[256*7+ 223] = "Samsung D-XENON 18-55mm F3.5-5.6 II"; + choices[256*7+ 224] = "smc PENTAX-DA 15mm F4 ED AL Limited"; + choices[256*7+ 225] = "Samsung D-XENON 18-250mm F3.5-6.3"; + choices[256*7+ 229] = "smc PENTAX-DA 18-55mm F3.5-5.6 AL II"; + choices[256*7+ 230] = "TAMRON AF 17-50mm F2.8 XR Di-II LD (Model A16)"; + choices[256*7+ 231] = "smc PENTAX-DA 18-250mm F3.5-6.3 ED AL [IF]"; + choices[256*7+ 233] = "smc PENTAX-DA 35mm F2.8 Macro Limited"; + choices[256*7+ 234] = "smc PENTAX-DA* 300mm F4 ED [IF] SDM (SDM unused)"; + choices[256*7+ 235] = "smc PENTAX-DA* 200mm F2.8 ED [IF] SDM (SDM unused)"; + choices[256*7+ 236] = "smc PENTAX-DA 55-300mm F4-5.8 ED"; + choices[256*7+ 238] = "TAMRON AF 18-250mm F3.5-6.3 Di II LD Aspherical [IF] MACRO"; + choices[256*7+ 241] = "smc PENTAX-DA* 50-135mm F2.8 ED [IF] SDM (SDM unused)"; + choices[256*7+ 242] = "smc PENTAX-DA* 16-50mm F2.8 ED AL [IF] SDM (SDM unused)"; + choices[256*7+ 243] = "smc PENTAX-DA 70mm F2.4 Limited"; + choices[256*7+ 244] = "smc PENTAX-DA 21mm F3.2 AL Limited"; + choices[256*8+ 226] = "smc PENTAX-DA* 55mm F1.4 SDM"; choices[256*8+ 227] = "smc PENTAX DA* 60-250mm F4 [IF] SDM"; choices[256*8+ 232] = "smc PENTAX-DA 17-70mm F4 AL [IF] SDM"; choices[256*8+ 234] = "smc PENTAX-DA* 300mm F4 ED [IF] SDM"; @@ -461,125 +461,125 @@ class PALensTypeInterpreter : public ChoiceInterpreter { choices[256*8+ 241] = "smc PENTAX-DA* 50-135mm F2.8 ED [IF] SDM"; choices[256*8+ 242] = "smc PENTAX-DA* 16-50mm F2.8 ED AL [IF] SDM"; choices[256*8+ 255] = "Sigma 70-200mm F2.8 EX DG Macro HSM II or 150-500mm F5-6.3 DG OS"; - } - virtual std::string toString (Tag* t) { - return choices[256*t->toInt(0,BYTE) + t->toInt(1,BYTE)]; - } -}; -PALensTypeInterpreter paLensTypeInterpreter; - -class PASRInfoInterpreter : public Interpreter { - public: - PASRInfoInterpreter () { } - - virtual std::string toString (Tag* t) { - std::ostringstream str; - int b = t->toInt(0,BYTE); - if (!b) - str << "SRResult = Not stabilized" << std::endl; - else if (b & 1) - str << "SRResult = Stabilized" << std::endl; - b = t->toInt(1,BYTE); - if (!b) - str << "ShakeReduction = Off" << std::endl; - else - str << "ShakeReduction = On" << std::endl; - str << "SRHalfPressTime = " << t->toInt(2,BYTE) << std::endl; - str << "SRFocalLength = " << t->toInt(3,BYTE); - return str.str(); - } -}; -PASRInfoInterpreter paSRInfoInterpreter; - - -const TagAttrib pentaxAttribs[] = { - 0, 1, 0, 0, 0x0001, "PentaxVersion", &stdInterpreter, - 0, 1, 0, 0, 0x0001, "PentaxModelType", &stdInterpreter, - 0, 2, 0, 0, 0x0002, "PreviewImageSize", &stdInterpreter, - 0, 2, 0, 0, 0x0003, "PreviewImageLength", &stdInterpreter, - 0, 2, 0, 0, 0x0004, "PreviewImageStart", &stdInterpreter, - 0, 1, 0, 0, 0x0005, "PentaxModelID", &stdInterpreter, - 0, 1, 0, 0, 0x0006, "Date", &stdInterpreter, - 0, 1, 0, 0, 0x0007, "Time", &stdInterpreter, - 0, 1, 0, 0, 0x0008, "Quality", &paQualityInterpreter, - 0, 1, 0, 0, 0x0009, "PentaxImageSize", &stdInterpreter, - 0, 1, 0, 0, 0x000b, "PictureMode", &paPictureModeInterpreter, - 0, 1, 0, 0, 0x000c, "FlashMode", &paFlashModeInterpreter, - 0, 1, 0, 0, 0x000d, "FocusMode", &paFocusModeInterpreter, - 0, 1, 0, 0, 0x000e, "AFPointSelected", &paAFPointInterpreter, - 0, 1, 0, 0, 0x000f, "AFPointsInFocus", &paAFFocusInterpreter, - 0, 1, 0, 0, 0x0010, "FocusPosition", &stdInterpreter, - 0, 1, 0, 0, 0x0012, "ExposureTime", &stdInterpreter, - 0, 1, 0, 0, 0x0013, "FNumber", &stdInterpreter, - 0, 1, 0, 0, 0x0014, "ISO", &paISOInterpreter, - 0, 1, 0, 0, 0x0015, "LightReading", &stdInterpreter, - 0, 1, 0, 0, 0x0016, "ExposureCompensation", &stdInterpreter, - 0, 1, 0, 0, 0x0017, "MeteringMode", &paMeteringModeInterpreter, - 0, 1, 0, 0, 0x0018, "AutoBracketing", &stdInterpreter, - 0, 1, 0, 0, 0x0019, "WhiteBalance", &paWhiteBalanceInterpreter, - 0, 1, 0, 0, 0x001a, "WhiteBalanceMode", &paWhiteBalanceModeInterpreter, - 0, 1, 0, 0, 0x001b, "BlueBalance", &stdInterpreter, - 0, 1, 0, 0, 0x001c, "RedBalance", &stdInterpreter, - 0, 1, 0, 0, 0x001d, "FocalLength", &stdInterpreter, - 0, 1, 0, 0, 0x001e, "DigitalZoom", &stdInterpreter, - 0, 1, 0, 0, 0x001f, "Saturation", &paSaturationInterpreter, - 0, 1, 0, 0, 0x0020, "Contrast", &paContrastInterpreter, - 0, 1, 0, 0, 0x0021, "Sharpness", &paSharpnessInterpreter, - 0, 1, 0, 0, 0x0022, "WorldTimeLocation", &stdInterpreter, - 0, 1, 0, 0, 0x0023, "HometownCity", &stdInterpreter, - 0, 3, 0, 0, 0x0024, "DestinationCity", &stdInterpreter, - 0, 3, 0, 0, 0x0025, "HometownDST", &stdInterpreter, - 0, 1, 0, 0, 0x0026, "DestinationDST", &stdInterpreter, - 0, 1, 0, 0, 0x0027, "DSPFirmwareVersion", &stdInterpreter, - 0, 1, 0, 0, 0x0028, "CPUFirmwareVersion", &stdInterpreter, - 0, 1, 0, 0, 0x0029, "FrameNumber", &stdInterpreter, - 0, 1, 0, 0, 0x002d, "EffectiveLV", &stdInterpreter, - 0, 1, 0, 0, 0x0032, "ImageProcessing", &stdInterpreter, - 0, 1, 0, 0, 0x0033, "PictureMode", &stdInterpreter, - 0, 1, 0, 0, 0x0034, "DriveMode", &stdInterpreter, - 0, 1, 0, 0, 0x0037, "ColorSpace", &stdInterpreter, - 0, 1, 0, 0, 0x0038, "ImageAreaOffset", &stdInterpreter, - 0, 1, 0, 0, 0x0039, "RawImageSize", &stdInterpreter, - 0, 1, 0, 0, 0x003c, "AFPointsInFocus", &stdInterpreter, - 0, 1, 0, 0, 0x003e, "PreviewImageBorders", &stdInterpreter, - 0, 1, 0, 0, 0x003f, "LensType", &paLensTypeInterpreter, - 0, 1, 0, 0, 0x0040, "SensitivityAdjust", &stdInterpreter, - 0, 1, 0, 0, 0x0041, "ImageProcessingCount", &stdInterpreter, - 0, 1, 0, 0, 0x0047, "CameraTemperature", &stdInterpreter, - 0, 1, 0, 0, 0x0048, "AELock", &paOnOffInterpreter, - 0, 1, 0, 0, 0x0049, "NoiseReduction", &paOnOffInterpreter, - 0, 1, 0, 0, 0x004d, "FlashExposureComp", &stdInterpreter, - 0, 1, 0, 0, 0x004f, "ImageTone", &stdInterpreter, - 0, 1, 0, 0, 0x0050, "ColorTemperature", &stdInterpreter, - 0, 1, 0, 0, 0x005c, "ShakeReductionInfo", &paSRInfoInterpreter, - 0, 1, 0, 0, 0x005d, "ShutterCount", &stdInterpreter, - 0, 1, 0, 0, 0x0200, "BlackPoint", &stdInterpreter, - 0, 1, 0, 0, 0x0201, "WhitePoint", &stdInterpreter, - 0, 1, 0, 0, 0x0205, "ShotInfo", &stdInterpreter, - 0, 1, 0, 0, 0x0206, "AEInfo", &stdInterpreter, - 0, 1, 0, 0, 0x0207, "LensInfo", &stdInterpreter, - 0, 1, 0, 0, 0x0208, "FlashInfo", &stdInterpreter, - 0, 1, 0, 0, 0x0209, "AEMeteringSegments", &stdInterpreter, - 0, 1, 0, 0, 0x020a, "FlashADump", &stdInterpreter, - 0, 1, 0, 0, 0x020b, "FlashBDump", &stdInterpreter, - 0, 1, 0, 0, 0x020d, "WB_RGGBLevelsDaylight", &stdInterpreter, - 0, 1, 0, 0, 0x020e, "WB_RGGBLevelsShade", &stdInterpreter, - 0, 1, 0, 0, 0x020f, "WB_RGGBLevelsCloudy", &stdInterpreter, - 0, 1, 0, 0, 0x0210, "WB_RGGBLevelsTungsten", &stdInterpreter, - 0, 1, 0, 0, 0x0211, "WB_RGGBLevelsFluorescentD", &stdInterpreter, - 0, 1, 0, 0, 0x0212, "WB_RGGBLevelsFluorescentN", &stdInterpreter, - 0, 1, 0, 0, 0x0213, "WB_RGGBLevelsFluorescentW", &stdInterpreter, - 0, 1, 0, 0, 0x0214, "WB_RGGBLevelsFlash", &stdInterpreter, - 0, 1, 0, 0, 0x0215, "CameraInfo", &stdInterpreter, - 0, 1, 0, 0, 0x0216, "BatteryInfo", &stdInterpreter, - 0, 1, 0, 0, 0x021f, "AFInfo", &stdInterpreter, - 0, 1, 0, 0, 0x0222, "ColorInfo", &stdInterpreter, - 0, 1, 0, 0, 0x03fe, "DataDump", &stdInterpreter, - 0, 1, 0, 0, 0x03ff, "UnknownInfo", &stdInterpreter, - 0, 1, 0, 0, 0x0402, "ToneCurve", &stdInterpreter, - 0, 1, 0, 0, 0x0403, "ToneCurves", &stdInterpreter, - 0, 1, 0, 0, 0x0e00, "PrintIM", &stdInterpreter, - -1, 0, 0, 0, 0, "", NULL}; -}; - #endif + } + virtual std::string toString (Tag* t) { + return choices[256*t->toInt(0,BYTE) + t->toInt(1,BYTE)]; + } +}; +PALensTypeInterpreter paLensTypeInterpreter; + +class PASRInfoInterpreter : public Interpreter { + public: + PASRInfoInterpreter () { } + + virtual std::string toString (Tag* t) { + std::ostringstream str; + int b = t->toInt(0,BYTE); + if (!b) + str << "SRResult = Not stabilized" << std::endl; + else if (b & 1) + str << "SRResult = Stabilized" << std::endl; + b = t->toInt(1,BYTE); + if (!b) + str << "ShakeReduction = Off" << std::endl; + else + str << "ShakeReduction = On" << std::endl; + str << "SRHalfPressTime = " << t->toInt(2,BYTE) << std::endl; + str << "SRFocalLength = " << t->toInt(3,BYTE); + return str.str(); + } +}; +PASRInfoInterpreter paSRInfoInterpreter; + + +const TagAttrib pentaxAttribs[] = { + 0, 1, 0, 0, 0x0001, "PentaxVersion", &stdInterpreter, + 0, 1, 0, 0, 0x0001, "PentaxModelType", &stdInterpreter, + 0, 2, 0, 0, 0x0002, "PreviewImageSize", &stdInterpreter, + 0, 2, 0, 0, 0x0003, "PreviewImageLength", &stdInterpreter, + 0, 2, 0, 0, 0x0004, "PreviewImageStart", &stdInterpreter, + 0, 1, 0, 0, 0x0005, "PentaxModelID", &stdInterpreter, + 0, 1, 0, 0, 0x0006, "Date", &stdInterpreter, + 0, 1, 0, 0, 0x0007, "Time", &stdInterpreter, + 0, 1, 0, 0, 0x0008, "Quality", &paQualityInterpreter, + 0, 1, 0, 0, 0x0009, "PentaxImageSize", &stdInterpreter, + 0, 1, 0, 0, 0x000b, "PictureMode", &paPictureModeInterpreter, + 0, 1, 0, 0, 0x000c, "FlashMode", &paFlashModeInterpreter, + 0, 1, 0, 0, 0x000d, "FocusMode", &paFocusModeInterpreter, + 0, 1, 0, 0, 0x000e, "AFPointSelected", &paAFPointInterpreter, + 0, 1, 0, 0, 0x000f, "AFPointsInFocus", &paAFFocusInterpreter, + 0, 1, 0, 0, 0x0010, "FocusPosition", &stdInterpreter, + 0, 1, 0, 0, 0x0012, "ExposureTime", &stdInterpreter, + 0, 1, 0, 0, 0x0013, "FNumber", &stdInterpreter, + 0, 1, 0, 0, 0x0014, "ISO", &paISOInterpreter, + 0, 1, 0, 0, 0x0015, "LightReading", &stdInterpreter, + 0, 1, 0, 0, 0x0016, "ExposureCompensation", &stdInterpreter, + 0, 1, 0, 0, 0x0017, "MeteringMode", &paMeteringModeInterpreter, + 0, 1, 0, 0, 0x0018, "AutoBracketing", &stdInterpreter, + 0, 1, 0, 0, 0x0019, "WhiteBalance", &paWhiteBalanceInterpreter, + 0, 1, 0, 0, 0x001a, "WhiteBalanceMode", &paWhiteBalanceModeInterpreter, + 0, 1, 0, 0, 0x001b, "BlueBalance", &stdInterpreter, + 0, 1, 0, 0, 0x001c, "RedBalance", &stdInterpreter, + 0, 1, 0, 0, 0x001d, "FocalLength", &stdInterpreter, + 0, 1, 0, 0, 0x001e, "DigitalZoom", &stdInterpreter, + 0, 1, 0, 0, 0x001f, "Saturation", &paSaturationInterpreter, + 0, 1, 0, 0, 0x0020, "Contrast", &paContrastInterpreter, + 0, 1, 0, 0, 0x0021, "Sharpness", &paSharpnessInterpreter, + 0, 1, 0, 0, 0x0022, "WorldTimeLocation", &stdInterpreter, + 0, 1, 0, 0, 0x0023, "HometownCity", &stdInterpreter, + 0, 3, 0, 0, 0x0024, "DestinationCity", &stdInterpreter, + 0, 3, 0, 0, 0x0025, "HometownDST", &stdInterpreter, + 0, 1, 0, 0, 0x0026, "DestinationDST", &stdInterpreter, + 0, 1, 0, 0, 0x0027, "DSPFirmwareVersion", &stdInterpreter, + 0, 1, 0, 0, 0x0028, "CPUFirmwareVersion", &stdInterpreter, + 0, 1, 0, 0, 0x0029, "FrameNumber", &stdInterpreter, + 0, 1, 0, 0, 0x002d, "EffectiveLV", &stdInterpreter, + 0, 1, 0, 0, 0x0032, "ImageProcessing", &stdInterpreter, + 0, 1, 0, 0, 0x0033, "PictureMode", &stdInterpreter, + 0, 1, 0, 0, 0x0034, "DriveMode", &stdInterpreter, + 0, 1, 0, 0, 0x0037, "ColorSpace", &stdInterpreter, + 0, 1, 0, 0, 0x0038, "ImageAreaOffset", &stdInterpreter, + 0, 1, 0, 0, 0x0039, "RawImageSize", &stdInterpreter, + 0, 1, 0, 0, 0x003c, "AFPointsInFocus", &stdInterpreter, + 0, 1, 0, 0, 0x003e, "PreviewImageBorders", &stdInterpreter, + 0, 1, 0, 0, 0x003f, "LensType", &paLensTypeInterpreter, + 0, 1, 0, 0, 0x0040, "SensitivityAdjust", &stdInterpreter, + 0, 1, 0, 0, 0x0041, "ImageProcessingCount", &stdInterpreter, + 0, 1, 0, 0, 0x0047, "CameraTemperature", &stdInterpreter, + 0, 1, 0, 0, 0x0048, "AELock", &paOnOffInterpreter, + 0, 1, 0, 0, 0x0049, "NoiseReduction", &paOnOffInterpreter, + 0, 1, 0, 0, 0x004d, "FlashExposureComp", &stdInterpreter, + 0, 1, 0, 0, 0x004f, "ImageTone", &stdInterpreter, + 0, 1, 0, 0, 0x0050, "ColorTemperature", &stdInterpreter, + 0, 1, 0, 0, 0x005c, "ShakeReductionInfo", &paSRInfoInterpreter, + 0, 1, 0, 0, 0x005d, "ShutterCount", &stdInterpreter, + 0, 1, 0, 0, 0x0200, "BlackPoint", &stdInterpreter, + 0, 1, 0, 0, 0x0201, "WhitePoint", &stdInterpreter, + 0, 1, 0, 0, 0x0205, "ShotInfo", &stdInterpreter, + 0, 1, 0, 0, 0x0206, "AEInfo", &stdInterpreter, + 0, 1, 0, 0, 0x0207, "LensInfo", &stdInterpreter, + 0, 1, 0, 0, 0x0208, "FlashInfo", &stdInterpreter, + 0, 1, 0, 0, 0x0209, "AEMeteringSegments", &stdInterpreter, + 0, 1, 0, 0, 0x020a, "FlashADump", &stdInterpreter, + 0, 1, 0, 0, 0x020b, "FlashBDump", &stdInterpreter, + 0, 1, 0, 0, 0x020d, "WB_RGGBLevelsDaylight", &stdInterpreter, + 0, 1, 0, 0, 0x020e, "WB_RGGBLevelsShade", &stdInterpreter, + 0, 1, 0, 0, 0x020f, "WB_RGGBLevelsCloudy", &stdInterpreter, + 0, 1, 0, 0, 0x0210, "WB_RGGBLevelsTungsten", &stdInterpreter, + 0, 1, 0, 0, 0x0211, "WB_RGGBLevelsFluorescentD", &stdInterpreter, + 0, 1, 0, 0, 0x0212, "WB_RGGBLevelsFluorescentN", &stdInterpreter, + 0, 1, 0, 0, 0x0213, "WB_RGGBLevelsFluorescentW", &stdInterpreter, + 0, 1, 0, 0, 0x0214, "WB_RGGBLevelsFlash", &stdInterpreter, + 0, 1, 0, 0, 0x0215, "CameraInfo", &stdInterpreter, + 0, 1, 0, 0, 0x0216, "BatteryInfo", &stdInterpreter, + 0, 1, 0, 0, 0x021f, "AFInfo", &stdInterpreter, + 0, 1, 0, 0, 0x0222, "ColorInfo", &stdInterpreter, + 0, 1, 0, 0, 0x03fe, "DataDump", &stdInterpreter, + 0, 1, 0, 0, 0x03ff, "UnknownInfo", &stdInterpreter, + 0, 1, 0, 0, 0x0402, "ToneCurve", &stdInterpreter, + 0, 1, 0, 0, 0x0403, "ToneCurves", &stdInterpreter, + 0, 1, 0, 0, 0x0e00, "PrintIM", &stdInterpreter, + -1, 0, 0, 0, 0, "", NULL}; +}; +#endif diff --git a/rtexif/rtexif.cc b/rtexif/rtexif.cc index a61f3050d..dbb716342 100644 --- a/rtexif/rtexif.cc +++ b/rtexif/rtexif.cc @@ -1,1434 +1,1434 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath * Some parts of the source code (e.g. ciff support) are taken from dcraw * that is copyrighted by Dave Coffin - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include -#include -#include + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include +#include +#include #include -#include - -namespace rtexif { - -StdInterpreter stdInterpreter; +#include -//--------------- class TagDirectory ------------------------------------------ -// this class is a collection (an array) of tags -//----------------------------------------------------------------------------- - -#define TAG_SUBFILETYPE 0x00fe - -TagDirectory::TagDirectory () - : attribs(ifdAttribs), parent(NULL), order(INTEL) {} - -TagDirectory::TagDirectory (TagDirectory* p, const TagAttrib* ta, ByteOrder border) - : attribs(ta), order(border), parent(p) {} - -TagDirectory::TagDirectory (TagDirectory* p, FILE* f, int base, const TagAttrib* ta, ByteOrder border) { - - attribs = ta; - order = border; - parent = p; - - int numOfTags = get2 (f, order); - if (numOfTags<=0 || numOfTags>200) - return; - - bool thumbdescr = false; - for (int i=0; igetType()==0) { - delete newTag; - continue; - } - - int id = newTag->getID(); - - // detect and possibly ignore tags of directories belonging to the embedded thumbnail image - if (attribs==ifdAttribs && id==TAG_SUBFILETYPE && newTag->toInt()!=0) - thumbdescr = true; - - const TagAttrib* attrib = getAttrib (id); - - if (!attrib || attrib->ignore==1 || (thumbdescr && attrib->ignore==2)) - delete newTag; - else - addTag (newTag); - } -} - -TagDirectory::~TagDirectory () { - - for (int i=0; igetID() < b->getID(); - } -}; - -void TagDirectory::sort () { - - std::sort (tags.begin(), tags.end(), CompareTags()); - for (int i=0; iisDirectory()) - for (int j=0; tags[i]->getDirectory(j); j++) - tags[i]->getDirectory(j)->sort (); -} - -const TagAttrib* TagDirectory::getAttrib (int id) { - - if (attribs) - for (int i=0; attribs[i].ignore!=-1; i++) - if (attribs[i].ID==id) - return &attribs[i]; - - return NULL; -} - -const TagAttrib* TagDirectory::getAttrib (const char* name) { - - if (attribs) - for (int i=0; attribs[i].ignore!=-1; i++) - if (!strcmp (attribs[i].name, name)) - return &attribs[i]; - - return NULL; -} - -void TagDirectory::printAll () const { - - for (int i=0; inameToString (); - if (tags[i]->isDirectory()) - for (int j=0; tags[i]->getDirectory(j); j++) { - printf ("==== DIRECTORY %s[%d]: ====\n", name.c_str(), j); - tags[i]->getDirectory(j)->printAll (); - printf ("==== END OF DIRECTORY %s[%d] ====\n", name.c_str(), j); - } - else { - std::string value = tags[i]->valueToString (); - printf ("%s: %s\n", name.c_str(), value.c_str()); - } - } -} - -void TagDirectory::addTag (Tag* tag) { - - // look up if it already exists: - if (getTag (tag->getID())) - delete tag; - else - tags.push_back (tag); -} - -void TagDirectory::addTagFront (Tag* tag) { - - // look up if it already exists: - if (getTag (tag->getID())) - delete tag; - else - tags.insert (tags.begin(), tag); -} - -void TagDirectory::replaceTag (Tag* tag) { - - // look up if it already exists: - for (int i=0; igetID()==tag->getID()) { - delete tags[i]; - tags[i] = tag; - return; - } - tags.push_back (tag); -} - -Tag* TagDirectory::getTag (int ID) { - - for (int i=0; igetID()==ID) - return tags[i]; - return NULL; -} - -Tag* TagDirectory::getTag (const char* name) { +namespace rtexif { - if (attribs) { - for (int i=0; attribs[i].ignore!=-1; i++) - if (!strcmp (attribs[i].name, name)) - return getTag (attribs[i].ID); - } - return NULL; -} - -int TagDirectory::calculateSize () { - - int size = 2; // space to store the number of tags - for (int i=0; igetKeep()) - size += 12 + tags[i]->calculateSize (); - - size += 4; // next ifd pointer - return size; -} - -TagDirectory* TagDirectory::clone (TagDirectory* parent) { - - TagDirectory* td = new TagDirectory (parent, attribs, order); - for (int i=0; itags.push_back (tags[i]->clone (td)); - return td; -} - -int TagDirectory::write (int start, unsigned char* buffer) { - - int size = calculateSize (); - int tagnum = 0; - int nondirspace = 0; - for (int i=0; igetKeep()) { - tagnum++; - if (!tags[i]->isDirectory()) - nondirspace += tags[i]->calculateSize(); - } - int nextValOffs = start + 2 + tagnum * 12 + 4; - int nextDirOffs = nextValOffs + nondirspace; - int pos = start; - sset2 (tagnum, buffer+start, order); - pos += 2; - int maxPos = start + size; - for (int i=0; igetKeep()) { - if (!tags[i]->isDirectory()) - nextValOffs = tags[i]->write (pos, nextValOffs, buffer); // pos: where to put the tag, dataoffset: the place where the value can be put. return: next data offset - else - nextDirOffs = tags[i]->write (pos, nextDirOffs, buffer); // pos: where to put the tag, dataoffset: the place where the value can be put. return: next data offset - - pos += 12; - } - } - sset4 (0, buffer+pos, order); - return maxPos; -} - -void TagDirectory::applyChange (std::string name, std::string value) { - - std::string::size_type dp = name.find_first_of ('.'); - std::string fseg = name.substr (0,dp); - // this is a final segment: apply change - if (dp==std::string::npos) { - - Tag* t = NULL; - for (int i=0; inameToString()==fseg) { - t = tags[i]; - break; - } - - if (value=="#keep" && t) - t->setKeep (true); - else if (value=="#delete" && t) - t->setKeep (false); - else if (t && !t->isDirectory()) - t->valueFromString (value); - else { - const TagAttrib* attrib = NULL; - for (int i=0; attribs[i].ignore!=-1; i++) - if (!strcmp (attribs[i].name, fseg.c_str())) { - attrib = &attribs[i]; - break; - } - if (attrib) { - Tag* nt = new Tag (this, attrib); - nt->initString (value.c_str()); - addTag (nt); - } - } - } - // this is a subdirectory - else { - // try to find it - std::string::size_type dp1 = fseg.find_first_of ('['); - std::string::size_type dp2 = fseg.find_first_of (']'); - std::string basename = fseg.substr (0,dp1); - Tag* t = NULL; - int dirnum = -1; - for (int i=0; iisDirectory()) { - for (int j=0; tags[i]->getDirectory(j); j++) { - if (tags[i]->nameToString(j) == fseg) { - t = tags[i]; - dirnum = j; - break; - } - } - if (!t && tags[i]->nameToString() == basename) { // found it, but that directory index does not exist - t = tags[i]; - dirnum = -1; - } - } - if (!t && value!="#keep" && value!="#delete") { - const TagAttrib* attrib = NULL; - for (int i=0; attribs[i].ignore!=-1; i++) - if (!strcmp (attribs[i].name, fseg.c_str())) { - attrib = &attribs[i]; - break; - } - if (attrib && attrib->subdirAttribs) { - t = new Tag (this, attrib); - t->initSubDir (); - addTag (t); - } - dirnum = 0; - } - if (t && dirnum>=0) - t->getDirectory(dirnum)->applyChange (name.substr (dp+1, std::string::npos), value); - } -} - -//--------------- class Tag --------------------------------------------------- -// this class represents a tag stored in the directory -//----------------------------------------------------------------------------- - -Tag::Tag (TagDirectory* p, FILE* f, int base) - : parent(p), value(NULL), directory(NULL), count(0), attrib(NULL), type(INVALID) { - - tag = get2 (f, getOrder()); - type = (TagType)get2 (f, getOrder()); - count = get4 (f, getOrder()); - - makerNoteKind = NOMK; - keep = false; - - // filter out invalid tags - if ((int)type<1 || (int)type>14 || count>900000 || count<0) { - type = INVALID; +StdInterpreter stdInterpreter; + +//--------------- class TagDirectory ------------------------------------------ +// this class is a collection (an array) of tags +//----------------------------------------------------------------------------- + +#define TAG_SUBFILETYPE 0x00fe + +TagDirectory::TagDirectory () + : attribs(ifdAttribs), parent(NULL), order(INTEL) {} + +TagDirectory::TagDirectory (TagDirectory* p, const TagAttrib* ta, ByteOrder border) + : attribs(ta), order(border), parent(p) {} + +TagDirectory::TagDirectory (TagDirectory* p, FILE* f, int base, const TagAttrib* ta, ByteOrder border) { + + attribs = ta; + order = border; + parent = p; + + int numOfTags = get2 (f, order); + if (numOfTags<=0 || numOfTags>200) return; - } - - // save file position - int save = ftell(f) + 4; - - // load value field (possibly seek before) - valuesize = count * ("11124811248484"[type<14?type:0]-'0'); - - if (valuesize > 4) - fseek (f, get4(f, getOrder()) + base, SEEK_SET); - - attrib = parent->getAttrib (tag); - - if (attrib && (attrib->action==1 || attrib->action==3)) - keep = true; - - // if this tag is the makernote, it needs special treatment (brand specific parsing) - if (tag==0x927C && attrib && !strcmp (attrib->name, "MakerNote")) { - value = NULL; - // select format of makernote - char make[128], model[128]; - Tag* tmake = parent->getParent()->getTag ("Make"); - if (tmake) - tmake->toString (make); - else - make[0] = 0; - Tag* tmodel = parent->getParent()->getTag ("Model"); - if (tmodel) - tmodel->toString (model); - else - model[0] = 0; - if (!strncmp(make, "NIKON", 5)) { - if (!strncmp(model, "NIKON E700",10)||!strncmp(model, "NIKON E800",10)||!strncmp(model, "NIKON E900",10)||!strncmp(model, "NIKON E900S",11)||!strncmp(model, "NIKON E910", 10)||!strncmp(model, "NIKON E950", 10)) { - makerNoteKind = HEADERIFD; - valuesize = 8; - value = new unsigned char[8]; - fread (value, 1, 8, f); - directory = new TagDirectory*[2]; - directory[0] = new TagDirectory (parent, f, base, nikon2Attribs, getOrder()); - directory[1] = NULL; - } - else if (!strncmp(model, "NIKON E990",10)||(!strncmp(model, "NIKON D1",8) && model[8]!='0')) { - makerNoteKind = IFD; - directory = new TagDirectory*[2]; - directory[0] = new TagDirectory (parent, f, base, nikon3Attribs, getOrder()); - directory[1] = NULL; - } - else { - // needs refinement! (embedded tiff header parsing) - makerNoteKind = NIKON3; - valuesize = 18; - value = new unsigned char[18]; - int basepos = ftell (f); - fread (value, 1, 18, f); - directory = new TagDirectory*[2]; - directory[0] = new TagDirectory (parent, f, basepos+10, nikon3Attribs, getOrder()); - directory[1] = NULL; - } - } - else if (!strncmp(make, "Canon", 5)) { - makerNoteKind = IFD; - directory = new TagDirectory*[2]; - directory[0] = new TagDirectory (parent, f, base, canonAttribs, getOrder()); - directory[1] = NULL; - } - else if (!strncmp(make, "PENTAX", 6)) { - makerNoteKind = HEADERIFD; - valuesize = 6; - value = new unsigned char[6]; - fread (value, 1, 6, f); - directory = new TagDirectory*[2]; - directory[0] = new TagDirectory (parent, f, base, pentaxAttribs, getOrder()); - directory[1] = NULL; - } - else if (!strncmp(make, "FUJIFILM", 8)) { - makerNoteKind = FUJI; - valuesize = 12; - value = new unsigned char[12]; - fread (value, 1, 12, f); - directory = new TagDirectory*[2]; - directory[0] = new TagDirectory (parent, f, ftell(f)-12, fujiAttribs, INTEL); - directory[1] = NULL; - } - else if (!strncmp(make, "KONICA MINOLTA", 14) || !strncmp(make, "Minolta", 7)) { - makerNoteKind = IFD; - directory = new TagDirectory*[2]; - directory[0] = new TagDirectory (parent, f, base, minoltaAttribs, getOrder()); - directory[1] = NULL; - } - else if (!strncmp(make, "SONY", 4)) { - valuesize = 12; - value = new unsigned char[12]; - fread (value, 1, 12, f); - if (!strncmp((char*)value, "SONY DSC", 8)) - makerNoteKind = HEADERIFD; - else { - makerNoteKind = IFD; - fseek (f, -12, SEEK_CUR); - } - directory = new TagDirectory*[2]; - directory[0] = new TagDirectory (parent, f, base, sonyAttribs, getOrder()); - directory[1] = NULL; - } - else if (!strncmp(make, "OLYMPUS", 7)) { - makerNoteKind = HEADERIFD; - valuesize = 8; - value = new unsigned char[12]; - fread (value, 1, 8, f); - directory = new TagDirectory*[2]; - directory[1] = NULL; - if (!strncmp((char*)value, "OLYMPUS", 7)) { - makerNoteKind = OLYMPUS2; - fread (value+8, 1, 4, f); - valuesize = 12; - directory[0] = new TagDirectory (parent, f, ftell(f)-12, olympusAttribs, value[8]=='I' ? INTEL : MOTOROLA); - } - else - directory[0] = new TagDirectory (parent, f, base, olympusAttribs, getOrder()); - } - else { - type = INVALID; - fseek (f, save, SEEK_SET); - return; - } - } - else if (type==UNDEFINED && attrib && attrib->subdirAttribs) { - count = 1; - type = LONG; - directory = new TagDirectory*[2]; - directory[0] = new TagDirectory (parent, f, base, attrib->subdirAttribs, getOrder()); - directory[1] = NULL; - } - else { - // read value - value = new unsigned char [valuesize]; - fread (value, 1, valuesize, f); - - // if it is a subdirectory, load it (there may be several directories if count>1) - if (attrib && attrib->subdirAttribs) { - int pos = ftell (f); - // count the number of valid subdirs - int sdcount = count; - if (sdcount>0) { - if (parent->getAttribTable()==olympusAttribs) - sdcount = 1; - // allocate space - directory = new TagDirectory*[sdcount+1]; - // load directories - for (int j=0,i=0; jsubdirAttribs, getOrder()); - fseek (f, pos, SEEK_SET); - } - // set the terminating NULL - directory[sdcount] = NULL; - } - else - type = INVALID; - } - } - // seek back to the saved position - fseek (f, save, SEEK_SET); -} - -Tag* Tag::clone (TagDirectory* parent) { - - Tag* t = new Tag (parent, attrib); - - t->tag = tag; - t->type = type; - t->count = count; - t->keep = keep; - t->valuesize = valuesize; - if (value) { - t->value = new unsigned char [valuesize]; - memcpy (t->value, value, valuesize); - } - else - value = NULL; - t->makerNoteKind = makerNoteKind; - if (directory) { - int ds = 0; - for (; directory[ds]; ds++); - t->directory = new TagDirectory*[ds+1]; - for (int i=0; idirectory[i] = directory[i]->clone (parent); - t->directory[ds] = NULL; - } - else - t->directory = NULL; - return t; -} - -Tag::~Tag () { - - // delete value - if (value) - delete [] value; - - // if there are directories behind the tag, delete them - int i = 0; - if (directory) { - while (directory[i]) - delete directory[i++]; - delete [] directory; - } -} - -void Tag::setInt (int v, int ofs, TagType astype) { - - if (astype==SHORT) - sset2 (v, value+ofs, getOrder()); - else if (astype==RATIONAL) { - sset4 (v, value+ofs, getOrder()); - sset4 (1, value+ofs+4, getOrder()); - } - else - sset4 (v, value+ofs, getOrder()); -} - -void Tag::fromInt (int v) { - - if (type==SHORT) - sset2 (v, value, getOrder()); - else - sset4 (v, value, getOrder()); -} - -void Tag::fromString (const char* v, int size) { - - delete value; - if (size<0) - valuesize = strlen (v) + 1; - else - valuesize = size; - count = valuesize; - value = new unsigned char [valuesize]; - memcpy ((char*)value, v, valuesize); -} - -int Tag::toInt (int ofs, TagType astype) { - - int a; - if (astype == INVALID) - astype = type; - switch (astype) { - case BYTE: return value[ofs]; - case ASCII: return 0; - case SSHORT:return (int)int2_to_signed(sget2 (value+ofs, getOrder())); - case SHORT: return (int)sget2 (value+ofs, getOrder()); - case SLONG: - case LONG: return (int)sget4 (value+ofs, getOrder()); - case SRATIONAL: - case RATIONAL: a = (int)sget4 (value+ofs+4, getOrder()); return a==0 ? 0 : (int)sget4 (value+ofs, getOrder()) / a; - case FLOAT: return (int)((float) sget4 (value+ofs, getOrder())); - case UNDEFINED: return 0; - } -} - -double Tag::toDouble (int ofs) { - - double ud, dd; - switch (type) { - case BYTE: return (double)((int)value[ofs]); - case ASCII: return 0.0; - case SSHORT:return (double)int2_to_signed(sget2 (value+ofs, getOrder())); - case SHORT: return (double)((int)sget2 (value+ofs, getOrder())); - case SLONG: - case LONG: return (double)((int)sget4 (value+ofs, getOrder())); - case SRATIONAL: - case RATIONAL: ud = (int)sget4 (value+ofs, getOrder()); dd = (int)sget4 (value+ofs+4, getOrder()); return dd==0 ? 0 : (double)ud / (double)dd; - case FLOAT: return (float) sget4 (value+ofs, getOrder()); - case UNDEFINED: return 0; - } -} - -void Tag::toRational (int& num, int& denom, int ofs) { - - switch (type) { - case BYTE: num = (int)value[ofs]; denom = 1; break; - case ASCII: num = 0; denom = 0; break; - case SSHORT: - case SHORT: num = (int)sget2 (value+ofs, getOrder()); denom = 1; break; - case SLONG: - case LONG: num = (int)sget4 (value+ofs, getOrder()); denom = 1; break; - case SRATIONAL: - case RATIONAL: num = (int)sget4 (value+ofs, getOrder()); denom = (int)sget4 (value+ofs+4, getOrder()); break; - case FLOAT: num = 0; denom = 0; break; - case UNDEFINED: num = 0; denom = 0; break; - } -} - -void Tag::toString (char* buffer, int ofs) { - - if (type==UNDEFINED && !directory) { - bool isstring = true; - int i=0; - for (i=0; i+ofs126) - isstring = false; - if (isstring) { - int j = 0; - for (i=0; i+ofs') - buffer[j++] = '\\'; - buffer[j++] = value[i+ofs]; - } - buffer[j++] = 0; - return; - } - } - else if (type==ASCII) { - sprintf (buffer, "%s", value+ofs); - return; - } - - int maxcount = 4; - if (count<4) - maxcount = count; - - strcpy (buffer, ""); - for (int i=0; i0) - strcat (buffer, ", "); - char* b = buffer + strlen(buffer); - - switch (type) { - case UNDEFINED: - case BYTE: sprintf (b, "%d", value[i+ofs]); break; - case SSHORT: - case SHORT: sprintf (b, "%d", toInt(2*i+ofs)); break; - case SLONG: - case LONG: sprintf (b, "%d", toInt(4*i+ofs)); break; - case SRATIONAL: - case RATIONAL: sprintf (b, "%d/%d", (int)sget4 (value+8*i+ofs, getOrder()), (int)sget4 (value+8*i+ofs+4, getOrder())); break; - case FLOAT: sprintf (b, "%g", toDouble(8*i+ofs)); break; - } - } - if (count > maxcount) - strcat (buffer, "..."); -} - -std::string Tag::nameToString (int i) { - + + bool thumbdescr = false; + for (int i=0; igetType()==0) { + delete newTag; + continue; + } + + int id = newTag->getID(); + + // detect and possibly ignore tags of directories belonging to the embedded thumbnail image + if (attribs==ifdAttribs && id==TAG_SUBFILETYPE && newTag->toInt()!=0) + thumbdescr = true; + + const TagAttrib* attrib = getAttrib (id); + + if (!attrib || attrib->ignore==1 || (thumbdescr && attrib->ignore==2)) + delete newTag; + else + addTag (newTag); + } +} + +TagDirectory::~TagDirectory () { + + for (int i=0; igetID() < b->getID(); + } +}; + +void TagDirectory::sort () { + + std::sort (tags.begin(), tags.end(), CompareTags()); + for (int i=0; iisDirectory()) + for (int j=0; tags[i]->getDirectory(j); j++) + tags[i]->getDirectory(j)->sort (); +} + +const TagAttrib* TagDirectory::getAttrib (int id) { + + if (attribs) + for (int i=0; attribs[i].ignore!=-1; i++) + if (attribs[i].ID==id) + return &attribs[i]; + + return NULL; +} + +const TagAttrib* TagDirectory::getAttrib (const char* name) { + + if (attribs) + for (int i=0; attribs[i].ignore!=-1; i++) + if (!strcmp (attribs[i].name, name)) + return &attribs[i]; + + return NULL; +} + +void TagDirectory::printAll () const { + + for (int i=0; inameToString (); + if (tags[i]->isDirectory()) + for (int j=0; tags[i]->getDirectory(j); j++) { + printf ("==== DIRECTORY %s[%d]: ====\n", name.c_str(), j); + tags[i]->getDirectory(j)->printAll (); + printf ("==== END OF DIRECTORY %s[%d] ====\n", name.c_str(), j); + } + else { + std::string value = tags[i]->valueToString (); + printf ("%s: %s\n", name.c_str(), value.c_str()); + } + } +} + +void TagDirectory::addTag (Tag* tag) { + + // look up if it already exists: + if (getTag (tag->getID())) + delete tag; + else + tags.push_back (tag); +} + +void TagDirectory::addTagFront (Tag* tag) { + + // look up if it already exists: + if (getTag (tag->getID())) + delete tag; + else + tags.insert (tags.begin(), tag); +} + +void TagDirectory::replaceTag (Tag* tag) { + + // look up if it already exists: + for (int i=0; igetID()==tag->getID()) { + delete tags[i]; + tags[i] = tag; + return; + } + tags.push_back (tag); +} + +Tag* TagDirectory::getTag (int ID) { + + for (int i=0; igetID()==ID) + return tags[i]; + return NULL; +} + +Tag* TagDirectory::getTag (const char* name) { + + if (attribs) { + for (int i=0; attribs[i].ignore!=-1; i++) + if (!strcmp (attribs[i].name, name)) + return getTag (attribs[i].ID); + } + return NULL; +} + +int TagDirectory::calculateSize () { + + int size = 2; // space to store the number of tags + for (int i=0; igetKeep()) + size += 12 + tags[i]->calculateSize (); + + size += 4; // next ifd pointer + return size; +} + +TagDirectory* TagDirectory::clone (TagDirectory* parent) { + + TagDirectory* td = new TagDirectory (parent, attribs, order); + for (int i=0; itags.push_back (tags[i]->clone (td)); + return td; +} + +int TagDirectory::write (int start, unsigned char* buffer) { + + int size = calculateSize (); + int tagnum = 0; + int nondirspace = 0; + for (int i=0; igetKeep()) { + tagnum++; + if (!tags[i]->isDirectory()) + nondirspace += tags[i]->calculateSize(); + } + int nextValOffs = start + 2 + tagnum * 12 + 4; + int nextDirOffs = nextValOffs + nondirspace; + int pos = start; + sset2 (tagnum, buffer+start, order); + pos += 2; + int maxPos = start + size; + for (int i=0; igetKeep()) { + if (!tags[i]->isDirectory()) + nextValOffs = tags[i]->write (pos, nextValOffs, buffer); // pos: where to put the tag, dataoffset: the place where the value can be put. return: next data offset + else + nextDirOffs = tags[i]->write (pos, nextDirOffs, buffer); // pos: where to put the tag, dataoffset: the place where the value can be put. return: next data offset + + pos += 12; + } + } + sset4 (0, buffer+pos, order); + return maxPos; +} + +void TagDirectory::applyChange (std::string name, std::string value) { + + std::string::size_type dp = name.find_first_of ('.'); + std::string fseg = name.substr (0,dp); + // this is a final segment: apply change + if (dp==std::string::npos) { + + Tag* t = NULL; + for (int i=0; inameToString()==fseg) { + t = tags[i]; + break; + } + + if (value=="#keep" && t) + t->setKeep (true); + else if (value=="#delete" && t) + t->setKeep (false); + else if (t && !t->isDirectory()) + t->valueFromString (value); + else { + const TagAttrib* attrib = NULL; + for (int i=0; attribs[i].ignore!=-1; i++) + if (!strcmp (attribs[i].name, fseg.c_str())) { + attrib = &attribs[i]; + break; + } + if (attrib) { + Tag* nt = new Tag (this, attrib); + nt->initString (value.c_str()); + addTag (nt); + } + } + } + // this is a subdirectory + else { + // try to find it + std::string::size_type dp1 = fseg.find_first_of ('['); + std::string::size_type dp2 = fseg.find_first_of (']'); + std::string basename = fseg.substr (0,dp1); + Tag* t = NULL; + int dirnum = -1; + for (int i=0; iisDirectory()) { + for (int j=0; tags[i]->getDirectory(j); j++) { + if (tags[i]->nameToString(j) == fseg) { + t = tags[i]; + dirnum = j; + break; + } + } + if (!t && tags[i]->nameToString() == basename) { // found it, but that directory index does not exist + t = tags[i]; + dirnum = -1; + } + } + if (!t && value!="#keep" && value!="#delete") { + const TagAttrib* attrib = NULL; + for (int i=0; attribs[i].ignore!=-1; i++) + if (!strcmp (attribs[i].name, fseg.c_str())) { + attrib = &attribs[i]; + break; + } + if (attrib && attrib->subdirAttribs) { + t = new Tag (this, attrib); + t->initSubDir (); + addTag (t); + } + dirnum = 0; + } + if (t && dirnum>=0) + t->getDirectory(dirnum)->applyChange (name.substr (dp+1, std::string::npos), value); + } +} + +//--------------- class Tag --------------------------------------------------- +// this class represents a tag stored in the directory +//----------------------------------------------------------------------------- + +Tag::Tag (TagDirectory* p, FILE* f, int base) + : parent(p), value(NULL), directory(NULL), count(0), attrib(NULL), type(INVALID) { + + tag = get2 (f, getOrder()); + type = (TagType)get2 (f, getOrder()); + count = get4 (f, getOrder()); + + makerNoteKind = NOMK; + keep = false; + + // filter out invalid tags + if ((int)type<1 || (int)type>14 || count>900000 || count<0) { + type = INVALID; + return; + } + + // save file position + int save = ftell(f) + 4; + + // load value field (possibly seek before) + valuesize = count * ("11124811248484"[type<14?type:0]-'0'); + + if (valuesize > 4) + fseek (f, get4(f, getOrder()) + base, SEEK_SET); + + attrib = parent->getAttrib (tag); + + if (attrib && (attrib->action==1 || attrib->action==3)) + keep = true; + + // if this tag is the makernote, it needs special treatment (brand specific parsing) + if (tag==0x927C && attrib && !strcmp (attrib->name, "MakerNote")) { + value = NULL; + // select format of makernote + char make[128], model[128]; + Tag* tmake = parent->getParent()->getTag ("Make"); + if (tmake) + tmake->toString (make); + else + make[0] = 0; + Tag* tmodel = parent->getParent()->getTag ("Model"); + if (tmodel) + tmodel->toString (model); + else + model[0] = 0; + if (!strncmp(make, "NIKON", 5)) { + if (!strncmp(model, "NIKON E700",10)||!strncmp(model, "NIKON E800",10)||!strncmp(model, "NIKON E900",10)||!strncmp(model, "NIKON E900S",11)||!strncmp(model, "NIKON E910", 10)||!strncmp(model, "NIKON E950", 10)) { + makerNoteKind = HEADERIFD; + valuesize = 8; + value = new unsigned char[8]; + fread (value, 1, 8, f); + directory = new TagDirectory*[2]; + directory[0] = new TagDirectory (parent, f, base, nikon2Attribs, getOrder()); + directory[1] = NULL; + } + else if (!strncmp(model, "NIKON E990",10)||(!strncmp(model, "NIKON D1",8) && model[8]!='0')) { + makerNoteKind = IFD; + directory = new TagDirectory*[2]; + directory[0] = new TagDirectory (parent, f, base, nikon3Attribs, getOrder()); + directory[1] = NULL; + } + else { + // needs refinement! (embedded tiff header parsing) + makerNoteKind = NIKON3; + valuesize = 18; + value = new unsigned char[18]; + int basepos = ftell (f); + fread (value, 1, 18, f); + directory = new TagDirectory*[2]; + directory[0] = new TagDirectory (parent, f, basepos+10, nikon3Attribs, getOrder()); + directory[1] = NULL; + } + } + else if (!strncmp(make, "Canon", 5)) { + makerNoteKind = IFD; + directory = new TagDirectory*[2]; + directory[0] = new TagDirectory (parent, f, base, canonAttribs, getOrder()); + directory[1] = NULL; + } + else if (!strncmp(make, "PENTAX", 6)) { + makerNoteKind = HEADERIFD; + valuesize = 6; + value = new unsigned char[6]; + fread (value, 1, 6, f); + directory = new TagDirectory*[2]; + directory[0] = new TagDirectory (parent, f, base, pentaxAttribs, getOrder()); + directory[1] = NULL; + } + else if (!strncmp(make, "FUJIFILM", 8)) { + makerNoteKind = FUJI; + valuesize = 12; + value = new unsigned char[12]; + fread (value, 1, 12, f); + directory = new TagDirectory*[2]; + directory[0] = new TagDirectory (parent, f, ftell(f)-12, fujiAttribs, INTEL); + directory[1] = NULL; + } + else if (!strncmp(make, "KONICA MINOLTA", 14) || !strncmp(make, "Minolta", 7)) { + makerNoteKind = IFD; + directory = new TagDirectory*[2]; + directory[0] = new TagDirectory (parent, f, base, minoltaAttribs, getOrder()); + directory[1] = NULL; + } + else if (!strncmp(make, "SONY", 4)) { + valuesize = 12; + value = new unsigned char[12]; + fread (value, 1, 12, f); + if (!strncmp((char*)value, "SONY DSC", 8)) + makerNoteKind = HEADERIFD; + else { + makerNoteKind = IFD; + fseek (f, -12, SEEK_CUR); + } + directory = new TagDirectory*[2]; + directory[0] = new TagDirectory (parent, f, base, sonyAttribs, getOrder()); + directory[1] = NULL; + } + else if (!strncmp(make, "OLYMPUS", 7)) { + makerNoteKind = HEADERIFD; + valuesize = 8; + value = new unsigned char[12]; + fread (value, 1, 8, f); + directory = new TagDirectory*[2]; + directory[1] = NULL; + if (!strncmp((char*)value, "OLYMPUS", 7)) { + makerNoteKind = OLYMPUS2; + fread (value+8, 1, 4, f); + valuesize = 12; + directory[0] = new TagDirectory (parent, f, ftell(f)-12, olympusAttribs, value[8]=='I' ? INTEL : MOTOROLA); + } + else + directory[0] = new TagDirectory (parent, f, base, olympusAttribs, getOrder()); + } + else { + type = INVALID; + fseek (f, save, SEEK_SET); + return; + } + } + else if (type==UNDEFINED && attrib && attrib->subdirAttribs) { + count = 1; + type = LONG; + directory = new TagDirectory*[2]; + directory[0] = new TagDirectory (parent, f, base, attrib->subdirAttribs, getOrder()); + directory[1] = NULL; + } + else { + // read value + value = new unsigned char [valuesize]; + fread (value, 1, valuesize, f); + + // if it is a subdirectory, load it (there may be several directories if count>1) + if (attrib && attrib->subdirAttribs) { + int pos = ftell (f); + // count the number of valid subdirs + int sdcount = count; + if (sdcount>0) { + if (parent->getAttribTable()==olympusAttribs) + sdcount = 1; + // allocate space + directory = new TagDirectory*[sdcount+1]; + // load directories + for (int j=0,i=0; jsubdirAttribs, getOrder()); + fseek (f, pos, SEEK_SET); + } + // set the terminating NULL + directory[sdcount] = NULL; + } + else + type = INVALID; + } + } + // seek back to the saved position + fseek (f, save, SEEK_SET); +} + +Tag* Tag::clone (TagDirectory* parent) { + + Tag* t = new Tag (parent, attrib); + + t->tag = tag; + t->type = type; + t->count = count; + t->keep = keep; + t->valuesize = valuesize; + if (value) { + t->value = new unsigned char [valuesize]; + memcpy (t->value, value, valuesize); + } + else + value = NULL; + t->makerNoteKind = makerNoteKind; + if (directory) { + int ds = 0; + for (; directory[ds]; ds++); + t->directory = new TagDirectory*[ds+1]; + for (int i=0; idirectory[i] = directory[i]->clone (parent); + t->directory[ds] = NULL; + } + else + t->directory = NULL; + return t; +} + +Tag::~Tag () { + + // delete value + if (value) + delete [] value; + + // if there are directories behind the tag, delete them + int i = 0; + if (directory) { + while (directory[i]) + delete directory[i++]; + delete [] directory; + } +} + +void Tag::setInt (int v, int ofs, TagType astype) { + + if (astype==SHORT) + sset2 (v, value+ofs, getOrder()); + else if (astype==RATIONAL) { + sset4 (v, value+ofs, getOrder()); + sset4 (1, value+ofs+4, getOrder()); + } + else + sset4 (v, value+ofs, getOrder()); +} + +void Tag::fromInt (int v) { + + if (type==SHORT) + sset2 (v, value, getOrder()); + else + sset4 (v, value, getOrder()); +} + +void Tag::fromString (const char* v, int size) { + + delete value; + if (size<0) + valuesize = strlen (v) + 1; + else + valuesize = size; + count = valuesize; + value = new unsigned char [valuesize]; + memcpy ((char*)value, v, valuesize); +} + +int Tag::toInt (int ofs, TagType astype) { + + int a; + if (astype == INVALID) + astype = type; + switch (astype) { + case BYTE: return value[ofs]; + case ASCII: return 0; + case SSHORT:return (int)int2_to_signed(sget2 (value+ofs, getOrder())); + case SHORT: return (int)sget2 (value+ofs, getOrder()); + case SLONG: + case LONG: return (int)sget4 (value+ofs, getOrder()); + case SRATIONAL: + case RATIONAL: a = (int)sget4 (value+ofs+4, getOrder()); return a==0 ? 0 : (int)sget4 (value+ofs, getOrder()) / a; + case FLOAT: return (int)((float) sget4 (value+ofs, getOrder())); + case UNDEFINED: return 0; + } +} + +double Tag::toDouble (int ofs) { + + double ud, dd; + switch (type) { + case BYTE: return (double)((int)value[ofs]); + case ASCII: return 0.0; + case SSHORT:return (double)int2_to_signed(sget2 (value+ofs, getOrder())); + case SHORT: return (double)((int)sget2 (value+ofs, getOrder())); + case SLONG: + case LONG: return (double)((int)sget4 (value+ofs, getOrder())); + case SRATIONAL: + case RATIONAL: ud = (int)sget4 (value+ofs, getOrder()); dd = (int)sget4 (value+ofs+4, getOrder()); return dd==0 ? 0 : (double)ud / (double)dd; + case FLOAT: return (float) sget4 (value+ofs, getOrder()); + case UNDEFINED: return 0; + } +} + +void Tag::toRational (int& num, int& denom, int ofs) { + + switch (type) { + case BYTE: num = (int)value[ofs]; denom = 1; break; + case ASCII: num = 0; denom = 0; break; + case SSHORT: + case SHORT: num = (int)sget2 (value+ofs, getOrder()); denom = 1; break; + case SLONG: + case LONG: num = (int)sget4 (value+ofs, getOrder()); denom = 1; break; + case SRATIONAL: + case RATIONAL: num = (int)sget4 (value+ofs, getOrder()); denom = (int)sget4 (value+ofs+4, getOrder()); break; + case FLOAT: num = 0; denom = 0; break; + case UNDEFINED: num = 0; denom = 0; break; + } +} + +void Tag::toString (char* buffer, int ofs) { + + if (type==UNDEFINED && !directory) { + bool isstring = true; + int i=0; + for (i=0; i+ofs126) + isstring = false; + if (isstring) { + int j = 0; + for (i=0; i+ofs') + buffer[j++] = '\\'; + buffer[j++] = value[i+ofs]; + } + buffer[j++] = 0; + return; + } + } + else if (type==ASCII) { + sprintf (buffer, "%s", value+ofs); + return; + } + + int maxcount = 4; + if (count<4) + maxcount = count; + + strcpy (buffer, ""); + for (int i=0; i0) + strcat (buffer, ", "); + char* b = buffer + strlen(buffer); + + switch (type) { + case UNDEFINED: + case BYTE: sprintf (b, "%d", value[i+ofs]); break; + case SSHORT: + case SHORT: sprintf (b, "%d", toInt(2*i+ofs)); break; + case SLONG: + case LONG: sprintf (b, "%d", toInt(4*i+ofs)); break; + case SRATIONAL: + case RATIONAL: sprintf (b, "%d/%d", (int)sget4 (value+8*i+ofs, getOrder()), (int)sget4 (value+8*i+ofs+4, getOrder())); break; + case FLOAT: sprintf (b, "%g", toDouble(8*i+ofs)); break; + } + } + if (count > maxcount) + strcat (buffer, "..."); +} + +std::string Tag::nameToString (int i) { + static char buffer[1024]; - if (attrib) - strcpy (buffer, attrib->name); + if (attrib) + strcpy (buffer, attrib->name); else sprintf (buffer, "0x%x", tag); - if (i>0) - sprintf (buffer+strlen(buffer)-1, "[%d]", i); - return buffer; -} - -std::string Tag::valueToString () { - - static char buffer[1024]; - if (attrib && attrib->interpreter) - return attrib->interpreter->toString (this); - else { - toString (buffer); - return buffer; - } -} - -void Tag::valueFromString (const std::string& value) { - - if (attrib && attrib->interpreter) - attrib->interpreter->fromString (this, value); -} - -int Tag::calculateSize () { - int size = 0; - - if (directory) { - int j; - for (j=0; directory[j]; j++) - size += directory[j]->calculateSize (); - if (j>1) - size += 4*j; - } - else if (valuesize > 4) - size += valuesize + (valuesize%2); // we align tags to even byte positions - - if (makerNoteKind!=NOMK) - count = directory[0]->calculateSize (); - - if (makerNoteKind==NIKON3 || makerNoteKind==OLYMPUS2 || makerNoteKind==FUJI) - size += valuesize; - else if (makerNoteKind==HEADERIFD) - size += valuesize; - - return size; -} - -int Tag::write (int offs, int dataOffs, unsigned char* buffer) { - - if ((int)type==0 || offs>65500) - return dataOffs; - - sset2 (tag, buffer+offs, parent->getOrder()); - offs += 2; - unsigned short typ = type; - sset2 (typ, buffer+offs, parent->getOrder()); - offs += 2; - sset4 (count, buffer+offs, parent->getOrder()); - offs += 4; - if (!directory) { - if (valuesize>4) { - sset4 (dataOffs, buffer+offs, parent->getOrder()); - memcpy (buffer+dataOffs, value, valuesize); - if (valuesize%2) - buffer[dataOffs+valuesize] = 0; // zero padding required by the exif standard - return dataOffs + valuesize + (valuesize%2); - } - else { - memcpy (buffer+offs, value, valuesize); - return dataOffs; - } - } - else { - if (makerNoteKind==NIKON3) { - sset4 (dataOffs, buffer+offs, parent->getOrder()); - memcpy (buffer+dataOffs, value, 18); - dataOffs += 10; - dataOffs += directory[0]->write (8, buffer+dataOffs); - return dataOffs; - } - else if (makerNoteKind==OLYMPUS2 || makerNoteKind==FUJI) { - sset4 (dataOffs, buffer+offs, parent->getOrder()); - memcpy (buffer+dataOffs, value, valuesize); - dataOffs += valuesize + directory[0]->write (valuesize, buffer+dataOffs); - return dataOffs; - } - else if (makerNoteKind==HEADERIFD) { - sset4 (dataOffs, buffer+offs, parent->getOrder()); - memcpy (buffer+dataOffs, value, valuesize); - dataOffs += valuesize; - dataOffs += directory[0]->write (dataOffs, buffer); - return dataOffs; - } - else if (!directory[1]) { - sset4 (dataOffs, buffer+offs, parent->getOrder()); - return directory[0]->write (dataOffs, buffer); - } - else { - sset4 (dataOffs, buffer+offs, parent->getOrder()); - int linkOffs = dataOffs; - for (int i=0; directory[i]; i++) - dataOffs += 4; - for (int i=0; directory[i]; i++) { - sset4 (dataOffs, buffer+linkOffs, parent->getOrder()); - linkOffs += 4; - dataOffs = directory[i]->write (dataOffs, buffer); - } - return dataOffs; - } - } -} - -Tag::Tag (TagDirectory* p, const TagAttrib* attr) - : parent(p), attrib(attr), makerNoteKind (NOMK), directory(NULL), keep(true), tag(attr ? attr->ID : -1), count(0), valuesize(0), value(NULL), type(INVALID) { -} - -Tag::Tag (TagDirectory* p, const TagAttrib* attr, int data, TagType t) - : parent(p), attrib(attr), makerNoteKind (NOMK), directory(NULL), keep(true), tag(attr ? attr->ID : -1), count(1), valuesize(0), value(NULL), type(t) { - - initInt (data, t); -} - -Tag::Tag (TagDirectory* p, const TagAttrib* attr, const char* text) - : parent(p), attrib(attr), makerNoteKind (NOMK), directory(NULL), keep(true), tag(attr ? attr->ID : -1), count(1), valuesize(0), value(NULL), type(ASCII) { - - initString (text); -} - -void Tag::initInt (int data, TagType t, int cnt) { - - type = t; - if (t==LONG) - valuesize = 4; - else if (t==SHORT) - valuesize = 2; - else if (t==RATIONAL) - valuesize = 8; - - count = cnt; - valuesize *= count; - value = new unsigned char[valuesize]; - setInt (data, 0, t); -} - -void Tag::initString (const char* text) { - - type = ASCII; - count = strlen(text)+1; - valuesize = count; - value = new unsigned char[valuesize]; - strcpy ((char*)value, text); -} - -void Tag::initSubDir () { - type = LONG; - valuesize = 4; - count = 1; - value = new unsigned char[4]; - setInt (0); - directory = new TagDirectory*[2]; - directory[0] = new TagDirectory (parent, attrib ? attrib->subdirAttribs : NULL, parent->getOrder()); - directory[1] = NULL; -} - -void Tag::initMakerNote (MNKind mnk, const TagAttrib* ta) { - type = UNDEFINED; - valuesize = 4; - count = 1; - value = new unsigned char[4]; - setInt (0); - directory = new TagDirectory*[2]; - directory[0] = new TagDirectory (parent, ta, parent->getOrder()); - directory[1] = NULL; - makerNoteKind = mnk; -} - -void Tag::initUndefArray (const char* data, int len) { - type = UNDEFINED; - count = valuesize = len; - value = new unsigned char[valuesize]; - memcpy (value, data, len); -} - -void Tag::initLongArray (const char* data, int len) { - type = LONG; - count = (len+3)/4; - valuesize = count * 4; - value = new unsigned char[valuesize]; - memcpy (value, data, len); -} - -void Tag::initRational (int num, int den) { - count = 1; - valuesize = 8; - value = new unsigned char[8]; - type = RATIONAL; - setInt (num, 0); - setInt (den, 4); -} - -//--------------- class IFDParser --------------------------------------------- -// static functions to read tag directoryes from different kinds of files -//----------------------------------------------------------------------------- - - -const TagAttrib* lookupAttrib (const TagAttrib* dir, const char* field) { - - for (int i=0; dir[i].ignore!=-1; i++) - if (!strcmp (dir[i].name, field)) - return &dir[i]; -} - - -TagDirectory* ExifManager::parseCIFF (FILE* f, int base, int length) { - - TagDirectory* root = new TagDirectory (NULL, ifdAttribs, INTEL); - Tag* exif = new Tag (root, lookupAttrib(ifdAttribs,"Exif")); - exif->initSubDir (); - Tag* mn = new Tag (exif->getDirectory(), lookupAttrib(exifAttribs,"MakerNote")); - mn->initMakerNote (IFD, canonAttribs); - root->addTag (exif); - exif->getDirectory()->addTag (mn); - parseCIFF (f, base, length, root); - root->sort (); - return root; -} - -Tag* ExifManager::saveCIFFMNTag (FILE* f, TagDirectory* root, int len, const char* name) { - int s = ftell (f); - char* data = new char [len]; - fread (data, len, 1, f); - TagDirectory* mn = root->getTag ("Exif")->getDirectory()->getTag("MakerNote")->getDirectory(); - Tag* cs = new Tag (mn, lookupAttrib(canonAttribs, name)); - cs->initUndefArray (data, len); - mn->addTag (cs); - fseek (f, s, SEEK_SET); - return cs; -} - -void ExifManager::parseCIFF (FILE* f, int base, int length, TagDirectory* root) { - - static char buffer[1024]; - Tag* t; - - fseek (f, base+length-4, SEEK_SET); - - int dirStart = get4 (f, INTEL) + base; - fseek (f, dirStart, SEEK_SET); - - int numOfTags = get2 (f, INTEL); - - if (numOfTags > 100) return; - - float exptime, shutter, aperture, fnumber, ev; - exptime = fnumber = shutter = aperture = ev = -1000; - int focal_len, iso; - focal_len = iso = -1; - - TagDirectory* exif = root->getTag("Exif")->getDirectory(); - - time_t timestamp = time (NULL); - - for (int i=0; i> 8) + 8) | 8) == 0x38) - parseCIFF (f, ftell(f), len, root); // Parse a sub-table - - if (type == 0x0810) { - fread (buffer, 64, 1, f); - t = new Tag (root, lookupAttrib(ifdAttribs,"Artist")); - t->initString (buffer); - root->addTag (t); - } - if (type == 0x080a) { - fread (buffer, 64, 1, f); - t = new Tag (root, lookupAttrib(ifdAttribs,"Make")); - t->initString (buffer); - root->addTag (t); - fseek (f, strlen(buffer) - 63, SEEK_CUR); - fread (buffer, 64, 1, f); - t = new Tag (root, lookupAttrib(ifdAttribs,"Model")); - t->initString (buffer); - root->addTag (t); - } - if (type == 0x1818) { - ev = int_to_float(get4(f, INTEL)); - shutter = int_to_float(get4(f, INTEL)); - exptime = pow (2, -shutter); - aperture = int_to_float(get4(f, INTEL)); - fnumber = pow (2, aperture/2); - - } - if (type == 0x102d) { - Tag* t = saveCIFFMNTag (f, root, len, "CanonCameraSettings"); - int mm = t->toInt (34, SHORT); - Tag* nt = new Tag (exif, lookupAttrib(exifAttribs,"MeteringMode")); - switch (mm) { - case 0: nt->initInt (5, SHORT); break; - case 1: nt->initInt (3, SHORT); break; - case 2: nt->initInt (1, SHORT); break; - case 3: nt->initInt (5, SHORT); break; - case 4: nt->initInt (6, SHORT); break; - case 5: nt->initInt (2, SHORT); break; - } - exif->addTag (nt); - nt = new Tag (exif, lookupAttrib(exifAttribs,"MaxApertureValue")); - nt->initRational (t->toInt(52,SHORT), 32); - exif->addTag (nt); - int em = t->toInt(40,SHORT); - nt = new Tag (exif, lookupAttrib(exifAttribs,"ExposureProgram")); - switch (em) { - case 0: nt->initInt (2, SHORT); break; - case 1: nt->initInt (2, SHORT); break; - case 2: nt->initInt (4, SHORT); break; - case 3: nt->initInt (3, SHORT); break; - case 4: nt->initInt (1, SHORT); break; - default: nt->initInt (0, SHORT); break; - } - exif->addTag (nt); - nt = new Tag (exif, lookupAttrib(exifAttribs,"Flash")); - if (t->toInt(8,SHORT)==0) - nt->initInt (0, SHORT); - else - nt->initInt (1, SHORT); - exif->addTag (nt); - nt = new Tag (exif, lookupAttrib(exifAttribs,"MaxApertureValue")); - nt->initRational (t->toInt(52,SHORT), 32); - exif->addTag (nt); - } - if (type == 0x1029) - saveCIFFMNTag (f, root, len, "CanonFocalLength"); - if (type == 0x1031) - saveCIFFMNTag (f, root, len, "SensorInfo"); - if (type == 0x1033) - saveCIFFMNTag (f, root, len, "CustomFunctions"); - if (type == 0x1038) - saveCIFFMNTag (f, root, len, "CanonAFInfo"); - if (type == 0x1093) - saveCIFFMNTag (f, root, len, "CanonFileInfo"); - if (type == 0x10a9) - saveCIFFMNTag (f, root, len, "ColorBalance"); - if (type == 0x102a) { - saveCIFFMNTag (f, root, len, "CanonShotInfo"); - - iso = pow (2, (get4(f, INTEL),get2(f, INTEL))/32.0 - 4) * 50; - aperture = ((get2(f, INTEL),(short)get2(f, INTEL))/32.0); - fnumber = pow (2, aperture/2); - shutter = ((short)get2(f, INTEL))/32.0; - ev = ((short)get2(f, INTEL))/32.0; - fseek (f, 34, SEEK_CUR); - if (shutter > 1e6) shutter = get2 (f, INTEL) / 10.0; - exptime = pow (2,-shutter); - } - if (type == 0x5029) { - focal_len = len >> 16; - if ((len & 0xffff) == 2) focal_len /= 32; - } -// if (type == 0x5813) flash_used = int_to_float(len); - if (type == 0x580e) timestamp = len; - if (type == 0x180e) timestamp = get4 (f, INTEL); - if ((type | 0x4000) == 0x580e) - timestamp = mktime (gmtime (×tamp)); - fseek (f, nextPos, SEEK_SET); - } - if (shutter>-999) { - t = new Tag (exif, lookupAttrib(exifAttribs,"ShutterSpeedValue")); - t->initRational ((int)(shutter*10000), 10000); - exif->addTag (t); - } - if (exptime>-999) { - t = new Tag (exif, lookupAttrib(exifAttribs,"ExposureTime")); - t->initRational ((int)(exptime*10000), 10000); - exif->addTag (t); - } - if (aperture>-999) { - t = new Tag (exif, lookupAttrib(exifAttribs,"ApertureValue")); - t->initRational ((int)(aperture*10), 10); - exif->addTag (t); - } - if (fnumber>-999) { - t = new Tag (exif, lookupAttrib(exifAttribs,"FNumber")); - t->initRational ((int)(fnumber*10), 10); - exif->addTag (t); - } - if (ev>-999) { - t = new Tag (exif, lookupAttrib(exifAttribs,"ExposureBiasValue")); - t->initRational ((int)(ev*1000), 1000); - exif->addTag (t); - } - if (iso>0) { - t = new Tag (exif, lookupAttrib(exifAttribs,"ISOSpeedRatings")); - t->initInt (iso, LONG); - exif->addTag (t); - } - if (focal_len>0) { - t = new Tag (exif, lookupAttrib(exifAttribs,"FocalLength")); - t->initRational (focal_len*32, 32); - exif->addTag (t); - } - - if (timestamp!=time(NULL)) { - struct tm* tim = localtime (×tamp); - strftime (buffer, 20, "%Y:%m:%d %H:%M:%S", tim); - t = new Tag (exif, lookupAttrib(exifAttribs,"DateTimeOriginal")); - t->initString (buffer); - exif->addTag (t); - t = new Tag (exif, lookupAttrib(exifAttribs,"DateTimeDigitized")); - t->initString (buffer); - exif->addTag (t); - t = new Tag (root, lookupAttrib(ifdAttribs,"DateTime")); - t->initString (buffer); - root->addTag (t); - } -} - -TagDirectory* ExifManager::parse (FILE* f, int base) { - - // read tiff header - fseek (f, base, SEEK_SET); - unsigned short bo; - fread (&bo, 1, 2, f); - ByteOrder order = (ByteOrder)((int)bo); - get2 (f, order); - int firstifd = get4 (f, order); + if (i>0) + sprintf (buffer+strlen(buffer)-1, "[%d]", i); + return buffer; +} - // seek to IFD0 - fseek (f, base+firstifd, SEEK_SET); - - // first read the IFD directory - TagDirectory* root = new TagDirectory (NULL, f, base, ifdAttribs, order); - - // fix ISO issue with nikon and panasonic cameras - Tag* exif = root->getTag ("Exif"); +std::string Tag::valueToString () { + + static char buffer[1024]; + if (attrib && attrib->interpreter) + return attrib->interpreter->toString (this); + else { + toString (buffer); + return buffer; + } +} + +void Tag::valueFromString (const std::string& value) { + + if (attrib && attrib->interpreter) + attrib->interpreter->fromString (this, value); +} + +int Tag::calculateSize () { + int size = 0; + + if (directory) { + int j; + for (j=0; directory[j]; j++) + size += directory[j]->calculateSize (); + if (j>1) + size += 4*j; + } + else if (valuesize > 4) + size += valuesize + (valuesize%2); // we align tags to even byte positions + + if (makerNoteKind!=NOMK) + count = directory[0]->calculateSize (); + + if (makerNoteKind==NIKON3 || makerNoteKind==OLYMPUS2 || makerNoteKind==FUJI) + size += valuesize; + else if (makerNoteKind==HEADERIFD) + size += valuesize; + + return size; +} + +int Tag::write (int offs, int dataOffs, unsigned char* buffer) { + + if ((int)type==0 || offs>65500) + return dataOffs; + + sset2 (tag, buffer+offs, parent->getOrder()); + offs += 2; + unsigned short typ = type; + sset2 (typ, buffer+offs, parent->getOrder()); + offs += 2; + sset4 (count, buffer+offs, parent->getOrder()); + offs += 4; + if (!directory) { + if (valuesize>4) { + sset4 (dataOffs, buffer+offs, parent->getOrder()); + memcpy (buffer+dataOffs, value, valuesize); + if (valuesize%2) + buffer[dataOffs+valuesize] = 0; // zero padding required by the exif standard + return dataOffs + valuesize + (valuesize%2); + } + else { + memcpy (buffer+offs, value, valuesize); + return dataOffs; + } + } + else { + if (makerNoteKind==NIKON3) { + sset4 (dataOffs, buffer+offs, parent->getOrder()); + memcpy (buffer+dataOffs, value, 18); + dataOffs += 10; + dataOffs += directory[0]->write (8, buffer+dataOffs); + return dataOffs; + } + else if (makerNoteKind==OLYMPUS2 || makerNoteKind==FUJI) { + sset4 (dataOffs, buffer+offs, parent->getOrder()); + memcpy (buffer+dataOffs, value, valuesize); + dataOffs += valuesize + directory[0]->write (valuesize, buffer+dataOffs); + return dataOffs; + } + else if (makerNoteKind==HEADERIFD) { + sset4 (dataOffs, buffer+offs, parent->getOrder()); + memcpy (buffer+dataOffs, value, valuesize); + dataOffs += valuesize; + dataOffs += directory[0]->write (dataOffs, buffer); + return dataOffs; + } + else if (!directory[1]) { + sset4 (dataOffs, buffer+offs, parent->getOrder()); + return directory[0]->write (dataOffs, buffer); + } + else { + sset4 (dataOffs, buffer+offs, parent->getOrder()); + int linkOffs = dataOffs; + for (int i=0; directory[i]; i++) + dataOffs += 4; + for (int i=0; directory[i]; i++) { + sset4 (dataOffs, buffer+linkOffs, parent->getOrder()); + linkOffs += 4; + dataOffs = directory[i]->write (dataOffs, buffer); + } + return dataOffs; + } + } +} + +Tag::Tag (TagDirectory* p, const TagAttrib* attr) + : parent(p), attrib(attr), makerNoteKind (NOMK), directory(NULL), keep(true), tag(attr ? attr->ID : -1), count(0), valuesize(0), value(NULL), type(INVALID) { +} + +Tag::Tag (TagDirectory* p, const TagAttrib* attr, int data, TagType t) + : parent(p), attrib(attr), makerNoteKind (NOMK), directory(NULL), keep(true), tag(attr ? attr->ID : -1), count(1), valuesize(0), value(NULL), type(t) { + + initInt (data, t); +} + +Tag::Tag (TagDirectory* p, const TagAttrib* attr, const char* text) + : parent(p), attrib(attr), makerNoteKind (NOMK), directory(NULL), keep(true), tag(attr ? attr->ID : -1), count(1), valuesize(0), value(NULL), type(ASCII) { + + initString (text); +} + +void Tag::initInt (int data, TagType t, int cnt) { + + type = t; + if (t==LONG) + valuesize = 4; + else if (t==SHORT) + valuesize = 2; + else if (t==RATIONAL) + valuesize = 8; + + count = cnt; + valuesize *= count; + value = new unsigned char[valuesize]; + setInt (data, 0, t); +} + +void Tag::initString (const char* text) { + + type = ASCII; + count = strlen(text)+1; + valuesize = count; + value = new unsigned char[valuesize]; + strcpy ((char*)value, text); +} + +void Tag::initSubDir () { + type = LONG; + valuesize = 4; + count = 1; + value = new unsigned char[4]; + setInt (0); + directory = new TagDirectory*[2]; + directory[0] = new TagDirectory (parent, attrib ? attrib->subdirAttribs : NULL, parent->getOrder()); + directory[1] = NULL; +} + +void Tag::initMakerNote (MNKind mnk, const TagAttrib* ta) { + type = UNDEFINED; + valuesize = 4; + count = 1; + value = new unsigned char[4]; + setInt (0); + directory = new TagDirectory*[2]; + directory[0] = new TagDirectory (parent, ta, parent->getOrder()); + directory[1] = NULL; + makerNoteKind = mnk; +} + +void Tag::initUndefArray (const char* data, int len) { + type = UNDEFINED; + count = valuesize = len; + value = new unsigned char[valuesize]; + memcpy (value, data, len); +} + +void Tag::initLongArray (const char* data, int len) { + type = LONG; + count = (len+3)/4; + valuesize = count * 4; + value = new unsigned char[valuesize]; + memcpy (value, data, len); +} + +void Tag::initRational (int num, int den) { + count = 1; + valuesize = 8; + value = new unsigned char[8]; + type = RATIONAL; + setInt (num, 0); + setInt (den, 4); +} + +//--------------- class IFDParser --------------------------------------------- +// static functions to read tag directoryes from different kinds of files +//----------------------------------------------------------------------------- + + +const TagAttrib* lookupAttrib (const TagAttrib* dir, const char* field) { + + for (int i=0; dir[i].ignore!=-1; i++) + if (!strcmp (dir[i].name, field)) + return &dir[i]; +} + + +TagDirectory* ExifManager::parseCIFF (FILE* f, int base, int length) { + + TagDirectory* root = new TagDirectory (NULL, ifdAttribs, INTEL); + Tag* exif = new Tag (root, lookupAttrib(ifdAttribs,"Exif")); + exif->initSubDir (); + Tag* mn = new Tag (exif->getDirectory(), lookupAttrib(exifAttribs,"MakerNote")); + mn->initMakerNote (IFD, canonAttribs); + root->addTag (exif); + exif->getDirectory()->addTag (mn); + parseCIFF (f, base, length, root); + root->sort (); + return root; +} + +Tag* ExifManager::saveCIFFMNTag (FILE* f, TagDirectory* root, int len, const char* name) { + int s = ftell (f); + char* data = new char [len]; + fread (data, len, 1, f); + TagDirectory* mn = root->getTag ("Exif")->getDirectory()->getTag("MakerNote")->getDirectory(); + Tag* cs = new Tag (mn, lookupAttrib(canonAttribs, name)); + cs->initUndefArray (data, len); + mn->addTag (cs); + fseek (f, s, SEEK_SET); + return cs; +} + +void ExifManager::parseCIFF (FILE* f, int base, int length, TagDirectory* root) { + + static char buffer[1024]; + Tag* t; + + fseek (f, base+length-4, SEEK_SET); + + int dirStart = get4 (f, INTEL) + base; + fseek (f, dirStart, SEEK_SET); + + int numOfTags = get2 (f, INTEL); + + if (numOfTags > 100) return; + + float exptime, shutter, aperture, fnumber, ev; + exptime = fnumber = shutter = aperture = ev = -1000; + int focal_len, iso; + focal_len = iso = -1; + + TagDirectory* exif = root->getTag("Exif")->getDirectory(); + + time_t timestamp = time (NULL); + + for (int i=0; i> 8) + 8) | 8) == 0x38) + parseCIFF (f, ftell(f), len, root); // Parse a sub-table + + if (type == 0x0810) { + fread (buffer, 64, 1, f); + t = new Tag (root, lookupAttrib(ifdAttribs,"Artist")); + t->initString (buffer); + root->addTag (t); + } + if (type == 0x080a) { + fread (buffer, 64, 1, f); + t = new Tag (root, lookupAttrib(ifdAttribs,"Make")); + t->initString (buffer); + root->addTag (t); + fseek (f, strlen(buffer) - 63, SEEK_CUR); + fread (buffer, 64, 1, f); + t = new Tag (root, lookupAttrib(ifdAttribs,"Model")); + t->initString (buffer); + root->addTag (t); + } + if (type == 0x1818) { + ev = int_to_float(get4(f, INTEL)); + shutter = int_to_float(get4(f, INTEL)); + exptime = pow (2, -shutter); + aperture = int_to_float(get4(f, INTEL)); + fnumber = pow (2, aperture/2); + + } + if (type == 0x102d) { + Tag* t = saveCIFFMNTag (f, root, len, "CanonCameraSettings"); + int mm = t->toInt (34, SHORT); + Tag* nt = new Tag (exif, lookupAttrib(exifAttribs,"MeteringMode")); + switch (mm) { + case 0: nt->initInt (5, SHORT); break; + case 1: nt->initInt (3, SHORT); break; + case 2: nt->initInt (1, SHORT); break; + case 3: nt->initInt (5, SHORT); break; + case 4: nt->initInt (6, SHORT); break; + case 5: nt->initInt (2, SHORT); break; + } + exif->addTag (nt); + nt = new Tag (exif, lookupAttrib(exifAttribs,"MaxApertureValue")); + nt->initRational (t->toInt(52,SHORT), 32); + exif->addTag (nt); + int em = t->toInt(40,SHORT); + nt = new Tag (exif, lookupAttrib(exifAttribs,"ExposureProgram")); + switch (em) { + case 0: nt->initInt (2, SHORT); break; + case 1: nt->initInt (2, SHORT); break; + case 2: nt->initInt (4, SHORT); break; + case 3: nt->initInt (3, SHORT); break; + case 4: nt->initInt (1, SHORT); break; + default: nt->initInt (0, SHORT); break; + } + exif->addTag (nt); + nt = new Tag (exif, lookupAttrib(exifAttribs,"Flash")); + if (t->toInt(8,SHORT)==0) + nt->initInt (0, SHORT); + else + nt->initInt (1, SHORT); + exif->addTag (nt); + nt = new Tag (exif, lookupAttrib(exifAttribs,"MaxApertureValue")); + nt->initRational (t->toInt(52,SHORT), 32); + exif->addTag (nt); + } + if (type == 0x1029) + saveCIFFMNTag (f, root, len, "CanonFocalLength"); + if (type == 0x1031) + saveCIFFMNTag (f, root, len, "SensorInfo"); + if (type == 0x1033) + saveCIFFMNTag (f, root, len, "CustomFunctions"); + if (type == 0x1038) + saveCIFFMNTag (f, root, len, "CanonAFInfo"); + if (type == 0x1093) + saveCIFFMNTag (f, root, len, "CanonFileInfo"); + if (type == 0x10a9) + saveCIFFMNTag (f, root, len, "ColorBalance"); + if (type == 0x102a) { + saveCIFFMNTag (f, root, len, "CanonShotInfo"); + + iso = pow (2, (get4(f, INTEL),get2(f, INTEL))/32.0 - 4) * 50; + aperture = ((get2(f, INTEL),(short)get2(f, INTEL))/32.0); + fnumber = pow (2, aperture/2); + shutter = ((short)get2(f, INTEL))/32.0; + ev = ((short)get2(f, INTEL))/32.0; + fseek (f, 34, SEEK_CUR); + if (shutter > 1e6) shutter = get2 (f, INTEL) / 10.0; + exptime = pow (2,-shutter); + } + if (type == 0x5029) { + focal_len = len >> 16; + if ((len & 0xffff) == 2) focal_len /= 32; + } +// if (type == 0x5813) flash_used = int_to_float(len); + if (type == 0x580e) timestamp = len; + if (type == 0x180e) timestamp = get4 (f, INTEL); + if ((type | 0x4000) == 0x580e) + timestamp = mktime (gmtime (×tamp)); + fseek (f, nextPos, SEEK_SET); + } + if (shutter>-999) { + t = new Tag (exif, lookupAttrib(exifAttribs,"ShutterSpeedValue")); + t->initRational ((int)(shutter*10000), 10000); + exif->addTag (t); + } + if (exptime>-999) { + t = new Tag (exif, lookupAttrib(exifAttribs,"ExposureTime")); + t->initRational ((int)(exptime*10000), 10000); + exif->addTag (t); + } + if (aperture>-999) { + t = new Tag (exif, lookupAttrib(exifAttribs,"ApertureValue")); + t->initRational ((int)(aperture*10), 10); + exif->addTag (t); + } + if (fnumber>-999) { + t = new Tag (exif, lookupAttrib(exifAttribs,"FNumber")); + t->initRational ((int)(fnumber*10), 10); + exif->addTag (t); + } + if (ev>-999) { + t = new Tag (exif, lookupAttrib(exifAttribs,"ExposureBiasValue")); + t->initRational ((int)(ev*1000), 1000); + exif->addTag (t); + } + if (iso>0) { + t = new Tag (exif, lookupAttrib(exifAttribs,"ISOSpeedRatings")); + t->initInt (iso, LONG); + exif->addTag (t); + } + if (focal_len>0) { + t = new Tag (exif, lookupAttrib(exifAttribs,"FocalLength")); + t->initRational (focal_len*32, 32); + exif->addTag (t); + } + + if (timestamp!=time(NULL)) { + struct tm* tim = localtime (×tamp); + strftime (buffer, 20, "%Y:%m:%d %H:%M:%S", tim); + t = new Tag (exif, lookupAttrib(exifAttribs,"DateTimeOriginal")); + t->initString (buffer); + exif->addTag (t); + t = new Tag (exif, lookupAttrib(exifAttribs,"DateTimeDigitized")); + t->initString (buffer); + exif->addTag (t); + t = new Tag (root, lookupAttrib(ifdAttribs,"DateTime")); + t->initString (buffer); + root->addTag (t); + } +} + +TagDirectory* ExifManager::parse (FILE* f, int base) { + + // read tiff header + fseek (f, base, SEEK_SET); + unsigned short bo; + fread (&bo, 1, 2, f); + ByteOrder order = (ByteOrder)((int)bo); + get2 (f, order); + int firstifd = get4 (f, order); + + // seek to IFD0 + fseek (f, base+firstifd, SEEK_SET); + + // first read the IFD directory + TagDirectory* root = new TagDirectory (NULL, f, base, ifdAttribs, order); + + // fix ISO issue with nikon and panasonic cameras + Tag* exif = root->getTag ("Exif"); if (exif && !exif->getDirectory()->getTag("ISOSpeedRatings")) { - Tag* make = root->getTag ("Make"); + Tag* make = root->getTag ("Make"); if (make && !strncmp((char*)make->getValue(), "NIKON", 5)) { - Tag* mn = exif->getDirectory()->getTag("MakerNote"); - if (mn) { - Tag* iso = mn->getDirectory()->getTag("ISOSpeed"); - if (iso) { - std::string isov = iso->valueToString (); - Tag* niso = new Tag (exif->getDirectory(), exif->getDirectory()->getAttrib ("ISOSpeedRatings")); - niso->initInt (atoi(isov.c_str()), SHORT); - exif->getDirectory()->addTagFront (niso); + Tag* mn = exif->getDirectory()->getTag("MakerNote"); + if (mn) { + Tag* iso = mn->getDirectory()->getTag("ISOSpeed"); + if (iso) { + std::string isov = iso->valueToString (); + Tag* niso = new Tag (exif->getDirectory(), exif->getDirectory()->getAttrib ("ISOSpeedRatings")); + niso->initInt (atoi(isov.c_str()), SHORT); + exif->getDirectory()->addTagFront (niso); } } } else if (make && (!strncmp((char*)make->getValue(), "Panasonic", 9) || !strncmp((char*)make->getValue(), "LEICA", 5))) { - Tag* iso = root->getTag("PanaISO"); - if (iso) { - std::string isov = iso->valueToString (); - Tag* niso = new Tag (exif->getDirectory(), exif->getDirectory()->getAttrib ("ISOSpeedRatings")); - niso->initInt (atoi(isov.c_str()), SHORT); - exif->getDirectory()->addTagFront (niso); + Tag* iso = root->getTag("PanaISO"); + if (iso) { + std::string isov = iso->valueToString (); + Tag* niso = new Tag (exif->getDirectory(), exif->getDirectory()->getAttrib ("ISOSpeedRatings")); + niso->initInt (atoi(isov.c_str()), SHORT); + exif->getDirectory()->addTagFront (niso); } } } -// root->printAll (); - - return root; -} - -TagDirectory* ExifManager::parseJPEG (FILE* f) { - - fseek (f, 0, SEEK_SET); - unsigned char markerl = 0xff; - unsigned char c; - fread (&c, 1, 1, f); - const char exifid[] = "Exif\0\0"; - char idbuff[8]; - bool success = false; - int tiffbase = -1; - while (fread (&c, 1, 1, f)) { - if (c!=markerl) continue; - if (fread (&c, 1, 1, f) && c==0xe1) { // APP1 marker found - if (fread (idbuff, 1, 8, f)<8) - return NULL; - if (!memcmp(idbuff+2, exifid, 6)) { // Exif info found - tiffbase = ftell (f); - return parse (f, tiffbase); - } - } - } - return NULL; -} - -TagDirectory* ExifManager::parseTIFF (FILE* f) { - - return parse (f, 0); -} - -std::vector ExifManager::defTags; - -// forthis: the byte order will be taken from directory "forthis" -const std::vector& ExifManager::getDefaultTIFFTags (TagDirectory* forthis) { - - for (int i=0; i >& changeList, int W, int H, unsigned char* buffer) { - - // write tiff header - int offs = 6; - memcpy (buffer, "Exif\0\0", 6); - ByteOrder order = INTEL; - if (root) - order = root->getOrder (); - sset2 ((unsigned short)order, buffer+offs, order); offs += 2; - sset2 (42, buffer+offs, order); offs += 2; - sset4 (8, buffer+offs, order); offs += 4; - - TagDirectory* cl; - if (root) - cl = ((TagDirectory*)root)->clone (NULL); - else - cl = new TagDirectory (NULL, ifdAttribs, INTEL); - - for (int i=0; iapplyChange (changeList[i].first, changeList[i].second); - - getDefaultTIFFTags (cl); - - defTags[0]->setInt (W, 0, LONG); - defTags[1]->setInt (H, 0, LONG); - defTags[8]->setInt (8, 0, SHORT); - - for (int i=defTags.size()-1; i>=0; i--) - cl->replaceTag (defTags[i]->clone (cl)); - cl->sort (); - int size = cl->write (8, buffer+6); - - delete cl; - - return size + 6; -} - -int ExifManager::createTIFFHeader (const TagDirectory* root, const std::vector< std::pair >& changeList, int W, int H, int bps, const char* profiledata, int profilelen, const char* iptcdata, int iptclen, unsigned char* buffer) { - -// write tiff header - int offs = 0; - ByteOrder order = INTEL; - if (root) - order = root->getOrder (); - sset2 ((unsigned short)order, buffer+offs, order); offs += 2; - sset2 (42, buffer+offs, order); offs += 2; - sset4 (8, buffer+offs, order); offs += 4; - - TagDirectory* cl; - if (root) - cl = ((TagDirectory*)root)->clone (NULL); - else - cl = new TagDirectory (NULL, ifdAttribs, INTEL); - -// add tiff strip data - int rps = 8; - int strips = ceil((double)H/rps); - cl->replaceTag (new Tag (cl, lookupAttrib(ifdAttribs,"RowsPerStrip"), rps, LONG)); - Tag* stripBC = new Tag (cl, lookupAttrib(ifdAttribs,"StripByteCounts")); - stripBC->initInt (0, LONG, strips); - cl->replaceTag (stripBC); - Tag* stripOffs = new Tag (cl, lookupAttrib(ifdAttribs,"StripOffsets")); - stripOffs->initInt (0, LONG, strips); - cl->replaceTag (stripOffs); - for (int i=0; isetInt (rps*W*3*bps/8, i*4); - int remaining = (H-rps*floor((double)H/rps))*W*3*bps/8; - if (remaining) - stripBC->setInt (remaining, (strips-1)*4); - else - stripBC->setInt (rps*W*3*bps/8, (strips-1)*4); - if (profiledata) { - Tag* icc = new Tag (cl, lookupAttrib(ifdAttribs,"ICCProfile")); - icc->initUndefArray (profiledata, profilelen); - cl->replaceTag (icc); - } - if (iptcdata) { - Tag* iptc = new Tag (cl, lookupAttrib(ifdAttribs,"IPTCData")); - iptc->initLongArray (iptcdata, iptclen); - cl->replaceTag (iptc); - } - -// apply list of changes - for (int i=0; iapplyChange (changeList[i].first, changeList[i].second); - - // append default properties - getDefaultTIFFTags (cl); - - defTags[0]->setInt (W, 0, LONG); - defTags[1]->setInt (H, 0, LONG); - defTags[8]->setInt (bps, 0, SHORT); - - for (int i=defTags.size()-1; i>=0; i--) - cl->replaceTag (defTags[i]->clone (cl)); - -// calculate strip offsets - int size = cl->calculateSize (); - int byps = bps / 8; - for (int i=0; isetInt (size + 8 + i*rps*W*3*byps, i*4); - - cl->sort (); - int endOffs = cl->write (8, buffer); - -// cl->printAll(); - delete cl; - - return endOffs; -} - -//----------------------------------------------------------------------------- -// global functions to read byteorder dependent data -//----------------------------------------------------------------------------- -unsigned short sget2 (unsigned char *s, rtexif::ByteOrder order) { - - if (order == rtexif::INTEL) return s[0] | s[1] << 8; - else return s[0] << 8 | s[1]; -} - -int sget4 (unsigned char *s, rtexif::ByteOrder order) { - - if (order == rtexif::INTEL) return s[0] | s[1] << 8 | s[2] << 16 | s[3] << 24; - else return s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]; -} - -unsigned short get2 (FILE* f, rtexif::ByteOrder order) { - - unsigned char str[2] = { 0xff,0xff }; - fread (str, 1, 2, f); - return rtexif::sget2 (str, order); -} - -int get4 (FILE* f, rtexif::ByteOrder order) { - - unsigned char str[4] = { 0xff,0xff,0xff,0xff }; - fread (str, 1, 4, f); - return rtexif::sget4 (str, order); -} - -void sset2 (unsigned short v, unsigned char *s, rtexif::ByteOrder order) { - - if (order == rtexif::INTEL) { - s[0] = v & 0xff; v >>= 8; - s[1] = v; - } - else { - s[1] = v & 0xff; v >>= 8; - s[0] = v; - } -} - -void sset4 (int v, unsigned char *s, rtexif::ByteOrder order) { - - if (order == rtexif::INTEL) { - s[0] = v & 0xff; v >>= 8; - s[1] = v & 0xff; v >>= 8; - s[2] = v & 0xff; v >>= 8; - s[3] = v; - } - else { - s[3] = v & 0xff; v >>= 8; - s[2] = v & 0xff; v >>= 8; - s[1] = v & 0xff; v >>= 8; - s[0] = v; - } -} - -float int_to_float (int i) { - union { int i; float f; } u; - u.i = i; - return u.f; -} - -short int int2_to_signed (short unsigned int i) { - union { short unsigned int i; short int s; } u; - u.i = i; - return u.s; -} - -/* Function to parse and extract focal length and aperture information from description - * @fullname must conform to the following formats - * mm f/ - * -mm f/ - * -mm f/- - * NB: no space between separator '-'; no space between focal length and 'mm' - */ -bool extractLensInfo(std::string &fullname,double &minFocal, double &maxFocal, double &maxApertureAtMinFocal, double &maxApertureAtMaxFocal) -{ - minFocal=0.0; - maxFocal=0.0; - maxApertureAtMinFocal=0.0; - maxApertureAtMaxFocal=0.0; - - int iAperture = fullname.find("f/"); - if( iAperture != std::string::npos ){ - char meno; - std::istringstream apertures( std::string(fullname,iAperture+2) ); - apertures >> maxApertureAtMinFocal; - if( !apertures.eof()) - apertures >> meno; - if( !apertures.eof()) - apertures >> maxApertureAtMaxFocal; - if(maxApertureAtMinFocal >0. && maxApertureAtMaxFocal==0.) - maxApertureAtMaxFocal= maxApertureAtMinFocal; - - int eFocal = fullname.rfind("mm",iAperture); - if( eFocal != -1 ){ - int iFocal = fullname.rfind(' ',eFocal); // find first space leading focal length - if( iFocal == std::string::npos ) - iFocal = 0; - - std::istringstream focals( std::string(fullname,iFocal,eFocal-iFocal) ); - focals >> minFocal; - if( !focals.eof()) - focals >> meno; - if( !focals.eof()) - focals >> maxFocal; - if(minFocal >0. && maxFocal==0.0) - maxFocal=minFocal; - - return true; - } - return false; - } - return false; -} - - -} +// root->printAll (); + + return root; +} + +TagDirectory* ExifManager::parseJPEG (FILE* f) { + + fseek (f, 0, SEEK_SET); + unsigned char markerl = 0xff; + unsigned char c; + fread (&c, 1, 1, f); + const char exifid[] = "Exif\0\0"; + char idbuff[8]; + bool success = false; + int tiffbase = -1; + while (fread (&c, 1, 1, f)) { + if (c!=markerl) continue; + if (fread (&c, 1, 1, f) && c==0xe1) { // APP1 marker found + if (fread (idbuff, 1, 8, f)<8) + return NULL; + if (!memcmp(idbuff+2, exifid, 6)) { // Exif info found + tiffbase = ftell (f); + return parse (f, tiffbase); + } + } + } + return NULL; +} + +TagDirectory* ExifManager::parseTIFF (FILE* f) { + + return parse (f, 0); +} + +std::vector ExifManager::defTags; + +// forthis: the byte order will be taken from directory "forthis" +const std::vector& ExifManager::getDefaultTIFFTags (TagDirectory* forthis) { + + for (int i=0; i >& changeList, int W, int H, unsigned char* buffer) { + + // write tiff header + int offs = 6; + memcpy (buffer, "Exif\0\0", 6); + ByteOrder order = INTEL; + if (root) + order = root->getOrder (); + sset2 ((unsigned short)order, buffer+offs, order); offs += 2; + sset2 (42, buffer+offs, order); offs += 2; + sset4 (8, buffer+offs, order); offs += 4; + + TagDirectory* cl; + if (root) + cl = ((TagDirectory*)root)->clone (NULL); + else + cl = new TagDirectory (NULL, ifdAttribs, INTEL); + + for (int i=0; iapplyChange (changeList[i].first, changeList[i].second); + + getDefaultTIFFTags (cl); + + defTags[0]->setInt (W, 0, LONG); + defTags[1]->setInt (H, 0, LONG); + defTags[8]->setInt (8, 0, SHORT); + + for (int i=defTags.size()-1; i>=0; i--) + cl->replaceTag (defTags[i]->clone (cl)); + cl->sort (); + int size = cl->write (8, buffer+6); + + delete cl; + + return size + 6; +} + +int ExifManager::createTIFFHeader (const TagDirectory* root, const std::vector< std::pair >& changeList, int W, int H, int bps, const char* profiledata, int profilelen, const char* iptcdata, int iptclen, unsigned char* buffer) { + +// write tiff header + int offs = 0; + ByteOrder order = INTEL; + if (root) + order = root->getOrder (); + sset2 ((unsigned short)order, buffer+offs, order); offs += 2; + sset2 (42, buffer+offs, order); offs += 2; + sset4 (8, buffer+offs, order); offs += 4; + + TagDirectory* cl; + if (root) + cl = ((TagDirectory*)root)->clone (NULL); + else + cl = new TagDirectory (NULL, ifdAttribs, INTEL); + +// add tiff strip data + int rps = 8; + int strips = ceil((double)H/rps); + cl->replaceTag (new Tag (cl, lookupAttrib(ifdAttribs,"RowsPerStrip"), rps, LONG)); + Tag* stripBC = new Tag (cl, lookupAttrib(ifdAttribs,"StripByteCounts")); + stripBC->initInt (0, LONG, strips); + cl->replaceTag (stripBC); + Tag* stripOffs = new Tag (cl, lookupAttrib(ifdAttribs,"StripOffsets")); + stripOffs->initInt (0, LONG, strips); + cl->replaceTag (stripOffs); + for (int i=0; isetInt (rps*W*3*bps/8, i*4); + int remaining = (H-rps*floor((double)H/rps))*W*3*bps/8; + if (remaining) + stripBC->setInt (remaining, (strips-1)*4); + else + stripBC->setInt (rps*W*3*bps/8, (strips-1)*4); + if (profiledata) { + Tag* icc = new Tag (cl, lookupAttrib(ifdAttribs,"ICCProfile")); + icc->initUndefArray (profiledata, profilelen); + cl->replaceTag (icc); + } + if (iptcdata) { + Tag* iptc = new Tag (cl, lookupAttrib(ifdAttribs,"IPTCData")); + iptc->initLongArray (iptcdata, iptclen); + cl->replaceTag (iptc); + } + +// apply list of changes + for (int i=0; iapplyChange (changeList[i].first, changeList[i].second); + + // append default properties + getDefaultTIFFTags (cl); + + defTags[0]->setInt (W, 0, LONG); + defTags[1]->setInt (H, 0, LONG); + defTags[8]->setInt (bps, 0, SHORT); + + for (int i=defTags.size()-1; i>=0; i--) + cl->replaceTag (defTags[i]->clone (cl)); + +// calculate strip offsets + int size = cl->calculateSize (); + int byps = bps / 8; + for (int i=0; isetInt (size + 8 + i*rps*W*3*byps, i*4); + + cl->sort (); + int endOffs = cl->write (8, buffer); + +// cl->printAll(); + delete cl; + + return endOffs; +} + +//----------------------------------------------------------------------------- +// global functions to read byteorder dependent data +//----------------------------------------------------------------------------- +unsigned short sget2 (unsigned char *s, rtexif::ByteOrder order) { + + if (order == rtexif::INTEL) return s[0] | s[1] << 8; + else return s[0] << 8 | s[1]; +} + +int sget4 (unsigned char *s, rtexif::ByteOrder order) { + + if (order == rtexif::INTEL) return s[0] | s[1] << 8 | s[2] << 16 | s[3] << 24; + else return s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]; +} + +unsigned short get2 (FILE* f, rtexif::ByteOrder order) { + + unsigned char str[2] = { 0xff,0xff }; + fread (str, 1, 2, f); + return rtexif::sget2 (str, order); +} + +int get4 (FILE* f, rtexif::ByteOrder order) { + + unsigned char str[4] = { 0xff,0xff,0xff,0xff }; + fread (str, 1, 4, f); + return rtexif::sget4 (str, order); +} + +void sset2 (unsigned short v, unsigned char *s, rtexif::ByteOrder order) { + + if (order == rtexif::INTEL) { + s[0] = v & 0xff; v >>= 8; + s[1] = v; + } + else { + s[1] = v & 0xff; v >>= 8; + s[0] = v; + } +} + +void sset4 (int v, unsigned char *s, rtexif::ByteOrder order) { + + if (order == rtexif::INTEL) { + s[0] = v & 0xff; v >>= 8; + s[1] = v & 0xff; v >>= 8; + s[2] = v & 0xff; v >>= 8; + s[3] = v; + } + else { + s[3] = v & 0xff; v >>= 8; + s[2] = v & 0xff; v >>= 8; + s[1] = v & 0xff; v >>= 8; + s[0] = v; + } +} + +float int_to_float (int i) { + union { int i; float f; } u; + u.i = i; + return u.f; +} + +short int int2_to_signed (short unsigned int i) { + union { short unsigned int i; short int s; } u; + u.i = i; + return u.s; +} + +/* Function to parse and extract focal length and aperture information from description + * @fullname must conform to the following formats + * mm f/ + * -mm f/ + * -mm f/- + * NB: no space between separator '-'; no space between focal length and 'mm' + */ +bool extractLensInfo(std::string &fullname,double &minFocal, double &maxFocal, double &maxApertureAtMinFocal, double &maxApertureAtMaxFocal) +{ + minFocal=0.0; + maxFocal=0.0; + maxApertureAtMinFocal=0.0; + maxApertureAtMaxFocal=0.0; + + int iAperture = fullname.find("f/"); + if( iAperture != std::string::npos ){ + char meno; + std::istringstream apertures( std::string(fullname,iAperture+2) ); + apertures >> maxApertureAtMinFocal; + if( !apertures.eof()) + apertures >> meno; + if( !apertures.eof()) + apertures >> maxApertureAtMaxFocal; + if(maxApertureAtMinFocal >0. && maxApertureAtMaxFocal==0.) + maxApertureAtMaxFocal= maxApertureAtMinFocal; + + int eFocal = fullname.rfind("mm",iAperture); + if( eFocal != -1 ){ + int iFocal = fullname.rfind(' ',eFocal); // find first space leading focal length + if( iFocal == std::string::npos ) + iFocal = 0; + + std::istringstream focals( std::string(fullname,iFocal,eFocal-iFocal) ); + focals >> minFocal; + if( !focals.eof()) + focals >> meno; + if( !focals.eof()) + focals >> maxFocal; + if(minFocal >0. && maxFocal==0.0) + maxFocal=minFocal; + + return true; + } + return false; + } + return false; +} + + +} diff --git a/rtexif/rtexif.h b/rtexif/rtexif.h index eee6f2df9..7b85119cf 100644 --- a/rtexif/rtexif.h +++ b/rtexif/rtexif.h @@ -1,236 +1,236 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _MEXIF3_ -#define _MEXIF3_ - -#include -#include -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _MEXIF3_ +#define _MEXIF3_ + +#include +#include +#include +#include #include -namespace rtexif { - -enum TagType {INVALID=0, BYTE=1, ASCII=2, SHORT=3, LONG=4, RATIONAL=5, UNDEFINED=7, SSHORT=8, SLONG=9, SRATIONAL=10, FLOAT=11, DOUBLE=12, OLYUNDEF=13, SUBDIR=99}; -enum ActionCode {DONTWRITE=0, WRITE=1, SYSTEM=2}; -enum ByteOrder {INTEL=0x4949, MOTOROLA=0x4D4D}; -enum MNKind {NOMK, IFD, HEADERIFD, NIKON3, OLYMPUS2, FUJI}; - -struct TIFFHeader { - - unsigned short byteOrder; - unsigned short fixed; - unsigned int ifdOffset; -}; - -class Tag; -class Interpreter; - -// structure of informations describing an exif tag -struct TagAttrib { - int ignore; // =0: never ignore, =1: always ignore, =2: ignore if the subdir type is reduced image, =-1: end of table - int action; //=0: dont write it to the output, =1: write it to the output, =2: dont write, dont show, =3: write, dont show - int editable; - const TagAttrib* subdirAttribs; // =0 ->not subdir - unsigned short ID; - const char* name; - Interpreter* interpreter; -}; - -// a directory of tags -class TagDirectory { - - protected: - std::vector tags; // tags in the directory - const TagAttrib* attribs; // descriptor table to decode the tags - ByteOrder order; // byte order - TagDirectory* parent; // parent directory (NULL if root) - - public: - TagDirectory (); - TagDirectory (TagDirectory* p, FILE* f, int base, const TagAttrib* ta, ByteOrder border); - TagDirectory (TagDirectory* p, const TagAttrib* ta, ByteOrder border); - ~TagDirectory (); - - inline ByteOrder getOrder () const { return order; } - TagDirectory* getParent () { return parent; } - inline int getCount () const { return tags.size (); } - const TagAttrib* getAttrib (int id); - const TagAttrib* getAttrib (const char* name); - const TagAttrib* getAttribTable() { return attribs; } - Tag* getTag (const char* name); - Tag* getTag (int ID); - void addTag (Tag* a); - void addTagFront (Tag* a); - void replaceTag (Tag* a); - inline Tag* getTagByIndex (int ix) { return tags[ix]; } - inline void setOrder (ByteOrder bo) { order = bo; } - - int calculateSize (); - int write (int start, unsigned char* buffer); - TagDirectory* clone (TagDirectory* parent); - void applyChange (std::string field, std::string value); - - void printAll () const; - void sort (); -}; - -// a class representing a single tag -class Tag { - - protected: - unsigned short tag; - TagType type; - unsigned int count; - unsigned char* value; - int valuesize; - bool keep; - - const TagAttrib* attrib; - TagDirectory* parent; - TagDirectory** directory; - MNKind makerNoteKind; - - public: - Tag (TagDirectory* parent, FILE* f, int base); // parse next tag from the file - Tag (TagDirectory* parent, const TagAttrib* attr); - Tag (TagDirectory* parent, const TagAttrib* attr, int data, TagType t); // create a new tag from array (used - Tag (TagDirectory* parent, const TagAttrib* attr, const char* data); // create a new tag from array (used - ~Tag (); - void initInt (int data, TagType t, int count=1); - void initString (const char* text); - void initSubDir (); - void initMakerNote (MNKind mnk, const TagAttrib* ta); - void initUndefArray (const char* data, int len); - void initLongArray (const char* data, int len); - void initRational (int num, int den); - - // get basic tag properties - int getID () const { return tag; } - int getCount () const { return count; } - TagType getType () const { return type; } - unsigned char* getValue () const { return value; } - const TagAttrib* getAttrib () const { return attrib; } - inline ByteOrder getOrder () const { return parent ? parent->getOrder() : INTEL; } - inline TagDirectory* getParent () const { return parent; } - int getValueSize () const { return valuesize; } - - // read/write value - int toInt (int ofs=0, TagType astype=INVALID); - void fromInt (int v); - double toDouble (int ofs=0); - void toRational (int& num, int& denom, int ofs=0); - void toString (char* buffer, int ofs=0); - void fromString (const char* v, int size=-1); - void setInt (int v, int ofs=0, TagType astype=LONG); - - // additional getter/setter for more confortable use - std::string valueToString (); - std::string nameToString (int i=0); - void valueFromString (const std::string& value); - - // functions for writing - int calculateSize (); - int write (int offs, int dataOffs, unsigned char* buffer); - Tag* clone (TagDirectory* parent); - - // to control if the tag shall be written - bool getKeep () { return keep; } - void setKeep (bool k) { keep = k; } - - // get subdirectory (there can be several, the last is NULL) - bool isDirectory () { return directory!=NULL; } - TagDirectory* getDirectory (int i=0) { return directory[i]; } - - MNKind getMakerNoteFormat () { return makerNoteKind; } - }; - -class ExifManager { - - static std::vector defTags; - - static Tag* saveCIFFMNTag (FILE* f, TagDirectory* root, int len, const char* name); - public: - static TagDirectory* parse (FILE*f, int base); - static TagDirectory* parseJPEG (FILE*f); - static TagDirectory* parseTIFF (FILE*f); - static TagDirectory* parseCIFF (FILE* f, int base, int length); - static void parseCIFF (FILE* f, int base, int length, TagDirectory* root); - - static const std::vector& getDefaultTIFFTags (TagDirectory* forthis); - static int createJPEGMarker (const TagDirectory* root, const std::vector< std::pair >& changeList, int W, int H, unsigned char* buffer); - static int createTIFFHeader (const TagDirectory* root, const std::vector< std::pair >& changeList, int W, int H, int bps, const char* profiledata, int profilelen, const char* iptcdata, int iptclen, unsigned char* buffer); -}; - -class Interpreter { - protected: - char buffer[1024]; - public: - Interpreter () {} - virtual std::string toString (Tag* t) { return ""; } - virtual void fromString (Tag* t, const std::string& value) {} -}; - -class StdInterpreter : public Interpreter { - public: - StdInterpreter () {} - virtual std::string toString (Tag* t) { - t->toString (buffer); - std::string s(buffer); - std::string::size_type p1 = s.find_first_not_of(' '); - if( p1 == std::string::npos ) - return s; - else - return s.substr(p1, s.find_last_not_of(' ')-p1+1); - } - virtual void fromString (Tag* t, const std::string& value) { - if (t->getType()==SHORT || t->getType()==LONG) - t->fromInt (atoi(value.c_str())); - else - t->fromString (value.c_str()); - } -}; -extern StdInterpreter stdInterpreter; -class ChoiceInterpreter : public Interpreter { - protected: - std::map choices; - public: - ChoiceInterpreter () {}; - virtual std::string toString (Tag* t) { - std::map::iterator r = choices.find (t->toInt()); - if (r!=choices.end()) - return r->second; - else { - t->toString (buffer); - return std::string (buffer); - } - } -}; - -inline unsigned short sget2 (unsigned char *s, ByteOrder order); -inline int sget4 (unsigned char *s, ByteOrder order); -inline unsigned short get2 (FILE* f, ByteOrder order); -inline int get4 (FILE* f, ByteOrder order); -inline void sset2 (unsigned short v, unsigned char *s, ByteOrder order); -inline void sset4 (int v, unsigned char *s, ByteOrder order); -inline float int_to_float (int i); -inline short int int2_to_signed (short unsigned int i); +namespace rtexif { + +enum TagType {INVALID=0, BYTE=1, ASCII=2, SHORT=3, LONG=4, RATIONAL=5, UNDEFINED=7, SSHORT=8, SLONG=9, SRATIONAL=10, FLOAT=11, DOUBLE=12, OLYUNDEF=13, SUBDIR=99}; +enum ActionCode {DONTWRITE=0, WRITE=1, SYSTEM=2}; +enum ByteOrder {INTEL=0x4949, MOTOROLA=0x4D4D}; +enum MNKind {NOMK, IFD, HEADERIFD, NIKON3, OLYMPUS2, FUJI}; + +struct TIFFHeader { + + unsigned short byteOrder; + unsigned short fixed; + unsigned int ifdOffset; +}; + +class Tag; +class Interpreter; + +// structure of informations describing an exif tag +struct TagAttrib { + int ignore; // =0: never ignore, =1: always ignore, =2: ignore if the subdir type is reduced image, =-1: end of table + int action; //=0: dont write it to the output, =1: write it to the output, =2: dont write, dont show, =3: write, dont show + int editable; + const TagAttrib* subdirAttribs; // =0 ->not subdir + unsigned short ID; + const char* name; + Interpreter* interpreter; +}; + +// a directory of tags +class TagDirectory { + + protected: + std::vector tags; // tags in the directory + const TagAttrib* attribs; // descriptor table to decode the tags + ByteOrder order; // byte order + TagDirectory* parent; // parent directory (NULL if root) + + public: + TagDirectory (); + TagDirectory (TagDirectory* p, FILE* f, int base, const TagAttrib* ta, ByteOrder border); + TagDirectory (TagDirectory* p, const TagAttrib* ta, ByteOrder border); + ~TagDirectory (); + + inline ByteOrder getOrder () const { return order; } + TagDirectory* getParent () { return parent; } + inline int getCount () const { return tags.size (); } + const TagAttrib* getAttrib (int id); + const TagAttrib* getAttrib (const char* name); + const TagAttrib* getAttribTable() { return attribs; } + Tag* getTag (const char* name); + Tag* getTag (int ID); + void addTag (Tag* a); + void addTagFront (Tag* a); + void replaceTag (Tag* a); + inline Tag* getTagByIndex (int ix) { return tags[ix]; } + inline void setOrder (ByteOrder bo) { order = bo; } + + int calculateSize (); + int write (int start, unsigned char* buffer); + TagDirectory* clone (TagDirectory* parent); + void applyChange (std::string field, std::string value); + + void printAll () const; + void sort (); +}; + +// a class representing a single tag +class Tag { + + protected: + unsigned short tag; + TagType type; + unsigned int count; + unsigned char* value; + int valuesize; + bool keep; + + const TagAttrib* attrib; + TagDirectory* parent; + TagDirectory** directory; + MNKind makerNoteKind; + + public: + Tag (TagDirectory* parent, FILE* f, int base); // parse next tag from the file + Tag (TagDirectory* parent, const TagAttrib* attr); + Tag (TagDirectory* parent, const TagAttrib* attr, int data, TagType t); // create a new tag from array (used + Tag (TagDirectory* parent, const TagAttrib* attr, const char* data); // create a new tag from array (used + ~Tag (); + void initInt (int data, TagType t, int count=1); + void initString (const char* text); + void initSubDir (); + void initMakerNote (MNKind mnk, const TagAttrib* ta); + void initUndefArray (const char* data, int len); + void initLongArray (const char* data, int len); + void initRational (int num, int den); + + // get basic tag properties + int getID () const { return tag; } + int getCount () const { return count; } + TagType getType () const { return type; } + unsigned char* getValue () const { return value; } + const TagAttrib* getAttrib () const { return attrib; } + inline ByteOrder getOrder () const { return parent ? parent->getOrder() : INTEL; } + inline TagDirectory* getParent () const { return parent; } + int getValueSize () const { return valuesize; } + + // read/write value + int toInt (int ofs=0, TagType astype=INVALID); + void fromInt (int v); + double toDouble (int ofs=0); + void toRational (int& num, int& denom, int ofs=0); + void toString (char* buffer, int ofs=0); + void fromString (const char* v, int size=-1); + void setInt (int v, int ofs=0, TagType astype=LONG); + + // additional getter/setter for more confortable use + std::string valueToString (); + std::string nameToString (int i=0); + void valueFromString (const std::string& value); + + // functions for writing + int calculateSize (); + int write (int offs, int dataOffs, unsigned char* buffer); + Tag* clone (TagDirectory* parent); + + // to control if the tag shall be written + bool getKeep () { return keep; } + void setKeep (bool k) { keep = k; } + + // get subdirectory (there can be several, the last is NULL) + bool isDirectory () { return directory!=NULL; } + TagDirectory* getDirectory (int i=0) { return directory[i]; } + + MNKind getMakerNoteFormat () { return makerNoteKind; } + }; + +class ExifManager { + + static std::vector defTags; + + static Tag* saveCIFFMNTag (FILE* f, TagDirectory* root, int len, const char* name); + public: + static TagDirectory* parse (FILE*f, int base); + static TagDirectory* parseJPEG (FILE*f); + static TagDirectory* parseTIFF (FILE*f); + static TagDirectory* parseCIFF (FILE* f, int base, int length); + static void parseCIFF (FILE* f, int base, int length, TagDirectory* root); + + static const std::vector& getDefaultTIFFTags (TagDirectory* forthis); + static int createJPEGMarker (const TagDirectory* root, const std::vector< std::pair >& changeList, int W, int H, unsigned char* buffer); + static int createTIFFHeader (const TagDirectory* root, const std::vector< std::pair >& changeList, int W, int H, int bps, const char* profiledata, int profilelen, const char* iptcdata, int iptclen, unsigned char* buffer); +}; + +class Interpreter { + protected: + char buffer[1024]; + public: + Interpreter () {} + virtual std::string toString (Tag* t) { return ""; } + virtual void fromString (Tag* t, const std::string& value) {} +}; + +class StdInterpreter : public Interpreter { + public: + StdInterpreter () {} + virtual std::string toString (Tag* t) { + t->toString (buffer); + std::string s(buffer); + std::string::size_type p1 = s.find_first_not_of(' '); + if( p1 == std::string::npos ) + return s; + else + return s.substr(p1, s.find_last_not_of(' ')-p1+1); + } + virtual void fromString (Tag* t, const std::string& value) { + if (t->getType()==SHORT || t->getType()==LONG) + t->fromInt (atoi(value.c_str())); + else + t->fromString (value.c_str()); + } +}; +extern StdInterpreter stdInterpreter; +class ChoiceInterpreter : public Interpreter { + protected: + std::map choices; + public: + ChoiceInterpreter () {}; + virtual std::string toString (Tag* t) { + std::map::iterator r = choices.find (t->toInt()); + if (r!=choices.end()) + return r->second; + else { + t->toString (buffer); + return std::string (buffer); + } + } +}; + +inline unsigned short sget2 (unsigned char *s, ByteOrder order); +inline int sget4 (unsigned char *s, ByteOrder order); +inline unsigned short get2 (FILE* f, ByteOrder order); +inline int get4 (FILE* f, ByteOrder order); +inline void sset2 (unsigned short v, unsigned char *s, ByteOrder order); +inline void sset4 (int v, unsigned char *s, ByteOrder order); +inline float int_to_float (int i); +inline short int int2_to_signed (short unsigned int i); bool extractLensInfo(std::string &fullname,double &minFocal, double &maxFocal, double &maxApertureAtMinFocal, double &maxApertureAtMaxFocal); extern const TagAttrib exifAttribs[]; @@ -245,5 +245,5 @@ extern const TagAttrib fujiAttribs[]; extern const TagAttrib minoltaAttribs[]; extern const TagAttrib sonyAttribs[]; extern const TagAttrib olympusAttribs[]; -}; -#endif +}; +#endif diff --git a/rtexif/sonyminoltaattribs.cc b/rtexif/sonyminoltaattribs.cc index 767e49996..a49515020 100644 --- a/rtexif/sonyminoltaattribs.cc +++ b/rtexif/sonyminoltaattribs.cc @@ -1,616 +1,616 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _SONYMINOLTAATTRIBS_ -#define _SONYMINOLTAATTRIBS_ - -#include -#include -#include -#include -#include -#include - -#undef ABS -#define ABS(a) (((a) < 0) ? -(a) : (a)) - -namespace rtexif { - -class SAOnOffInterpreter : public ChoiceInterpreter { - public: - SAOnOffInterpreter () { - choices[0] = "Off"; - choices[1] = "On"; - choices[5] = "On"; - } -}; -SAOnOffInterpreter saOnOffInterpreter; - -class SASceneModeInterpreter : public ChoiceInterpreter { - public: - SASceneModeInterpreter () { - choices[0] = "Normal (P,A,S or M)"; - choices[1] = "Portrait"; - choices[2] = "Text"; - choices[3] = "Night Scene"; - choices[4] = "Sunset"; - choices[5] = "Sports"; - choices[6] = "Landscape"; - choices[8] = "Macro"; - choices[8] = "Super Macro"; - choices[16] = "Auto"; - choices[17] = "Night Portrait"; - } -}; -SASceneModeInterpreter saSceneModeInterpreter; - -class SAZoneMatchingInterpreter : public ChoiceInterpreter { - public: - SAZoneMatchingInterpreter () { - choices[0] = "ISO Setting Used"; - choices[1] = "High Key"; - choices[2] = "Low Key"; - } -}; -SAZoneMatchingInterpreter saZoneMatchingInterpreter; - -class SADynamicRangeOptimizerInterpreter : public ChoiceInterpreter { - public: - SADynamicRangeOptimizerInterpreter () { - choices[0] = "Off"; - choices[1] = "Standard"; - choices[2] = "Advanced"; - choices[3] = "Auto"; - choices[8] = "Advanced Lv1"; - choices[9] = "Advanced Lv2"; - choices[10] = "Advanced Lv3"; - choices[11] = "Advanced Lv4"; - choices[12] = "Advanced Lv5"; - } -}; -SADynamicRangeOptimizerInterpreter saDynamicRangeOptimizerInterpreter; - -class SAColorModeInterpreter : public ChoiceInterpreter { - public: - SAColorModeInterpreter () { - choices[0] = "Standard"; - choices[1] = "Vivid"; - choices[2] = "Portrait"; - choices[3] = "Landscape"; - choices[4] = "Sunset"; - choices[5] = "Night Scene"; - choices[6] = "B&W"; - choices[7] = "Adobe RGB"; - choices[12] = "Neutral"; - choices[100]= "Neutral"; - choices[101]= "Clear"; - choices[102]= "Deep"; - choices[103]= "Light"; - choices[104]= "Night View"; - choices[105]= "Autumn Leaves"; - } -}; -SAColorModeInterpreter saColorModeInterpreter; - -class SAExposureModeInterpreter : public ChoiceInterpreter { - public: - SAExposureModeInterpreter () { - choices[0] = "Auto"; - choices[5] = "Landscape"; - choices[6] = "Program"; - choices[7] = "Aperture Priority"; - choices[8] = "Shutter Priority"; - choices[9] = "Night Scene"; - choices[15] = "Manual"; - choices[34] = "Panorama"; - choices[35] = "Handheld Twilight"; - choices[36] = "Anti Motion Blur"; - } -}; -SAExposureModeInterpreter saExposureModeInterpreter; - -class SAQualityInterpreter : public ChoiceInterpreter { - public: - SAQualityInterpreter () { - choices[0] = "Normal"; - choices[1] = "Fine"; - } -}; -SAQualityInterpreter saQualityInterpreter; - -class SAAntiBlurInterpreter : public ChoiceInterpreter { - public: - SAAntiBlurInterpreter () { - choices[0] = "Off"; - choices[1] = "On (Continuous)"; - choices[2] = "On (Shooting)"; - choices[65535] = "n/a"; - } -}; -SAAntiBlurInterpreter saAntiBlurInterpreter; - -class SALensIDInterpreter : public Interpreter { - typedef std::multimap container_t; - typedef std::pair p_t; - protected: - container_t choices; - public: - SALensIDInterpreter () { - choices.insert(p_t(0, "Minolta AF 28-85mm f/3.5-4.5")); - choices.insert(p_t(1, "Minolta AF 80-200mm f/2.8 HS-APO G")); - choices.insert(p_t(2, "Minolta AF 28-70mm f/2.8 G")); - choices.insert(p_t(3, "Minolta AF 28-80mm f/4-5.6")); - choices.insert(p_t(5, "Minolta AF 35-70mm f/3.5-4.5")); - choices.insert(p_t(6, "Minolta AF 24-85mm f/3.5-4.5 [New]")); - choices.insert(p_t(7, "Minolta AF 100-300mm f/4.5-5.6 APO [New]")); - choices.insert(p_t(7, "Sigma AF 100-300mm f/4 EX DG IF")); - choices.insert(p_t(8, "Minolta AF 70-210mm f/4.5-5.6")); - choices.insert(p_t(9, "Minolta AF 50mm f/3.5 Macro")); - choices.insert(p_t(10, "Minolta AF 28-105mm f/3.5-4.5 [New]")); - choices.insert(p_t(11, "Minolta AF 300mm f/4 HS-APO G")); - choices.insert(p_t(12, "Minolta AF 100mm f/2.8 Soft Focus")); - choices.insert(p_t(13, "Minolta AF 75-300mm f/4.5-5.6")); - choices.insert(p_t(14, "Minolta AF 100-400mm f/4.5-6.7 APO")); - choices.insert(p_t(15, "Minolta AF 400mm f/4.5 HS-APO G")); - choices.insert(p_t(16, "Minolta AF 17-35mm f/3.5 G")); - choices.insert(p_t(17, "Minolta AF 20-35mm f/3.5-4.5")); - choices.insert(p_t(18, "Minolta AF 28-80mm f/3.5-5.6 II")); - choices.insert(p_t(19, "Minolta AF 35mm f/1.4")); - choices.insert(p_t(20, "Minolta/Sony STF 135mm F2.8 [T4.5]")); - choices.insert(p_t(22, "Minolta AF 35-80mm f/4-5.6")); - choices.insert(p_t(23, "Minolta AF 200mm f/4 G APO Macro")); - choices.insert(p_t(24, "Minolta/Sony AF 24-105mm f/3.5-4.5 (D)")); - choices.insert(p_t(24, "Sigma 18-50mm f/2.8 EX DC Macro")); - choices.insert(p_t(24, "Sigma 17-70mm f/2.8-4.5 DC Macro")); - choices.insert(p_t(24, "Sigma 20-40mm f/2.8 EX DG Aspherical IF")); - choices.insert(p_t(24, "Sigma 18-200mm f/3.5-6.3 DC")); - choices.insert(p_t(24, "Tamron SP AF 28-75mm f/2.8 XR Di (IF) Macro")); - choices.insert(p_t(25, "Minolta AF 100-300mm f/4.5-5.6 APO D")); - choices.insert(p_t(25, "Sigma 100-300mm f/4 EX DG APO")); - choices.insert(p_t(25, "Sigma 70mm f/2.8 EX DG Macro")); - choices.insert(p_t(25, "Sigma 20mm f/1.8 EX DG Aspherical RF")); - choices.insert(p_t(25, "Sigma 30mm f/1.4 EX DG")); - choices.insert(p_t(27, "Minolta AF 85mm f71.4 G")); - choices.insert(p_t(28, "Minolta AF 100mm f/2.8 Macro (D)")); - choices.insert(p_t(28, "Tamron SP AF 90mm f/2.8 Di Macro ")); - choices.insert(p_t(29, "Minolta AF 75-300mm f/4.5-5.6 (D)")); - choices.insert(p_t(30, "Minolta AF 28-80mm f/3.5-5.6 (D)")); - choices.insert(p_t(30, "Sigma 10-20mm f/4-5.6 EX DC")); - choices.insert(p_t(30, "Sigma 12-24mm f/4.5-5.6 EX DG")); - choices.insert(p_t(30, "Sigma 28-70mm f/2.8 EX DG")); - choices.insert(p_t(30, "Sigma 55-200mm f/4-5.6 DC")); - choices.insert(p_t(31, "Minolta/Sony AF 50mm f/2.8 Macro (D)")); - choices.insert(p_t(32, "Minolta AF 300mm f/2.8 G")); - choices.insert(p_t(33, "Minolta/Sony AF 70-200mm f/2.8 G (D) SSM")); - choices.insert(p_t(35, "Minolta AF 85mm f/1.4 G (D) Limited")); - choices.insert(p_t(36, "Minolta AF 28-100mm f/3.5-5.6 (D)")); - choices.insert(p_t(38, "Minolta AF 17-35mm f/2.8-4 (D)")); - choices.insert(p_t(39, "Minolta AF 28-75mm f/2.8 (D)")); - choices.insert(p_t(40, "Minolta/Sony AF DT 18-70mm f/3.5-5.6 (D)")); - choices.insert(p_t(41, "Minolta/Sony AF DT 11-18mm f/4.5-5.6 (D)")); - choices.insert(p_t(42, "Minolta AF DT 18-200mm f/3.5-6.3 (D)")); - choices.insert(p_t(43, "Minolta AF 35mm f/1.4 G")); - choices.insert(p_t(44, "Sony AF 50mm f/1.4")); - choices.insert(p_t(45, "Carl Zeiss Planar T* 85mm f/1.4 ZA")); - choices.insert(p_t(46, "Carl Zeiss Vario-Sonnar T* DT 16-80mm f/3.5-4.5 ZA")); - choices.insert(p_t(47, "Carl Zeiss Sonnar T* 135mm F1.8 ZA")); - choices.insert(p_t(48, "Carl Zeiss Vario-Sonnar T* 24-70mm f/2.8 ZA SSM")); - choices.insert(p_t(49, "Sony AF DT 55-200mm f/4-5.6")); - choices.insert(p_t(50, "Sony AF DT 18-250mm f/3.5-6.3")); - choices.insert(p_t(51, "Sony AF DT 16-105mm f/3.5-5.6 or 55-200mm f/4-5.5")); - choices.insert(p_t(52, "Sony AF 70-300mm f/4.5-5.6 G SSM")); - choices.insert(p_t(53, "Sony AF 70-400mm f/4.5-5.6 G SSM")); - choices.insert(p_t(54, "Carl Zeiss Vario-Sonnar T* 16-35mm f/2.8 ZA SSM")); - choices.insert(p_t(55, "Sony DT 18-55mm f/3.5-5.6 SAM")); - choices.insert(p_t(56, "Sony AF DT 55-200mm f/4-5.6 SAM")); - choices.insert(p_t(57, "Sony AF DT 50mm f/1.8 SAM")); - choices.insert(p_t(58, "Sony AF DT 30mm f/2.8 SAM Macro")); - choices.insert(p_t(59, "Sony AF 28-75mm f/2.8 SAM")); - choices.insert(p_t(128, "Tamron AF 18-200mm f/3.5-6.3 XR Di II LD Aspherical (IF)")); - choices.insert(p_t(128, "Tamron AF 28-300mm f/3.5-6.3")); - choices.insert(p_t(128, "Tamron AF 28-200mm f/3.8-5.6 XR Di Aspherical (IF) Macro ")); - choices.insert(p_t(128, "Tamron SP AF 17-35mm f/2.8-4 Di LD Aspherical IF")); - choices.insert(p_t(128, "Sigma 10-20mm f/3.5 EX DC")); - choices.insert(p_t(128, "Sigma 70-200mm f/2.8 II EX DG APO Macro")); - choices.insert(p_t(129, "Tamron 200-400mm f/5.6 LD (IF)")); - choices.insert(p_t(129, "Tamron 70-300mm f/4-5.6 LD")); - choices.insert(p_t(135, "Vivitar 28-210mm f/3.5-5.6")); - choices.insert(p_t(136, "Tokina EMZ M100 AF 100mm f/3.5")); - choices.insert(p_t(137, "Cosina 70-210mm f/2.8-4 AF")); - choices.insert(p_t(138, "Soligor 19-35mm f/3.5-4.5")); - choices.insert(p_t(142, "Voigtlander 70-300mm f/4.5-5.6")); - choices.insert(p_t(146, "Voigtlander Macro APO-Lanthar 125mm f/2.5 SL")); - choices.insert(p_t(255, "Tamron SP AF 17-50mm f/2.8 XR Di II LD Aspherical")); - choices.insert(p_t(255, "Tamron AF 18-250mm f/3.5-6.3 XR Di II LD")); - choices.insert(p_t(255, "Tamron AF 55-200mm f/4-5.6 Di II")); - choices.insert(p_t(255, "Tamron AF 70-300mm f/4-5.6 Di LD Macro 1:2")); - choices.insert(p_t(255, "Tamron SP AF 200-500mm f/5.0-6.3 Di LD (IF)")); - choices.insert(p_t(255, "Tamron SP AF 10-24mm f/3.5-4.5 Di II LD Aspherical (IF)")); - choices.insert(p_t(255, "Tamron SP AF 70-200mm f/2.8 Di LD Macro (IF)")); - choices.insert(p_t(255, "Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical (IF)")); - choices.insert(p_t(2550, "Minolta AF 50mm f/1.7")); - choices.insert(p_t(2551, "Minolta AF 35-70mm f/4")); - choices.insert(p_t(2551, "Sigma UC AF 28-70mm f/3.5-4.5")); - choices.insert(p_t(2551, "Sigma AF 28-70mm f/2.8")); - choices.insert(p_t(2551, "Sigma M-AF 70-200mm f/2.8 EX Aspherical")); - choices.insert(p_t(2551, "Quantaray M-AF 35-80mm f/4-5.6")); - choices.insert(p_t(2552, "Minolta AF 28-85mm f/3.5-4.5 [New]")); - choices.insert(p_t(2552, "Tokina 19-35mm f/3.5-4.5")); - choices.insert(p_t(2552, "Tokina 28-70mm f/2.8 AT-X")); - choices.insert(p_t(2552, "Tokina 80-400mm f/4.5-5.6 AT-X AF II 840")); - choices.insert(p_t(2552, "Tokina AF PRO 28-80mm f/2.8 AT-X 280")); - choices.insert(p_t(2552, "Tokina AT-X PRO II AF 28-70mm f/2.6-2.8 270")); - choices.insert(p_t(2552, "Tamron AF 19-35mm f/3.5-4.5")); - choices.insert(p_t(2552, "Angenieux AF 28-70mm f/2.6")); - choices.insert(p_t(2553, "Minolta AF 28-135mm f/4-4.5")); - choices.insert(p_t(2553, "Sigma ZOOM-alpha 35-135mm f/3.5-4.5")); - choices.insert(p_t(2553, "Sigma 28-105mm f/2.8-4 Aspherical")); - choices.insert(p_t(2554, "Minolta AF 35-105mm f/3.5-4.5")); - choices.insert(p_t(2555, "Minolta AF 70-210mm f/4 Macro")); - choices.insert(p_t(2555, "Sigma 70-210mm f/4-5.6 APO")); - choices.insert(p_t(2555, "Sigma M-AF 70-200mm f/2.8 EX APO")); - choices.insert(p_t(2555, "Sigma 75-200mm f/2.8-3.5")); - choices.insert(p_t(2556, "Minolta AF 135mm f/2.8")); - choices.insert(p_t(2557, "Minolta AF 28mm f/2.8")); - choices.insert(p_t(2558, "Minolta AF 24-50mm f/4")); - choices.insert(p_t(2560, "Minolta AF 100-200mm f/4.5")); - choices.insert(p_t(2561, "Minolta AF 75-300mm f/4.5-5.6")); - choices.insert(p_t(2561, "Sigma 70-300mm f/4-5.6 DL Macro")); - choices.insert(p_t(2561, "Sigma 300mm f/4 APO Macro")); - choices.insert(p_t(2561, "Sigma AF 500mm f/4.5 APO")); - choices.insert(p_t(2561, "Sigma AF 170-500mm f/5-6.3 APO Aspherical")); - choices.insert(p_t(2561, "Tokina AT-X AF 300mm f/4")); - choices.insert(p_t(2561, "Tokina AT-X AF 400mm f/5.6 SD")); - choices.insert(p_t(2561, "Tokina AF 730 II 75-300mm f/4.5-5.6")); - choices.insert(p_t(2562, "Minolta/Sony AF 50mm f/1.4 [New]")); - choices.insert(p_t(2563, "Minolta AF 300mm f/2.8 G")); - choices.insert(p_t(2563, "Sigma AF 50-500mm f/4-6.3 EX DG APO")); - choices.insert(p_t(2563, "Sigma AF 170-500mm f/5-6.3 APO Aspherical")); - choices.insert(p_t(2563, "Sigma AF 500mm f/4.5 EX DG APO")); - choices.insert(p_t(2563, "Sigma 400mm f/5.6 APO")); - choices.insert(p_t(2564, "Minolta AF 50mm f/2.8 Macro")); - choices.insert(p_t(2564, "Sigma 50mm f/2.8 EX Macro")); - choices.insert(p_t(2565, "Minolta AF 600mm f/4")); - choices.insert(p_t(2566, "Minolta AF 24mm f/2.8")); - choices.insert(p_t(2572, "Minolta/Sony AF 500mm f/8 Reflex")); - choices.insert(p_t(2578, "Minolta AF 16mm f/2.8 Fisheye")); - choices.insert(p_t(2578, "Sigma 8mm f/4 EX DG Fisheye")); - choices.insert(p_t(2578, "Sigma 14mm f/3.5")); - choices.insert(p_t(2578, "Sigma 15mm f/2.8 Fisheye")); - choices.insert(p_t(2579, "Minolta AF 20mm f/2.8")); - choices.insert(p_t(2581, "Minolta/Sony AF 100mm f/2.8 Macro")); - choices.insert(p_t(2581, "Sigma AF 90mm f/2.8 Macro")); - choices.insert(p_t(2581, "Sigma AF 105mm f/2.8 EX DG Macro")); - choices.insert(p_t(2581, "Sigma 180mm f/5.6 Macro")); - choices.insert(p_t(2581, "Tamron AF 90mm f/2.8 Macro")); - choices.insert(p_t(2585, "Minolta AF 35-105mm f/3.5-4.5 New")); - choices.insert(p_t(2585, "Tamron AF 24-135mm f/3.5-5.6")); - choices.insert(p_t(2588, "Minolta AF 70-210mm f/3.5-4.5")); - choices.insert(p_t(2589, "Minolta AF 80-200 f/2.8 APO")); - choices.insert(p_t(2589, "Tokina 80-200mm f/2.8")); - choices.insert(p_t(2591, "Minolta AF 35mm f/1.4")); - choices.insert(p_t(2592, "Minolta AF 85mm f/1.4 G (D)")); - choices.insert(p_t(2593, "Minolta AF 200mm f/2.8 G APO")); - choices.insert(p_t(2594, "Minolta AF 3x-1x f/1.7-2.8 Macro")); - choices.insert(p_t(2596, "Minolta AF 28mm f/2")); - choices.insert(p_t(2597, "Minolta AF 35mm f/2")); - choices.insert(p_t(2598, "Minolta AF 100mm f/2")); - choices.insert(p_t(2604, "Minolta AF 80-200mm f/4.5-5.6")); - choices.insert(p_t(2605, "Minolta AF 35-80mm f/4-5.6")); - choices.insert(p_t(2606, "Minolta AF 100-300mm f/4.5-5.6 (D)")); - choices.insert(p_t(2607, "Minolta AF 35-80mm f/4-5.6")); - choices.insert(p_t(2608, "Minolta AF 300mm f/2.8 G")); - choices.insert(p_t(2609, "Minolta AF 600mm f/4 HS-APO G")); - choices.insert(p_t(2612, "Minolta AF 200mm f/2.8 G HS-APO")); - choices.insert(p_t(2613, "Minolta AF 50mm f/1.7 New")); - choices.insert(p_t(2615, "Minolta AF 28-105mm f/3.5-4.5 Power Zoom")); - choices.insert(p_t(2616, "Minolta AF 35-200mm f/4.5-5.6 Power Zoom")); - choices.insert(p_t(2618, "Minolta AF 28-80mm f/4-5.6 Power Zoom")); - choices.insert(p_t(2619, "Minolta AF 80-200mm f/4.5-5.6 Power Zoom")); - choices.insert(p_t(2620, "Minolta AF 28-70mm f/2.8 G")); - choices.insert(p_t(2621, "Minolta AF 100-300mm f/4.5-5.6 Power Zoom")); - choices.insert(p_t(2624, "Minolta AF 35-80mm f/4-5.6 Power Zoom")); - choices.insert(p_t(2628, "Minolta AF 80-200mm f/2.8 G")); - choices.insert(p_t(2629, "Minolta AF 85mm f/1.4 New")); - choices.insert(p_t(2631, "Minolta/Sony AF 100-300mm f/4.5-5.6 APO")); - choices.insert(p_t(2632, "Minolta AF 24-50mm f/4 New")); - choices.insert(p_t(2638, "Minolta AF 50mm f/2.8 Macro New")); - choices.insert(p_t(2639, "Minolta AF 100mm f/2.8 Macro")); - choices.insert(p_t(2641, "Minolta AF 20mm f/2.8 New")); - choices.insert(p_t(2642, "Minolta AF 24mm f/2.8 New")); - choices.insert(p_t(2644, "Minolta AF 100-400mm f/4.5-6.7 APO")); - choices.insert(p_t(2662, "Minolta AF 50mm f/1.4 New")); - choices.insert(p_t(2667, "Minolta AF 35mm f/2 New")); - choices.insert(p_t(2668, "Minolta AF 28mm f/2 New")); - choices.insert(p_t(2672, "Minolta AF 24-105mm f/3.5-4.5 (D)")); - choices.insert(p_t(4574, "Minolta AF 200mm f/2.8 G x2")); - choices.insert(p_t(4575, "1.4 x Teleconverter")); - choices.insert(p_t(4585, "Tamron SP AF 300mm f/2.8 LD IF")); - choices.insert(p_t(6553, "Arax MC 35mm f/2.8 Tilt+Shift")); - choices.insert(p_t(6553, "Arax MC 80mm f/2.8 Tilt+Shift")); - choices.insert(p_t(6553, "Zenitar MF 16mm f/2.8 Fisheye M42")); - choices.insert(p_t(6553, "Samyang 500mm Mirror f/8")); - choices.insert(p_t(6553, "Pentacon Auto 135mm f/2.8")); - choices.insert(p_t(6553, "Pentacon Auto 29mm f/2.8")); - choices.insert(p_t(6553, "Helios 44-2 58mm f/2")); - choices.insert(p_t(25501, "Minolta AF 50mm f/1.7")); - choices.insert(p_t(25511, "Minolta AF 35-70mm f/4")); - choices.insert(p_t(25511, "Sigma UC AF 28-70mm f/3.5-4.5")); - choices.insert(p_t(25511, "Sigma AF 28-70mm f/2.8")); - choices.insert(p_t(25511, "Sigma M-AF 70-200mm f/2.8 EX Aspherical")); - choices.insert(p_t(25511, "Quantaray M-AF 35-80mm f/4-5.6")); - choices.insert(p_t(25521, "Minolta AF 28-85mm f/3.5-4.5 [New]")); - choices.insert(p_t(25521, "Tokina 19-35mm f/3.5-4.5")); - choices.insert(p_t(25521, "Tokina 28-70mm f/2.8 AT-X")); - choices.insert(p_t(25521, "Tokina 80-400mm f/4.5-5.6 AT-X AF II 840")); - choices.insert(p_t(25521, "Tokina AF PRO 28-80mm f/2.8 AT-X 280")); - choices.insert(p_t(25521, "Tokina AT-X PRO II AF 28-70mm f/2.6-2.8 270")); - choices.insert(p_t(25521, "Tamron AF 19-35mm f/3.5-4.5")); - choices.insert(p_t(25521, "Angenieux AF 28-70mm f/2.6")); - choices.insert(p_t(25531, "Minolta AF 28-135mm f/4-4.5")); - choices.insert(p_t(25531, "Sigma ZOOM-alpha 35-135mm f/3.5-4.5")); - choices.insert(p_t(25531, "Sigma 28-105mm f/2.8-4 Aspherical")); - choices.insert(p_t(25541, "Minolta AF 35-105mm f/3.5-4.5")); - choices.insert(p_t(25551, "Minolta AF 70-210mm f/4 Macro")); - choices.insert(p_t(25551, "Sigma 70-210mm f/4-5.6 APO")); - choices.insert(p_t(25551, "Sigma M-AF 70-200mm f/2.8 EX APO")); - choices.insert(p_t(25551, "Sigma 75-200mm f/2.8-3.5")); - choices.insert(p_t(25561, "Minolta AF 135mm f/2.8")); - choices.insert(p_t(25571, "Minolta AF 28mm f/2.8")); - choices.insert(p_t(25581, "Minolta AF 24-50mm f/4")); - choices.insert(p_t(25601, "Minolta AF 100-200mm f/4.5")); - choices.insert(p_t(25611, "Minolta AF 75-300mm f/4.5-5.6")); - choices.insert(p_t(25611, "Sigma 70-300mm f/4-5.6 DL Macro")); - choices.insert(p_t(25611, "Sigma 300mm f/4 APO Macro")); - choices.insert(p_t(25611, "Sigma AF 500mm f/4.5 APO")); - choices.insert(p_t(25611, "Sigma AF 170-500mm f/5-6.3 APO Aspherical")); - choices.insert(p_t(25611, "Tokina AT-X AF 300mm f/4")); - choices.insert(p_t(25611, "Tokina AT-X AF 400mm f/5.6 SD")); - choices.insert(p_t(25611, "Tokina AF 730 II 75-300mm f/4.5-5.6")); - choices.insert(p_t(25621, "Minolta AF 50mm f/1.4")); - choices.insert(p_t(25631, "Minolta AF 300mm f/2.8 G")); - choices.insert(p_t(25631, "Sigma AF 50-500mm f/4-6.3 EX DG APO")); - choices.insert(p_t(25631, "Sigma AF 170-500mm f/5-6.3 APO Aspherical")); - choices.insert(p_t(25631, "Sigma AF 500mm f/4.5 EX DG APO")); - choices.insert(p_t(25631, "Sigma 400mm f/5.6 APO")); - choices.insert(p_t(25641, "Minolta AF 50mm f/2.8 Macro")); - choices.insert(p_t(25641, "Sigma AF 50mm f/2.8 Macro")); - choices.insert(p_t(25651, "Minolta AF 600mm f/4")); - choices.insert(p_t(25661, "Minolta AF 24mm f/2.8")); - choices.insert(p_t(25721, "Minolta/Sony AF 500mm f/8 Reflex")); - choices.insert(p_t(25781, "Minolta AF 16mm f/2.8 Fisheye")); - choices.insert(p_t(25781, "Sigma 8mm f/4 EX DG Fisheye")); - choices.insert(p_t(25781, "Sigma 14mm f/3.5")); - choices.insert(p_t(25781, "Sigma 15mm f/2.8 Fisheye")); - choices.insert(p_t(25791, "Minolta AF 20mm f/2.8")); - choices.insert(p_t(25811, "Minolta/Sony AF 100mm f/2.8 Macro New")); - choices.insert(p_t(25811, "Sigma AF 90mm f/2.8 Macro")); - choices.insert(p_t(25811, "Sigma AF 105mm f/2.8 EX DG Macro")); - choices.insert(p_t(25811, "Sigma 180mm f/5.6 Macro")); - choices.insert(p_t(25811, "Tamron 90mm f/2.8 Macro")); - choices.insert(p_t(25851, "Beroflex 35-135mm f/3.5-4.5")); - choices.insert(p_t(25858, "Minolta AF 35-105mm f/3.5-4.5 New")); - choices.insert(p_t(25858, "Tamron 24-135mm f/3.5-5.6")); - choices.insert(p_t(25881, "Minolta AF 70-210mm f/3.5-4.5")); - choices.insert(p_t(25891, "Minolta AF 80-200 f/2.8 APO")); - choices.insert(p_t(25891, "Tokina 80-200mm f/2.8")); - choices.insert(p_t(25911, "Minolta AF 35mm f/1.4")); - choices.insert(p_t(25921, "Minolta AF 85mm f/1.4 G (D)")); - choices.insert(p_t(25931, "Minolta AF 200mm f/2.8 G APO")); - choices.insert(p_t(25941, "Minolta AF 3x-1x f/1.7-2.8 Macro")); - choices.insert(p_t(25961, "Minolta AF 28mm f/2")); - choices.insert(p_t(25971, "Minolta AF 35mm f/2")); - choices.insert(p_t(25981, "Minolta AF 100mm f/2")); - choices.insert(p_t(26041, "Minolta AF 80-200mm f/4.5-5.6")); - choices.insert(p_t(26051, "Minolta AF 35-80mm f/4-5.6")); - choices.insert(p_t(26061, "Minolta AF 100-300mm f/4.5-5.6 (D)")); - choices.insert(p_t(26071, "Minolta AF 35-80mm f/4-5.6")); - choices.insert(p_t(26081, "Minolta AF 300mm f/2.8 HS-APO G")); - choices.insert(p_t(26091, "Minolta AF 600mm f/4 HS-APO G")); - choices.insert(p_t(26121, "Minolta AF 200mm f/2.8 HS-APO G")); - choices.insert(p_t(26131, "Minolta AF 50mm f/1.7 New")); - choices.insert(p_t(26151, "Minolta AF 28-105mm f/3.5-4.5 Power Zoom")); - choices.insert(p_t(26161, "Minolta AF 35-200mm f/4.5-5.6 Power Zoom")); - choices.insert(p_t(26181, "Minolta AF 28-80mm f/4-5.6 Power Zoom")); - choices.insert(p_t(26191, "Minolta AF 80-200mm f/4.5-5.6 Power Zoom")); - choices.insert(p_t(26201, "Minolta AF 28-70mm f/2.8 G")); - choices.insert(p_t(26211, "Minolta AF 100-300mm f/4.5-5.6 Power Zoom")); - choices.insert(p_t(26241, "Minolta AF 35-80mm f/4-5.6 Power Zoom")); - choices.insert(p_t(26281, "Minolta AF 80-200mm f/2.8 G")); - choices.insert(p_t(26291, "Minolta AF 85mm f/1.4 New")); - choices.insert(p_t(26311, "Minolta/Sony AF 100-300mm f/4.5-5.6 APO")); - choices.insert(p_t(26321, "Minolta AF 24-50mm f/4 New")); - choices.insert(p_t(26381, "Minolta AF 50mm f/2.8 Macro New")); - choices.insert(p_t(26391, "Minolta AF 100mm f/2.8 Macro")); - choices.insert(p_t(26411, "Minolta AF 20mm f/2.8 New")); - choices.insert(p_t(26421, "Minolta AF 24mm f/2.8 New")); - choices.insert(p_t(26441, "Minolta AF 100-400mm f/4.5-6.7 APO")); - choices.insert(p_t(26621, "Minolta AF 50mm f/1.4 New")); - choices.insert(p_t(26671, "Minolta AF 35mm f/2 New")); - choices.insert(p_t(26681, "Minolta AF 28mm f/2 New")); - choices.insert(p_t(26721, "Minolta AF 24-105mm f/3.5-4.5 (D)")); - choices.insert(p_t(45671, "Tokina 70-210mm f/4-5.6")); - choices.insert(p_t(45741, "Minolta AF 200mm f/2.8 G x2")); - choices.insert(p_t(45851, "Tamron SP AF 300mm f/2.8 LD IF")); - choices.insert(p_t(45871, "Tamron SP AF 70-210mm f/2.8 LD")); - choices.insert(p_t(65535, "Arax MC 35mm f/2.8 Tilt+Shift")); - choices.insert(p_t(65535, "Arax MC 80mm f/2.8 Tilt+Shift")); - choices.insert(p_t(65535, "Zenitar MF 16mm f/2.8 Fisheye M42")); - choices.insert(p_t(65535, "Samyang 500mm f/8 Mirror")); - choices.insert(p_t(65535, "Pentacon Auto 135mm f/2.8")); - choices.insert(p_t(65535, "Pentacon Auto 29mm f/2.8")); - choices.insert(p_t(65535, "Helios 44-2 58mm f/2")); - } - - - virtual std::string toString (Tag* t) - { - int lensID = t->toInt(); - size_t nFound = choices.count( lensID ); - container_t::iterator r; - switch( nFound ) - { - case 0: // lens Unknown - t->toString (buffer); - return std::string (buffer); - case 1: // lens found - r = choices.find ( lensID ); - return r->second; - default: - // More than one hit: we must guess - break; - } - - double maxApertureAtFocal = pow(2.0, t->getParent()->getParent()->getTag(0x9205)->toDouble()/2.0); // MaxApertureValue at focal Length - double focalLength = t->getParent()->getParent()->getTag(0x920A)->toDouble(); // Focal Length - double deltaMin = 1000.; - - /* Choose the best match: thanks to exiftool by Phil Harvey - * first throws for "out of focal range" and lower or upper aperture of the lens compared to MaxApertureAtFocal - * if the lens is not constant aperture, calculate aprox. aperture of the lens at focalLength - * and compare with actual aperture. - */ - std::string bestMatch("Unknown"); - std::ostringstream candidates; - for ( r = choices.lower_bound( lensID ); r != choices.upper_bound(lensID); r++ ){ - double a1,a2,f1,f2,lensAperture,dif; - - if( !extractLensInfo( r->second ,f1,f2,a1,a2) ) - continue; - if( f1 == 0. || a1 == 0.) - continue; - - if( focalLength < f1 - .5 || focalLength > f2 + 0.5 ) - continue; - if( maxApertureAtFocal < a1 - 0.15 || maxApertureAtFocal > a2 +0.15) - continue; - - if( a1 == a2 || f1 == f2) - lensAperture = a1; - else - lensAperture = exp( log(a1)+(log(a2)-log(a1))/(log(f2)-log(f1))*(log(focalLength)-log(f1)) ); - - dif = ABS(lensAperture - maxApertureAtFocal); - if( dif < deltaMin ){ - deltaMin = dif; - bestMatch = r->second; - } - if( dif < 0.15){ - if( candidates.tellp() ) - candidates << "\n or " << r->second; - else - candidates << r->second; - } - } - if( !candidates.tellp() ) - return bestMatch; - else - return candidates.str(); - } -}; -SALensIDInterpreter saLensIDInterpreter; - -class MATeleconverterInterpreter : public ChoiceInterpreter { - public: - MATeleconverterInterpreter () { - choices[0] = "None "; - choices[0x48] = "Minolta AF 2x APO (D)"; - choices[0x50] = "Minolta AF 2x APO II"; - choices[0x88] = "Minolta AF 1.4x APO (D)"; - choices[0x90] = "Minolta AF 1.4x APO II"; - } -}; -MATeleconverterInterpreter maTeleconverterInterpreter; - -class MAQualityInterpreter : public ChoiceInterpreter { - public: - MAQualityInterpreter () { - choices[0] = "Raw"; - choices[1] = "Super Fine"; - choices[2] = "Fine"; - choices[3] = "Standard"; - choices[4] = "Economy"; - choices[5] = "Extra fine"; - choices[6] = "RAW + JPEG"; - choices[7] = "cRAW"; - choices[8] = "cRAW + JPEG"; - } -}; -MAQualityInterpreter maQualityInterpreter; - -class MAImageSizeInterpreter : public ChoiceInterpreter { - public: - MAImageSizeInterpreter () { - choices[1] = "1600x1200"; - choices[2] = "1280x960"; - choices[3] = "640x480"; - choices[5] = "2560x1920"; - choices[6] = "2272x1704"; - choices[7] = "2048x1536"; - } -}; -MAImageSizeInterpreter maImageSizeInterpreter; - -const TagAttrib minoltaAttribs[] = { - 0, 1, 0, 0, 0x0000, "MakerNoteVersion", &stdInterpreter, - 0, 1, 0, 0, 0x0001, "MinoltaCameraSettingsOld", &stdInterpreter, - 0, 1, 0, 0, 0x0003, "MinoltaCameraSettings", &stdInterpreter, - 0, 1, 0, 0, 0x0004, "MinoltaCameraSettings7D", &stdInterpreter, - 0, 1, 0, 0, 0x0018, "ImageStabilization", &stdInterpreter, - 0, 1, 0, 0, 0x0040, "CompressedImageSize", &stdInterpreter, - 1, 1, 0, 0, 0x0081, "PreviewImage", &stdInterpreter, - 1, 1, 0, 0, 0x0088, "PreviewImageStart", &stdInterpreter, - 1, 1, 0, 0, 0x0089, "PreviewImageLength", &stdInterpreter, - 0, 1, 0, 0, 0x0100, "SceneMode", &saSceneModeInterpreter, - 0, 1, 0, 0, 0x0101, "ColorMode", &saColorModeInterpreter, - 0, 1, 0, 0, 0x0102, "MinoltaQuality", &maQualityInterpreter, - 0, 1, 0, 0, 0x0103, "MinoltaImageSize", &maImageSizeInterpreter, - 0, 1, 0, 0, 0x0104, "FlashExposureComp", &stdInterpreter, - 0, 1, 0, 0, 0x0105, "Teleconverter", &maTeleconverterInterpreter, - 0, 1, 0, 0, 0x0107, "ImageStabilization", &saOnOffInterpreter, - 0, 1, 0, 0, 0x010a, "ZoneMatching", &saZoneMatchingInterpreter, - 0, 1, 0, 0, 0x010b, "ColorTemperature", &stdInterpreter, - 0, 1, 0, 0, 0x010c, "LensID", &saLensIDInterpreter, - 0, 1, 0, 0, 0x0113, "ImageStabilization", &saOnOffInterpreter, - 0, 1, 0, 0, 0x0114, "MinoltaCameraSettings", &stdInterpreter, - 1, 1, 0, 0, 0x0e00, "PrintIM", &stdInterpreter, - 0, 1, 0, 0, 0x0f00, "MinoltaCameraSettings2", &stdInterpreter, - -1, 0, 0, 0, 0, "", NULL}; - -const TagAttrib sonyAttribs[] = { - 1, 1, 0, 0, 0x0e00, "PrintIM", &stdInterpreter, - 1, 1, 0, 0, 0x2001, "PreviewImage", &stdInterpreter, - 0, 1, 0, 0, 0xb020, "ColorReproduction", &stdInterpreter, - 0, 1, 0, 0, 0xb021, "ColorTemperature", &stdInterpreter, - 0, 1, 0, 0, 0xb023, "SceneMode", &saSceneModeInterpreter, - 0, 1, 0, 0, 0xb024, "ZoneMatching", &saZoneMatchingInterpreter, - 0, 1, 0, 0, 0xb025, "DynamicRangeOptimizer", &saDynamicRangeOptimizerInterpreter, - 0, 1, 0, 0, 0xb026, "ImageStabilization", &saOnOffInterpreter, - 0, 1, 0, 0, 0xb027, "LensID", &saLensIDInterpreter, - 0, 1, 0, minoltaAttribs, 0xb028, "MinoltaMakerNote", &stdInterpreter, - 0, 1, 0, 0, 0xb029, "ColorMode", &saColorModeInterpreter, - 0, 1, 0, 0, 0xb040, "Macro", &saOnOffInterpreter, - 0, 1, 0, 0, 0xb041, "ExposureMode", &saExposureModeInterpreter, - 0, 1, 0, 0, 0xb047, "Quality", &saQualityInterpreter, - 0, 1, 0, 0, 0xb04b, "AntiBlur", &saAntiBlurInterpreter, - 0, 1, 0, 0, 0xb04e, "LongExposureNoiseReduction", &saOnOffInterpreter, - -1, 0, 0, 0, 0, "", NULL}; - -}; - #endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _SONYMINOLTAATTRIBS_ +#define _SONYMINOLTAATTRIBS_ + +#include +#include +#include +#include +#include +#include + +#undef ABS +#define ABS(a) (((a) < 0) ? -(a) : (a)) + +namespace rtexif { + +class SAOnOffInterpreter : public ChoiceInterpreter { + public: + SAOnOffInterpreter () { + choices[0] = "Off"; + choices[1] = "On"; + choices[5] = "On"; + } +}; +SAOnOffInterpreter saOnOffInterpreter; + +class SASceneModeInterpreter : public ChoiceInterpreter { + public: + SASceneModeInterpreter () { + choices[0] = "Normal (P,A,S or M)"; + choices[1] = "Portrait"; + choices[2] = "Text"; + choices[3] = "Night Scene"; + choices[4] = "Sunset"; + choices[5] = "Sports"; + choices[6] = "Landscape"; + choices[8] = "Macro"; + choices[8] = "Super Macro"; + choices[16] = "Auto"; + choices[17] = "Night Portrait"; + } +}; +SASceneModeInterpreter saSceneModeInterpreter; + +class SAZoneMatchingInterpreter : public ChoiceInterpreter { + public: + SAZoneMatchingInterpreter () { + choices[0] = "ISO Setting Used"; + choices[1] = "High Key"; + choices[2] = "Low Key"; + } +}; +SAZoneMatchingInterpreter saZoneMatchingInterpreter; + +class SADynamicRangeOptimizerInterpreter : public ChoiceInterpreter { + public: + SADynamicRangeOptimizerInterpreter () { + choices[0] = "Off"; + choices[1] = "Standard"; + choices[2] = "Advanced"; + choices[3] = "Auto"; + choices[8] = "Advanced Lv1"; + choices[9] = "Advanced Lv2"; + choices[10] = "Advanced Lv3"; + choices[11] = "Advanced Lv4"; + choices[12] = "Advanced Lv5"; + } +}; +SADynamicRangeOptimizerInterpreter saDynamicRangeOptimizerInterpreter; + +class SAColorModeInterpreter : public ChoiceInterpreter { + public: + SAColorModeInterpreter () { + choices[0] = "Standard"; + choices[1] = "Vivid"; + choices[2] = "Portrait"; + choices[3] = "Landscape"; + choices[4] = "Sunset"; + choices[5] = "Night Scene"; + choices[6] = "B&W"; + choices[7] = "Adobe RGB"; + choices[12] = "Neutral"; + choices[100]= "Neutral"; + choices[101]= "Clear"; + choices[102]= "Deep"; + choices[103]= "Light"; + choices[104]= "Night View"; + choices[105]= "Autumn Leaves"; + } +}; +SAColorModeInterpreter saColorModeInterpreter; + +class SAExposureModeInterpreter : public ChoiceInterpreter { + public: + SAExposureModeInterpreter () { + choices[0] = "Auto"; + choices[5] = "Landscape"; + choices[6] = "Program"; + choices[7] = "Aperture Priority"; + choices[8] = "Shutter Priority"; + choices[9] = "Night Scene"; + choices[15] = "Manual"; + choices[34] = "Panorama"; + choices[35] = "Handheld Twilight"; + choices[36] = "Anti Motion Blur"; + } +}; +SAExposureModeInterpreter saExposureModeInterpreter; + +class SAQualityInterpreter : public ChoiceInterpreter { + public: + SAQualityInterpreter () { + choices[0] = "Normal"; + choices[1] = "Fine"; + } +}; +SAQualityInterpreter saQualityInterpreter; + +class SAAntiBlurInterpreter : public ChoiceInterpreter { + public: + SAAntiBlurInterpreter () { + choices[0] = "Off"; + choices[1] = "On (Continuous)"; + choices[2] = "On (Shooting)"; + choices[65535] = "n/a"; + } +}; +SAAntiBlurInterpreter saAntiBlurInterpreter; + +class SALensIDInterpreter : public Interpreter { + typedef std::multimap container_t; + typedef std::pair p_t; + protected: + container_t choices; + public: + SALensIDInterpreter () { + choices.insert(p_t(0, "Minolta AF 28-85mm f/3.5-4.5")); + choices.insert(p_t(1, "Minolta AF 80-200mm f/2.8 HS-APO G")); + choices.insert(p_t(2, "Minolta AF 28-70mm f/2.8 G")); + choices.insert(p_t(3, "Minolta AF 28-80mm f/4-5.6")); + choices.insert(p_t(5, "Minolta AF 35-70mm f/3.5-4.5")); + choices.insert(p_t(6, "Minolta AF 24-85mm f/3.5-4.5 [New]")); + choices.insert(p_t(7, "Minolta AF 100-300mm f/4.5-5.6 APO [New]")); + choices.insert(p_t(7, "Sigma AF 100-300mm f/4 EX DG IF")); + choices.insert(p_t(8, "Minolta AF 70-210mm f/4.5-5.6")); + choices.insert(p_t(9, "Minolta AF 50mm f/3.5 Macro")); + choices.insert(p_t(10, "Minolta AF 28-105mm f/3.5-4.5 [New]")); + choices.insert(p_t(11, "Minolta AF 300mm f/4 HS-APO G")); + choices.insert(p_t(12, "Minolta AF 100mm f/2.8 Soft Focus")); + choices.insert(p_t(13, "Minolta AF 75-300mm f/4.5-5.6")); + choices.insert(p_t(14, "Minolta AF 100-400mm f/4.5-6.7 APO")); + choices.insert(p_t(15, "Minolta AF 400mm f/4.5 HS-APO G")); + choices.insert(p_t(16, "Minolta AF 17-35mm f/3.5 G")); + choices.insert(p_t(17, "Minolta AF 20-35mm f/3.5-4.5")); + choices.insert(p_t(18, "Minolta AF 28-80mm f/3.5-5.6 II")); + choices.insert(p_t(19, "Minolta AF 35mm f/1.4")); + choices.insert(p_t(20, "Minolta/Sony STF 135mm F2.8 [T4.5]")); + choices.insert(p_t(22, "Minolta AF 35-80mm f/4-5.6")); + choices.insert(p_t(23, "Minolta AF 200mm f/4 G APO Macro")); + choices.insert(p_t(24, "Minolta/Sony AF 24-105mm f/3.5-4.5 (D)")); + choices.insert(p_t(24, "Sigma 18-50mm f/2.8 EX DC Macro")); + choices.insert(p_t(24, "Sigma 17-70mm f/2.8-4.5 DC Macro")); + choices.insert(p_t(24, "Sigma 20-40mm f/2.8 EX DG Aspherical IF")); + choices.insert(p_t(24, "Sigma 18-200mm f/3.5-6.3 DC")); + choices.insert(p_t(24, "Tamron SP AF 28-75mm f/2.8 XR Di (IF) Macro")); + choices.insert(p_t(25, "Minolta AF 100-300mm f/4.5-5.6 APO D")); + choices.insert(p_t(25, "Sigma 100-300mm f/4 EX DG APO")); + choices.insert(p_t(25, "Sigma 70mm f/2.8 EX DG Macro")); + choices.insert(p_t(25, "Sigma 20mm f/1.8 EX DG Aspherical RF")); + choices.insert(p_t(25, "Sigma 30mm f/1.4 EX DG")); + choices.insert(p_t(27, "Minolta AF 85mm f71.4 G")); + choices.insert(p_t(28, "Minolta AF 100mm f/2.8 Macro (D)")); + choices.insert(p_t(28, "Tamron SP AF 90mm f/2.8 Di Macro ")); + choices.insert(p_t(29, "Minolta AF 75-300mm f/4.5-5.6 (D)")); + choices.insert(p_t(30, "Minolta AF 28-80mm f/3.5-5.6 (D)")); + choices.insert(p_t(30, "Sigma 10-20mm f/4-5.6 EX DC")); + choices.insert(p_t(30, "Sigma 12-24mm f/4.5-5.6 EX DG")); + choices.insert(p_t(30, "Sigma 28-70mm f/2.8 EX DG")); + choices.insert(p_t(30, "Sigma 55-200mm f/4-5.6 DC")); + choices.insert(p_t(31, "Minolta/Sony AF 50mm f/2.8 Macro (D)")); + choices.insert(p_t(32, "Minolta AF 300mm f/2.8 G")); + choices.insert(p_t(33, "Minolta/Sony AF 70-200mm f/2.8 G (D) SSM")); + choices.insert(p_t(35, "Minolta AF 85mm f/1.4 G (D) Limited")); + choices.insert(p_t(36, "Minolta AF 28-100mm f/3.5-5.6 (D)")); + choices.insert(p_t(38, "Minolta AF 17-35mm f/2.8-4 (D)")); + choices.insert(p_t(39, "Minolta AF 28-75mm f/2.8 (D)")); + choices.insert(p_t(40, "Minolta/Sony AF DT 18-70mm f/3.5-5.6 (D)")); + choices.insert(p_t(41, "Minolta/Sony AF DT 11-18mm f/4.5-5.6 (D)")); + choices.insert(p_t(42, "Minolta AF DT 18-200mm f/3.5-6.3 (D)")); + choices.insert(p_t(43, "Minolta AF 35mm f/1.4 G")); + choices.insert(p_t(44, "Sony AF 50mm f/1.4")); + choices.insert(p_t(45, "Carl Zeiss Planar T* 85mm f/1.4 ZA")); + choices.insert(p_t(46, "Carl Zeiss Vario-Sonnar T* DT 16-80mm f/3.5-4.5 ZA")); + choices.insert(p_t(47, "Carl Zeiss Sonnar T* 135mm F1.8 ZA")); + choices.insert(p_t(48, "Carl Zeiss Vario-Sonnar T* 24-70mm f/2.8 ZA SSM")); + choices.insert(p_t(49, "Sony AF DT 55-200mm f/4-5.6")); + choices.insert(p_t(50, "Sony AF DT 18-250mm f/3.5-6.3")); + choices.insert(p_t(51, "Sony AF DT 16-105mm f/3.5-5.6 or 55-200mm f/4-5.5")); + choices.insert(p_t(52, "Sony AF 70-300mm f/4.5-5.6 G SSM")); + choices.insert(p_t(53, "Sony AF 70-400mm f/4.5-5.6 G SSM")); + choices.insert(p_t(54, "Carl Zeiss Vario-Sonnar T* 16-35mm f/2.8 ZA SSM")); + choices.insert(p_t(55, "Sony DT 18-55mm f/3.5-5.6 SAM")); + choices.insert(p_t(56, "Sony AF DT 55-200mm f/4-5.6 SAM")); + choices.insert(p_t(57, "Sony AF DT 50mm f/1.8 SAM")); + choices.insert(p_t(58, "Sony AF DT 30mm f/2.8 SAM Macro")); + choices.insert(p_t(59, "Sony AF 28-75mm f/2.8 SAM")); + choices.insert(p_t(128, "Tamron AF 18-200mm f/3.5-6.3 XR Di II LD Aspherical (IF)")); + choices.insert(p_t(128, "Tamron AF 28-300mm f/3.5-6.3")); + choices.insert(p_t(128, "Tamron AF 28-200mm f/3.8-5.6 XR Di Aspherical (IF) Macro ")); + choices.insert(p_t(128, "Tamron SP AF 17-35mm f/2.8-4 Di LD Aspherical IF")); + choices.insert(p_t(128, "Sigma 10-20mm f/3.5 EX DC")); + choices.insert(p_t(128, "Sigma 70-200mm f/2.8 II EX DG APO Macro")); + choices.insert(p_t(129, "Tamron 200-400mm f/5.6 LD (IF)")); + choices.insert(p_t(129, "Tamron 70-300mm f/4-5.6 LD")); + choices.insert(p_t(135, "Vivitar 28-210mm f/3.5-5.6")); + choices.insert(p_t(136, "Tokina EMZ M100 AF 100mm f/3.5")); + choices.insert(p_t(137, "Cosina 70-210mm f/2.8-4 AF")); + choices.insert(p_t(138, "Soligor 19-35mm f/3.5-4.5")); + choices.insert(p_t(142, "Voigtlander 70-300mm f/4.5-5.6")); + choices.insert(p_t(146, "Voigtlander Macro APO-Lanthar 125mm f/2.5 SL")); + choices.insert(p_t(255, "Tamron SP AF 17-50mm f/2.8 XR Di II LD Aspherical")); + choices.insert(p_t(255, "Tamron AF 18-250mm f/3.5-6.3 XR Di II LD")); + choices.insert(p_t(255, "Tamron AF 55-200mm f/4-5.6 Di II")); + choices.insert(p_t(255, "Tamron AF 70-300mm f/4-5.6 Di LD Macro 1:2")); + choices.insert(p_t(255, "Tamron SP AF 200-500mm f/5.0-6.3 Di LD (IF)")); + choices.insert(p_t(255, "Tamron SP AF 10-24mm f/3.5-4.5 Di II LD Aspherical (IF)")); + choices.insert(p_t(255, "Tamron SP AF 70-200mm f/2.8 Di LD Macro (IF)")); + choices.insert(p_t(255, "Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical (IF)")); + choices.insert(p_t(2550, "Minolta AF 50mm f/1.7")); + choices.insert(p_t(2551, "Minolta AF 35-70mm f/4")); + choices.insert(p_t(2551, "Sigma UC AF 28-70mm f/3.5-4.5")); + choices.insert(p_t(2551, "Sigma AF 28-70mm f/2.8")); + choices.insert(p_t(2551, "Sigma M-AF 70-200mm f/2.8 EX Aspherical")); + choices.insert(p_t(2551, "Quantaray M-AF 35-80mm f/4-5.6")); + choices.insert(p_t(2552, "Minolta AF 28-85mm f/3.5-4.5 [New]")); + choices.insert(p_t(2552, "Tokina 19-35mm f/3.5-4.5")); + choices.insert(p_t(2552, "Tokina 28-70mm f/2.8 AT-X")); + choices.insert(p_t(2552, "Tokina 80-400mm f/4.5-5.6 AT-X AF II 840")); + choices.insert(p_t(2552, "Tokina AF PRO 28-80mm f/2.8 AT-X 280")); + choices.insert(p_t(2552, "Tokina AT-X PRO II AF 28-70mm f/2.6-2.8 270")); + choices.insert(p_t(2552, "Tamron AF 19-35mm f/3.5-4.5")); + choices.insert(p_t(2552, "Angenieux AF 28-70mm f/2.6")); + choices.insert(p_t(2553, "Minolta AF 28-135mm f/4-4.5")); + choices.insert(p_t(2553, "Sigma ZOOM-alpha 35-135mm f/3.5-4.5")); + choices.insert(p_t(2553, "Sigma 28-105mm f/2.8-4 Aspherical")); + choices.insert(p_t(2554, "Minolta AF 35-105mm f/3.5-4.5")); + choices.insert(p_t(2555, "Minolta AF 70-210mm f/4 Macro")); + choices.insert(p_t(2555, "Sigma 70-210mm f/4-5.6 APO")); + choices.insert(p_t(2555, "Sigma M-AF 70-200mm f/2.8 EX APO")); + choices.insert(p_t(2555, "Sigma 75-200mm f/2.8-3.5")); + choices.insert(p_t(2556, "Minolta AF 135mm f/2.8")); + choices.insert(p_t(2557, "Minolta AF 28mm f/2.8")); + choices.insert(p_t(2558, "Minolta AF 24-50mm f/4")); + choices.insert(p_t(2560, "Minolta AF 100-200mm f/4.5")); + choices.insert(p_t(2561, "Minolta AF 75-300mm f/4.5-5.6")); + choices.insert(p_t(2561, "Sigma 70-300mm f/4-5.6 DL Macro")); + choices.insert(p_t(2561, "Sigma 300mm f/4 APO Macro")); + choices.insert(p_t(2561, "Sigma AF 500mm f/4.5 APO")); + choices.insert(p_t(2561, "Sigma AF 170-500mm f/5-6.3 APO Aspherical")); + choices.insert(p_t(2561, "Tokina AT-X AF 300mm f/4")); + choices.insert(p_t(2561, "Tokina AT-X AF 400mm f/5.6 SD")); + choices.insert(p_t(2561, "Tokina AF 730 II 75-300mm f/4.5-5.6")); + choices.insert(p_t(2562, "Minolta/Sony AF 50mm f/1.4 [New]")); + choices.insert(p_t(2563, "Minolta AF 300mm f/2.8 G")); + choices.insert(p_t(2563, "Sigma AF 50-500mm f/4-6.3 EX DG APO")); + choices.insert(p_t(2563, "Sigma AF 170-500mm f/5-6.3 APO Aspherical")); + choices.insert(p_t(2563, "Sigma AF 500mm f/4.5 EX DG APO")); + choices.insert(p_t(2563, "Sigma 400mm f/5.6 APO")); + choices.insert(p_t(2564, "Minolta AF 50mm f/2.8 Macro")); + choices.insert(p_t(2564, "Sigma 50mm f/2.8 EX Macro")); + choices.insert(p_t(2565, "Minolta AF 600mm f/4")); + choices.insert(p_t(2566, "Minolta AF 24mm f/2.8")); + choices.insert(p_t(2572, "Minolta/Sony AF 500mm f/8 Reflex")); + choices.insert(p_t(2578, "Minolta AF 16mm f/2.8 Fisheye")); + choices.insert(p_t(2578, "Sigma 8mm f/4 EX DG Fisheye")); + choices.insert(p_t(2578, "Sigma 14mm f/3.5")); + choices.insert(p_t(2578, "Sigma 15mm f/2.8 Fisheye")); + choices.insert(p_t(2579, "Minolta AF 20mm f/2.8")); + choices.insert(p_t(2581, "Minolta/Sony AF 100mm f/2.8 Macro")); + choices.insert(p_t(2581, "Sigma AF 90mm f/2.8 Macro")); + choices.insert(p_t(2581, "Sigma AF 105mm f/2.8 EX DG Macro")); + choices.insert(p_t(2581, "Sigma 180mm f/5.6 Macro")); + choices.insert(p_t(2581, "Tamron AF 90mm f/2.8 Macro")); + choices.insert(p_t(2585, "Minolta AF 35-105mm f/3.5-4.5 New")); + choices.insert(p_t(2585, "Tamron AF 24-135mm f/3.5-5.6")); + choices.insert(p_t(2588, "Minolta AF 70-210mm f/3.5-4.5")); + choices.insert(p_t(2589, "Minolta AF 80-200 f/2.8 APO")); + choices.insert(p_t(2589, "Tokina 80-200mm f/2.8")); + choices.insert(p_t(2591, "Minolta AF 35mm f/1.4")); + choices.insert(p_t(2592, "Minolta AF 85mm f/1.4 G (D)")); + choices.insert(p_t(2593, "Minolta AF 200mm f/2.8 G APO")); + choices.insert(p_t(2594, "Minolta AF 3x-1x f/1.7-2.8 Macro")); + choices.insert(p_t(2596, "Minolta AF 28mm f/2")); + choices.insert(p_t(2597, "Minolta AF 35mm f/2")); + choices.insert(p_t(2598, "Minolta AF 100mm f/2")); + choices.insert(p_t(2604, "Minolta AF 80-200mm f/4.5-5.6")); + choices.insert(p_t(2605, "Minolta AF 35-80mm f/4-5.6")); + choices.insert(p_t(2606, "Minolta AF 100-300mm f/4.5-5.6 (D)")); + choices.insert(p_t(2607, "Minolta AF 35-80mm f/4-5.6")); + choices.insert(p_t(2608, "Minolta AF 300mm f/2.8 G")); + choices.insert(p_t(2609, "Minolta AF 600mm f/4 HS-APO G")); + choices.insert(p_t(2612, "Minolta AF 200mm f/2.8 G HS-APO")); + choices.insert(p_t(2613, "Minolta AF 50mm f/1.7 New")); + choices.insert(p_t(2615, "Minolta AF 28-105mm f/3.5-4.5 Power Zoom")); + choices.insert(p_t(2616, "Minolta AF 35-200mm f/4.5-5.6 Power Zoom")); + choices.insert(p_t(2618, "Minolta AF 28-80mm f/4-5.6 Power Zoom")); + choices.insert(p_t(2619, "Minolta AF 80-200mm f/4.5-5.6 Power Zoom")); + choices.insert(p_t(2620, "Minolta AF 28-70mm f/2.8 G")); + choices.insert(p_t(2621, "Minolta AF 100-300mm f/4.5-5.6 Power Zoom")); + choices.insert(p_t(2624, "Minolta AF 35-80mm f/4-5.6 Power Zoom")); + choices.insert(p_t(2628, "Minolta AF 80-200mm f/2.8 G")); + choices.insert(p_t(2629, "Minolta AF 85mm f/1.4 New")); + choices.insert(p_t(2631, "Minolta/Sony AF 100-300mm f/4.5-5.6 APO")); + choices.insert(p_t(2632, "Minolta AF 24-50mm f/4 New")); + choices.insert(p_t(2638, "Minolta AF 50mm f/2.8 Macro New")); + choices.insert(p_t(2639, "Minolta AF 100mm f/2.8 Macro")); + choices.insert(p_t(2641, "Minolta AF 20mm f/2.8 New")); + choices.insert(p_t(2642, "Minolta AF 24mm f/2.8 New")); + choices.insert(p_t(2644, "Minolta AF 100-400mm f/4.5-6.7 APO")); + choices.insert(p_t(2662, "Minolta AF 50mm f/1.4 New")); + choices.insert(p_t(2667, "Minolta AF 35mm f/2 New")); + choices.insert(p_t(2668, "Minolta AF 28mm f/2 New")); + choices.insert(p_t(2672, "Minolta AF 24-105mm f/3.5-4.5 (D)")); + choices.insert(p_t(4574, "Minolta AF 200mm f/2.8 G x2")); + choices.insert(p_t(4575, "1.4 x Teleconverter")); + choices.insert(p_t(4585, "Tamron SP AF 300mm f/2.8 LD IF")); + choices.insert(p_t(6553, "Arax MC 35mm f/2.8 Tilt+Shift")); + choices.insert(p_t(6553, "Arax MC 80mm f/2.8 Tilt+Shift")); + choices.insert(p_t(6553, "Zenitar MF 16mm f/2.8 Fisheye M42")); + choices.insert(p_t(6553, "Samyang 500mm Mirror f/8")); + choices.insert(p_t(6553, "Pentacon Auto 135mm f/2.8")); + choices.insert(p_t(6553, "Pentacon Auto 29mm f/2.8")); + choices.insert(p_t(6553, "Helios 44-2 58mm f/2")); + choices.insert(p_t(25501, "Minolta AF 50mm f/1.7")); + choices.insert(p_t(25511, "Minolta AF 35-70mm f/4")); + choices.insert(p_t(25511, "Sigma UC AF 28-70mm f/3.5-4.5")); + choices.insert(p_t(25511, "Sigma AF 28-70mm f/2.8")); + choices.insert(p_t(25511, "Sigma M-AF 70-200mm f/2.8 EX Aspherical")); + choices.insert(p_t(25511, "Quantaray M-AF 35-80mm f/4-5.6")); + choices.insert(p_t(25521, "Minolta AF 28-85mm f/3.5-4.5 [New]")); + choices.insert(p_t(25521, "Tokina 19-35mm f/3.5-4.5")); + choices.insert(p_t(25521, "Tokina 28-70mm f/2.8 AT-X")); + choices.insert(p_t(25521, "Tokina 80-400mm f/4.5-5.6 AT-X AF II 840")); + choices.insert(p_t(25521, "Tokina AF PRO 28-80mm f/2.8 AT-X 280")); + choices.insert(p_t(25521, "Tokina AT-X PRO II AF 28-70mm f/2.6-2.8 270")); + choices.insert(p_t(25521, "Tamron AF 19-35mm f/3.5-4.5")); + choices.insert(p_t(25521, "Angenieux AF 28-70mm f/2.6")); + choices.insert(p_t(25531, "Minolta AF 28-135mm f/4-4.5")); + choices.insert(p_t(25531, "Sigma ZOOM-alpha 35-135mm f/3.5-4.5")); + choices.insert(p_t(25531, "Sigma 28-105mm f/2.8-4 Aspherical")); + choices.insert(p_t(25541, "Minolta AF 35-105mm f/3.5-4.5")); + choices.insert(p_t(25551, "Minolta AF 70-210mm f/4 Macro")); + choices.insert(p_t(25551, "Sigma 70-210mm f/4-5.6 APO")); + choices.insert(p_t(25551, "Sigma M-AF 70-200mm f/2.8 EX APO")); + choices.insert(p_t(25551, "Sigma 75-200mm f/2.8-3.5")); + choices.insert(p_t(25561, "Minolta AF 135mm f/2.8")); + choices.insert(p_t(25571, "Minolta AF 28mm f/2.8")); + choices.insert(p_t(25581, "Minolta AF 24-50mm f/4")); + choices.insert(p_t(25601, "Minolta AF 100-200mm f/4.5")); + choices.insert(p_t(25611, "Minolta AF 75-300mm f/4.5-5.6")); + choices.insert(p_t(25611, "Sigma 70-300mm f/4-5.6 DL Macro")); + choices.insert(p_t(25611, "Sigma 300mm f/4 APO Macro")); + choices.insert(p_t(25611, "Sigma AF 500mm f/4.5 APO")); + choices.insert(p_t(25611, "Sigma AF 170-500mm f/5-6.3 APO Aspherical")); + choices.insert(p_t(25611, "Tokina AT-X AF 300mm f/4")); + choices.insert(p_t(25611, "Tokina AT-X AF 400mm f/5.6 SD")); + choices.insert(p_t(25611, "Tokina AF 730 II 75-300mm f/4.5-5.6")); + choices.insert(p_t(25621, "Minolta AF 50mm f/1.4")); + choices.insert(p_t(25631, "Minolta AF 300mm f/2.8 G")); + choices.insert(p_t(25631, "Sigma AF 50-500mm f/4-6.3 EX DG APO")); + choices.insert(p_t(25631, "Sigma AF 170-500mm f/5-6.3 APO Aspherical")); + choices.insert(p_t(25631, "Sigma AF 500mm f/4.5 EX DG APO")); + choices.insert(p_t(25631, "Sigma 400mm f/5.6 APO")); + choices.insert(p_t(25641, "Minolta AF 50mm f/2.8 Macro")); + choices.insert(p_t(25641, "Sigma AF 50mm f/2.8 Macro")); + choices.insert(p_t(25651, "Minolta AF 600mm f/4")); + choices.insert(p_t(25661, "Minolta AF 24mm f/2.8")); + choices.insert(p_t(25721, "Minolta/Sony AF 500mm f/8 Reflex")); + choices.insert(p_t(25781, "Minolta AF 16mm f/2.8 Fisheye")); + choices.insert(p_t(25781, "Sigma 8mm f/4 EX DG Fisheye")); + choices.insert(p_t(25781, "Sigma 14mm f/3.5")); + choices.insert(p_t(25781, "Sigma 15mm f/2.8 Fisheye")); + choices.insert(p_t(25791, "Minolta AF 20mm f/2.8")); + choices.insert(p_t(25811, "Minolta/Sony AF 100mm f/2.8 Macro New")); + choices.insert(p_t(25811, "Sigma AF 90mm f/2.8 Macro")); + choices.insert(p_t(25811, "Sigma AF 105mm f/2.8 EX DG Macro")); + choices.insert(p_t(25811, "Sigma 180mm f/5.6 Macro")); + choices.insert(p_t(25811, "Tamron 90mm f/2.8 Macro")); + choices.insert(p_t(25851, "Beroflex 35-135mm f/3.5-4.5")); + choices.insert(p_t(25858, "Minolta AF 35-105mm f/3.5-4.5 New")); + choices.insert(p_t(25858, "Tamron 24-135mm f/3.5-5.6")); + choices.insert(p_t(25881, "Minolta AF 70-210mm f/3.5-4.5")); + choices.insert(p_t(25891, "Minolta AF 80-200 f/2.8 APO")); + choices.insert(p_t(25891, "Tokina 80-200mm f/2.8")); + choices.insert(p_t(25911, "Minolta AF 35mm f/1.4")); + choices.insert(p_t(25921, "Minolta AF 85mm f/1.4 G (D)")); + choices.insert(p_t(25931, "Minolta AF 200mm f/2.8 G APO")); + choices.insert(p_t(25941, "Minolta AF 3x-1x f/1.7-2.8 Macro")); + choices.insert(p_t(25961, "Minolta AF 28mm f/2")); + choices.insert(p_t(25971, "Minolta AF 35mm f/2")); + choices.insert(p_t(25981, "Minolta AF 100mm f/2")); + choices.insert(p_t(26041, "Minolta AF 80-200mm f/4.5-5.6")); + choices.insert(p_t(26051, "Minolta AF 35-80mm f/4-5.6")); + choices.insert(p_t(26061, "Minolta AF 100-300mm f/4.5-5.6 (D)")); + choices.insert(p_t(26071, "Minolta AF 35-80mm f/4-5.6")); + choices.insert(p_t(26081, "Minolta AF 300mm f/2.8 HS-APO G")); + choices.insert(p_t(26091, "Minolta AF 600mm f/4 HS-APO G")); + choices.insert(p_t(26121, "Minolta AF 200mm f/2.8 HS-APO G")); + choices.insert(p_t(26131, "Minolta AF 50mm f/1.7 New")); + choices.insert(p_t(26151, "Minolta AF 28-105mm f/3.5-4.5 Power Zoom")); + choices.insert(p_t(26161, "Minolta AF 35-200mm f/4.5-5.6 Power Zoom")); + choices.insert(p_t(26181, "Minolta AF 28-80mm f/4-5.6 Power Zoom")); + choices.insert(p_t(26191, "Minolta AF 80-200mm f/4.5-5.6 Power Zoom")); + choices.insert(p_t(26201, "Minolta AF 28-70mm f/2.8 G")); + choices.insert(p_t(26211, "Minolta AF 100-300mm f/4.5-5.6 Power Zoom")); + choices.insert(p_t(26241, "Minolta AF 35-80mm f/4-5.6 Power Zoom")); + choices.insert(p_t(26281, "Minolta AF 80-200mm f/2.8 G")); + choices.insert(p_t(26291, "Minolta AF 85mm f/1.4 New")); + choices.insert(p_t(26311, "Minolta/Sony AF 100-300mm f/4.5-5.6 APO")); + choices.insert(p_t(26321, "Minolta AF 24-50mm f/4 New")); + choices.insert(p_t(26381, "Minolta AF 50mm f/2.8 Macro New")); + choices.insert(p_t(26391, "Minolta AF 100mm f/2.8 Macro")); + choices.insert(p_t(26411, "Minolta AF 20mm f/2.8 New")); + choices.insert(p_t(26421, "Minolta AF 24mm f/2.8 New")); + choices.insert(p_t(26441, "Minolta AF 100-400mm f/4.5-6.7 APO")); + choices.insert(p_t(26621, "Minolta AF 50mm f/1.4 New")); + choices.insert(p_t(26671, "Minolta AF 35mm f/2 New")); + choices.insert(p_t(26681, "Minolta AF 28mm f/2 New")); + choices.insert(p_t(26721, "Minolta AF 24-105mm f/3.5-4.5 (D)")); + choices.insert(p_t(45671, "Tokina 70-210mm f/4-5.6")); + choices.insert(p_t(45741, "Minolta AF 200mm f/2.8 G x2")); + choices.insert(p_t(45851, "Tamron SP AF 300mm f/2.8 LD IF")); + choices.insert(p_t(45871, "Tamron SP AF 70-210mm f/2.8 LD")); + choices.insert(p_t(65535, "Arax MC 35mm f/2.8 Tilt+Shift")); + choices.insert(p_t(65535, "Arax MC 80mm f/2.8 Tilt+Shift")); + choices.insert(p_t(65535, "Zenitar MF 16mm f/2.8 Fisheye M42")); + choices.insert(p_t(65535, "Samyang 500mm f/8 Mirror")); + choices.insert(p_t(65535, "Pentacon Auto 135mm f/2.8")); + choices.insert(p_t(65535, "Pentacon Auto 29mm f/2.8")); + choices.insert(p_t(65535, "Helios 44-2 58mm f/2")); + } + + + virtual std::string toString (Tag* t) + { + int lensID = t->toInt(); + size_t nFound = choices.count( lensID ); + container_t::iterator r; + switch( nFound ) + { + case 0: // lens Unknown + t->toString (buffer); + return std::string (buffer); + case 1: // lens found + r = choices.find ( lensID ); + return r->second; + default: + // More than one hit: we must guess + break; + } + + double maxApertureAtFocal = pow(2.0, t->getParent()->getParent()->getTag(0x9205)->toDouble()/2.0); // MaxApertureValue at focal Length + double focalLength = t->getParent()->getParent()->getTag(0x920A)->toDouble(); // Focal Length + double deltaMin = 1000.; + + /* Choose the best match: thanks to exiftool by Phil Harvey + * first throws for "out of focal range" and lower or upper aperture of the lens compared to MaxApertureAtFocal + * if the lens is not constant aperture, calculate aprox. aperture of the lens at focalLength + * and compare with actual aperture. + */ + std::string bestMatch("Unknown"); + std::ostringstream candidates; + for ( r = choices.lower_bound( lensID ); r != choices.upper_bound(lensID); r++ ){ + double a1,a2,f1,f2,lensAperture,dif; + + if( !extractLensInfo( r->second ,f1,f2,a1,a2) ) + continue; + if( f1 == 0. || a1 == 0.) + continue; + + if( focalLength < f1 - .5 || focalLength > f2 + 0.5 ) + continue; + if( maxApertureAtFocal < a1 - 0.15 || maxApertureAtFocal > a2 +0.15) + continue; + + if( a1 == a2 || f1 == f2) + lensAperture = a1; + else + lensAperture = exp( log(a1)+(log(a2)-log(a1))/(log(f2)-log(f1))*(log(focalLength)-log(f1)) ); + + dif = ABS(lensAperture - maxApertureAtFocal); + if( dif < deltaMin ){ + deltaMin = dif; + bestMatch = r->second; + } + if( dif < 0.15){ + if( candidates.tellp() ) + candidates << "\n or " << r->second; + else + candidates << r->second; + } + } + if( !candidates.tellp() ) + return bestMatch; + else + return candidates.str(); + } +}; +SALensIDInterpreter saLensIDInterpreter; + +class MATeleconverterInterpreter : public ChoiceInterpreter { + public: + MATeleconverterInterpreter () { + choices[0] = "None "; + choices[0x48] = "Minolta AF 2x APO (D)"; + choices[0x50] = "Minolta AF 2x APO II"; + choices[0x88] = "Minolta AF 1.4x APO (D)"; + choices[0x90] = "Minolta AF 1.4x APO II"; + } +}; +MATeleconverterInterpreter maTeleconverterInterpreter; + +class MAQualityInterpreter : public ChoiceInterpreter { + public: + MAQualityInterpreter () { + choices[0] = "Raw"; + choices[1] = "Super Fine"; + choices[2] = "Fine"; + choices[3] = "Standard"; + choices[4] = "Economy"; + choices[5] = "Extra fine"; + choices[6] = "RAW + JPEG"; + choices[7] = "cRAW"; + choices[8] = "cRAW + JPEG"; + } +}; +MAQualityInterpreter maQualityInterpreter; + +class MAImageSizeInterpreter : public ChoiceInterpreter { + public: + MAImageSizeInterpreter () { + choices[1] = "1600x1200"; + choices[2] = "1280x960"; + choices[3] = "640x480"; + choices[5] = "2560x1920"; + choices[6] = "2272x1704"; + choices[7] = "2048x1536"; + } +}; +MAImageSizeInterpreter maImageSizeInterpreter; + +const TagAttrib minoltaAttribs[] = { + 0, 1, 0, 0, 0x0000, "MakerNoteVersion", &stdInterpreter, + 0, 1, 0, 0, 0x0001, "MinoltaCameraSettingsOld", &stdInterpreter, + 0, 1, 0, 0, 0x0003, "MinoltaCameraSettings", &stdInterpreter, + 0, 1, 0, 0, 0x0004, "MinoltaCameraSettings7D", &stdInterpreter, + 0, 1, 0, 0, 0x0018, "ImageStabilization", &stdInterpreter, + 0, 1, 0, 0, 0x0040, "CompressedImageSize", &stdInterpreter, + 1, 1, 0, 0, 0x0081, "PreviewImage", &stdInterpreter, + 1, 1, 0, 0, 0x0088, "PreviewImageStart", &stdInterpreter, + 1, 1, 0, 0, 0x0089, "PreviewImageLength", &stdInterpreter, + 0, 1, 0, 0, 0x0100, "SceneMode", &saSceneModeInterpreter, + 0, 1, 0, 0, 0x0101, "ColorMode", &saColorModeInterpreter, + 0, 1, 0, 0, 0x0102, "MinoltaQuality", &maQualityInterpreter, + 0, 1, 0, 0, 0x0103, "MinoltaImageSize", &maImageSizeInterpreter, + 0, 1, 0, 0, 0x0104, "FlashExposureComp", &stdInterpreter, + 0, 1, 0, 0, 0x0105, "Teleconverter", &maTeleconverterInterpreter, + 0, 1, 0, 0, 0x0107, "ImageStabilization", &saOnOffInterpreter, + 0, 1, 0, 0, 0x010a, "ZoneMatching", &saZoneMatchingInterpreter, + 0, 1, 0, 0, 0x010b, "ColorTemperature", &stdInterpreter, + 0, 1, 0, 0, 0x010c, "LensID", &saLensIDInterpreter, + 0, 1, 0, 0, 0x0113, "ImageStabilization", &saOnOffInterpreter, + 0, 1, 0, 0, 0x0114, "MinoltaCameraSettings", &stdInterpreter, + 1, 1, 0, 0, 0x0e00, "PrintIM", &stdInterpreter, + 0, 1, 0, 0, 0x0f00, "MinoltaCameraSettings2", &stdInterpreter, + -1, 0, 0, 0, 0, "", NULL}; + +const TagAttrib sonyAttribs[] = { + 1, 1, 0, 0, 0x0e00, "PrintIM", &stdInterpreter, + 1, 1, 0, 0, 0x2001, "PreviewImage", &stdInterpreter, + 0, 1, 0, 0, 0xb020, "ColorReproduction", &stdInterpreter, + 0, 1, 0, 0, 0xb021, "ColorTemperature", &stdInterpreter, + 0, 1, 0, 0, 0xb023, "SceneMode", &saSceneModeInterpreter, + 0, 1, 0, 0, 0xb024, "ZoneMatching", &saZoneMatchingInterpreter, + 0, 1, 0, 0, 0xb025, "DynamicRangeOptimizer", &saDynamicRangeOptimizerInterpreter, + 0, 1, 0, 0, 0xb026, "ImageStabilization", &saOnOffInterpreter, + 0, 1, 0, 0, 0xb027, "LensID", &saLensIDInterpreter, + 0, 1, 0, minoltaAttribs, 0xb028, "MinoltaMakerNote", &stdInterpreter, + 0, 1, 0, 0, 0xb029, "ColorMode", &saColorModeInterpreter, + 0, 1, 0, 0, 0xb040, "Macro", &saOnOffInterpreter, + 0, 1, 0, 0, 0xb041, "ExposureMode", &saExposureModeInterpreter, + 0, 1, 0, 0, 0xb047, "Quality", &saQualityInterpreter, + 0, 1, 0, 0, 0xb04b, "AntiBlur", &saAntiBlurInterpreter, + 0, 1, 0, 0, 0xb04e, "LongExposureNoiseReduction", &saOnOffInterpreter, + -1, 0, 0, 0, 0, "", NULL}; + +}; +#endif diff --git a/rtexif/stdattribs.cc b/rtexif/stdattribs.cc index 3fa72010d..f4f049b66 100644 --- a/rtexif/stdattribs.cc +++ b/rtexif/stdattribs.cc @@ -1,486 +1,486 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _STDATTRIBS_ -#define _STDATTRIBS_ - -#include -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _STDATTRIBS_ +#define _STDATTRIBS_ + +#include +#include +#include #include -#include - -namespace rtexif { - -class ColorSpaceInterpreter : public ChoiceInterpreter { - - public: - ColorSpaceInterpreter () { - choices[1] = "sRGB"; - choices[0xffff] = "Uncalibrated"; - } -}; -ColorSpaceInterpreter colorSpaceInterpreter; - -class ExposureProgramInterpreter : public ChoiceInterpreter { - - public: - ExposureProgramInterpreter () { - choices[0] = "Not defined"; - choices[1] = "Manual"; - choices[2] = "Normal program"; - choices[3] = "Aperture priority"; - choices[4] = "Shutter priority"; - choices[5] = "Creative program"; - choices[6] = "Action program"; - choices[7] = "Portrait mode"; - choices[8] = "Landscape mode"; - } -}; -ExposureProgramInterpreter exposureProgramInterpreter; - -class MeteringModeInterpreter : public ChoiceInterpreter { - - public: - MeteringModeInterpreter () { - choices[0] = "Unknown"; - choices[1] = "Average"; - choices[2] = "Center weighted"; - choices[3] = "Spot"; - choices[4] = "Multispot"; - choices[5] = "Pattern"; - choices[6] = "Partial"; - choices[255] = "Other"; - } -}; -MeteringModeInterpreter meteringModeInterpreter; - -class ExposureModeInterpreter : public ChoiceInterpreter { - - public: - ExposureModeInterpreter () { - choices[0] = "Auto exposure"; - choices[1] = "Manual exposure"; - choices[2] = "Auto bracket"; - } -}; -ExposureModeInterpreter exposureModeInterpreter; - -class WhiteBalanceInterpreter : public ChoiceInterpreter { - - public: - WhiteBalanceInterpreter () { - choices[0] = "Auto white balance"; - choices[1] = "Manual white balance"; - } -}; -WhiteBalanceInterpreter whiteBalanceInterpreter; - -class SceneCaptureInterpreter : public ChoiceInterpreter { - - public: - SceneCaptureInterpreter () { - choices[0] = "Standard"; - choices[1] = "Landscape"; - choices[2] = "Portrait"; - choices[3] = "Night scene"; - } -}; -SceneCaptureInterpreter sceneCaptureInterpreter; - -class GainControlInterpreter : public ChoiceInterpreter { - - public: - GainControlInterpreter () { - choices[0] = "None"; - choices[1] = "Low gain up"; - choices[2] = "High gain up"; - choices[3] = "Low gain down"; - choices[4] = "High gain down"; - } -}; -GainControlInterpreter gainControlInterpreter; - -class ContrastInterpreter : public ChoiceInterpreter { - - public: - ContrastInterpreter () { - choices[0] = "Normal"; - choices[1] = "Soft"; - choices[2] = "Hard"; - } -}; -ContrastInterpreter contrastInterpreter; - -class SharpnessInterpreter : public ChoiceInterpreter { - - public: - SharpnessInterpreter () { - choices[0] = "Normal"; - choices[1] = "Soft"; - choices[2] = "Hard"; - } -}; -SharpnessInterpreter sharpnessInterpreter; - -class SaturationInterpreter : public ChoiceInterpreter { - - public: - SaturationInterpreter () { - choices[0] = "Normal"; - choices[1] = "Low saturation"; - choices[2] = "High saturation"; - } -}; -SaturationInterpreter saturationInterpreter; - -class FlashInterpreter : public ChoiceInterpreter { - - public: - FlashInterpreter () { - choices[0x0000] = "Flash did not fire"; - choices[0x0001] = "Flash fired"; - choices[0x0005] = "Strobe return light not detected"; - choices[0x0007] = "Strobe return light detected"; - choices[0x0009] = "Flash fired, compulsory flash mode"; - choices[0x000D] = "Flash fired, compulsory flash mode, return light not detected"; - choices[0x000F] = "Flash fired, compulsory flash mode, return light detected"; - choices[0x0010] = "Flash did not fire, compulsory flash mode"; - choices[0x0018] = "Flash did not fire, auto mode"; - choices[0x0019] = "Flash fired, auto mode"; - choices[0x001D] = "Flash fired, auto mode, return light not detected"; - choices[0x001F] = "Flash fired, auto mode, return light detected"; - choices[0x0020] = "No flash function"; - choices[0x0041] = "Flash fired, red-eye reduction mode"; - choices[0x0045] = "Flash fired, red-eye reduction mode, return light not detected"; - choices[0x0047] = "Flash fired, red-eye reduction mode, return light detected"; - choices[0x0049] = "Flash fired, compulsory flash mode, red-eye reduction mode"; - choices[0x004D] = "Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected"; - choices[0x004F] = "Flash fired, compulsory flash mode, red-eye reduction mode, return light detected"; - choices[0x0059] = "Flash fired, auto mode, red-eye reduction mode"; - choices[0x005D] = "Flash fired, auto mode, return light not detected, red-eye reduction mode"; - choices[0x005F] = "Flash fired, auto mode, return light detected, red-eye reduction mode"; - } -}; -FlashInterpreter flashInterpreter; - -class LightSourceInterpreter : public ChoiceInterpreter { - - public: - LightSourceInterpreter () { - choices[0] = "Unknown"; - choices[1] = "Daylight"; - choices[2] = "Fluorescent"; - choices[3] = "Tungsten"; - choices[4] = "Flash"; - choices[9] = "Fine weather"; - choices[10] = "Cloudy weather"; - choices[11] = "Shade"; - choices[12] = "Daylight fluorescent"; - choices[13] = "Day white fluorescent"; - choices[14] = "Cool white fluorescent"; - choices[15] = "White fluorescent"; - choices[17] = "Standard light A"; - choices[18] = "Standard light B"; - choices[19] = "Standard light C"; - choices[20] = "D55"; - choices[21] = "D65"; - choices[22] = "D75"; - choices[23] = "D50"; - choices[24] = "ISO studio tungsten"; - choices[255] = "Other light source"; - } -}; -LightSourceInterpreter lightSourceInterpreter; - -class CompressionInterpreter : public ChoiceInterpreter { - - public: - CompressionInterpreter () { - choices[1] = "Uncompressed"; - choices[6] = "JPEG Compression"; - } -}; -CompressionInterpreter compressionInterpreter; - -class PhotometricInterpreter : public ChoiceInterpreter { - - public: - PhotometricInterpreter () { - choices[2] = "RGB"; - choices[6] = "YCbCr"; - } -}; -PhotometricInterpreter photometricInterpreter; - -class PlanarConfigInterpreter : public ChoiceInterpreter { - - public: - PlanarConfigInterpreter () { - choices[1] = "Chunky format"; - choices[2] = "Planar format"; - } -}; -PlanarConfigInterpreter planarConfigInterpreter; - -class FNumberInterpreter : public Interpreter { - public: - FNumberInterpreter () {} - virtual std::string toString (Tag* t) { - sprintf (buffer, "%0.1f", t->toDouble()); - return buffer; - } -}; -FNumberInterpreter fNumberInterpreter; - -class ApertureInterpreter : public Interpreter { - public: - ApertureInterpreter () {} - virtual std::string toString (Tag* t) { - sprintf (buffer, "%0.1f", pow(2.0, t->toDouble()/2.0)); - return buffer; - } -}; -ApertureInterpreter apertureInterpreter; - -class ExposureBiasInterpreter : public Interpreter { - public: - ExposureBiasInterpreter () {} - virtual std::string toString (Tag* t) { - sprintf (buffer, "%+0.2f", t->toDouble()); - return buffer; - } -}; -ExposureBiasInterpreter exposureBiasInterpreter; - -class ShutterSpeedInterpreter : public Interpreter { - public: - ShutterSpeedInterpreter () {} - virtual std::string toString (Tag* t) { - double d = pow (2.0, -t->toDouble()); - if (d > 0.0 && d < 0.9) - sprintf (buffer, "1/%0.0f", 1.0 / d); - else - sprintf (buffer, "%0.1f", d); - return buffer; - } -}; -ShutterSpeedInterpreter shutterSpeedInterpreter; - -class ExposureTimeInterpreter : public Interpreter { - public: - ExposureTimeInterpreter () {} - virtual std::string toString (Tag* t) { - double d = t->toDouble(); - if (d > 0.0 && d < 0.9) - sprintf (buffer, "1/%0.0f", 1.0 / d); - else - sprintf (buffer, "%0.1f", d); - return buffer; - } -}; -ExposureTimeInterpreter exposureTimeInterpreter; - -class FocalLengthInterpreter : public Interpreter { - public: - FocalLengthInterpreter () {} - virtual std::string toString (Tag* t) { - sprintf (buffer, "%0.1f", t->toDouble()); - return buffer; - } -}; -FocalLengthInterpreter focalLengthInterpreter; - -class UserCommentInterpreter : public Interpreter { - public: - UserCommentInterpreter () {} - virtual std::string toString (Tag* t) { - if (!strncmp((char*)t->getValue(), "ASCII\0\0\0",8)) - strncpy (buffer, (char*)t->getValue()+8, t->getCount()-8); - else - buffer[0]=0; - return buffer; - } - virtual void fromString (Tag* t, const std::string& value) { - memcpy (buffer, "ASCII\0\0\0", 8); - strcpy (buffer+8, value.c_str()); - t->fromString (buffer, value.size() + 9); - } -}; -UserCommentInterpreter userCommentInterpreter; - -const TagAttrib exifAttribs[] = { - 0, 2, 0, 0, 0x0103, "Compression", &compressionInterpreter, - 0, 2, 0, 0, 0xA000, "FlashpixVersion", &stdInterpreter, - 0, 2, 0, 0, 0xA001, "ColorSpace", &colorSpaceInterpreter, - 0, 1, 0, 0, 0x9000, "ExifVersion", &stdInterpreter, - 0, 1, 0, 0, 0x9003, "DateTimeOriginal", &stdInterpreter, - 0, 1, 0, 0, 0x9004, "DateTimeDigitized", &stdInterpreter, - 0, 2, 0, 0, 0x9101, "ComponentsConfiguration", &stdInterpreter, - 0, 2, 0, 0, 0x9102, "CompressedBitsPerPixel", &stdInterpreter, - 0, 2, 0, 0, 0xA002, "PixelXDimension", &stdInterpreter, - 0, 2, 0, 0, 0xA003, "PixelYDimension", &stdInterpreter, - 0, 1, 0, 0, 0x927C, "MakerNote", &stdInterpreter, - 0, 1, 1, 0, 0x9286, "UserComment", &userCommentInterpreter, - 1, 0, 0, 0, 0xA004, "RelatedSoundFile", &stdInterpreter, - 0, 1, 0, 0, 0x9290, "SubSecTime", &stdInterpreter, - 0, 1, 0, 0, 0x9291, "SubSecTimeOriginal", &stdInterpreter, - 0, 1, 0, 0, 0x9292, "SubSecTimeDigitized", &stdInterpreter, - 0, 1, 0, 0, 0xA420, "ImageUniqueID", &stdInterpreter, - 0, 1, 0, 0, 0x829A, "ExposureTime", &exposureTimeInterpreter, - 0, 1, 0, 0, 0x829D, "FNumber", &fNumberInterpreter, - 0, 1, 0, 0, 0x8822, "ExposureProgram", &exposureProgramInterpreter, - 0, 1, 0, 0, 0x8824, "SpectralSensitivity", &stdInterpreter, - 0, 1, 0, 0, 0x8827, "ISOSpeedRatings", &stdInterpreter, - 0, 1, 0, 0, 0x8828, "OECF", &stdInterpreter, - 0, 1, 0, 0, 0x9201, "ShutterSpeedValue", &shutterSpeedInterpreter, - 0, 1, 0, 0, 0x9202, "ApertureValue", &apertureInterpreter, - 0, 1, 0, 0, 0x9203, "BrightnessValue", &stdInterpreter, - 0, 1, 0, 0, 0x9204, "ExposureBiasValue", &exposureBiasInterpreter, - 0, 1, 0, 0, 0x9205, "MaxApertureValue", &apertureInterpreter, - 0, 1, 0, 0, 0x9206, "SubjectDistance", &stdInterpreter, - 0, 1, 0, 0, 0x9207, "MeteringMode", &meteringModeInterpreter, - 0, 1, 0, 0, 0x9208, "LightSource", &lightSourceInterpreter, - 0, 1, 0, 0, 0x9209, "Flash", &flashInterpreter, - 0, 1, 0, 0, 0x920A, "FocalLength", &focalLengthInterpreter, - 0, 1, 0, 0, 0x9214, "SubjectArea", &stdInterpreter, - 0, 0, 0, 0, 0x9216, "TIFFEPSStandardID", &stdInterpreter, - 0, 1, 0, 0, 0x9217, "SensingMethod", &stdInterpreter, - 0, 1, 0, 0, 0xA20B, "FlashEnergy", &stdInterpreter, - 0, 1, 0, 0, 0xA20C, "SpatialFrequencyResponse", &stdInterpreter, - 0, 1, 0, 0, 0xA20E, "FocalPlaneXResolution", &stdInterpreter, - 0, 1, 0, 0, 0xA20F, "FocalPlaneYResolution", &stdInterpreter, - 0, 1, 0, 0, 0xA210, "FocalPlaneResolutionUnit", &stdInterpreter, - 0, 1, 0, 0, 0xA214, "SubjectLocation", &stdInterpreter, - 0, 1, 0, 0, 0xA215, "ExposureIndex", &stdInterpreter, - 0, 1, 0, 0, 0xA217, "SensingMethod", &stdInterpreter, - 0, 1, 0, 0, 0xA300, "FileSource", &stdInterpreter, - 0, 1, 0, 0, 0xA301, "SceneType", &stdInterpreter, - 0, 0, 0, 0, 0xA302, "CFAPattern", &stdInterpreter, - 0, 1, 0, 0, 0xA401, "CustomRendered", &stdInterpreter, - 0, 1, 0, 0, 0xA402, "ExposureMode", &exposureModeInterpreter, - 0, 1, 0, 0, 0xA403, "WhiteBalance", &whiteBalanceInterpreter, - 0, 1, 0, 0, 0xA404, "DigitalZoomRatio", &stdInterpreter, - 0, 1, 0, 0, 0xA405, "FocalLengthIn35mmFilm", &stdInterpreter, - 0, 1, 0, 0, 0xA406, "SceneCaptureType", &sceneCaptureInterpreter, - 0, 1, 0, 0, 0xA407, "GainControl", &gainControlInterpreter, - 0, 1, 0, 0, 0xA408, "Contrast", &contrastInterpreter, - 0, 1, 0, 0, 0xA409, "Saturation", &saturationInterpreter, - 0, 1, 0, 0, 0xA40A, "Sharpness", &sharpnessInterpreter, - 0, 1, 0, 0, 0xA40B, "DeviceSettingDescription", &stdInterpreter, - 0, 1, 0, 0, 0xA40C, "SubjectDistanceRange", &stdInterpreter, - 0, 0, 0, 0, 0x828d, "CFAPattern", &stdInterpreter, - 0, 0, 0, 0, 0x828e, "CFARepeatPatternDim", &stdInterpreter, --1, 0, 0, 0, 0, "", NULL }; -// 0, 0xA005, LONG, 1, "Interoperability tag", "Interoperability IFD Pointer"}; - -const TagAttrib gpsAttribs[] = { - 0, 1, 0, 0, 0x0000, "GPSVersionID", &stdInterpreter, - 0, 1, 0, 0, 0x0001, "GPSLatitudeRef", &stdInterpreter, - 0, 1, 0, 0, 0x0002, "GPSLatitude", &stdInterpreter, - 0, 1, 0, 0, 0x0003, "GPSLongitudeRef", &stdInterpreter, - 0, 1, 0, 0, 0x0004, "GPSLongitude", &stdInterpreter, - 0, 1, 0, 0, 0x0005, "GPSAltitudeRef", &stdInterpreter, - 0, 1, 0, 0, 0x0006, "GPSAltitude", &stdInterpreter, - 0, 1, 0, 0, 0x0007, "GPSTimeStamp", &stdInterpreter, - 0, 1, 0, 0, 0x0008, "GPSSatelites", &stdInterpreter, - 0, 1, 0, 0, 0x0009, "GPSStatus", &stdInterpreter, - 0, 1, 0, 0, 0x000a, "GPSMeasureMode", &stdInterpreter, - 0, 1, 0, 0, 0x000b, "GPSDOP", &stdInterpreter, - 0, 1, 0, 0, 0x000c, "GPSSpeedRef", &stdInterpreter, - 0, 1, 0, 0, 0x000d, "GPSSpeed", &stdInterpreter, - 0, 1, 0, 0, 0x000e, "GPSTrackRef", &stdInterpreter, - 0, 1, 0, 0, 0x000f, "GPSTrack", &stdInterpreter, - 0, 1, 0, 0, 0x0010, "GPSImgDirectionRef", &stdInterpreter, - 0, 1, 0, 0, 0x0011, "GPSImgDirection", &stdInterpreter, - 0, 1, 0, 0, 0x0012, "GPSMapDatum", &stdInterpreter, - 0, 1, 0, 0, 0x0013, "GPSDestLatitudeRef", &stdInterpreter, - 0, 1, 0, 0, 0x0014, "GPSDestLatitude", &stdInterpreter, - 0, 1, 0, 0, 0x0015, "GPSDestLongitudeRef", &stdInterpreter, - 0, 1, 0, 0, 0x0016, "GPSDestLongitude", &stdInterpreter, - 0, 1, 0, 0, 0x0017, "GPSDestBearingRef", &stdInterpreter, - 0, 1, 0, 0, 0x0018, "GPSDestBearing", &stdInterpreter, - 0, 1, 0, 0, 0x0019, "GPSDestDistanceRef", &stdInterpreter, - 0, 1, 0, 0, 0x001a, "GPSDestDistance", &stdInterpreter, - 0, 1, 0, 0, 0x001b, "GPSProcessingMethod", &stdInterpreter, - 0, 1, 0, 0, 0x001c, "GPSAreaInformation", &stdInterpreter, - 0, 1, 0, 0, 0x001d, "GPSDateStamp", &stdInterpreter, - 0, 1, 0, 0, 0x001e, "GPSDifferential", &stdInterpreter, - -1, 0, 0, 0, 0, "", NULL }; - - - -const TagAttrib iopAttribs[] = { - 0, 1, 0, 0, 0x0001, "InteroperabilityIndex", &stdInterpreter, - 0, 1, 0, 0, 0x0002, "InteroperabilityVersion", &stdInterpreter, --1, 0, 0, 0, 0, "", NULL }; - - const TagAttrib ifdAttribs[] = { - 0, 2, 0, 0, 0x0017, "PanaISO", &stdInterpreter, - 0, 2, 0, 0, 0x0100, "ImageWidth", &stdInterpreter, - 0, 2, 0, 0, 0x0101, "ImageHeight", &stdInterpreter, - 0, 2, 0, 0, 0x0102, "BitsPerSample", &stdInterpreter, - 0, 2, 0, 0, 0x0103, "Compression", &compressionInterpreter, - 0, 2, 0, 0, 0x0106, "PhotometricInterpretation", &photometricInterpreter, - 0, 2, 0, 0, 0x0112, "Orientation", &stdInterpreter, - 0, 2, 0, 0, 0x0115, "SamplesPerPixel", &stdInterpreter, - 0, 2, 0, 0, 0x011C, "PlanarConfiguration", &planarConfigInterpreter, - 0, 2, 0, 0, 0x0212, "YCbCrSubSampling", &stdInterpreter, - 0, 2, 0, 0, 0x0213, "YCbCrPositioning", &stdInterpreter, - 0, 2, 0, 0, 0x011A, "XResolution", &stdInterpreter, - 0, 2, 0, 0, 0x011B, "YResolution", &stdInterpreter, - 0, 2, 0, 0, 0x0128, "ResolutionUnit", &stdInterpreter, - 1, 0, 0, 0, 0x0111, "StripOffsets", &stdInterpreter, - 1, 0, 0, 0, 0x0116, "RowsPerStrip", &stdInterpreter, - 1, 0, 0, 0, 0x0117, "StripByteCounts", &stdInterpreter, - 0, 2, 0, 0, 0x0201, "JPEGInterchangeFormat", &stdInterpreter, - 0, 2, 0, 0, 0x0202, "JPEGInterchangeFormatLength", &stdInterpreter, - 0, 2, 0, 0, 0x012D, "TransferFunction", &stdInterpreter, - 0, 2, 0, 0, 0x013E, "WhitePoint", &stdInterpreter, - 0, 2, 0, 0, 0x013F, "PriomaryChromaticities", &stdInterpreter, - 0, 2, 0, 0, 0x0211, "YCbCrCoefficients", &stdInterpreter, - 0, 2, 0, 0, 0x0214, "ReferenceBlackWhite", &stdInterpreter, - 0, 1, 0, 0, 0x0132, "DateTime", &stdInterpreter, - 0, 1, 1, 0, 0x010E, "ImageDescription", &stdInterpreter, - 0, 1, 0, 0, 0x010F, "Make", &stdInterpreter, - 0, 1, 0, 0, 0x0110, "Model", &stdInterpreter, - 0, 2, 0, 0, 0x0131, "Software", &stdInterpreter, - 0, 1, 1, 0, 0x013B, "Artist", &stdInterpreter, - 0, 1, 1, 0, 0x8298, "Copyright", &stdInterpreter, - 0, 1, 0, exifAttribs, 0x8769, "Exif", &stdInterpreter, - 0, 2, 0, 0, 0x8773, "ICCProfile", &stdInterpreter, - 0, 2, 0, 0, 0x83BB, "IPTCData", &stdInterpreter, - 0, 1, 0, gpsAttribs, 0x8825, "GPSInfo", &stdInterpreter, - 0, 1, 0, 0, 0x9003, "DateTimeOriginal", &stdInterpreter, - 0, 1, 0, 0, 0x9004, "DateTimeDigitized", &stdInterpreter, - 0, 1, 0, iopAttribs, 0xA005, "Interoperability", &stdInterpreter, - 1, 2, 0, ifdAttribs, 0x014A, "SubIFD", &stdInterpreter, - 0, 0, 0, 0, 0xC4A5, "PrintIMInformation", &stdInterpreter, - 0, 2, 0, 0, 0x00fe, "NewSubFileType", &stdInterpreter, - -1, 0, 0, 0, 0, "", NULL}; - -}; - -/*#include -#include -#include -#include -#include -#include */ - -#endif +#include + +namespace rtexif { + +class ColorSpaceInterpreter : public ChoiceInterpreter { + + public: + ColorSpaceInterpreter () { + choices[1] = "sRGB"; + choices[0xffff] = "Uncalibrated"; + } +}; +ColorSpaceInterpreter colorSpaceInterpreter; + +class ExposureProgramInterpreter : public ChoiceInterpreter { + + public: + ExposureProgramInterpreter () { + choices[0] = "Not defined"; + choices[1] = "Manual"; + choices[2] = "Normal program"; + choices[3] = "Aperture priority"; + choices[4] = "Shutter priority"; + choices[5] = "Creative program"; + choices[6] = "Action program"; + choices[7] = "Portrait mode"; + choices[8] = "Landscape mode"; + } +}; +ExposureProgramInterpreter exposureProgramInterpreter; + +class MeteringModeInterpreter : public ChoiceInterpreter { + + public: + MeteringModeInterpreter () { + choices[0] = "Unknown"; + choices[1] = "Average"; + choices[2] = "Center weighted"; + choices[3] = "Spot"; + choices[4] = "Multispot"; + choices[5] = "Pattern"; + choices[6] = "Partial"; + choices[255] = "Other"; + } +}; +MeteringModeInterpreter meteringModeInterpreter; + +class ExposureModeInterpreter : public ChoiceInterpreter { + + public: + ExposureModeInterpreter () { + choices[0] = "Auto exposure"; + choices[1] = "Manual exposure"; + choices[2] = "Auto bracket"; + } +}; +ExposureModeInterpreter exposureModeInterpreter; + +class WhiteBalanceInterpreter : public ChoiceInterpreter { + + public: + WhiteBalanceInterpreter () { + choices[0] = "Auto white balance"; + choices[1] = "Manual white balance"; + } +}; +WhiteBalanceInterpreter whiteBalanceInterpreter; + +class SceneCaptureInterpreter : public ChoiceInterpreter { + + public: + SceneCaptureInterpreter () { + choices[0] = "Standard"; + choices[1] = "Landscape"; + choices[2] = "Portrait"; + choices[3] = "Night scene"; + } +}; +SceneCaptureInterpreter sceneCaptureInterpreter; + +class GainControlInterpreter : public ChoiceInterpreter { + + public: + GainControlInterpreter () { + choices[0] = "None"; + choices[1] = "Low gain up"; + choices[2] = "High gain up"; + choices[3] = "Low gain down"; + choices[4] = "High gain down"; + } +}; +GainControlInterpreter gainControlInterpreter; + +class ContrastInterpreter : public ChoiceInterpreter { + + public: + ContrastInterpreter () { + choices[0] = "Normal"; + choices[1] = "Soft"; + choices[2] = "Hard"; + } +}; +ContrastInterpreter contrastInterpreter; + +class SharpnessInterpreter : public ChoiceInterpreter { + + public: + SharpnessInterpreter () { + choices[0] = "Normal"; + choices[1] = "Soft"; + choices[2] = "Hard"; + } +}; +SharpnessInterpreter sharpnessInterpreter; + +class SaturationInterpreter : public ChoiceInterpreter { + + public: + SaturationInterpreter () { + choices[0] = "Normal"; + choices[1] = "Low saturation"; + choices[2] = "High saturation"; + } +}; +SaturationInterpreter saturationInterpreter; + +class FlashInterpreter : public ChoiceInterpreter { + + public: + FlashInterpreter () { + choices[0x0000] = "Flash did not fire"; + choices[0x0001] = "Flash fired"; + choices[0x0005] = "Strobe return light not detected"; + choices[0x0007] = "Strobe return light detected"; + choices[0x0009] = "Flash fired, compulsory flash mode"; + choices[0x000D] = "Flash fired, compulsory flash mode, return light not detected"; + choices[0x000F] = "Flash fired, compulsory flash mode, return light detected"; + choices[0x0010] = "Flash did not fire, compulsory flash mode"; + choices[0x0018] = "Flash did not fire, auto mode"; + choices[0x0019] = "Flash fired, auto mode"; + choices[0x001D] = "Flash fired, auto mode, return light not detected"; + choices[0x001F] = "Flash fired, auto mode, return light detected"; + choices[0x0020] = "No flash function"; + choices[0x0041] = "Flash fired, red-eye reduction mode"; + choices[0x0045] = "Flash fired, red-eye reduction mode, return light not detected"; + choices[0x0047] = "Flash fired, red-eye reduction mode, return light detected"; + choices[0x0049] = "Flash fired, compulsory flash mode, red-eye reduction mode"; + choices[0x004D] = "Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected"; + choices[0x004F] = "Flash fired, compulsory flash mode, red-eye reduction mode, return light detected"; + choices[0x0059] = "Flash fired, auto mode, red-eye reduction mode"; + choices[0x005D] = "Flash fired, auto mode, return light not detected, red-eye reduction mode"; + choices[0x005F] = "Flash fired, auto mode, return light detected, red-eye reduction mode"; + } +}; +FlashInterpreter flashInterpreter; + +class LightSourceInterpreter : public ChoiceInterpreter { + + public: + LightSourceInterpreter () { + choices[0] = "Unknown"; + choices[1] = "Daylight"; + choices[2] = "Fluorescent"; + choices[3] = "Tungsten"; + choices[4] = "Flash"; + choices[9] = "Fine weather"; + choices[10] = "Cloudy weather"; + choices[11] = "Shade"; + choices[12] = "Daylight fluorescent"; + choices[13] = "Day white fluorescent"; + choices[14] = "Cool white fluorescent"; + choices[15] = "White fluorescent"; + choices[17] = "Standard light A"; + choices[18] = "Standard light B"; + choices[19] = "Standard light C"; + choices[20] = "D55"; + choices[21] = "D65"; + choices[22] = "D75"; + choices[23] = "D50"; + choices[24] = "ISO studio tungsten"; + choices[255] = "Other light source"; + } +}; +LightSourceInterpreter lightSourceInterpreter; + +class CompressionInterpreter : public ChoiceInterpreter { + + public: + CompressionInterpreter () { + choices[1] = "Uncompressed"; + choices[6] = "JPEG Compression"; + } +}; +CompressionInterpreter compressionInterpreter; + +class PhotometricInterpreter : public ChoiceInterpreter { + + public: + PhotometricInterpreter () { + choices[2] = "RGB"; + choices[6] = "YCbCr"; + } +}; +PhotometricInterpreter photometricInterpreter; + +class PlanarConfigInterpreter : public ChoiceInterpreter { + + public: + PlanarConfigInterpreter () { + choices[1] = "Chunky format"; + choices[2] = "Planar format"; + } +}; +PlanarConfigInterpreter planarConfigInterpreter; + +class FNumberInterpreter : public Interpreter { + public: + FNumberInterpreter () {} + virtual std::string toString (Tag* t) { + sprintf (buffer, "%0.1f", t->toDouble()); + return buffer; + } +}; +FNumberInterpreter fNumberInterpreter; + +class ApertureInterpreter : public Interpreter { + public: + ApertureInterpreter () {} + virtual std::string toString (Tag* t) { + sprintf (buffer, "%0.1f", pow(2.0, t->toDouble()/2.0)); + return buffer; + } +}; +ApertureInterpreter apertureInterpreter; + +class ExposureBiasInterpreter : public Interpreter { + public: + ExposureBiasInterpreter () {} + virtual std::string toString (Tag* t) { + sprintf (buffer, "%+0.2f", t->toDouble()); + return buffer; + } +}; +ExposureBiasInterpreter exposureBiasInterpreter; + +class ShutterSpeedInterpreter : public Interpreter { + public: + ShutterSpeedInterpreter () {} + virtual std::string toString (Tag* t) { + double d = pow (2.0, -t->toDouble()); + if (d > 0.0 && d < 0.9) + sprintf (buffer, "1/%0.0f", 1.0 / d); + else + sprintf (buffer, "%0.1f", d); + return buffer; + } +}; +ShutterSpeedInterpreter shutterSpeedInterpreter; + +class ExposureTimeInterpreter : public Interpreter { + public: + ExposureTimeInterpreter () {} + virtual std::string toString (Tag* t) { + double d = t->toDouble(); + if (d > 0.0 && d < 0.9) + sprintf (buffer, "1/%0.0f", 1.0 / d); + else + sprintf (buffer, "%0.1f", d); + return buffer; + } +}; +ExposureTimeInterpreter exposureTimeInterpreter; + +class FocalLengthInterpreter : public Interpreter { + public: + FocalLengthInterpreter () {} + virtual std::string toString (Tag* t) { + sprintf (buffer, "%0.1f", t->toDouble()); + return buffer; + } +}; +FocalLengthInterpreter focalLengthInterpreter; + +class UserCommentInterpreter : public Interpreter { + public: + UserCommentInterpreter () {} + virtual std::string toString (Tag* t) { + if (!strncmp((char*)t->getValue(), "ASCII\0\0\0",8)) + strncpy (buffer, (char*)t->getValue()+8, t->getCount()-8); + else + buffer[0]=0; + return buffer; + } + virtual void fromString (Tag* t, const std::string& value) { + memcpy (buffer, "ASCII\0\0\0", 8); + strcpy (buffer+8, value.c_str()); + t->fromString (buffer, value.size() + 9); + } +}; +UserCommentInterpreter userCommentInterpreter; + +const TagAttrib exifAttribs[] = { + 0, 2, 0, 0, 0x0103, "Compression", &compressionInterpreter, + 0, 2, 0, 0, 0xA000, "FlashpixVersion", &stdInterpreter, + 0, 2, 0, 0, 0xA001, "ColorSpace", &colorSpaceInterpreter, + 0, 1, 0, 0, 0x9000, "ExifVersion", &stdInterpreter, + 0, 1, 0, 0, 0x9003, "DateTimeOriginal", &stdInterpreter, + 0, 1, 0, 0, 0x9004, "DateTimeDigitized", &stdInterpreter, + 0, 2, 0, 0, 0x9101, "ComponentsConfiguration", &stdInterpreter, + 0, 2, 0, 0, 0x9102, "CompressedBitsPerPixel", &stdInterpreter, + 0, 2, 0, 0, 0xA002, "PixelXDimension", &stdInterpreter, + 0, 2, 0, 0, 0xA003, "PixelYDimension", &stdInterpreter, + 0, 1, 0, 0, 0x927C, "MakerNote", &stdInterpreter, + 0, 1, 1, 0, 0x9286, "UserComment", &userCommentInterpreter, + 1, 0, 0, 0, 0xA004, "RelatedSoundFile", &stdInterpreter, + 0, 1, 0, 0, 0x9290, "SubSecTime", &stdInterpreter, + 0, 1, 0, 0, 0x9291, "SubSecTimeOriginal", &stdInterpreter, + 0, 1, 0, 0, 0x9292, "SubSecTimeDigitized", &stdInterpreter, + 0, 1, 0, 0, 0xA420, "ImageUniqueID", &stdInterpreter, + 0, 1, 0, 0, 0x829A, "ExposureTime", &exposureTimeInterpreter, + 0, 1, 0, 0, 0x829D, "FNumber", &fNumberInterpreter, + 0, 1, 0, 0, 0x8822, "ExposureProgram", &exposureProgramInterpreter, + 0, 1, 0, 0, 0x8824, "SpectralSensitivity", &stdInterpreter, + 0, 1, 0, 0, 0x8827, "ISOSpeedRatings", &stdInterpreter, + 0, 1, 0, 0, 0x8828, "OECF", &stdInterpreter, + 0, 1, 0, 0, 0x9201, "ShutterSpeedValue", &shutterSpeedInterpreter, + 0, 1, 0, 0, 0x9202, "ApertureValue", &apertureInterpreter, + 0, 1, 0, 0, 0x9203, "BrightnessValue", &stdInterpreter, + 0, 1, 0, 0, 0x9204, "ExposureBiasValue", &exposureBiasInterpreter, + 0, 1, 0, 0, 0x9205, "MaxApertureValue", &apertureInterpreter, + 0, 1, 0, 0, 0x9206, "SubjectDistance", &stdInterpreter, + 0, 1, 0, 0, 0x9207, "MeteringMode", &meteringModeInterpreter, + 0, 1, 0, 0, 0x9208, "LightSource", &lightSourceInterpreter, + 0, 1, 0, 0, 0x9209, "Flash", &flashInterpreter, + 0, 1, 0, 0, 0x920A, "FocalLength", &focalLengthInterpreter, + 0, 1, 0, 0, 0x9214, "SubjectArea", &stdInterpreter, + 0, 0, 0, 0, 0x9216, "TIFFEPSStandardID", &stdInterpreter, + 0, 1, 0, 0, 0x9217, "SensingMethod", &stdInterpreter, + 0, 1, 0, 0, 0xA20B, "FlashEnergy", &stdInterpreter, + 0, 1, 0, 0, 0xA20C, "SpatialFrequencyResponse", &stdInterpreter, + 0, 1, 0, 0, 0xA20E, "FocalPlaneXResolution", &stdInterpreter, + 0, 1, 0, 0, 0xA20F, "FocalPlaneYResolution", &stdInterpreter, + 0, 1, 0, 0, 0xA210, "FocalPlaneResolutionUnit", &stdInterpreter, + 0, 1, 0, 0, 0xA214, "SubjectLocation", &stdInterpreter, + 0, 1, 0, 0, 0xA215, "ExposureIndex", &stdInterpreter, + 0, 1, 0, 0, 0xA217, "SensingMethod", &stdInterpreter, + 0, 1, 0, 0, 0xA300, "FileSource", &stdInterpreter, + 0, 1, 0, 0, 0xA301, "SceneType", &stdInterpreter, + 0, 0, 0, 0, 0xA302, "CFAPattern", &stdInterpreter, + 0, 1, 0, 0, 0xA401, "CustomRendered", &stdInterpreter, + 0, 1, 0, 0, 0xA402, "ExposureMode", &exposureModeInterpreter, + 0, 1, 0, 0, 0xA403, "WhiteBalance", &whiteBalanceInterpreter, + 0, 1, 0, 0, 0xA404, "DigitalZoomRatio", &stdInterpreter, + 0, 1, 0, 0, 0xA405, "FocalLengthIn35mmFilm", &stdInterpreter, + 0, 1, 0, 0, 0xA406, "SceneCaptureType", &sceneCaptureInterpreter, + 0, 1, 0, 0, 0xA407, "GainControl", &gainControlInterpreter, + 0, 1, 0, 0, 0xA408, "Contrast", &contrastInterpreter, + 0, 1, 0, 0, 0xA409, "Saturation", &saturationInterpreter, + 0, 1, 0, 0, 0xA40A, "Sharpness", &sharpnessInterpreter, + 0, 1, 0, 0, 0xA40B, "DeviceSettingDescription", &stdInterpreter, + 0, 1, 0, 0, 0xA40C, "SubjectDistanceRange", &stdInterpreter, + 0, 0, 0, 0, 0x828d, "CFAPattern", &stdInterpreter, + 0, 0, 0, 0, 0x828e, "CFARepeatPatternDim", &stdInterpreter, +-1, 0, 0, 0, 0, "", NULL }; +// 0, 0xA005, LONG, 1, "Interoperability tag", "Interoperability IFD Pointer"}; + +const TagAttrib gpsAttribs[] = { + 0, 1, 0, 0, 0x0000, "GPSVersionID", &stdInterpreter, + 0, 1, 0, 0, 0x0001, "GPSLatitudeRef", &stdInterpreter, + 0, 1, 0, 0, 0x0002, "GPSLatitude", &stdInterpreter, + 0, 1, 0, 0, 0x0003, "GPSLongitudeRef", &stdInterpreter, + 0, 1, 0, 0, 0x0004, "GPSLongitude", &stdInterpreter, + 0, 1, 0, 0, 0x0005, "GPSAltitudeRef", &stdInterpreter, + 0, 1, 0, 0, 0x0006, "GPSAltitude", &stdInterpreter, + 0, 1, 0, 0, 0x0007, "GPSTimeStamp", &stdInterpreter, + 0, 1, 0, 0, 0x0008, "GPSSatelites", &stdInterpreter, + 0, 1, 0, 0, 0x0009, "GPSStatus", &stdInterpreter, + 0, 1, 0, 0, 0x000a, "GPSMeasureMode", &stdInterpreter, + 0, 1, 0, 0, 0x000b, "GPSDOP", &stdInterpreter, + 0, 1, 0, 0, 0x000c, "GPSSpeedRef", &stdInterpreter, + 0, 1, 0, 0, 0x000d, "GPSSpeed", &stdInterpreter, + 0, 1, 0, 0, 0x000e, "GPSTrackRef", &stdInterpreter, + 0, 1, 0, 0, 0x000f, "GPSTrack", &stdInterpreter, + 0, 1, 0, 0, 0x0010, "GPSImgDirectionRef", &stdInterpreter, + 0, 1, 0, 0, 0x0011, "GPSImgDirection", &stdInterpreter, + 0, 1, 0, 0, 0x0012, "GPSMapDatum", &stdInterpreter, + 0, 1, 0, 0, 0x0013, "GPSDestLatitudeRef", &stdInterpreter, + 0, 1, 0, 0, 0x0014, "GPSDestLatitude", &stdInterpreter, + 0, 1, 0, 0, 0x0015, "GPSDestLongitudeRef", &stdInterpreter, + 0, 1, 0, 0, 0x0016, "GPSDestLongitude", &stdInterpreter, + 0, 1, 0, 0, 0x0017, "GPSDestBearingRef", &stdInterpreter, + 0, 1, 0, 0, 0x0018, "GPSDestBearing", &stdInterpreter, + 0, 1, 0, 0, 0x0019, "GPSDestDistanceRef", &stdInterpreter, + 0, 1, 0, 0, 0x001a, "GPSDestDistance", &stdInterpreter, + 0, 1, 0, 0, 0x001b, "GPSProcessingMethod", &stdInterpreter, + 0, 1, 0, 0, 0x001c, "GPSAreaInformation", &stdInterpreter, + 0, 1, 0, 0, 0x001d, "GPSDateStamp", &stdInterpreter, + 0, 1, 0, 0, 0x001e, "GPSDifferential", &stdInterpreter, + -1, 0, 0, 0, 0, "", NULL }; + + + +const TagAttrib iopAttribs[] = { + 0, 1, 0, 0, 0x0001, "InteroperabilityIndex", &stdInterpreter, + 0, 1, 0, 0, 0x0002, "InteroperabilityVersion", &stdInterpreter, +-1, 0, 0, 0, 0, "", NULL }; + + const TagAttrib ifdAttribs[] = { + 0, 2, 0, 0, 0x0017, "PanaISO", &stdInterpreter, + 0, 2, 0, 0, 0x0100, "ImageWidth", &stdInterpreter, + 0, 2, 0, 0, 0x0101, "ImageHeight", &stdInterpreter, + 0, 2, 0, 0, 0x0102, "BitsPerSample", &stdInterpreter, + 0, 2, 0, 0, 0x0103, "Compression", &compressionInterpreter, + 0, 2, 0, 0, 0x0106, "PhotometricInterpretation", &photometricInterpreter, + 0, 2, 0, 0, 0x0112, "Orientation", &stdInterpreter, + 0, 2, 0, 0, 0x0115, "SamplesPerPixel", &stdInterpreter, + 0, 2, 0, 0, 0x011C, "PlanarConfiguration", &planarConfigInterpreter, + 0, 2, 0, 0, 0x0212, "YCbCrSubSampling", &stdInterpreter, + 0, 2, 0, 0, 0x0213, "YCbCrPositioning", &stdInterpreter, + 0, 2, 0, 0, 0x011A, "XResolution", &stdInterpreter, + 0, 2, 0, 0, 0x011B, "YResolution", &stdInterpreter, + 0, 2, 0, 0, 0x0128, "ResolutionUnit", &stdInterpreter, + 1, 0, 0, 0, 0x0111, "StripOffsets", &stdInterpreter, + 1, 0, 0, 0, 0x0116, "RowsPerStrip", &stdInterpreter, + 1, 0, 0, 0, 0x0117, "StripByteCounts", &stdInterpreter, + 0, 2, 0, 0, 0x0201, "JPEGInterchangeFormat", &stdInterpreter, + 0, 2, 0, 0, 0x0202, "JPEGInterchangeFormatLength", &stdInterpreter, + 0, 2, 0, 0, 0x012D, "TransferFunction", &stdInterpreter, + 0, 2, 0, 0, 0x013E, "WhitePoint", &stdInterpreter, + 0, 2, 0, 0, 0x013F, "PriomaryChromaticities", &stdInterpreter, + 0, 2, 0, 0, 0x0211, "YCbCrCoefficients", &stdInterpreter, + 0, 2, 0, 0, 0x0214, "ReferenceBlackWhite", &stdInterpreter, + 0, 1, 0, 0, 0x0132, "DateTime", &stdInterpreter, + 0, 1, 1, 0, 0x010E, "ImageDescription", &stdInterpreter, + 0, 1, 0, 0, 0x010F, "Make", &stdInterpreter, + 0, 1, 0, 0, 0x0110, "Model", &stdInterpreter, + 0, 2, 0, 0, 0x0131, "Software", &stdInterpreter, + 0, 1, 1, 0, 0x013B, "Artist", &stdInterpreter, + 0, 1, 1, 0, 0x8298, "Copyright", &stdInterpreter, + 0, 1, 0, exifAttribs, 0x8769, "Exif", &stdInterpreter, + 0, 2, 0, 0, 0x8773, "ICCProfile", &stdInterpreter, + 0, 2, 0, 0, 0x83BB, "IPTCData", &stdInterpreter, + 0, 1, 0, gpsAttribs, 0x8825, "GPSInfo", &stdInterpreter, + 0, 1, 0, 0, 0x9003, "DateTimeOriginal", &stdInterpreter, + 0, 1, 0, 0, 0x9004, "DateTimeDigitized", &stdInterpreter, + 0, 1, 0, iopAttribs, 0xA005, "Interoperability", &stdInterpreter, + 1, 2, 0, ifdAttribs, 0x014A, "SubIFD", &stdInterpreter, + 0, 0, 0, 0, 0xC4A5, "PrintIMInformation", &stdInterpreter, + 0, 2, 0, 0, 0x00fe, "NewSubFileType", &stdInterpreter, + -1, 0, 0, 0, 0, "", NULL}; + +}; + +/*#include +#include +#include +#include +#include +#include */ + +#endif diff --git a/rtgui/adjuster.cc b/rtgui/adjuster.cc index 8151076ee..92546ec3a 100644 --- a/rtgui/adjuster.cc +++ b/rtgui/adjuster.cc @@ -1,239 +1,239 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include -#include -#include - -extern Glib::ustring argv0; - -int Adjuster::delay = 1000; - -Adjuster::Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep, double vdefault, bool editedcb) { - - adjusterListener = NULL; - afterReset = false; - - set_border_width (2); - - hbox = Gtk::manage (new Gtk::HBox ()); - - label = Gtk::manage (new Gtk::Label (vlabel, Gtk::ALIGN_LEFT)); +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include +#include +#include + +extern Glib::ustring argv0; + +int Adjuster::delay = 1000; + +Adjuster::Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep, double vdefault, bool editedcb) { + + adjusterListener = NULL; + afterReset = false; + + set_border_width (2); + + hbox = Gtk::manage (new Gtk::HBox ()); + + label = Gtk::manage (new Gtk::Label (vlabel, Gtk::ALIGN_LEFT)); if (editedcb) { editedCheckBox = new Gtk::CheckButton (); - editedChange = editedCheckBox->signal_toggled().connect( sigc::mem_fun(*this, &Adjuster::editedToggled) ); + editedChange = editedCheckBox->signal_toggled().connect( sigc::mem_fun(*this, &Adjuster::editedToggled) ); hbox->pack_start (*editedCheckBox); } else editedCheckBox = NULL; - hbox->pack_start (*label); - - reset = Gtk::manage (new Gtk::Button ()); - reset->add (*Gtk::manage (new Gtk::Image (argv0+"/images/undo.png"))); - reset->set_relief (Gtk::RELIEF_NONE); - reset->set_border_width (0); + hbox->pack_start (*label); + + reset = Gtk::manage (new Gtk::Button ()); + reset->add (*Gtk::manage (new Gtk::Image (argv0+"/images/undo.png"))); + reset->set_relief (Gtk::RELIEF_NONE); + reset->set_border_width (0); reset->set_tooltip_text (M("ADJUSTER_RESET_TO_DEFAULT")); - hbox->pack_end (*reset, Gtk::PACK_SHRINK, 0); - - spin = Gtk::manage (new Gtk::SpinButton ()); - spin->set_size_request (70, -1); + hbox->pack_end (*reset, Gtk::PACK_SHRINK, 0); + + spin = Gtk::manage (new Gtk::SpinButton ()); + spin->set_size_request (70, -1); - hbox->pack_end (*spin, Gtk::PACK_SHRINK, 0); - - reset->set_size_request (-1, spin->get_height()); - - slider = Gtk::manage (new Gtk::HScale ()); - slider->set_draw_value (false); + hbox->pack_end (*spin, Gtk::PACK_SHRINK, 0); - pack_start (*hbox, false, false); - pack_start (*slider, false, false); - - setLimits (vmin, vmax, vstep, vdefault); - + reset->set_size_request (-1, spin->get_height()); + + slider = Gtk::manage (new Gtk::HScale ()); + slider->set_draw_value (false); + + pack_start (*hbox, false, false); + pack_start (*slider, false, false); + + setLimits (vmin, vmax, vstep, vdefault); + defaultVal = shapeValue (vdefault); - editedState = defEditedState = Irrelevant; - - sliderChange = slider->signal_value_changed().connect( sigc::mem_fun(*this, &Adjuster::sliderChanged) ); - spinChange = spin->signal_value_changed().connect ( sigc::mem_fun(*this, &Adjuster::spinChanged), true); - reset->signal_clicked().connect( sigc::mem_fun(*this, &Adjuster::resetPressed) ); - slider->set_update_policy (Gtk::UPDATE_CONTINUOUS); - - show_all (); -} + editedState = defEditedState = Irrelevant; + + sliderChange = slider->signal_value_changed().connect( sigc::mem_fun(*this, &Adjuster::sliderChanged) ); + spinChange = spin->signal_value_changed().connect ( sigc::mem_fun(*this, &Adjuster::spinChanged), true); + reset->signal_clicked().connect( sigc::mem_fun(*this, &Adjuster::resetPressed) ); + slider->set_update_policy (Gtk::UPDATE_CONTINUOUS); + + show_all (); +} Adjuster::~Adjuster () { - sliderChange.block (true); - spinChange.block (true); - delayConnection.block (true); + sliderChange.block (true); + spinChange.block (true); + delayConnection.block (true); adjusterListener = NULL; } - -void Adjuster::setDefault (double def) { - - defaultVal = shapeValue (def); -} - + +void Adjuster::setDefault (double def) { + + defaultVal = shapeValue (def); +} + void Adjuster::setDefaultEditedState (EditedState eState) { defEditedState = eState; } -void Adjuster::resetPressed () { +void Adjuster::resetPressed () { if (editedState!=Irrelevant) { editedState = defEditedState; if (editedCheckBox) { - editedChange.block (true); - editedCheckBox->set_active (defEditedState==Edited); - editedChange.block (false); + editedChange.block (true); + editedCheckBox->set_active (defEditedState==Edited); + editedChange.block (false); } refreshLabelStyle (); - } - afterReset = true; - slider->set_value (defaultVal); -} - -double Adjuster::shapeValue (double a) { - - return round(a*pow(double(10), digits)) / pow(double(10), digits); -} - -void Adjuster::setLimits (double vmin, double vmax, double vstep, double vdefault) { - - sliderChange.block (true); - spinChange.block (true); - for (digits=0; fabs(vstep*pow(double(10),digits)-floor(vstep*pow(double(10),digits)))>0.000000000001; digits++); - spin->set_digits (digits); - spin->set_increments (vstep, 2.0*vstep); - spin->set_range (vmin, vmax); - spin->set_value (shapeValue(vdefault)); - slider->set_digits (digits); - slider->set_increments (vstep, 2.0*vstep); - slider->set_range (vmin, vmax); - slider->set_value (shapeValue(vdefault)); - defaultVal = shapeValue (vdefault); - sliderChange.block (false); - spinChange.block (false); -} - -void Adjuster::setAdjusterListener (AdjusterListener* alistener) { - - adjusterListener = alistener; -} - -void Adjuster::spinChanged () { - - sliderChange.block (true); - slider->set_value (spin->get_value ()); - sliderChange.block (false); - - if (delay==0) { - if (adjusterListener!=NULL) - adjusterListener->adjusterChanged (this, spin->get_value ()); - } - else + } + afterReset = true; + slider->set_value (defaultVal); +} + +double Adjuster::shapeValue (double a) { + + return round(a*pow(double(10), digits)) / pow(double(10), digits); +} + +void Adjuster::setLimits (double vmin, double vmax, double vstep, double vdefault) { + + sliderChange.block (true); + spinChange.block (true); + for (digits=0; fabs(vstep*pow(double(10),digits)-floor(vstep*pow(double(10),digits)))>0.000000000001; digits++); + spin->set_digits (digits); + spin->set_increments (vstep, 2.0*vstep); + spin->set_range (vmin, vmax); + spin->set_value (shapeValue(vdefault)); + slider->set_digits (digits); + slider->set_increments (vstep, 2.0*vstep); + slider->set_range (vmin, vmax); + slider->set_value (shapeValue(vdefault)); + defaultVal = shapeValue (vdefault); + sliderChange.block (false); + spinChange.block (false); +} + +void Adjuster::setAdjusterListener (AdjusterListener* alistener) { + + adjusterListener = alistener; +} + +void Adjuster::spinChanged () { + + sliderChange.block (true); + slider->set_value (spin->get_value ()); + sliderChange.block (false); + + if (delay==0) { + if (adjusterListener!=NULL) + adjusterListener->adjusterChanged (this, spin->get_value ()); + } + else Glib::signal_idle().connect (sigc::mem_fun(*this, &Adjuster::notifyListener)); if (editedState==UnEdited) { editedState = Edited; if (editedCheckBox) { - editedChange.block (true); + editedChange.block (true); editedCheckBox->set_active (true); - editedChange.block (false); - } + editedChange.block (false); + } refreshLabelStyle (); - } - afterReset = false; -} - -void Adjuster::sliderChanged () { - - if (delayConnection.connected()) - delayConnection.disconnect (); - - spinChange.block (true); - spin->set_value (slider->get_value ()); - spinChange.block (false); - - if (delay==0) { - if (adjusterListener) - adjusterListener->adjusterChanged (this, spin->get_value ()); - } - else - delayConnection = Glib::signal_timeout().connect (sigc::mem_fun(*this, &Adjuster::notifyListener), delay); - - if (!afterReset && editedState==UnEdited) { - editedState = Edited; - if (editedCheckBox) { - editedChange.block (true); - editedCheckBox->set_active (true); - editedChange.block (false); - } - refreshLabelStyle (); - } - afterReset = false; -} - -void Adjuster::setValue (double a) { - - spinChange.block (true); - sliderChange.block (true); - spin->set_value (shapeValue (a)); - slider->set_value (shapeValue (a)); - sliderChange.block (false); - spinChange.block (false); - afterReset = false; -} - -double Adjuster::getValue () { - - return spin->get_value (); -} - -bool Adjuster::notifyListener () { - - gdk_threads_enter(); - - if (adjusterListener!=NULL) - adjusterListener->adjusterChanged (this, spin->get_value ()); - gdk_threads_leave(); - - return false; -} - -void Adjuster::setEnabled (bool enabled) { - - spin->set_sensitive (enabled); - slider->set_sensitive (enabled); -} + } + afterReset = false; +} + +void Adjuster::sliderChanged () { + + if (delayConnection.connected()) + delayConnection.disconnect (); + + spinChange.block (true); + spin->set_value (slider->get_value ()); + spinChange.block (false); + + if (delay==0) { + if (adjusterListener) + adjusterListener->adjusterChanged (this, spin->get_value ()); + } + else + delayConnection = Glib::signal_timeout().connect (sigc::mem_fun(*this, &Adjuster::notifyListener), delay); + + if (!afterReset && editedState==UnEdited) { + editedState = Edited; + if (editedCheckBox) { + editedChange.block (true); + editedCheckBox->set_active (true); + editedChange.block (false); + } + refreshLabelStyle (); + } + afterReset = false; +} + +void Adjuster::setValue (double a) { + + spinChange.block (true); + sliderChange.block (true); + spin->set_value (shapeValue (a)); + slider->set_value (shapeValue (a)); + sliderChange.block (false); + spinChange.block (false); + afterReset = false; +} + +double Adjuster::getValue () { + + return spin->get_value (); +} + +bool Adjuster::notifyListener () { + + gdk_threads_enter(); + + if (adjusterListener!=NULL) + adjusterListener->adjusterChanged (this, spin->get_value ()); + gdk_threads_leave(); + + return false; +} + +void Adjuster::setEnabled (bool enabled) { + + spin->set_sensitive (enabled); + slider->set_sensitive (enabled); +} void Adjuster::setEditedState (EditedState eState) { if (editedState!=eState) { - if (editedCheckBox) { + if (editedCheckBox) { editedChange.block (true); - editedCheckBox->set_active (eState==Edited); - editedChange.block (false); + editedCheckBox->set_active (eState==Edited); + editedChange.block (false); } editedState = eState; refreshLabelStyle (); @@ -241,8 +241,8 @@ void Adjuster::setEditedState (EditedState eState) { } EditedState Adjuster::getEditedState () { - - if (editedState!=Irrelevant && editedCheckBox) + + if (editedState!=Irrelevant && editedCheckBox) editedState = editedCheckBox->get_active () ? Edited : UnEdited; return editedState; } @@ -253,22 +253,22 @@ void Adjuster::showEditedCB () { editedCheckBox = new Gtk::CheckButton (); hbox->pack_start (*editedCheckBox, Gtk::PACK_SHRINK, 2); hbox->reorder_child (*editedCheckBox, 0); - editedChange = editedCheckBox->signal_toggled().connect( sigc::mem_fun(*this, &Adjuster::editedToggled) ); + editedChange = editedCheckBox->signal_toggled().connect( sigc::mem_fun(*this, &Adjuster::editedToggled) ); } } void Adjuster::refreshLabelStyle () { -/* Glib::RefPtr style = label->get_style (); +/* Glib::RefPtr style = label->get_style (); Pango::FontDescription fd = style->get_font (); fd.set_weight (editedState==Edited ? Pango::WEIGHT_BOLD : Pango::WEIGHT_NORMAL); - style->set_font (fd); - label->set_style (style); + style->set_font (fd); + label->set_style (style); label->queue_draw ();*/ -} +} -void Adjuster::editedToggled () { - - if (adjusterListener) - adjusterListener->adjusterChanged (this, spin->get_value ()); -} +void Adjuster::editedToggled () { + + if (adjusterListener) + adjusterListener->adjusterChanged (this, spin->get_value ()); +} diff --git a/rtgui/adjuster.h b/rtgui/adjuster.h index c0222dde4..7e29c01c4 100644 --- a/rtgui/adjuster.h +++ b/rtgui/adjuster.h @@ -1,83 +1,83 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _ADJUSTER_H_ -#define _ADJUSTER_H_ - +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _ADJUSTER_H_ +#define _ADJUSTER_H_ + #include -#include - -class Adjuster; -class AdjusterListener { - - public: - virtual void adjusterChanged (Adjuster* a, double newval) {} -}; - - -class Adjuster : public Gtk::VBox { - - protected: - Gtk::HBox* hbox; - Gtk::Label* label; - Gtk::HScale* slider; - Gtk::SpinButton* spin; - Gtk::Button* reset; - AdjusterListener* adjusterListener; - sigc::connection delayConnection; - sigc::connection spinChange; - sigc::connection sliderChange; - sigc::connection editedChange; - bool listenerReady; +#include + +class Adjuster; +class AdjusterListener { + + public: + virtual void adjusterChanged (Adjuster* a, double newval) {} +}; + + +class Adjuster : public Gtk::VBox { + + protected: + Gtk::HBox* hbox; + Gtk::Label* label; + Gtk::HScale* slider; + Gtk::SpinButton* spin; + Gtk::Button* reset; + AdjusterListener* adjusterListener; + sigc::connection delayConnection; + sigc::connection spinChange; + sigc::connection sliderChange; + sigc::connection editedChange; + bool listenerReady; double defaultVal; EditedState editedState; EditedState defEditedState; int digits; - Gtk::CheckButton* editedCheckBox; - bool afterReset; - + Gtk::CheckButton* editedCheckBox; + bool afterReset; + double shapeValue (double a); - void refreshLabelStyle (); - - public: - - static int delay; - - Adjuster (Glib::ustring label, double vmin, double vmax, double vstep, double vdefault, bool editedCheckBox=false); + void refreshLabelStyle (); + + public: + + static int delay; + + Adjuster (Glib::ustring label, double vmin, double vmax, double vstep, double vdefault, bool editedCheckBox=false); virtual ~Adjuster (); - void setAdjusterListener (AdjusterListener* alistener); - - double getValue (); + void setAdjusterListener (AdjusterListener* alistener); + + double getValue (); void setValue (double a); - void setLimits (double vmin, double vmax, double vstep, double vdefault); - void setEnabled (bool enabled); - void setDefault (double def); + void setLimits (double vmin, double vmax, double vstep, double vdefault); + void setEnabled (bool enabled); + void setDefault (double def); void setEditedState (EditedState eState); EditedState getEditedState (); void setDefaultEditedState (EditedState eState); void showEditedCB (); - void spinChanged (); - void sliderChanged (); + void spinChanged (); + void sliderChanged (); bool notifyListener (); - void resetPressed (); - void editedToggled (); -}; - -#endif + void resetPressed (); + void editedToggled (); +}; + +#endif diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index c44bd9f2f..f10dfdcb5 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -1,375 +1,375 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include -#include -#include -#include - -using namespace rtengine; - -BatchQueue::BatchQueue () : processing(NULL), listener(NULL) { - - int p = 0; - pmenu = new Gtk::Menu (); - pmenu->attach (*(cancel = new Gtk::MenuItem (M("FILEBROWSER_POPUPCANCELJOB"))), 0, 1, p, p+1); p++; - pmenu->attach (*(new Gtk::SeparatorMenuItem ()), 0, 1, p, p+1); p++; - pmenu->attach (*(head = new Gtk::MenuItem (M("FILEBROWSER_POPUPMOVEHEAD"))), 0, 1, p, p+1); p++; - pmenu->attach (*(tail = new Gtk::MenuItem (M("FILEBROWSER_POPUPMOVEEND"))), 0, 1, p, p+1); p++; - pmenu->attach (*(new Gtk::SeparatorMenuItem ()), 0, 1, p, p+1); p++; - pmenu->attach (*(selall = new Gtk::MenuItem (M("FILEBROWSER_POPUPSELECTALL"))), 0, 1, p, p+1); p++; - pmenu->show_all (); - - cancel->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &BatchQueue::cancelItems), &selected)); - head->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &BatchQueue::headItems), &selected)); - tail->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &BatchQueue::tailItems), &selected)); - selall->signal_activate().connect (sigc::mem_fun(*this, &BatchQueue::selectAll)); -} - -void BatchQueue::rightClicked (ThumbBrowserEntryBase* entry) { - - pmenu->popup (3, 0); -} - -void BatchQueue::addEntry (BatchQueueEntry* entry, bool head) { +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include +#include +#include +#include + +using namespace rtengine; + +BatchQueue::BatchQueue () : processing(NULL), listener(NULL) { + + int p = 0; + pmenu = new Gtk::Menu (); + pmenu->attach (*(cancel = new Gtk::MenuItem (M("FILEBROWSER_POPUPCANCELJOB"))), 0, 1, p, p+1); p++; + pmenu->attach (*(new Gtk::SeparatorMenuItem ()), 0, 1, p, p+1); p++; + pmenu->attach (*(head = new Gtk::MenuItem (M("FILEBROWSER_POPUPMOVEHEAD"))), 0, 1, p, p+1); p++; + pmenu->attach (*(tail = new Gtk::MenuItem (M("FILEBROWSER_POPUPMOVEEND"))), 0, 1, p, p+1); p++; + pmenu->attach (*(new Gtk::SeparatorMenuItem ()), 0, 1, p, p+1); p++; + pmenu->attach (*(selall = new Gtk::MenuItem (M("FILEBROWSER_POPUPSELECTALL"))), 0, 1, p, p+1); p++; + pmenu->show_all (); + + cancel->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &BatchQueue::cancelItems), &selected)); + head->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &BatchQueue::headItems), &selected)); + tail->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &BatchQueue::tailItems), &selected)); + selall->signal_activate().connect (sigc::mem_fun(*this, &BatchQueue::selectAll)); +} + +void BatchQueue::rightClicked (ThumbBrowserEntryBase* entry) { + + pmenu->popup (3, 0); +} + +void BatchQueue::addEntry (BatchQueueEntry* entry, bool head) { entry->setParent (this); - entry->resize (options.thumbSize); - + entry->resize (options.thumbSize); + entry->selected = false; - if (!head) + if (!head) fd.push_back (entry); else { std::vector::iterator pos; for (pos=fd.begin(); pos!=fd.end(); pos++) - if (!(*pos)->processing) { - fd.insert (pos, entry); - break; - } + if (!(*pos)->processing) { + fd.insert (pos, entry); + break; + } if (pos==fd.end()) fd.push_back (entry); } - - if (entry->thumbnail) - entry->thumbnail->imageEnqueued (); - - BatchQueueButtonSet* bqbs = new BatchQueueButtonSet (entry); - bqbs->setButtonListener (this); - entry->addButtonSet (bqbs); - - arrangeFiles (); + + if (entry->thumbnail) + entry->thumbnail->imageEnqueued (); + + BatchQueueButtonSet* bqbs = new BatchQueueButtonSet (entry); + bqbs->setButtonListener (this); + entry->addButtonSet (bqbs); + + arrangeFiles (); queue_draw (); - notifyListener (); -} - -int deleteitem (void* data) { - - gdk_threads_enter (); - delete (BatchQueueEntry*)data; - gdk_threads_leave (); - return 0; -} - -void BatchQueue::cancelItems (std::vector* items) { - - for (int i=0; isize(); i++) { - BatchQueueEntry* entry = (BatchQueueEntry*)(*items)[i]; - if (entry->processing) - continue; - std::vector::iterator pos = std::find (fd.begin(), fd.end(), entry); - if (pos!=fd.end()) { - fd.erase (pos); - rtengine::ProcessingJob::destroy (entry->job); - if (entry->thumbnail) - entry->thumbnail->imageRemovedFromQueue (); - g_idle_add (deleteitem, entry); - } - } - for (int i=0; iselected = false; - lastClicked = NULL; - selected.clear (); + notifyListener (); +} + +int deleteitem (void* data) { + + gdk_threads_enter (); + delete (BatchQueueEntry*)data; + gdk_threads_leave (); + return 0; +} + +void BatchQueue::cancelItems (std::vector* items) { + + for (int i=0; isize(); i++) { + BatchQueueEntry* entry = (BatchQueueEntry*)(*items)[i]; + if (entry->processing) + continue; + std::vector::iterator pos = std::find (fd.begin(), fd.end(), entry); + if (pos!=fd.end()) { + fd.erase (pos); + rtengine::ProcessingJob::destroy (entry->job); + if (entry->thumbnail) + entry->thumbnail->imageRemovedFromQueue (); + g_idle_add (deleteitem, entry); + } + } + for (int i=0; iselected = false; + lastClicked = NULL; + selected.clear (); redraw (); - notifyListener (); -} - -void BatchQueue::headItems (std::vector* items) { - - for (int i=items->size()-1; i>=0; i--) { - BatchQueueEntry* entry = (BatchQueueEntry*)(*items)[i]; - if (entry->processing) - continue; - std::vector::iterator pos = std::find (fd.begin(), fd.end(), entry); - if (pos!=fd.end() && pos!=fd.begin()) { - fd.erase (pos); - // find the first item that is not under processing - for (pos=fd.begin(); pos!=fd.end(); pos++) - if (!(*pos)->processing) { - fd.insert (pos, entry); - break; - } - } - } - redraw (); -} - -void BatchQueue::tailItems (std::vector* items) { - - for (int i=0; isize(); i++) { - BatchQueueEntry* entry = (BatchQueueEntry*)(*items)[i]; - if (entry->processing) - continue; - std::vector::iterator pos = std::find (fd.begin(), fd.end(), entry); - if (pos!=fd.end()) { - fd.erase (pos); - fd.push_back (entry); - } - } - redraw (); -} - -void BatchQueue::selectAll () { - - lastClicked = NULL; - selected.clear (); - for (int i=0; iprocessing) - continue; - fd[i]->selected = true; - selected.push_back (fd[i]); - } - queue_draw (); -} -void BatchQueue::startProcessing () { - - if (!processing && fd.size()>0) { - BatchQueueEntry* next = (BatchQueueEntry*)fd[0]; - // tag it as processing - next->processing = true; - processing = next; - // remove from selection - if (processing->selected) { - std::vector::iterator pos = std::find (selected.begin(), selected.end(), processing); - if (pos!=selected.end()) - selected.erase (pos); - processing->selected = false; - } - // remove button set - next->removeButtonSet (); - // start batch processing - rtengine::startBatchProcessing (next->job, this); - queue_draw (); - } -} - -rtengine::ProcessingJob* BatchQueue::imageReady (rtengine::IImage16* img) { - - gdk_threads_enter (); - // save image img - Glib::ustring fname; - SaveFormat saveFormat; - if (processing->outFileName=="") { // auto file name - fname = obtainFileName (processing->filename); - saveFormat = options.saveFormat; - } - else { // use the save-as filename with automatic completion for uniqueness - fname = autoCompleteFileName (removeExtension(processing->outFileName), getExtension(processing->outFileName)); - saveFormat = processing->saveFormat; - } - printf ("fname=%s, %s\n", fname.c_str(), removeExtension(fname).c_str()); - if (img && fname!="") { - int err = 0; - if (saveFormat.format=="tif") - err = img->saveAsTIFF (fname, saveFormat.tiffBits); - else if (saveFormat.format=="png") - err = img->saveAsPNG (fname, saveFormat.pngCompression, saveFormat.pngBits); - else if (saveFormat.format=="jpg") - err = img->saveAsJPEG (fname, saveFormat.jpegQuality); - img->free (); - if (!err && saveFormat.saveParams) - processing->params.save (removeExtension(fname) + ".pp2"); - if (processing->thumbnail) { - processing->thumbnail->imageDeveloped (); - processing->thumbnail->imageRemovedFromQueue (); + notifyListener (); +} + +void BatchQueue::headItems (std::vector* items) { + + for (int i=items->size()-1; i>=0; i--) { + BatchQueueEntry* entry = (BatchQueueEntry*)(*items)[i]; + if (entry->processing) + continue; + std::vector::iterator pos = std::find (fd.begin(), fd.end(), entry); + if (pos!=fd.end() && pos!=fd.begin()) { + fd.erase (pos); + // find the first item that is not under processing + for (pos=fd.begin(); pos!=fd.end(); pos++) + if (!(*pos)->processing) { + fd.insert (pos, entry); + break; + } + } + } + redraw (); +} + +void BatchQueue::tailItems (std::vector* items) { + + for (int i=0; isize(); i++) { + BatchQueueEntry* entry = (BatchQueueEntry*)(*items)[i]; + if (entry->processing) + continue; + std::vector::iterator pos = std::find (fd.begin(), fd.end(), entry); + if (pos!=fd.end()) { + fd.erase (pos); + fd.push_back (entry); + } + } + redraw (); +} + +void BatchQueue::selectAll () { + + lastClicked = NULL; + selected.clear (); + for (int i=0; iprocessing) + continue; + fd[i]->selected = true; + selected.push_back (fd[i]); + } + queue_draw (); +} +void BatchQueue::startProcessing () { + + if (!processing && fd.size()>0) { + BatchQueueEntry* next = (BatchQueueEntry*)fd[0]; + // tag it as processing + next->processing = true; + processing = next; + // remove from selection + if (processing->selected) { + std::vector::iterator pos = std::find (selected.begin(), selected.end(), processing); + if (pos!=selected.end()) + selected.erase (pos); + processing->selected = false; + } + // remove button set + next->removeButtonSet (); + // start batch processing + rtengine::startBatchProcessing (next->job, this); + queue_draw (); + } +} + +rtengine::ProcessingJob* BatchQueue::imageReady (rtengine::IImage16* img) { + + gdk_threads_enter (); + // save image img + Glib::ustring fname; + SaveFormat saveFormat; + if (processing->outFileName=="") { // auto file name + fname = obtainFileName (processing->filename); + saveFormat = options.saveFormat; + } + else { // use the save-as filename with automatic completion for uniqueness + fname = autoCompleteFileName (removeExtension(processing->outFileName), getExtension(processing->outFileName)); + saveFormat = processing->saveFormat; + } + printf ("fname=%s, %s\n", fname.c_str(), removeExtension(fname).c_str()); + if (img && fname!="") { + int err = 0; + if (saveFormat.format=="tif") + err = img->saveAsTIFF (fname, saveFormat.tiffBits); + else if (saveFormat.format=="png") + err = img->saveAsPNG (fname, saveFormat.pngCompression, saveFormat.pngBits); + else if (saveFormat.format=="jpg") + err = img->saveAsJPEG (fname, saveFormat.jpegQuality); + img->free (); + if (!err && saveFormat.saveParams) + processing->params.save (removeExtension(fname) + ".pp2"); + if (processing->thumbnail) { + processing->thumbnail->imageDeveloped (); + processing->thumbnail->imageRemovedFromQueue (); if (listener) - listener->imageProcessingReady (processing->filename); - } - } - - // delete from the queue - delete processing; - processing = NULL; - fd.erase (fd.begin()); - // return next job - if (fd.size()==0) { - if (listener) - listener->queueEmpty (); - } - else if (listener && listener->canStartNext ()) { - BatchQueueEntry* next = (BatchQueueEntry*)fd[0]; - // tag it as selected - next->processing = true; - processing = next; - // remove from selection - if (processing->selected) { - std::vector::iterator pos = std::find (selected.begin(), selected.end(), processing); - if (pos!=selected.end()) - selected.erase (pos); - processing->selected = false; - } - // remove button set - next->removeButtonSet (); - } + listener->imageProcessingReady (processing->filename); + } + } + + // delete from the queue + delete processing; + processing = NULL; + fd.erase (fd.begin()); + // return next job + if (fd.size()==0) { + if (listener) + listener->queueEmpty (); + } + else if (listener && listener->canStartNext ()) { + BatchQueueEntry* next = (BatchQueueEntry*)fd[0]; + // tag it as selected + next->processing = true; + processing = next; + // remove from selection + if (processing->selected) { + std::vector::iterator pos = std::find (selected.begin(), selected.end(), processing); + if (pos!=selected.end()) + selected.erase (pos); + processing->selected = false; + } + // remove button set + next->removeButtonSet (); + } redraw (); - notifyListener (); - gdk_threads_leave (); - return processing ? processing->job : NULL; -} - -Glib::ustring BatchQueue::obtainFileName (const Glib::ustring& origFileName) { - - std::vector pa; - std::vector da; - - for (int i=0; i=origFileName.size()) - break; - Glib::ustring tok = ""; - while ((i=0 && origFileName[extpos]!='.'; extpos--); - for (int k=extpos-1; k>=0 && origFileName[k]!='/' && origFileName[k]!='\\'; k--) - filename = origFileName[k] + filename; - -// printf ("%d, |%s|\n", extpos, filename.c_str()); - - // constructing full output path -// printf ("path=|%s|\n", options.savePath.c_str()); - - Glib::ustring path=""; - if (options.saveUsePathTemplate) { - int ix=0; - while (options.savePathTemplate[ix]!=0) { - if (options.savePathTemplate[ix]=='%') { - ix++; - if (options.savePathTemplate[ix]=='p') { - ix++; - int i = options.savePathTemplate[ix]-'0'; - if (iredraw(); - gdk_threads_leave (); - return 0; -} - -void BatchQueue::setProgress (double p) { - - if (processing) - processing->progress = p; - - g_idle_add (bqredraw, this); -} - -void BatchQueue::buttonPressed (LWButton* button, int actionCode, void* actionData) { - - std::vector bqe; - bqe.push_back ((BatchQueueEntry*)actionData); - - if (actionCode==10) // cancel - cancelItems (&bqe); - else if (actionCode==8) // to head - headItems (&bqe); - else if (actionCode==9) // to tail - tailItems (&bqe); + notifyListener (); + gdk_threads_leave (); + return processing ? processing->job : NULL; +} + +Glib::ustring BatchQueue::obtainFileName (const Glib::ustring& origFileName) { + + std::vector pa; + std::vector da; + + for (int i=0; i=origFileName.size()) + break; + Glib::ustring tok = ""; + while ((i=0 && origFileName[extpos]!='.'; extpos--); + for (int k=extpos-1; k>=0 && origFileName[k]!='/' && origFileName[k]!='\\'; k--) + filename = origFileName[k] + filename; + +// printf ("%d, |%s|\n", extpos, filename.c_str()); + + // constructing full output path +// printf ("path=|%s|\n", options.savePath.c_str()); + + Glib::ustring path=""; + if (options.saveUsePathTemplate) { + int ix=0; + while (options.savePathTemplate[ix]!=0) { + if (options.savePathTemplate[ix]=='%') { + ix++; + if (options.savePathTemplate[ix]=='p') { + ix++; + int i = options.savePathTemplate[ix]-'0'; + if (iredraw(); + gdk_threads_leave (); + return 0; +} + +void BatchQueue::setProgress (double p) { + + if (processing) + processing->progress = p; + + g_idle_add (bqredraw, this); +} + +void BatchQueue::buttonPressed (LWButton* button, int actionCode, void* actionData) { + + std::vector bqe; + bqe.push_back ((BatchQueueEntry*)actionData); + + if (actionCode==10) // cancel + cancelItems (&bqe); + else if (actionCode==8) // to head + headItems (&bqe); + else if (actionCode==9) // to tail + tailItems (&bqe); } struct NLParams { @@ -379,11 +379,11 @@ struct NLParams { int bqnotifylistener (void* data) { - gdk_threads_enter (); + gdk_threads_enter (); NLParams* params = (NLParams*)data; params->listener->queueSizeChanged (params->qsize); delete params; - gdk_threads_leave (); + gdk_threads_leave (); return 0; } @@ -395,9 +395,9 @@ void BatchQueue::notifyListener () { params->qsize = fd.size(); g_idle_add (bqnotifylistener, params); } -} - -void BatchQueue::redrawNeeded (LWButton* button) { - - queue_draw (); -} +} + +void BatchQueue::redrawNeeded (LWButton* button) { + + queue_draw (); +} diff --git a/rtgui/batchqueue.h b/rtgui/batchqueue.h index 32c5f666a..990e2f821 100644 --- a/rtgui/batchqueue.h +++ b/rtgui/batchqueue.h @@ -1,84 +1,84 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _BATCHQUEUE_ -#define _BATCHQUEUE_ - -#include -#include -#include -#include -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _BATCHQUEUE_ +#define _BATCHQUEUE_ + +#include +#include +#include +#include +#include +#include class BatchQueueListener { public: virtual void queueSizeChanged (int qsize) =0; - virtual void imageProcessingReady (Glib::ustring fname) =0; - virtual void queueEmpty () =0; - virtual bool canStartNext () =0; + virtual void imageProcessingReady (Glib::ustring fname) =0; + virtual void queueEmpty () =0; + virtual bool canStartNext () =0; }; - -class FileCatalog; + +class FileCatalog; class BatchQueue : public ThumbBrowserBase, public rtengine::BatchProcessingListener, - public LWButtonListener { - - protected: - - BatchQueueEntry* processing; - - Glib::ustring nameTemplate; - - Gtk::MenuItem* cancel; - Gtk::MenuItem* head; - Gtk::MenuItem* tail; - Gtk::MenuItem* selall; - Gtk::Menu* pmenu; - - BatchQueueListener* listener; - - Glib::ustring obtainFileName (const Glib::ustring& origFileName); - Glib::ustring autoCompleteFileName (const Glib::ustring& fileName, const Glib::ustring& format); - - public: - BatchQueue (); + public LWButtonListener { - void addEntry (BatchQueueEntry* entry, bool head=false); - - void cancelItems (std::vector* items); - void headItems (std::vector* items); - void tailItems (std::vector* items); - void selectAll (); - - void startProcessing (); - - bool hasJobs () { return fd.size()>0; } - - rtengine::ProcessingJob* imageReady (rtengine::IImage16* img); - void setProgress (double p); - void rightClicked (ThumbBrowserEntryBase* entry); + protected: + + BatchQueueEntry* processing; + + Glib::ustring nameTemplate; + + Gtk::MenuItem* cancel; + Gtk::MenuItem* head; + Gtk::MenuItem* tail; + Gtk::MenuItem* selall; + Gtk::Menu* pmenu; + + BatchQueueListener* listener; + + Glib::ustring obtainFileName (const Glib::ustring& origFileName); + Glib::ustring autoCompleteFileName (const Glib::ustring& fileName, const Glib::ustring& format); + + public: + BatchQueue (); + + void addEntry (BatchQueueEntry* entry, bool head=false); + + void cancelItems (std::vector* items); + void headItems (std::vector* items); + void tailItems (std::vector* items); + void selectAll (); + + void startProcessing (); + + bool hasJobs () { return fd.size()>0; } + + rtengine::ProcessingJob* imageReady (rtengine::IImage16* img); + void setProgress (double p); + void rightClicked (ThumbBrowserEntryBase* entry); void buttonPressed (LWButton* button, int actionCode, void* actionData); - void redrawNeeded (LWButton* button); + void redrawNeeded (LWButton* button); void setBatchQueueListener (BatchQueueListener* l) { listener = l; } - void notifyListener (); -}; - -#endif + void notifyListener (); +}; + +#endif diff --git a/rtgui/batchqueuebuttonset.cc b/rtgui/batchqueuebuttonset.cc index 36ebc4363..2958133c7 100644 --- a/rtgui/batchqueuebuttonset.cc +++ b/rtgui/batchqueuebuttonset.cc @@ -1,42 +1,42 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include #include - -extern Glib::ustring argv0; - -bool BatchQueueButtonSet::iconsLoaded = false; - -Cairo::RefPtr BatchQueueButtonSet::cancelIcon; -Cairo::RefPtr BatchQueueButtonSet::headIcon; -Cairo::RefPtr BatchQueueButtonSet::tailIcon; - -BatchQueueButtonSet::BatchQueueButtonSet (BatchQueueEntry* myEntry) { - - if (!iconsLoaded) { - cancelIcon = Cairo::ImageSurface::create_from_png (argv0+"/images/deltags.png"); - headIcon = Cairo::ImageSurface::create_from_png (argv0+"/images/head.png"); - tailIcon = Cairo::ImageSurface::create_from_png (argv0+"/images/tail.png"); - iconsLoaded = true; - } - - add (new LWButton (headIcon, 8, myEntry, LWButton::Left, LWButton::Center, M("FILEBROWSER_POPUPMOVEHEAD"))); - add (new LWButton (tailIcon, 9, myEntry, LWButton::Left, LWButton::Center, M("FILEBROWSER_POPUPMOVEEND"))); - add (new LWButton (cancelIcon, 10, myEntry, LWButton::Right, LWButton::Center, M("FILEBROWSER_POPUPCANCELJOB"))); -} + +extern Glib::ustring argv0; + +bool BatchQueueButtonSet::iconsLoaded = false; + +Cairo::RefPtr BatchQueueButtonSet::cancelIcon; +Cairo::RefPtr BatchQueueButtonSet::headIcon; +Cairo::RefPtr BatchQueueButtonSet::tailIcon; + +BatchQueueButtonSet::BatchQueueButtonSet (BatchQueueEntry* myEntry) { + + if (!iconsLoaded) { + cancelIcon = Cairo::ImageSurface::create_from_png (argv0+"/images/deltags.png"); + headIcon = Cairo::ImageSurface::create_from_png (argv0+"/images/head.png"); + tailIcon = Cairo::ImageSurface::create_from_png (argv0+"/images/tail.png"); + iconsLoaded = true; + } + + add (new LWButton (headIcon, 8, myEntry, LWButton::Left, LWButton::Center, M("FILEBROWSER_POPUPMOVEHEAD"))); + add (new LWButton (tailIcon, 9, myEntry, LWButton::Left, LWButton::Center, M("FILEBROWSER_POPUPMOVEEND"))); + add (new LWButton (cancelIcon, 10, myEntry, LWButton::Right, LWButton::Center, M("FILEBROWSER_POPUPCANCELJOB"))); +} diff --git a/rtgui/batchqueuebuttonset.h b/rtgui/batchqueuebuttonset.h index 4b92c3d85..fec768dfd 100644 --- a/rtgui/batchqueuebuttonset.h +++ b/rtgui/batchqueuebuttonset.h @@ -1,38 +1,38 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _BATCHQUEUEBUTTONSET_ -#define _BATCHQUEUEBUTTONSET_ - -#include -#include - -class BatchQueueEntry; -class BatchQueueButtonSet : public LWButtonSet { - - static bool iconsLoaded; - - public: - static Cairo::RefPtr cancelIcon; - static Cairo::RefPtr headIcon; - static Cairo::RefPtr tailIcon; - - BatchQueueButtonSet (BatchQueueEntry* myEntry); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _BATCHQUEUEBUTTONSET_ +#define _BATCHQUEUEBUTTONSET_ + +#include +#include + +class BatchQueueEntry; +class BatchQueueButtonSet : public LWButtonSet { + + static bool iconsLoaded; + + public: + static Cairo::RefPtr cancelIcon; + static Cairo::RefPtr headIcon; + static Cairo::RefPtr tailIcon; + + BatchQueueButtonSet (BatchQueueEntry* myEntry); +}; + +#endif diff --git a/rtgui/batchqueueentry.cc b/rtgui/batchqueueentry.cc index 8a74829d7..55cd2b872 100644 --- a/rtgui/batchqueueentry.cc +++ b/rtgui/batchqueueentry.cc @@ -1,103 +1,103 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include #include - -BatchQueueEntry::BatchQueueEntry (rtengine::ProcessingJob* pjob, const rtengine::procparams::ProcParams& pparams, Glib::ustring fname, guint8* previmg, int prevw, int prevh, Thumbnail* thumbnail) - : job(pjob), ThumbBrowserEntryBase(fname), + +BatchQueueEntry::BatchQueueEntry (rtengine::ProcessingJob* pjob, const rtengine::procparams::ProcParams& pparams, Glib::ustring fname, guint8* previmg, int prevw, int prevh, Thumbnail* thumbnail) + : job(pjob), ThumbBrowserEntryBase(fname), opreview(previmg), origpw(prevw), origph(prevh), progress(0), thumbnail(thumbnail), - outFileName("") { + outFileName("") { params = pparams; - - bqih = new BatchQueueEntryIdleHelper; - bqih->bqentry = this; - bqih->destroyed = false; - bqih->pending = 0; - if (thumbnail) - thumbnail->increaseRef (); -} - -BatchQueueEntry::~BatchQueueEntry () { - + bqih = new BatchQueueEntryIdleHelper; + bqih->bqentry = this; + bqih->destroyed = false; + bqih->pending = 0; + + if (thumbnail) + thumbnail->increaseRef (); +} + +BatchQueueEntry::~BatchQueueEntry () { + batchQueueEntryUpdater.removeJobs (this); - delete [] opreview; - if (thumbnail) - thumbnail->decreaseRef (); - - if (bqih->pending) - bqih->destroyed = true; - else - delete bqih; -} - -void BatchQueueEntry::refreshThumbnailImage () { + delete [] opreview; + if (thumbnail) + thumbnail->decreaseRef (); + + if (bqih->pending) + bqih->destroyed = true; + else + delete bqih; +} + +void BatchQueueEntry::refreshThumbnailImage () { if (!opreview) return; batchQueueEntryUpdater.add (opreview, origpw, origph, preh, this); batchQueueEntryUpdater.process (); -} - -void BatchQueueEntry::calcThumbnailSize () { - - prew = preh * origpw / origph; -} - - -void BatchQueueEntry::drawProgressBar (Glib::RefPtr win, Glib::RefPtr gc, const Gdk::Color& foregr, const Gdk::Color& backgr, int x, int w, int y, int h) { - - if (processing) { - Cairo::RefPtr cr = win->create_cairo_context(); - cr->set_antialias (Cairo::ANTIALIAS_SUBPIXEL); - double px = x + w/6.0; - double pw = w*2.0/3.0; - double py = y + h/4.0; - double ph = h/2.0; - cr->move_to (px, py); - cr->line_to (px+pw, py); - cr->set_line_width (ph); - cr->set_line_cap (Cairo::LINE_CAP_ROUND); - cr->set_source_rgb (foregr.get_red_p(), foregr.get_green_p(), foregr.get_blue_p()); - cr->stroke (); - - cr->move_to (px, py); - cr->line_to (px+pw, py); - cr->set_line_width (ph*3.0/4.0); - cr->set_source_rgb (backgr.get_red_p(), backgr.get_green_p(), backgr.get_blue_p()); - cr->stroke (); - - cr->move_to (px, py); - cr->line_to (px+pw*progress, py); - cr->set_line_width (ph/2.0); - cr->set_source_rgb (foregr.get_red_p(), foregr.get_green_p(), foregr.get_blue_p()); - cr->stroke (); - } -} - -void BatchQueueEntry::removeButtonSet () { - - delete buttonSet; - buttonSet = NULL; -} +} + +void BatchQueueEntry::calcThumbnailSize () { + + prew = preh * origpw / origph; +} + + +void BatchQueueEntry::drawProgressBar (Glib::RefPtr win, Glib::RefPtr gc, const Gdk::Color& foregr, const Gdk::Color& backgr, int x, int w, int y, int h) { + + if (processing) { + Cairo::RefPtr cr = win->create_cairo_context(); + cr->set_antialias (Cairo::ANTIALIAS_SUBPIXEL); + double px = x + w/6.0; + double pw = w*2.0/3.0; + double py = y + h/4.0; + double ph = h/2.0; + cr->move_to (px, py); + cr->line_to (px+pw, py); + cr->set_line_width (ph); + cr->set_line_cap (Cairo::LINE_CAP_ROUND); + cr->set_source_rgb (foregr.get_red_p(), foregr.get_green_p(), foregr.get_blue_p()); + cr->stroke (); + + cr->move_to (px, py); + cr->line_to (px+pw, py); + cr->set_line_width (ph*3.0/4.0); + cr->set_source_rgb (backgr.get_red_p(), backgr.get_green_p(), backgr.get_blue_p()); + cr->stroke (); + + cr->move_to (px, py); + cr->line_to (px+pw*progress, py); + cr->set_line_width (ph/2.0); + cr->set_source_rgb (foregr.get_red_p(), foregr.get_green_p(), foregr.get_blue_p()); + cr->stroke (); + } +} + +void BatchQueueEntry::removeButtonSet () { + + delete buttonSet; + buttonSet = NULL; +} struct bqupdate { BatchQueueEntryIdleHelper* bqih; guint8* img; @@ -108,22 +108,22 @@ int bqeupdate (void* data) { gdk_threads_enter (); bqupdate* params = (bqupdate*)data; - - BatchQueueEntryIdleHelper* bqih = params->bqih; - - if (bqih->destroyed) { - if (bqih->pending == 1) - delete bqih; - else - bqih->pending--; - delete [] params->img; - delete params; - gdk_threads_leave (); - return 0; - } - - bqih->bqentry->_updateImage (params->img, params->w, params->h); - bqih->pending--; + + BatchQueueEntryIdleHelper* bqih = params->bqih; + + if (bqih->destroyed) { + if (bqih->pending == 1) + delete bqih; + else + bqih->pending--; + delete [] params->img; + delete params; + gdk_threads_leave (); + return 0; + } + + bqih->bqentry->_updateImage (params->img, params->w, params->h); + bqih->pending--; gdk_threads_leave (); delete params; @@ -132,8 +132,8 @@ int bqeupdate (void* data) { void BatchQueueEntry::updateImage (guint8* img, int w, int h) { - bqih->pending++; - + bqih->pending++; + bqupdate* param = new bqupdate (); param->bqih = bqih; param->img = img; diff --git a/rtgui/batchqueueentry.h b/rtgui/batchqueueentry.h index d16d96f8f..61f5ef2a4 100644 --- a/rtgui/batchqueueentry.h +++ b/rtgui/batchqueueentry.h @@ -1,66 +1,66 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _BATCHQUEUEENTRY_ -#define _BATCHQUEUEENTRY_ - -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _BATCHQUEUEENTRY_ +#define _BATCHQUEUEENTRY_ + +#include +#include #include #include #include - -class BatchQueueEntry; -struct BatchQueueEntryIdleHelper { - BatchQueueEntry* bqentry; - bool destroyed; - int pending; -}; - -class BatchQueueEntry : public ThumbBrowserEntryBase, public BQEntryUpdateListener { - - guint8* opreview; + +class BatchQueueEntry; +struct BatchQueueEntryIdleHelper { + BatchQueueEntry* bqentry; + bool destroyed; + int pending; +}; + +class BatchQueueEntry : public ThumbBrowserEntryBase, public BQEntryUpdateListener { + + guint8* opreview; int origpw, origph; - BatchQueueEntryIdleHelper* bqih; - + BatchQueueEntryIdleHelper* bqih; + public: - Thumbnail* thumbnail; + Thumbnail* thumbnail; rtengine::ProcessingJob* job; rtengine::procparams::ProcParams params; double progress; - Glib::ustring outFileName; - SaveFormat saveFormat; - + Glib::ustring outFileName; + SaveFormat saveFormat; + BatchQueueEntry (rtengine::ProcessingJob* job, const rtengine::procparams::ProcParams& pparams, Glib::ustring fname, guint8* previmg, int prevw, int prevh, Thumbnail* thumbnail=NULL); - ~BatchQueueEntry (); + ~BatchQueueEntry (); - void refreshThumbnailImage (); + void refreshThumbnailImage (); void calcThumbnailSize (); - + void drawProgressBar (Glib::RefPtr win, Glib::RefPtr gc, const Gdk::Color& foregr, const Gdk::Color& backgr, int x, int w, int y, int h); - + void removeButtonSet (); // bqentryupdatelistener interface void updateImage (guint8* img, int w, int h); void _updateImage (guint8* img, int w, int h); // inside gtk thread -}; - - - -#endif +}; + + + +#endif diff --git a/rtgui/batchqueuepanel.cc b/rtgui/batchqueuepanel.cc index e094083c2..ac9925127 100644 --- a/rtgui/batchqueuepanel.cc +++ b/rtgui/batchqueuepanel.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include @@ -24,143 +24,143 @@ BatchQueuePanel::BatchQueuePanel () { - batchQueue = new BatchQueue(); + batchQueue = new BatchQueue(); - // construct batch queue panel with the extra "start" and "stop" button - Gtk::VBox* batchQueueButtonBox = Gtk::manage (new Gtk::VBox); - start = Gtk::manage (new Gtk::ToggleButton (M("FILEBROWSER_STARTPROCESSING"))); - stop = Gtk::manage (new Gtk::ToggleButton (M("FILEBROWSER_STOPPROCESSING"))); - autoStart = Gtk::manage (new Gtk::CheckButton (M("BATCHQUEUE_AUTOSTART"))); - start->set_tooltip_text (M("FILEBROWSER_STARTPROCESSINGHINT")); - stop->set_tooltip_text (M("FILEBROWSER_STOPPROCESSINGHINT")); - autoStart->set_tooltip_text (M("FILEBROWSER_TOOLTIP_STOPPROCESSING")); - start->set_active (false); - stop->set_active (true); - autoStart->set_active (options.procQueueEnabled); - - start->set_image (*Gtk::manage (new Gtk::Image (Gtk::StockID("gtk-media-play"), Gtk::ICON_SIZE_BUTTON))); - startConnection = start->signal_toggled().connect (sigc::mem_fun(*this, &BatchQueuePanel::startBatchProc)); - stop->set_image (*Gtk::manage (new Gtk::Image (Gtk::StockID("gtk-media-stop"), Gtk::ICON_SIZE_BUTTON))); - stopConnection = stop->signal_toggled().connect (sigc::mem_fun(*this, &BatchQueuePanel::stopBatchProc)); - batchQueueButtonBox->pack_start (*start, Gtk::PACK_SHRINK, 4); - batchQueueButtonBox->pack_start (*stop, Gtk::PACK_SHRINK, 4); - batchQueueButtonBox->pack_start (*autoStart, Gtk::PACK_SHRINK, 4); - - // Output directory selection - fdir = Gtk::manage (new Gtk::Frame (M("PREFERENCES_OUTDIR"))); - Gtk::VBox* odvb = Gtk::manage (new Gtk::VBox ()); - odvb->set_border_width (4); - Gtk::HBox* hb2 = Gtk::manage (new Gtk::HBox ()); - useTemplate = Gtk::manage (new Gtk::RadioButton (M("PREFERENCES_OUTDIRTEMPLATE")+":")); - hb2->pack_start (*useTemplate, Gtk::PACK_SHRINK,4); - outdirTemplate = Gtk::manage (new Gtk::Entry ()); - hb2->pack_start (*outdirTemplate); - odvb->pack_start (*hb2, Gtk::PACK_SHRINK, 4); - outdirTemplate->set_tooltip_markup (M("PREFERENCES_OUTDIRTEMPLATEHINT")); - useTemplate->set_tooltip_markup (M("PREFERENCES_OUTDIRTEMPLATEHINT")); - Gtk::HBox* hb3 = Gtk::manage (new Gtk::HBox ()); - useFolder = Gtk::manage (new Gtk::RadioButton (M("PREFERENCES_OUTDIRFOLDER")+":")); - hb3->pack_start (*useFolder, Gtk::PACK_SHRINK,4); - outdirFolder = Gtk::manage (new Gtk::FileChooserButton (M("PREFERENCES_OUTDIRFOLDER"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER)); - hb3->pack_start (*outdirFolder); - odvb->pack_start (*hb3, Gtk::PACK_SHRINK, 4); - outdirFolder->set_tooltip_markup (M("PREFERENCES_OUTDIRFOLDERHINT")); - useFolder->set_tooltip_markup (M("PREFERENCES_OUTDIRFOLDERHINT")); - Gtk::RadioButton::Group g = useTemplate->get_group(); - useFolder->set_group (g); - fdir->add (*odvb); - - // Output file format selection - fformat = Gtk::manage (new Gtk::Frame (M("PREFERENCES_FILEFORMAT"))); - saveFormatPanel = Gtk::manage (new SaveFormatPanel ()); - fformat->add (*saveFormatPanel); - - saveFormatPanel->init (options.saveFormat); - outdirTemplate->set_text (options.savePathTemplate); - if (Glib::file_test (options.savePathFolder, Glib::FILE_TEST_IS_DIR)) - outdirFolder->set_filename (options.savePathFolder); - useTemplate->set_active (options.saveUsePathTemplate); - useFolder->set_active (!options.saveUsePathTemplate); - - // setup signal handlers - outdirTemplate->signal_changed().connect (sigc::mem_fun(*this, &BatchQueuePanel::saveOptions)); - outdirFolder->signal_current_folder_changed().connect (sigc::mem_fun(*this, &BatchQueuePanel::saveOptions)); - useTemplate->signal_toggled().connect (sigc::mem_fun(*this, &BatchQueuePanel::saveOptions)); - useFolder->signal_toggled().connect (sigc::mem_fun(*this, &BatchQueuePanel::saveOptions)); - saveFormatPanel->setListener (this); + // construct batch queue panel with the extra "start" and "stop" button + Gtk::VBox* batchQueueButtonBox = Gtk::manage (new Gtk::VBox); + start = Gtk::manage (new Gtk::ToggleButton (M("FILEBROWSER_STARTPROCESSING"))); + stop = Gtk::manage (new Gtk::ToggleButton (M("FILEBROWSER_STOPPROCESSING"))); + autoStart = Gtk::manage (new Gtk::CheckButton (M("BATCHQUEUE_AUTOSTART"))); + start->set_tooltip_text (M("FILEBROWSER_STARTPROCESSINGHINT")); + stop->set_tooltip_text (M("FILEBROWSER_STOPPROCESSINGHINT")); + autoStart->set_tooltip_text (M("FILEBROWSER_TOOLTIP_STOPPROCESSING")); + start->set_active (false); + stop->set_active (true); + autoStart->set_active (options.procQueueEnabled); + + start->set_image (*Gtk::manage (new Gtk::Image (Gtk::StockID("gtk-media-play"), Gtk::ICON_SIZE_BUTTON))); + startConnection = start->signal_toggled().connect (sigc::mem_fun(*this, &BatchQueuePanel::startBatchProc)); + stop->set_image (*Gtk::manage (new Gtk::Image (Gtk::StockID("gtk-media-stop"), Gtk::ICON_SIZE_BUTTON))); + stopConnection = stop->signal_toggled().connect (sigc::mem_fun(*this, &BatchQueuePanel::stopBatchProc)); + batchQueueButtonBox->pack_start (*start, Gtk::PACK_SHRINK, 4); + batchQueueButtonBox->pack_start (*stop, Gtk::PACK_SHRINK, 4); + batchQueueButtonBox->pack_start (*autoStart, Gtk::PACK_SHRINK, 4); - // setup button bar - topBox = Gtk::manage (new Gtk::HBox ()); - pack_start (*topBox, Gtk::PACK_SHRINK); - - topBox->pack_start (*batchQueueButtonBox, Gtk::PACK_SHRINK, 4); - topBox->pack_start (*fdir); - topBox->pack_start (*fformat, Gtk::PACK_SHRINK, 4); - - // add middle browser area - Gtk::HBox* hBox = Gtk::manage (new Gtk::HBox ()); - pack_start (*batchQueue); - - // lower box with thumbnail zoom - bottomBox = Gtk::manage (new Gtk::HBox ()); - pack_start (*bottomBox, Gtk::PACK_SHRINK); + // Output directory selection + fdir = Gtk::manage (new Gtk::Frame (M("PREFERENCES_OUTDIR"))); + Gtk::VBox* odvb = Gtk::manage (new Gtk::VBox ()); + odvb->set_border_width (4); + Gtk::HBox* hb2 = Gtk::manage (new Gtk::HBox ()); + useTemplate = Gtk::manage (new Gtk::RadioButton (M("PREFERENCES_OUTDIRTEMPLATE")+":")); + hb2->pack_start (*useTemplate, Gtk::PACK_SHRINK,4); + outdirTemplate = Gtk::manage (new Gtk::Entry ()); + hb2->pack_start (*outdirTemplate); + odvb->pack_start (*hb2, Gtk::PACK_SHRINK, 4); + outdirTemplate->set_tooltip_markup (M("PREFERENCES_OUTDIRTEMPLATEHINT")); + useTemplate->set_tooltip_markup (M("PREFERENCES_OUTDIRTEMPLATEHINT")); + Gtk::HBox* hb3 = Gtk::manage (new Gtk::HBox ()); + useFolder = Gtk::manage (new Gtk::RadioButton (M("PREFERENCES_OUTDIRFOLDER")+":")); + hb3->pack_start (*useFolder, Gtk::PACK_SHRINK,4); + outdirFolder = Gtk::manage (new Gtk::FileChooserButton (M("PREFERENCES_OUTDIRFOLDER"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER)); + hb3->pack_start (*outdirFolder); + odvb->pack_start (*hb3, Gtk::PACK_SHRINK, 4); + outdirFolder->set_tooltip_markup (M("PREFERENCES_OUTDIRFOLDERHINT")); + useFolder->set_tooltip_markup (M("PREFERENCES_OUTDIRFOLDERHINT")); + Gtk::RadioButton::Group g = useTemplate->get_group(); + useFolder->set_group (g); + fdir->add (*odvb); + + // Output file format selection + fformat = Gtk::manage (new Gtk::Frame (M("PREFERENCES_FILEFORMAT"))); + saveFormatPanel = Gtk::manage (new SaveFormatPanel ()); + fformat->add (*saveFormatPanel); + + saveFormatPanel->init (options.saveFormat); + outdirTemplate->set_text (options.savePathTemplate); + if (Glib::file_test (options.savePathFolder, Glib::FILE_TEST_IS_DIR)) + outdirFolder->set_filename (options.savePathFolder); + useTemplate->set_active (options.saveUsePathTemplate); + useFolder->set_active (!options.saveUsePathTemplate); + + // setup signal handlers + outdirTemplate->signal_changed().connect (sigc::mem_fun(*this, &BatchQueuePanel::saveOptions)); + outdirFolder->signal_current_folder_changed().connect (sigc::mem_fun(*this, &BatchQueuePanel::saveOptions)); + useTemplate->signal_toggled().connect (sigc::mem_fun(*this, &BatchQueuePanel::saveOptions)); + useFolder->signal_toggled().connect (sigc::mem_fun(*this, &BatchQueuePanel::saveOptions)); + saveFormatPanel->setListener (this); + + // setup button bar + topBox = Gtk::manage (new Gtk::HBox ()); + pack_start (*topBox, Gtk::PACK_SHRINK); + + topBox->pack_start (*batchQueueButtonBox, Gtk::PACK_SHRINK, 4); + topBox->pack_start (*fdir); + topBox->pack_start (*fformat, Gtk::PACK_SHRINK, 4); + + // add middle browser area + Gtk::HBox* hBox = Gtk::manage (new Gtk::HBox ()); + pack_start (*batchQueue); + + // lower box with thumbnail zoom + bottomBox = Gtk::manage (new Gtk::HBox ()); + pack_start (*bottomBox, Gtk::PACK_SHRINK); + + // change thumbnail arrangement button + hAlignIcon = new Gtk::Image (argv0+"/images/horizontals.png"); + vAlignIcon = new Gtk::Image (argv0+"/images/verticals.png"); + hAlignIcon->show (); + vAlignIcon->show (); + chAlign = Gtk::manage (new Gtk::Button ()); + chAlign->show (); + bottomBox->pack_end (*chAlign, Gtk::PACK_SHRINK); + chAlign->set_image (*hAlignIcon); + chAlign->set_relief (Gtk::RELIEF_NONE); + chAlign->signal_pressed().connect (sigc::mem_fun(*this, &BatchQueuePanel::arrangementButtonPressed)); + chAlign->set_tooltip_text (M("FILEBROWSER_ARRANGEMENTHINT")); + bottomBox->pack_end (*Gtk::manage (new Gtk::VSeparator), Gtk::PACK_SHRINK, 4); + if (options.fbArrangement==1) + chAlign->set_image (*vAlignIcon); + else + chAlign->set_image (*hAlignIcon); + arrangementButtonPressed (); + + // thumbnail zoom + Gtk::HBox* zoomBox = Gtk::manage (new Gtk::HBox ()); + zoomBox->pack_start (*Gtk::manage (new Gtk::VSeparator), Gtk::PACK_SHRINK, 4); + Gtk::Label* zoomLabel = Gtk::manage (new Gtk::Label (Glib::ustring("")+M("FILEBROWSER_THUMBSIZE")+":")); + zoomLabel->set_use_markup (true); + zoomBox->pack_start (*zoomLabel, Gtk::PACK_SHRINK, 4); + zoomInButton = Gtk::manage (new Gtk::Button ()); + zoomInButton->set_image (*Gtk::manage (new Gtk::Image (Gtk::StockID("gtk-zoom-in"), Gtk::ICON_SIZE_SMALL_TOOLBAR))); + zoomInButton->signal_pressed().connect (sigc::mem_fun(*batchQueue, &BatchQueue::zoomIn)); + zoomInButton->set_relief (Gtk::RELIEF_NONE); + zoomInButton->set_tooltip_text (M("FILEBROWSER_ZOOMINHINT")); + zoomBox->pack_end (*zoomInButton, Gtk::PACK_SHRINK); + zoomOutButton = Gtk::manage (new Gtk::Button ()); + zoomOutButton->set_image (*Gtk::manage (new Gtk::Image (Gtk::StockID("gtk-zoom-out"), Gtk::ICON_SIZE_SMALL_TOOLBAR))); + zoomOutButton->signal_pressed().connect (sigc::mem_fun(*batchQueue, &BatchQueue::zoomOut)); + zoomOutButton->set_relief (Gtk::RELIEF_NONE); + zoomOutButton->set_tooltip_text (M("FILEBROWSER_ZOOMOUTHINT")); + zoomBox->pack_end (*zoomOutButton, Gtk::PACK_SHRINK); + bottomBox->pack_end (*zoomBox, Gtk::PACK_SHRINK); - // change thumbnail arrangement button - hAlignIcon = new Gtk::Image (argv0+"/images/horizontals.png"); - vAlignIcon = new Gtk::Image (argv0+"/images/verticals.png"); - hAlignIcon->show (); - vAlignIcon->show (); - chAlign = Gtk::manage (new Gtk::Button ()); - chAlign->show (); - bottomBox->pack_end (*chAlign, Gtk::PACK_SHRINK); - chAlign->set_image (*hAlignIcon); - chAlign->set_relief (Gtk::RELIEF_NONE); - chAlign->signal_pressed().connect (sigc::mem_fun(*this, &BatchQueuePanel::arrangementButtonPressed)); - chAlign->set_tooltip_text (M("FILEBROWSER_ARRANGEMENTHINT")); - bottomBox->pack_end (*Gtk::manage (new Gtk::VSeparator), Gtk::PACK_SHRINK, 4); - if (options.fbArrangement==1) - chAlign->set_image (*vAlignIcon); - else - chAlign->set_image (*hAlignIcon); - arrangementButtonPressed (); - - // thumbnail zoom - Gtk::HBox* zoomBox = Gtk::manage (new Gtk::HBox ()); - zoomBox->pack_start (*Gtk::manage (new Gtk::VSeparator), Gtk::PACK_SHRINK, 4); - Gtk::Label* zoomLabel = Gtk::manage (new Gtk::Label (Glib::ustring("")+M("FILEBROWSER_THUMBSIZE")+":")); - zoomLabel->set_use_markup (true); - zoomBox->pack_start (*zoomLabel, Gtk::PACK_SHRINK, 4); - zoomInButton = Gtk::manage (new Gtk::Button ()); - zoomInButton->set_image (*Gtk::manage (new Gtk::Image (Gtk::StockID("gtk-zoom-in"), Gtk::ICON_SIZE_SMALL_TOOLBAR))); - zoomInButton->signal_pressed().connect (sigc::mem_fun(*batchQueue, &BatchQueue::zoomIn)); - zoomInButton->set_relief (Gtk::RELIEF_NONE); - zoomInButton->set_tooltip_text (M("FILEBROWSER_ZOOMINHINT")); - zoomBox->pack_end (*zoomInButton, Gtk::PACK_SHRINK); - zoomOutButton = Gtk::manage (new Gtk::Button ()); - zoomOutButton->set_image (*Gtk::manage (new Gtk::Image (Gtk::StockID("gtk-zoom-out"), Gtk::ICON_SIZE_SMALL_TOOLBAR))); - zoomOutButton->signal_pressed().connect (sigc::mem_fun(*batchQueue, &BatchQueue::zoomOut)); - zoomOutButton->set_relief (Gtk::RELIEF_NONE); - zoomOutButton->set_tooltip_text (M("FILEBROWSER_ZOOMOUTHINT")); - zoomBox->pack_end (*zoomOutButton, Gtk::PACK_SHRINK); - bottomBox->pack_end (*zoomBox, Gtk::PACK_SHRINK); - batchQueue->setBatchQueueListener (this); show_all (); } -void BatchQueuePanel::arrangementButtonPressed () { - - if (chAlign->get_image()==hAlignIcon) { - chAlign->set_image (*vAlignIcon); +void BatchQueuePanel::arrangementButtonPressed () { + + if (chAlign->get_image()==hAlignIcon) { + chAlign->set_image (*vAlignIcon); batchQueue->setArrangement (BatchQueue::TB_Vertical); - } - else { - chAlign->set_image (*hAlignIcon); - batchQueue->setArrangement (BatchQueue::TB_Horizontal); - } -} + } + else { + chAlign->set_image (*hAlignIcon); + batchQueue->setArrangement (BatchQueue::TB_Horizontal); + } +} void BatchQueuePanel::queueSizeChanged (int qsize) { @@ -172,71 +172,71 @@ void BatchQueuePanel::imageProcessingReady (Glib::ustring fname) { parent->imageDeveloped (fname); } -void BatchQueuePanel::startBatchProc () { - - stopConnection.block (true); - startConnection.block (true); - stop->set_active (false); - start->set_active (true); - stopConnection.block (false); - startConnection.block (false); - - if (batchQueue->hasJobs()) { - fdir->set_sensitive (false); - fformat->set_sensitive (false); +void BatchQueuePanel::startBatchProc () { + + stopConnection.block (true); + startConnection.block (true); + stop->set_active (false); + start->set_active (true); + stopConnection.block (false); + startConnection.block (false); + + if (batchQueue->hasJobs()) { + fdir->set_sensitive (false); + fformat->set_sensitive (false); saveOptions(); - batchQueue->startProcessing (); - } - else - stopBatchProc (); -} - -void BatchQueuePanel::stopBatchProc () { - - stopConnection.block (true); - startConnection.block (true); - stop->set_active (true); - start->set_active (false); - stopConnection.block (false); - startConnection.block (false); -} - + batchQueue->startProcessing (); + } + else + stopBatchProc (); +} + +void BatchQueuePanel::stopBatchProc () { + + stopConnection.block (true); + startConnection.block (true); + stop->set_active (true); + start->set_active (false); + stopConnection.block (false); + startConnection.block (false); +} + void BatchQueuePanel::addBatchQueueJob (BatchQueueEntry* bqe, bool head) { - batchQueue->addEntry (bqe, head); - - if (stop->get_active () && autoStart->get_active ()) + batchQueue->addEntry (bqe, head); + + if (stop->get_active () && autoStart->get_active ()) startBatchProc (); } - -void BatchQueuePanel::queueEmpty () { - - stopBatchProc (); - fdir->set_sensitive (true); - fformat->set_sensitive (true); -} - -bool BatchQueuePanel::canStartNext () { - - if (start->get_active ()) - return true; - else { - fdir->set_sensitive (true); - fformat->set_sensitive (true); - return false; - } -} -void BatchQueuePanel::saveOptions () { - - options.saveFormat = saveFormatPanel->getFormat (); - options.savePathTemplate = outdirTemplate->get_text(); - options.savePathFolder = outdirFolder->get_filename(); - options.saveUsePathTemplate = useTemplate->get_active(); - options.procQueueEnabled = autoStart->get_active (); -} - -void BatchQueuePanel::formatChanged () { - - saveOptions (); -} +void BatchQueuePanel::queueEmpty () { + + stopBatchProc (); + fdir->set_sensitive (true); + fformat->set_sensitive (true); +} + +bool BatchQueuePanel::canStartNext () { + + if (start->get_active ()) + return true; + else { + fdir->set_sensitive (true); + fformat->set_sensitive (true); + return false; + } +} + +void BatchQueuePanel::saveOptions () { + + options.saveFormat = saveFormatPanel->getFormat (); + options.savePathTemplate = outdirTemplate->get_text(); + options.savePathFolder = outdirFolder->get_filename(); + options.saveUsePathTemplate = useTemplate->get_active(); + options.procQueueEnabled = autoStart->get_active (); +} + +void BatchQueuePanel::formatChanged () { + + saveOptions (); +} diff --git a/rtgui/batchqueuepanel.h b/rtgui/batchqueuepanel.h index fa7436a70..22bd0c6be 100644 --- a/rtgui/batchqueuepanel.h +++ b/rtgui/batchqueuepanel.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _BATCHQUEUEPANEL_ #define _BATCHQUEUEPANEL_ @@ -28,13 +28,13 @@ class BatchQueuePanel : public Gtk::VBox, public BatchQueueListener, public FormatChangeListener { - Gtk::Button* zoomInButton; - Gtk::Button* zoomOutButton; - Gtk::ToggleButton* start; - Gtk::ToggleButton* stop; + Gtk::Button* zoomInButton; + Gtk::Button* zoomOutButton; + Gtk::ToggleButton* start; + Gtk::ToggleButton* stop; Gtk::CheckButton* autoStart; - sigc::connection startConnection; - sigc::connection stopConnection; + sigc::connection startConnection; + sigc::connection stopConnection; Gtk::Entry* outdirTemplate; Gtk::FileChooserButton* outdirFolder; @@ -43,9 +43,9 @@ class BatchQueuePanel : public Gtk::VBox, SaveFormatPanel* saveFormatPanel; Gtk::Frame *fdir, *fformat; - Gtk::Image* hAlignIcon; - Gtk::Image* vAlignIcon; - Gtk::Button* chAlign; + Gtk::Image* hAlignIcon; + Gtk::Image* vAlignIcon; + Gtk::Button* chAlign; RTWindow* parent; BatchQueue* batchQueue; @@ -57,7 +57,7 @@ class BatchQueuePanel : public Gtk::VBox, BatchQueuePanel (); void setParent (RTWindow* p) { parent = p; } - void arrangementButtonPressed (); + void arrangementButtonPressed (); void addBatchQueueJob (BatchQueueEntry* bqe, bool head=false); diff --git a/rtgui/batchtoolpanelcoord.cc b/rtgui/batchtoolpanelcoord.cc index c65c37099..c552d6c0d 100644 --- a/rtgui/batchtoolpanelcoord.cc +++ b/rtgui/batchtoolpanelcoord.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include @@ -255,9 +255,9 @@ void BatchToolPanelCoordinator::profileChange (const ProcParams *nparams, rteng paramcListeners[i]->procParamsChanged (&pparams, event, descr, &pparamsEdited); } -void BatchToolPanelCoordinator::cropSelectionReady () { - - toolBar->setTool (TMHand); +void BatchToolPanelCoordinator::cropSelectionReady () { + + toolBar->setTool (TMHand); } CropGUIListener* BatchToolPanelCoordinator::startCropEditing (Thumbnail* thm) { @@ -269,23 +269,23 @@ CropGUIListener* BatchToolPanelCoordinator::startCropEditing (Thumbnail* thm) { } return crop; } - -void BatchToolPanelCoordinator::rotateSelectionReady (double rotate_deg, Thumbnail* thm) { - - toolBar->setTool (TMHand); - if (rotate_deg!=0.0) + +void BatchToolPanelCoordinator::rotateSelectionReady (double rotate_deg, Thumbnail* thm) { + + toolBar->setTool (TMHand); + if (rotate_deg!=0.0) rotate->straighten (rotate_deg); -} - -void BatchToolPanelCoordinator::spotWBselected (int x, int y, Thumbnail* thm) { - -// toolBar->setTool (TOOL_HAND); - if (x>0 && y>0 && thm) { +} + +void BatchToolPanelCoordinator::spotWBselected (int x, int y, Thumbnail* thm) { + +// toolBar->setTool (TOOL_HAND); + if (x>0 && y>0 && thm) { for (int i=0; igetSpotWB (x, y, whitebalance->getSize(), temp, green); + thm->getSpotWB (x, y, whitebalance->getSize(), temp, green); double otemp = initialPP[i].wb.temperature; double ogreen = initialPP[i].wb.green; if (options.baBehav[12]) @@ -294,6 +294,6 @@ void BatchToolPanelCoordinator::spotWBselected (int x, int y, Thumbnail* thm) { green = green - ogreen; whitebalance->setWB (temp, green); } - } -} + } +} diff --git a/rtgui/batchtoolpanelcoord.h b/rtgui/batchtoolpanelcoord.h index b743275d7..5f41c3958 100644 --- a/rtgui/batchtoolpanelcoord.h +++ b/rtgui/batchtoolpanelcoord.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef __BATCHTOOLPANELCCORD__ #define __BATCHTOOLPANELCCORD__ @@ -49,7 +49,7 @@ class BatchToolPanelCoordinator : BatchToolPanelCoordinator (FilePanel* parent); // FileSelectionChangeListener interface - void selectionChanged (const std::vector& selected); + void selectionChanged (const std::vector& selected); // toolpanellistener interface void panelChanged (rtengine::ProcEvent event, const Glib::ustring& descr); @@ -65,9 +65,9 @@ class BatchToolPanelCoordinator : void procParamsChanged (Thumbnail* thm, int whoChangedIt); // imageareatoollistener interface - void spotWBselected (int x, int y, Thumbnail* thm=NULL); - void cropSelectionReady (); - void rotateSelectionReady (double rotate_deg, Thumbnail* thm=NULL); + void spotWBselected (int x, int y, Thumbnail* thm=NULL); + void cropSelectionReady (); + void rotateSelectionReady (double rotate_deg, Thumbnail* thm=NULL); CropGUIListener* startCropEditing (Thumbnail* thm=NULL); void optionsChanged (); diff --git a/rtgui/bqentryupdater.cc b/rtgui/bqentryupdater.cc index e4b9b720e..f98cab189 100644 --- a/rtgui/bqentryupdater.cc +++ b/rtgui/bqentryupdater.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include @@ -24,7 +24,7 @@ BatchQueueEntryUpdater batchQueueEntryUpdater; BatchQueueEntryUpdater::BatchQueueEntryUpdater () : tostop(false), stopped(true), qMutex(NULL) { -} +} void BatchQueueEntryUpdater::add (guint8* oimg, int ow, int oh, int newh, BQEntryUpdateListener* listener) { @@ -53,35 +53,35 @@ void BatchQueueEntryUpdater::add (guint8* oimg, int ow, int oh, int newh, BQEntr jqueue.push_back (j); } qMutex->unlock (); -} +} void BatchQueueEntryUpdater::process () { - if (stopped) - #undef THREAD_PRIORITY_NORMAL - thread = Glib::Thread::create(sigc::mem_fun(*this, &BatchQueueEntryUpdater::process_), (unsigned long int)0, true, true, Glib::THREAD_PRIORITY_NORMAL); -} + if (stopped) + #undef THREAD_PRIORITY_NORMAL + thread = Glib::Thread::create(sigc::mem_fun(*this, &BatchQueueEntryUpdater::process_), (unsigned long int)0, true, true, Glib::THREAD_PRIORITY_NORMAL); +} -void BatchQueueEntryUpdater::process_ () { +void BatchQueueEntryUpdater::process_ () { - stopped = false; - tostop = false; + stopped = false; + tostop = false; -// TODO: process visible jobs first - while (!tostop && !jqueue.empty ()) { +// TODO: process visible jobs first + while (!tostop && !jqueue.empty ()) { qMutex->lock (); - Job current = jqueue.front (); + Job current = jqueue.front (); jqueue.pop_front (); qMutex->unlock (); if (current.listener) { int neww = current.newh * current.ow / current.oh; - guint8* img = new guint8 [current.newh*neww*3]; + guint8* img = new guint8 [current.newh*neww*3]; thumbInterp (current.oimg, current.ow, current.oh, img, neww, current.newh); current.listener->updateImage (img, neww, current.newh); } } - stopped = true; -} + stopped = true; +} void BatchQueueEntryUpdater::stop () { @@ -95,7 +95,7 @@ void BatchQueueEntryUpdater::stop () { if (!stopped) thread->join (); gdk_threads_enter(); -} +} void BatchQueueEntryUpdater::removeJobs () { @@ -126,8 +126,8 @@ void BatchQueueEntryUpdater::removeJobs (BQEntryUpdateListener* listener) { } } qMutex->unlock (); -} - +} + void BatchQueueEntryUpdater::terminate () { stop (); diff --git a/rtgui/bqentryupdater.h b/rtgui/bqentryupdater.h index 630180640..24d4a893f 100644 --- a/rtgui/bqentryupdater.h +++ b/rtgui/bqentryupdater.h @@ -1,25 +1,25 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _BQENTRYUPDATER_ -#define _BQENTRYUPDATER_ - -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _BQENTRYUPDATER_ +#define _BQENTRYUPDATER_ + +#include #include #include @@ -28,35 +28,35 @@ class BQEntryUpdateListener { public: virtual void updateImage (guint8* img, int w, int h) {} }; - -class BatchQueueEntryUpdater { + +class BatchQueueEntryUpdater { struct Job { guint8* oimg; int ow, oh, newh; BQEntryUpdateListener* listener; }; - - protected: - bool tostop; - bool stopped; - std::list jqueue; + + protected: + bool tostop; + bool stopped; + std::list jqueue; Glib::Thread* thread; Glib::Mutex* qMutex; - - public: - BatchQueueEntryUpdater (); - void add (guint8* oimg, int ow, int oh, int newh, BQEntryUpdateListener* listener); - void process (); - void stop (); - void removeJobs (); - void removeJobs (BQEntryUpdateListener* listener); + public: + BatchQueueEntryUpdater (); + + void add (guint8* oimg, int ow, int oh, int newh, BQEntryUpdateListener* listener); + void process (); + void stop (); + void removeJobs (); + void removeJobs (BQEntryUpdateListener* listener); void terminate (); - void process_ (); -}; + void process_ (); +}; extern BatchQueueEntryUpdater batchQueueEntryUpdater; - -#endif + +#endif diff --git a/rtgui/browserfilter.cc b/rtgui/browserfilter.cc index 3d44f113c..c39e40e5e 100644 --- a/rtgui/browserfilter.cc +++ b/rtgui/browserfilter.cc @@ -1,26 +1,26 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include - -BrowserFilter::BrowserFilter () : exifFilterEnabled (false) { - - showTrash = true; - for (int i=0; i<6; i++) - showRanked[i] = true; -} +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include + +BrowserFilter::BrowserFilter () : exifFilterEnabled (false) { + + showTrash = true; + for (int i=0; i<6; i++) + showRanked[i] = true; +} diff --git a/rtgui/browserfilter.h b/rtgui/browserfilter.h index bfbb7039f..61a9d5684 100644 --- a/rtgui/browserfilter.h +++ b/rtgui/browserfilter.h @@ -1,37 +1,37 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _BROWSERFILTER_ -#define _BROWSERFILTER_ - -#include - -class BrowserFilter { - - public: - bool showRanked[6]; - bool showTrash; - bool showNotTrash; - - bool exifFilterEnabled; - ExifFilterSettings exifFilter; - - BrowserFilter (); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _BROWSERFILTER_ +#define _BROWSERFILTER_ + +#include + +class BrowserFilter { + + public: + bool showRanked[6]; + bool showTrash; + bool showNotTrash; + + bool exifFilterEnabled; + ExifFilterSettings exifFilter; + + BrowserFilter (); +}; + +#endif diff --git a/rtgui/cacheimagedata.cc b/rtgui/cacheimagedata.cc index 29dc40867..221f3aa7f 100644 --- a/rtgui/cacheimagedata.cc +++ b/rtgui/cacheimagedata.cc @@ -1,59 +1,59 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include -#include +#include CacheImageData::CacheImageData () : md5(""), supported(false), format(FT_Invalid), rank(0), inTrash(false), recentlySaved(false), timeValid(false), exifValid(false) { } -int CacheImageData::load (const Glib::ustring& fname) { - - rtengine::SafeKeyFile keyFile; - - try { - if (!keyFile.load_from_file (fname)) - return 1; +int CacheImageData::load (const Glib::ustring& fname) { - if (keyFile.has_group ("General")) { - if (keyFile.has_key ("General", "MD5")) md5 = keyFile.get_string ("General", "MD5"); - if (keyFile.has_key ("General", "Version")) version = keyFile.get_integer ("General", "Version"); - if (keyFile.has_key ("General", "Supported")) supported = keyFile.get_boolean ("General", "Supported"); - if (keyFile.has_key ("General", "Format")) format = (ThFileType)keyFile.get_integer ("General", "Format"); - if (keyFile.has_key ("General", "Rank")) rank = keyFile.get_integer ("General", "Rank"); - if (keyFile.has_key ("General", "InTrash")) inTrash = keyFile.get_boolean ("General", "InTrash"); - if (keyFile.has_key ("General", "RecentlySaved")) recentlySaved = keyFile.get_boolean ("General", "RecentlySaved"); + rtengine::SafeKeyFile keyFile; + + try { + if (!keyFile.load_from_file (fname)) + return 1; + + if (keyFile.has_group ("General")) { + if (keyFile.has_key ("General", "MD5")) md5 = keyFile.get_string ("General", "MD5"); + if (keyFile.has_key ("General", "Version")) version = keyFile.get_integer ("General", "Version"); + if (keyFile.has_key ("General", "Supported")) supported = keyFile.get_boolean ("General", "Supported"); + if (keyFile.has_key ("General", "Format")) format = (ThFileType)keyFile.get_integer ("General", "Format"); + if (keyFile.has_key ("General", "Rank")) rank = keyFile.get_integer ("General", "Rank"); + if (keyFile.has_key ("General", "InTrash")) inTrash = keyFile.get_boolean ("General", "InTrash"); + if (keyFile.has_key ("General", "RecentlySaved")) recentlySaved = keyFile.get_boolean ("General", "RecentlySaved"); } timeValid = keyFile.has_group ("DateTime"); - if (timeValid) { - if (keyFile.has_key ("DateTime", "Year")) year = keyFile.get_integer ("DateTime", "Year"); - if (keyFile.has_key ("DateTime", "Month")) month = keyFile.get_integer ("DateTime", "Month"); - if (keyFile.has_key ("DateTime", "Day")) day = keyFile.get_integer ("DateTime", "Day"); - if (keyFile.has_key ("DateTime", "Hour")) hour = keyFile.get_integer ("DateTime", "Hour"); - if (keyFile.has_key ("DateTime", "Min")) min = keyFile.get_integer ("DateTime", "Min"); - if (keyFile.has_key ("DateTime", "Sec")) sec = keyFile.get_integer ("DateTime", "Sec"); - if (keyFile.has_key ("DateTime", "MSec")) msec = keyFile.get_integer ("DateTime", "MSec"); + if (timeValid) { + if (keyFile.has_key ("DateTime", "Year")) year = keyFile.get_integer ("DateTime", "Year"); + if (keyFile.has_key ("DateTime", "Month")) month = keyFile.get_integer ("DateTime", "Month"); + if (keyFile.has_key ("DateTime", "Day")) day = keyFile.get_integer ("DateTime", "Day"); + if (keyFile.has_key ("DateTime", "Hour")) hour = keyFile.get_integer ("DateTime", "Hour"); + if (keyFile.has_key ("DateTime", "Min")) min = keyFile.get_integer ("DateTime", "Min"); + if (keyFile.has_key ("DateTime", "Sec")) sec = keyFile.get_integer ("DateTime", "Sec"); + if (keyFile.has_key ("DateTime", "MSec")) msec = keyFile.get_integer ("DateTime", "MSec"); } exifValid = false; @@ -62,78 +62,78 @@ int CacheImageData::load (const Glib::ustring& fname) { exifValid = true; if (keyFile.has_key ("ExifInfo", "Valid")) exifValid = keyFile.get_boolean ("ExifInfo", "Valid"); - if (exifValid) { - if (keyFile.has_key ("ExifInfo", "FNumber")) fnumber = keyFile.get_double ("ExifInfo", "FNumber"); - if (keyFile.has_key ("ExifInfo", "Shutter")) shutter = keyFile.get_double ("ExifInfo", "Shutter"); - if (keyFile.has_key ("ExifInfo", "FocalLen")) focalLen = keyFile.get_double ("ExifInfo", "FocalLen"); - if (keyFile.has_key ("ExifInfo", "ISO")) iso = keyFile.get_integer ("ExifInfo", "ISO"); + if (exifValid) { + if (keyFile.has_key ("ExifInfo", "FNumber")) fnumber = keyFile.get_double ("ExifInfo", "FNumber"); + if (keyFile.has_key ("ExifInfo", "Shutter")) shutter = keyFile.get_double ("ExifInfo", "Shutter"); + if (keyFile.has_key ("ExifInfo", "FocalLen")) focalLen = keyFile.get_double ("ExifInfo", "FocalLen"); + if (keyFile.has_key ("ExifInfo", "ISO")) iso = keyFile.get_integer ("ExifInfo", "ISO"); } if (keyFile.has_key ("ExifInfo", "Lens")) lens = keyFile.get_string ("ExifInfo", "Lens"); if (keyFile.has_key ("ExifInfo", "Camera")) camera = keyFile.get_string ("ExifInfo", "Camera"); } if (format==FT_Raw && keyFile.has_group ("ExtraRawInfo")) { - if (keyFile.has_key ("ExtraRawInfo", "ThumbImageType")) thumbImgType = keyFile.get_integer ("ExtraRawInfo", "ThumbImageType"); - if (keyFile.has_key ("ExtraRawInfo", "ThumbImageOffset")) thumbOffset = keyFile.get_integer ("ExtraRawInfo", "ThumbImageOffset"); + if (keyFile.has_key ("ExtraRawInfo", "ThumbImageType")) thumbImgType = keyFile.get_integer ("ExtraRawInfo", "ThumbImageType"); + if (keyFile.has_key ("ExtraRawInfo", "ThumbImageOffset")) thumbOffset = keyFile.get_integer ("ExtraRawInfo", "ThumbImageOffset"); } else { rotate = 0; thumbImgType = 0; } - return 0; - } - catch (Glib::Error) { - return 1; - } + return 0; + } + catch (Glib::Error) { + return 1; + } } -int CacheImageData::save (const Glib::ustring& fname) { +int CacheImageData::save (const Glib::ustring& fname) { - rtengine::SafeKeyFile keyFile; + rtengine::SafeKeyFile keyFile; - try { - keyFile.load_from_file (fname); - } catch (...) {} - - keyFile.set_string ("General", "MD5", md5); - keyFile.set_integer ("General", "Version", options.version); - keyFile.set_boolean ("General", "Supported", supported); - keyFile.set_integer ("General", "Format", format); - keyFile.set_integer ("General", "Rank", rank); - keyFile.set_boolean ("General", "InTrash", inTrash); + try { + keyFile.load_from_file (fname); + } catch (...) {} + + keyFile.set_string ("General", "MD5", md5); + keyFile.set_integer ("General", "Version", options.version); + keyFile.set_boolean ("General", "Supported", supported); + keyFile.set_integer ("General", "Format", format); + keyFile.set_integer ("General", "Rank", rank); + keyFile.set_boolean ("General", "InTrash", inTrash); keyFile.set_boolean ("General", "RecentlySaved", recentlySaved); - if (timeValid) { - keyFile.set_integer ("DateTime", "Year", year); - keyFile.set_integer ("DateTime", "Month", month); - keyFile.set_integer ("DateTime", "Day", day); - keyFile.set_integer ("DateTime", "Hour", hour); - keyFile.set_integer ("DateTime", "Min", min); - keyFile.set_integer ("DateTime", "Sec", sec); - keyFile.set_integer ("DateTime", "MSec", msec); + if (timeValid) { + keyFile.set_integer ("DateTime", "Year", year); + keyFile.set_integer ("DateTime", "Month", month); + keyFile.set_integer ("DateTime", "Day", day); + keyFile.set_integer ("DateTime", "Hour", hour); + keyFile.set_integer ("DateTime", "Min", min); + keyFile.set_integer ("DateTime", "Sec", sec); + keyFile.set_integer ("DateTime", "MSec", msec); } keyFile.set_boolean ("ExifInfo", "Valid", exifValid); - if (exifValid) { - keyFile.set_double ("ExifInfo", "FNumber", fnumber); - keyFile.set_double ("ExifInfo", "Shutter", shutter); - keyFile.set_double ("ExifInfo", "FocalLen", focalLen); - keyFile.set_integer ("ExifInfo", "ISO", iso); + if (exifValid) { + keyFile.set_double ("ExifInfo", "FNumber", fnumber); + keyFile.set_double ("ExifInfo", "Shutter", shutter); + keyFile.set_double ("ExifInfo", "FocalLen", focalLen); + keyFile.set_integer ("ExifInfo", "ISO", iso); } keyFile.set_string ("ExifInfo", "Lens", lens); keyFile.set_string ("ExifInfo", "Camera", camera); if (format==FT_Raw) { - keyFile.set_integer ("ExtraRawInfo", "ThumbImageType", thumbImgType); - keyFile.set_integer ("ExtraRawInfo", "ThumbImageOffset", thumbOffset); + keyFile.set_integer ("ExtraRawInfo", "ThumbImageType", thumbImgType); + keyFile.set_integer ("ExtraRawInfo", "ThumbImageOffset", thumbOffset); } - FILE *f = g_fopen (fname.c_str(), "wt"); - if (!f) - return 1; - else { - fprintf (f, "%s", keyFile.to_data().c_str()); - fclose (f); - return 0; - } } + FILE *f = g_fopen (fname.c_str(), "wt"); + if (!f) + return 1; + else { + fprintf (f, "%s", keyFile.to_data().c_str()); + fclose (f); + return 0; + }} diff --git a/rtgui/cacheimagedata.h b/rtgui/cacheimagedata.h index 2ac4b42bf..828a7ca44 100644 --- a/rtgui/cacheimagedata.h +++ b/rtgui/cacheimagedata.h @@ -1,67 +1,67 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _CACHEIMAGEDATA_ -#define _CACHEIMAGEDATA_ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _CACHEIMAGEDATA_ +#define _CACHEIMAGEDATA_ #include #include - -class CacheImageData { - - public: - // basic informations +class CacheImageData { + + public: + + // basic informations Glib::ustring md5; - int version; - bool supported; - ThFileType format; - char rank; - bool inTrash; - bool recentlySaved; + int version; + bool supported; + ThFileType format; + char rank; + bool inTrash; + bool recentlySaved; // time/date info bool timeValid; - short year; - char month; - char day; - char hour; - char min; - char sec; - char msec; + short year; + char month; + char day; + char hour; + char min; + char sec; + char msec; - // exif info - bool exifValid; - double fnumber; - double shutter; - double focalLen; - unsigned iso; - Glib::ustring lens; - Glib::ustring camera; + // exif info + bool exifValid; + double fnumber; + double shutter; + double focalLen; + unsigned iso; + Glib::ustring lens; + Glib::ustring camera; // additional info on raw images - int rotate; - int thumbImgType; - int thumbOffset; + int rotate; + int thumbImgType; + int thumbOffset; CacheImageData (); - int load (const Glib::ustring& fname); - int save (const Glib::ustring& fname); -}; -#endif + int load (const Glib::ustring& fname); + int save (const Glib::ustring& fname); +}; +#endif diff --git a/rtgui/cachemanager.cc b/rtgui/cachemanager.cc index fde9442d8..81746034b 100644 --- a/rtgui/cachemanager.cc +++ b/rtgui/cachemanager.cc @@ -1,253 +1,253 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include +#include +#include #include -#include - -CacheManager cacheMgr; - -void CacheManager::init () { - - openEntries.clear (); - baseDir = options.cacheBaseDir; - - if (!Glib::file_test (baseDir, Glib::FILE_TEST_IS_DIR)) - g_mkdir_with_parents (baseDir.c_str(), 511); - if (!Glib::file_test (Glib::build_filename (baseDir, "profiles"), Glib::FILE_TEST_IS_DIR)) - g_mkdir_with_parents (Glib::ustring(Glib::build_filename (baseDir, "profiles")).c_str(), 511); - if (!Glib::file_test (Glib::build_filename (baseDir, "images"), Glib::FILE_TEST_IS_DIR)) - g_mkdir_with_parents (Glib::ustring(Glib::build_filename (baseDir, "images")).c_str(), 511); - if (!Glib::file_test (Glib::build_filename (baseDir, "aehistograms"), Glib::FILE_TEST_IS_DIR)) - g_mkdir_with_parents (Glib::ustring(Glib::build_filename (baseDir, "aehistograms")).c_str(), 511); - if (!Glib::file_test (Glib::build_filename (baseDir, "embprofiles"), Glib::FILE_TEST_IS_DIR)) - g_mkdir_with_parents (Glib::ustring(Glib::build_filename (baseDir, "embprofiles")).c_str(), 511); - if (!Glib::file_test (Glib::build_filename (baseDir, "data"), Glib::FILE_TEST_IS_DIR)) - g_mkdir_with_parents (Glib::ustring(Glib::build_filename (baseDir, "data")).c_str(), 511); -} - -Thumbnail* CacheManager::getEntry (const Glib::ustring& fname) { - - Thumbnail* res = NULL; - - std::map::iterator r = openEntries.find (fname); - // if it is open, return it - if (r!=openEntries.end()) { - r->second->increaseRef (); - return r->second; - } - - // compute the md5 - std::string md5 = getMD5 (fname); - if (md5=="") - return NULL; - - // build path name - Glib::ustring cfname = getCacheFileName ("data", fname, md5) + ".txt"; - - // let's see if we have it in the cache - if (Glib::file_test (cfname, Glib::FILE_TEST_EXISTS)) { - CacheImageData* cfs = new CacheImageData (); - int e = cfs->load (cfname); - if (!e && cfs->supported==true) - res = new Thumbnail (this, fname, cfs); - if (res && !res->isSupported ()) { - delete res; - res = NULL; - } - delete cfs; - } - // if not, create a new one - if (!res) { - res = new Thumbnail (this, fname, md5); - if (!res->isSupported ()) { - delete res; - res = NULL; - } - } - - if (res) - openEntries[fname] = res; - return res; -} - - -void CacheManager::deleteEntry (const Glib::ustring& fname) { - - // check if it is opened - std::map::iterator r = openEntries.find (fname); - // if it is open, dont delete it - if (r!=openEntries.end()) { - std::string md5 = r->second->getMD5 (); - r->second->decreaseRef (); - // if in the editor, the thumbnail still exists. If not, delete it: - r = openEntries.find (fname); - if (r==openEntries.end() && md5!="") { - ::g_remove ((getCacheFileName ("data", fname, md5) + ".txt").c_str()); - ::g_remove ((getCacheFileName ("profiles", fname, md5) + ".pp2").c_str()); - ::g_remove ((getCacheFileName ("images", fname, md5) + ".cust").c_str()); - ::g_remove ((getCacheFileName ("images", fname, md5) + ".jpg").c_str()); - ::g_remove ((getCacheFileName ("aehistograms", fname, md5)).c_str()); - ::g_remove ((getCacheFileName ("embprofiles", fname, md5) + ".icc").c_str()); - } - } - else { - std::string md5 = getMD5 (fname); - if (md5!="") { - ::g_remove ((getCacheFileName ("data", fname, md5) + ".txt").c_str()); - ::g_remove ((getCacheFileName ("profiles", fname, md5) + ".pp2").c_str()); - ::g_remove ((getCacheFileName ("images", fname, md5) + ".cust").c_str()); - ::g_remove ((getCacheFileName ("images", fname, md5) + ".jpg").c_str()); - ::g_remove ((getCacheFileName ("aehistograms", fname, md5)).c_str()); - ::g_remove ((getCacheFileName ("embprofiles", fname, md5) + ".icc").c_str()); - } - } -} - - -void CacheManager::renameEntry (const std::string& oldfilename, const std::string& oldmd5, const std::string& newfilename) { - - std::string newmd5 = getMD5 (newfilename); - - ::g_rename ((getCacheFileName ("profiles", oldfilename, oldmd5) + ".pp2").c_str(), (getCacheFileName ("profiles", newfilename, newmd5) + ".pp2").c_str()); - ::g_rename ((getCacheFileName ("images", oldfilename, oldmd5) + ".cust").c_str(), (getCacheFileName ("images", newfilename, newmd5) + ".cust").c_str()); - ::g_rename ((getCacheFileName ("images", oldfilename, oldmd5) + ".jpg").c_str(), (getCacheFileName ("images", newfilename, newmd5) + ".jpg").c_str()); - ::g_rename ((getCacheFileName ("aehistograms", oldfilename, oldmd5)).c_str(), (getCacheFileName ("aehistograms", newfilename, newmd5)).c_str()); - ::g_rename ((getCacheFileName ("embprofiles", oldfilename, oldmd5) + ".icc").c_str(), (getCacheFileName ("embprofiles", newfilename, newmd5) + ".icc").c_str()); - ::g_rename ((getCacheFileName ("data", oldfilename, oldmd5) + ".txt").c_str(), (getCacheFileName ("data", newfilename, newmd5) + ".txt").c_str()); - - // check if it is opened - std::map::iterator r = openEntries.find (oldfilename); - // if it is open, update md5 - if (r!=openEntries.end()) { - Thumbnail* t = r->second; - openEntries.erase (r); - t->setFileName (newfilename); - openEntries[newfilename] = t; - t->updateCache (); - t->reSaveThumbnail (); - } -} - -void CacheManager::closeThumbnail (Thumbnail* t) { - - t->updateCache (); - std::map::iterator r = openEntries.find (t->getFileName()); - if (r!=openEntries.end()) - openEntries.erase (r); - delete t; -} - -void CacheManager::closeCache () { - - applyCacheSizeLimitation (); -} - -void CacheManager::clearAll () { - - deleteDir ("images"); - deleteDir ("aehistograms"); - deleteDir ("embprofiles"); - deleteDir ("profiles"); - deleteDir ("data"); - - // re-generate thumbnail images and clear profiles of open thumbnails - std::map::iterator i; - for (i=openEntries.begin(); i!=openEntries.end(); i++) { - i->second->clearProcParams (CACHEMGR); - i->second->generateThumbnailImage (); - i->second->updateCache (); - } -} -void CacheManager::clearThumbImages () { - - deleteDir ("images"); - deleteDir ("aehistograms"); - deleteDir ("embprofiles"); - - // re-generate thumbnail images of open thumbnails - std::map::iterator i; - for (i=openEntries.begin(); i!=openEntries.end(); i++) - i->second->generateThumbnailImage (); -} - -void CacheManager::clearProfiles () { - - deleteDir ("profiles"); - // clear profiles of open thumbnails - std::map::iterator i; - for (i=openEntries.begin(); i!=openEntries.end(); i++) - i->second->clearProcParams (CACHEMGR); -} - -void CacheManager::deleteDir (const Glib::ustring& dirName) { - - try { - Glib::Dir* dir = new Glib::Dir (Glib::build_filename (baseDir, dirName)); - for (Glib::DirIterator i = dir->begin(); i!=dir->end(); ++i) - ::g_remove (Glib::build_filename (Glib::build_filename (baseDir, dirName), *i).c_str()); - delete dir; - } - catch (const Glib::FileError& fe) { - } -} - -std::string CacheManager::getMD5 (const Glib::ustring& fname) { - - Glib::RefPtr file = Gio::File::create_for_path (fname); +#include + +CacheManager cacheMgr; + +void CacheManager::init () { + + openEntries.clear (); + baseDir = options.cacheBaseDir; + + if (!Glib::file_test (baseDir, Glib::FILE_TEST_IS_DIR)) + g_mkdir_with_parents (baseDir.c_str(), 511); + if (!Glib::file_test (Glib::build_filename (baseDir, "profiles"), Glib::FILE_TEST_IS_DIR)) + g_mkdir_with_parents (Glib::ustring(Glib::build_filename (baseDir, "profiles")).c_str(), 511); + if (!Glib::file_test (Glib::build_filename (baseDir, "images"), Glib::FILE_TEST_IS_DIR)) + g_mkdir_with_parents (Glib::ustring(Glib::build_filename (baseDir, "images")).c_str(), 511); + if (!Glib::file_test (Glib::build_filename (baseDir, "aehistograms"), Glib::FILE_TEST_IS_DIR)) + g_mkdir_with_parents (Glib::ustring(Glib::build_filename (baseDir, "aehistograms")).c_str(), 511); + if (!Glib::file_test (Glib::build_filename (baseDir, "embprofiles"), Glib::FILE_TEST_IS_DIR)) + g_mkdir_with_parents (Glib::ustring(Glib::build_filename (baseDir, "embprofiles")).c_str(), 511); + if (!Glib::file_test (Glib::build_filename (baseDir, "data"), Glib::FILE_TEST_IS_DIR)) + g_mkdir_with_parents (Glib::ustring(Glib::build_filename (baseDir, "data")).c_str(), 511); +} + +Thumbnail* CacheManager::getEntry (const Glib::ustring& fname) { + + Thumbnail* res = NULL; + + std::map::iterator r = openEntries.find (fname); + // if it is open, return it + if (r!=openEntries.end()) { + r->second->increaseRef (); + return r->second; + } + + // compute the md5 + std::string md5 = getMD5 (fname); + if (md5=="") + return NULL; + + // build path name + Glib::ustring cfname = getCacheFileName ("data", fname, md5) + ".txt"; + + // let's see if we have it in the cache + if (Glib::file_test (cfname, Glib::FILE_TEST_EXISTS)) { + CacheImageData* cfs = new CacheImageData (); + int e = cfs->load (cfname); + if (!e && cfs->supported==true) + res = new Thumbnail (this, fname, cfs); + if (res && !res->isSupported ()) { + delete res; + res = NULL; + } + delete cfs; + } + // if not, create a new one + if (!res) { + res = new Thumbnail (this, fname, md5); + if (!res->isSupported ()) { + delete res; + res = NULL; + } + } + + if (res) + openEntries[fname] = res; + return res; +} + + +void CacheManager::deleteEntry (const Glib::ustring& fname) { + + // check if it is opened + std::map::iterator r = openEntries.find (fname); + // if it is open, dont delete it + if (r!=openEntries.end()) { + std::string md5 = r->second->getMD5 (); + r->second->decreaseRef (); + // if in the editor, the thumbnail still exists. If not, delete it: + r = openEntries.find (fname); + if (r==openEntries.end() && md5!="") { + ::g_remove ((getCacheFileName ("data", fname, md5) + ".txt").c_str()); + ::g_remove ((getCacheFileName ("profiles", fname, md5) + ".pp2").c_str()); + ::g_remove ((getCacheFileName ("images", fname, md5) + ".cust").c_str()); + ::g_remove ((getCacheFileName ("images", fname, md5) + ".jpg").c_str()); + ::g_remove ((getCacheFileName ("aehistograms", fname, md5)).c_str()); + ::g_remove ((getCacheFileName ("embprofiles", fname, md5) + ".icc").c_str()); + } + } + else { + std::string md5 = getMD5 (fname); + if (md5!="") { + ::g_remove ((getCacheFileName ("data", fname, md5) + ".txt").c_str()); + ::g_remove ((getCacheFileName ("profiles", fname, md5) + ".pp2").c_str()); + ::g_remove ((getCacheFileName ("images", fname, md5) + ".cust").c_str()); + ::g_remove ((getCacheFileName ("images", fname, md5) + ".jpg").c_str()); + ::g_remove ((getCacheFileName ("aehistograms", fname, md5)).c_str()); + ::g_remove ((getCacheFileName ("embprofiles", fname, md5) + ".icc").c_str()); + } + } +} + + +void CacheManager::renameEntry (const std::string& oldfilename, const std::string& oldmd5, const std::string& newfilename) { + + std::string newmd5 = getMD5 (newfilename); + + ::g_rename ((getCacheFileName ("profiles", oldfilename, oldmd5) + ".pp2").c_str(), (getCacheFileName ("profiles", newfilename, newmd5) + ".pp2").c_str()); + ::g_rename ((getCacheFileName ("images", oldfilename, oldmd5) + ".cust").c_str(), (getCacheFileName ("images", newfilename, newmd5) + ".cust").c_str()); + ::g_rename ((getCacheFileName ("images", oldfilename, oldmd5) + ".jpg").c_str(), (getCacheFileName ("images", newfilename, newmd5) + ".jpg").c_str()); + ::g_rename ((getCacheFileName ("aehistograms", oldfilename, oldmd5)).c_str(), (getCacheFileName ("aehistograms", newfilename, newmd5)).c_str()); + ::g_rename ((getCacheFileName ("embprofiles", oldfilename, oldmd5) + ".icc").c_str(), (getCacheFileName ("embprofiles", newfilename, newmd5) + ".icc").c_str()); + ::g_rename ((getCacheFileName ("data", oldfilename, oldmd5) + ".txt").c_str(), (getCacheFileName ("data", newfilename, newmd5) + ".txt").c_str()); + + // check if it is opened + std::map::iterator r = openEntries.find (oldfilename); + // if it is open, update md5 + if (r!=openEntries.end()) { + Thumbnail* t = r->second; + openEntries.erase (r); + t->setFileName (newfilename); + openEntries[newfilename] = t; + t->updateCache (); + t->reSaveThumbnail (); + } +} + +void CacheManager::closeThumbnail (Thumbnail* t) { + + t->updateCache (); + std::map::iterator r = openEntries.find (t->getFileName()); + if (r!=openEntries.end()) + openEntries.erase (r); + delete t; +} + +void CacheManager::closeCache () { + + applyCacheSizeLimitation (); +} + +void CacheManager::clearAll () { + + deleteDir ("images"); + deleteDir ("aehistograms"); + deleteDir ("embprofiles"); + deleteDir ("profiles"); + deleteDir ("data"); + + // re-generate thumbnail images and clear profiles of open thumbnails + std::map::iterator i; + for (i=openEntries.begin(); i!=openEntries.end(); i++) { + i->second->clearProcParams (CACHEMGR); + i->second->generateThumbnailImage (); + i->second->updateCache (); + } +} +void CacheManager::clearThumbImages () { + + deleteDir ("images"); + deleteDir ("aehistograms"); + deleteDir ("embprofiles"); + + // re-generate thumbnail images of open thumbnails + std::map::iterator i; + for (i=openEntries.begin(); i!=openEntries.end(); i++) + i->second->generateThumbnailImage (); +} + +void CacheManager::clearProfiles () { + + deleteDir ("profiles"); + // clear profiles of open thumbnails + std::map::iterator i; + for (i=openEntries.begin(); i!=openEntries.end(); i++) + i->second->clearProcParams (CACHEMGR); +} + +void CacheManager::deleteDir (const Glib::ustring& dirName) { + + try { + Glib::Dir* dir = new Glib::Dir (Glib::build_filename (baseDir, dirName)); + for (Glib::DirIterator i = dir->begin(); i!=dir->end(); ++i) + ::g_remove (Glib::build_filename (Glib::build_filename (baseDir, dirName), *i).c_str()); + delete dir; + } + catch (const Glib::FileError& fe) { + } +} + +std::string CacheManager::getMD5 (const Glib::ustring& fname) { + + Glib::RefPtr file = Gio::File::create_for_path (fname); if (file) { Glib::RefPtr info = safe_query_file_info (file); - if (info) - return Glib::Checksum::compute_checksum (Glib::Checksum::CHECKSUM_MD5, Glib::ustring::compose ("%1%2", fname, info->get_size())); - } - return ""; -} - -Glib::ustring CacheManager::getCacheFileName (const Glib::ustring& subdir, const Glib::ustring& fname, const Glib::ustring& md5) { - - Glib::ustring cfn = Glib::build_filename (baseDir, subdir); - Glib::ustring cname = Glib::path_get_basename (fname) + "." + md5; - return Glib::build_filename (cfn, cname); -} - -void CacheManager::applyCacheSizeLimitation () { - - std::vector flist; - Glib::ustring dataDir = Glib::build_filename (baseDir, "data"); - Glib::RefPtr dir = Gio::File::create_for_path (dataDir); + if (info) + return Glib::Checksum::compute_checksum (Glib::Checksum::CHECKSUM_MD5, Glib::ustring::compose ("%1%2", fname, info->get_size())); + } + return ""; +} + +Glib::ustring CacheManager::getCacheFileName (const Glib::ustring& subdir, const Glib::ustring& fname, const Glib::ustring& md5) { + + Glib::ustring cfn = Glib::build_filename (baseDir, subdir); + Glib::ustring cname = Glib::path_get_basename (fname) + "." + md5; + return Glib::build_filename (cfn, cname); +} + +void CacheManager::applyCacheSizeLimitation () { + + std::vector flist; + Glib::ustring dataDir = Glib::build_filename (baseDir, "data"); + Glib::RefPtr dir = Gio::File::create_for_path (dataDir); safe_build_file_list (dir, flist); - - if (flist.size() > options.maxCacheEntries) { - std::sort (flist.begin(), flist.end()); - while (flist.size() > options.maxCacheEntries) { - ::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "data"), flist.front().fname) + ".txt").c_str()); - ::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "images"), flist.front().fname) + ".cust").c_str()); - ::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "images"), flist.front().fname) + ".jpg").c_str()); - ::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "aehistograms"), flist.front().fname)).c_str()); - ::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "embprofiles"), flist.front().fname) + ".icc").c_str()); -// ::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "profiles"), flist.front().fname) + ".pp2").c_str()); - flist.erase (flist.begin()); - } - } -} - + + if (flist.size() > options.maxCacheEntries) { + std::sort (flist.begin(), flist.end()); + while (flist.size() > options.maxCacheEntries) { + ::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "data"), flist.front().fname) + ".txt").c_str()); + ::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "images"), flist.front().fname) + ".cust").c_str()); + ::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "images"), flist.front().fname) + ".jpg").c_str()); + ::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "aehistograms"), flist.front().fname)).c_str()); + ::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "embprofiles"), flist.front().fname) + ".icc").c_str()); +// ::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "profiles"), flist.front().fname) + ".pp2").c_str()); + flist.erase (flist.begin()); + } + } +} + diff --git a/rtgui/cachemanager.h b/rtgui/cachemanager.h index d99d2a5ef..f2f15c59d 100644 --- a/rtgui/cachemanager.h +++ b/rtgui/cachemanager.h @@ -1,64 +1,64 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _CACHEMANAGER_ -#define _CACHEMANAGER_ - -#include -#include -#include -#include -#include - -class Thumbnail; - -class CacheManager { - - std::map openEntries; - Glib::ustring baseDir; +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _CACHEMANAGER_ +#define _CACHEMANAGER_ + +#include +#include +#include +#include +#include + +class Thumbnail; + +class CacheManager { + + std::map openEntries; + Glib::ustring baseDir; void deleteDir (const Glib::ustring& dirName); - - public: - CacheManager () {} - - void init (); - Thumbnail* getEntry (const Glib::ustring& fname); - void deleteEntry (const Glib::ustring& fname); - void renameEntry (const std::string& oldfilename, const std::string& oldmd5, const std::string& newfilename); - - void closeThumbnail (Thumbnail* t); - - const Glib::ustring& getBaseDir () { return baseDir; } - void closeCache (); - - static std::string getMD5 (const Glib::ustring& fname); - - void clearAll (); - void clearThumbImages (); + + public: + CacheManager () {} + + void init (); + Thumbnail* getEntry (const Glib::ustring& fname); + void deleteEntry (const Glib::ustring& fname); + void renameEntry (const std::string& oldfilename, const std::string& oldmd5, const std::string& newfilename); + + void closeThumbnail (Thumbnail* t); + + const Glib::ustring& getBaseDir () { return baseDir; } + void closeCache (); + + static std::string getMD5 (const Glib::ustring& fname); + + void clearAll (); + void clearThumbImages (); void clearProfiles (); void applyCacheSizeLimitation (); - Glib::ustring getCacheFileName (const Glib::ustring& subdir, const Glib::ustring& fname, const Glib::ustring& md5); -}; - -extern CacheManager cacheMgr; - -#endif - + Glib::ustring getCacheFileName (const Glib::ustring& subdir, const Glib::ustring& fname, const Glib::ustring& md5); +}; + +extern CacheManager cacheMgr; + +#endif + diff --git a/rtgui/cacorrection.cc b/rtgui/cacorrection.cc index c727a57f5..3a97b90d8 100644 --- a/rtgui/cacorrection.cc +++ b/rtgui/cacorrection.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include diff --git a/rtgui/cacorrection.h b/rtgui/cacorrection.h index d51dd73f0..c9b4a8142 100644 --- a/rtgui/cacorrection.h +++ b/rtgui/cacorrection.h @@ -1,46 +1,46 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _CACORRECTION_H_ -#define _CACORRECTION_H_ - -#include -#include -#include - -class CACorrection : public Gtk::VBox, public AdjusterListener, public ToolPanel { - - protected: - Adjuster* red; - Adjuster* blue; - bool valaAdd, valbAdd; - - public: - - CACorrection (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); - void setBatchMode (bool batchMode); - - void adjusterChanged (Adjuster* a, double newval); - void setAdjusterBehavior (bool baadd, bool bbadd); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _CACORRECTION_H_ +#define _CACORRECTION_H_ + +#include +#include +#include + +class CACorrection : public Gtk::VBox, public AdjusterListener, public ToolPanel { + + protected: + Adjuster* red; + Adjuster* blue; + bool valaAdd, valbAdd; + + public: + + CACorrection (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); + void setBatchMode (bool batchMode); + + void adjusterChanged (Adjuster* a, double newval); + void setAdjusterBehavior (bool baadd, bool bbadd); +}; + +#endif diff --git a/rtgui/chmixer.cc b/rtgui/chmixer.cc index 10544f5f2..b41f44a9b 100644 --- a/rtgui/chmixer.cc +++ b/rtgui/chmixer.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include using namespace rtengine; diff --git a/rtgui/chmixer.h b/rtgui/chmixer.h index b84ba222f..e6eb6afc0 100644 --- a/rtgui/chmixer.h +++ b/rtgui/chmixer.h @@ -1,45 +1,45 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _CHMIXER_H_ -#define _CHMIXER_H_ - -#include -#include -#include - -class ChMixer : public Gtk::VBox, public AdjusterListener, public ToolPanel { - - protected: - Adjuster *red[3]; - Adjuster *green[3]; - Adjuster *blue[3]; - - public: - - ChMixer (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); - void setBatchMode (bool batchMode); - - void adjusterChanged (Adjuster* a, double newval); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _CHMIXER_H_ +#define _CHMIXER_H_ + +#include +#include +#include + +class ChMixer : public Gtk::VBox, public AdjusterListener, public ToolPanel { + + protected: + Adjuster *red[3]; + Adjuster *green[3]; + Adjuster *blue[3]; + + public: + + ChMixer (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); + void setBatchMode (bool batchMode); + + void adjusterChanged (Adjuster* a, double newval); +}; + +#endif diff --git a/rtgui/clipboard.cc b/rtgui/clipboard.cc index 48a8822f4..38c2e75aa 100644 --- a/rtgui/clipboard.cc +++ b/rtgui/clipboard.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include - -Clipboard clipboard; +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include + +Clipboard clipboard; diff --git a/rtgui/clipboard.h b/rtgui/clipboard.h index 76a386c3f..e9a43bd54 100644 --- a/rtgui/clipboard.h +++ b/rtgui/clipboard.h @@ -1,44 +1,44 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _CLIPBOARD_ -#define _CLIPBOARD_ - -#include -#include - -class Clipboard { - +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _CLIPBOARD_ +#define _CLIPBOARD_ + +#include +#include + +class Clipboard { + bool _hasIPTC; std::vector iptc; bool _hasProcParams; - rtengine::procparams::ProcParams procParams; - - public: - void setIPTC (const std::vector& iptcc) { iptc = iptcc; _hasIPTC = true;} + rtengine::procparams::ProcParams procParams; + + public: + void setIPTC (const std::vector& iptcc) { iptc = iptcc; _hasIPTC = true;} const std::vector& getIPTC () { return iptc; } bool hasIPTC () { return _hasIPTC; } - void setProcParams (const rtengine::procparams::ProcParams& pparams) { procParams = pparams; _hasProcParams = true; } - const rtengine::procparams::ProcParams& getProcParams () { return procParams; } + void setProcParams (const rtengine::procparams::ProcParams& pparams) { procParams = pparams; _hasProcParams = true; } + const rtengine::procparams::ProcParams& getProcParams () { return procParams; } bool hasProcParams () { return _hasProcParams; } -}; - -extern Clipboard clipboard; - -#endif +}; + +extern Clipboard clipboard; + +#endif diff --git a/rtgui/coarsepanel.cc b/rtgui/coarsepanel.cc index 775ffab05..d2c6f0644 100644 --- a/rtgui/coarsepanel.cc +++ b/rtgui/coarsepanel.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include extern Glib::ustring argv0; diff --git a/rtgui/coarsepanel.h b/rtgui/coarsepanel.h index 0811b151a..5355c67fc 100644 --- a/rtgui/coarsepanel.h +++ b/rtgui/coarsepanel.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef __COARSEPANEL__ #define __COARSEPANEL__ diff --git a/rtgui/colorboost.cc b/rtgui/colorboost.cc index 6221b675a..c70ce4311 100644 --- a/rtgui/colorboost.cc +++ b/rtgui/colorboost.cc @@ -1,191 +1,191 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include - -using namespace rtengine; -using namespace rtengine::procparams; - -ColorBoost::ColorBoost () : ToolPanel(), cbAdd(false) { - - colorboost = new Adjuster (M("TP_COLORBOOST_AMOUNT"), -100, 300, 1, 0); - - pack_start (*colorboost); - pack_start (*Gtk::manage (new Gtk::HSeparator())); - - avoidclip = Gtk::manage (new Gtk::CheckButton (M("TP_COLORBOOST_AVOIDCOLORCLIP"))); - - pack_start (*avoidclip); - pack_start (*Gtk::manage (new Gtk::HSeparator())); - - enablelimiter = Gtk::manage (new Gtk::CheckButton (M("TP_COLORBOOST_ENABLESATLIMITER"))); - pack_start (*enablelimiter); - - saturationlimiter = new Adjuster (M("TP_COLORBOOST_SATLIMIT"), 0, 200, 0.1, 100); - saturationlimiter->show (); +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include + +using namespace rtengine; +using namespace rtengine::procparams; + +ColorBoost::ColorBoost () : ToolPanel(), cbAdd(false) { + + colorboost = new Adjuster (M("TP_COLORBOOST_AMOUNT"), -100, 300, 1, 0); + + pack_start (*colorboost); + pack_start (*Gtk::manage (new Gtk::HSeparator())); + + avoidclip = Gtk::manage (new Gtk::CheckButton (M("TP_COLORBOOST_AVOIDCOLORCLIP"))); + + pack_start (*avoidclip); + pack_start (*Gtk::manage (new Gtk::HSeparator())); + + enablelimiter = Gtk::manage (new Gtk::CheckButton (M("TP_COLORBOOST_ENABLESATLIMITER"))); + pack_start (*enablelimiter); + + saturationlimiter = new Adjuster (M("TP_COLORBOOST_SATLIMIT"), 0, 200, 0.1, 100); + saturationlimiter->show (); saturationlimiter->reference (); - - colorboost->setAdjusterListener (this); - saturationlimiter->setAdjusterListener (this); - acconn = avoidclip->signal_toggled().connect( sigc::mem_fun(*this, &ColorBoost::avoidclip_toggled) ); - elconn = enablelimiter->signal_toggled().connect( sigc::mem_fun(*this, &ColorBoost::enablelimiter_toggled) ); - - show_all_children (); -} + + colorboost->setAdjusterListener (this); + saturationlimiter->setAdjusterListener (this); + acconn = avoidclip->signal_toggled().connect( sigc::mem_fun(*this, &ColorBoost::avoidclip_toggled) ); + elconn = enablelimiter->signal_toggled().connect( sigc::mem_fun(*this, &ColorBoost::enablelimiter_toggled) ); + + show_all_children (); +} ColorBoost::~ColorBoost () { delete saturationlimiter; } - -void ColorBoost::read (const ProcParams* pp, const ParamsEdited* pedited) { - - disableListener (); - - if (pedited) { - colorboost->setEditedState (pedited->colorBoost.amount ? Edited : UnEdited); - saturationlimiter->setEditedState (pedited->colorBoost.saturationlimit ? Edited : UnEdited); - avoidclip->set_inconsistent (!pedited->colorBoost.avoidclip); - enablelimiter->set_inconsistent (!pedited->colorBoost.enable_saturationlimiter); - } - - colorboost->setValue (pp->colorBoost.amount); - saturationlimiter->setValue (pp->colorBoost.saturationlimit); - acconn.block (true); - avoidclip->set_active (pp->colorBoost.avoidclip); - acconn.block (false); - elconn.block (true); - enablelimiter->set_active (pp->colorBoost.enable_saturationlimiter); - elconn.block (false); - - removeIfThere (this, saturationlimiter, false); - if (enablelimiter->get_active () || enablelimiter->get_inconsistent()) - pack_start (*saturationlimiter); - - lastACVal = pp->colorBoost.avoidclip; - lastELVal = pp->colorBoost.enable_saturationlimiter; - - enableListener (); -} - -void ColorBoost::write (ProcParams* pp, ParamsEdited* pedited) { - - pp->colorBoost.amount = (int)colorboost->getValue(); - pp->colorBoost.avoidclip = avoidclip->get_active (); - pp->colorBoost.enable_saturationlimiter = enablelimiter->get_active (); - pp->colorBoost.saturationlimit = saturationlimiter->getValue (); - - if (pedited) { - pedited->colorBoost.amount = colorboost->getEditedState (); - pedited->colorBoost.avoidclip = !avoidclip->get_inconsistent(); - pedited->colorBoost.enable_saturationlimiter = !enablelimiter->get_inconsistent(); - pedited->colorBoost.saturationlimit = saturationlimiter->getEditedState (); - } -} - -void ColorBoost::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { - - colorboost->setDefault (defParams->colorBoost.amount); - saturationlimiter->setDefault (defParams->colorBoost.saturationlimit); - - if (pedited) { - colorboost->setDefaultEditedState (pedited->colorBoost.amount ? Edited : UnEdited); - saturationlimiter->setDefaultEditedState (pedited->colorBoost.saturationlimit ? Edited : UnEdited); - } - else { - colorboost->setDefaultEditedState (Irrelevant); - saturationlimiter->setDefaultEditedState (Irrelevant); - } -} - -void ColorBoost::avoidclip_toggled () { - - if (batchMode) { - if (avoidclip->get_inconsistent()) { - avoidclip->set_inconsistent (false); - acconn.block (true); - avoidclip->set_active (false); - acconn.block (false); - } - else if (lastACVal) - avoidclip->set_inconsistent (true); - - lastACVal = avoidclip->get_active (); - } - - if (listener) { - if (avoidclip->get_active ()) - listener->panelChanged (EvCBAvoidClip, M("GENERAL_ENABLED")); - else - listener->panelChanged (EvCBAvoidClip, M("GENERAL_DISABLED")); - } -} - -void ColorBoost::enablelimiter_toggled () { - - if (batchMode) { - if (enablelimiter->get_inconsistent()) { - enablelimiter->set_inconsistent (false); - elconn.block (true); - enablelimiter->set_active (false); - elconn.block (false); - } - else if (lastELVal) - enablelimiter->set_inconsistent (true); - - lastELVal = enablelimiter->get_active (); - } - - removeIfThere (this, saturationlimiter, false); - if (enablelimiter->get_active () || enablelimiter->get_inconsistent()) - pack_start (*saturationlimiter); - - if (listener) { - if (enablelimiter->get_active ()) - listener->panelChanged (EvCBSatLimiter, M("GENERAL_ENABLED")); - else - listener->panelChanged (EvCBSatLimiter, M("GENERAL_DISABLED")); - } -} - -void ColorBoost::adjusterChanged (Adjuster* a, double newval) { - - if (listener) { + +void ColorBoost::read (const ProcParams* pp, const ParamsEdited* pedited) { + + disableListener (); + + if (pedited) { + colorboost->setEditedState (pedited->colorBoost.amount ? Edited : UnEdited); + saturationlimiter->setEditedState (pedited->colorBoost.saturationlimit ? Edited : UnEdited); + avoidclip->set_inconsistent (!pedited->colorBoost.avoidclip); + enablelimiter->set_inconsistent (!pedited->colorBoost.enable_saturationlimiter); + } + + colorboost->setValue (pp->colorBoost.amount); + saturationlimiter->setValue (pp->colorBoost.saturationlimit); + acconn.block (true); + avoidclip->set_active (pp->colorBoost.avoidclip); + acconn.block (false); + elconn.block (true); + enablelimiter->set_active (pp->colorBoost.enable_saturationlimiter); + elconn.block (false); + + removeIfThere (this, saturationlimiter, false); + if (enablelimiter->get_active () || enablelimiter->get_inconsistent()) + pack_start (*saturationlimiter); + + lastACVal = pp->colorBoost.avoidclip; + lastELVal = pp->colorBoost.enable_saturationlimiter; + + enableListener (); +} + +void ColorBoost::write (ProcParams* pp, ParamsEdited* pedited) { + + pp->colorBoost.amount = (int)colorboost->getValue(); + pp->colorBoost.avoidclip = avoidclip->get_active (); + pp->colorBoost.enable_saturationlimiter = enablelimiter->get_active (); + pp->colorBoost.saturationlimit = saturationlimiter->getValue (); + + if (pedited) { + pedited->colorBoost.amount = colorboost->getEditedState (); + pedited->colorBoost.avoidclip = !avoidclip->get_inconsistent(); + pedited->colorBoost.enable_saturationlimiter = !enablelimiter->get_inconsistent(); + pedited->colorBoost.saturationlimit = saturationlimiter->getEditedState (); + } +} + +void ColorBoost::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { + + colorboost->setDefault (defParams->colorBoost.amount); + saturationlimiter->setDefault (defParams->colorBoost.saturationlimit); + + if (pedited) { + colorboost->setDefaultEditedState (pedited->colorBoost.amount ? Edited : UnEdited); + saturationlimiter->setDefaultEditedState (pedited->colorBoost.saturationlimit ? Edited : UnEdited); + } + else { + colorboost->setDefaultEditedState (Irrelevant); + saturationlimiter->setDefaultEditedState (Irrelevant); + } +} + +void ColorBoost::avoidclip_toggled () { + + if (batchMode) { + if (avoidclip->get_inconsistent()) { + avoidclip->set_inconsistent (false); + acconn.block (true); + avoidclip->set_active (false); + acconn.block (false); + } + else if (lastACVal) + avoidclip->set_inconsistent (true); + + lastACVal = avoidclip->get_active (); + } + + if (listener) { + if (avoidclip->get_active ()) + listener->panelChanged (EvCBAvoidClip, M("GENERAL_ENABLED")); + else + listener->panelChanged (EvCBAvoidClip, M("GENERAL_DISABLED")); + } +} + +void ColorBoost::enablelimiter_toggled () { + + if (batchMode) { + if (enablelimiter->get_inconsistent()) { + enablelimiter->set_inconsistent (false); + elconn.block (true); + enablelimiter->set_active (false); + elconn.block (false); + } + else if (lastELVal) + enablelimiter->set_inconsistent (true); + + lastELVal = enablelimiter->get_active (); + } + + removeIfThere (this, saturationlimiter, false); + if (enablelimiter->get_active () || enablelimiter->get_inconsistent()) + pack_start (*saturationlimiter); + + if (listener) { + if (enablelimiter->get_active ()) + listener->panelChanged (EvCBSatLimiter, M("GENERAL_ENABLED")); + else + listener->panelChanged (EvCBSatLimiter, M("GENERAL_DISABLED")); + } +} + +void ColorBoost::adjusterChanged (Adjuster* a, double newval) { + + if (listener) { if (a!=saturationlimiter) - listener->panelChanged (EvCBBoost, Glib::ustring::format ((int)a->getValue())); - else - listener->panelChanged (EvCBSatLimit, Glib::ustring::format (std::setw(2), std::fixed, std::setprecision(1), a->getValue())); - } -} - -void ColorBoost::setAdjusterBehavior (bool bcbadd) { - - if (!cbAdd && bcbadd || cbAdd && !bcbadd) - colorboost->setLimits (-100, 100, 1, 0); - - cbAdd = bcbadd; -} - -void ColorBoost::setBatchMode (bool batchMode) { - - ToolPanel::setBatchMode (batchMode); - colorboost->showEditedCB (); - saturationlimiter->showEditedCB (); -} + listener->panelChanged (EvCBBoost, Glib::ustring::format ((int)a->getValue())); + else + listener->panelChanged (EvCBSatLimit, Glib::ustring::format (std::setw(2), std::fixed, std::setprecision(1), a->getValue())); + } +} + +void ColorBoost::setAdjusterBehavior (bool bcbadd) { + + if (!cbAdd && bcbadd || cbAdd && !bcbadd) + colorboost->setLimits (-100, 100, 1, 0); + + cbAdd = bcbadd; +} + +void ColorBoost::setBatchMode (bool batchMode) { + + ToolPanel::setBatchMode (batchMode); + colorboost->showEditedCB (); + saturationlimiter->showEditedCB (); +} diff --git a/rtgui/colorboost.h b/rtgui/colorboost.h index cc581da87..d7efc4ad6 100644 --- a/rtgui/colorboost.h +++ b/rtgui/colorboost.h @@ -1,53 +1,53 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _COLORBOOST_H_ -#define _COLORBOOST_H_ - -#include -#include -#include - -class ColorBoost : public Gtk::VBox, public AdjusterListener, public ToolPanel { - - protected: - Adjuster* colorboost; - Gtk::CheckButton* avoidclip; - Gtk::CheckButton* enablelimiter; - Adjuster* saturationlimiter; - bool cbAdd; - sigc::connection acconn, elconn; - bool lastACVal, lastELVal; - - public: - - ColorBoost (); - virtual ~ColorBoost (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); - void setBatchMode (bool batchMode); - - void adjusterChanged (Adjuster* a, double newval); - void avoidclip_toggled (); - void enablelimiter_toggled (); - void setAdjusterBehavior (bool bcbadd); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _COLORBOOST_H_ +#define _COLORBOOST_H_ + +#include +#include +#include + +class ColorBoost : public Gtk::VBox, public AdjusterListener, public ToolPanel { + + protected: + Adjuster* colorboost; + Gtk::CheckButton* avoidclip; + Gtk::CheckButton* enablelimiter; + Adjuster* saturationlimiter; + bool cbAdd; + sigc::connection acconn, elconn; + bool lastACVal, lastELVal; + + public: + + ColorBoost (); + virtual ~ColorBoost (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); + void setBatchMode (bool batchMode); + + void adjusterChanged (Adjuster* a, double newval); + void avoidclip_toggled (); + void enablelimiter_toggled (); + void setAdjusterBehavior (bool bcbadd); +}; + +#endif diff --git a/rtgui/colordenoise.cc b/rtgui/colordenoise.cc index b35a4871a..956315518 100644 --- a/rtgui/colordenoise.cc +++ b/rtgui/colordenoise.cc @@ -1,120 +1,120 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include -#include - -using namespace rtengine; -using namespace rtengine::procparams; - -ColorDenoise::ColorDenoise () : ToolPanel() { - - enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); - enabled->set_active (false); - - amount = Gtk::manage (new Adjuster (M("TP_DETAIL_AMOUNT"), 1, 100, 1, 30)); - - pack_start (*enabled); - pack_start (*Gtk::manage (new Gtk::HSeparator())); - pack_start (*amount); - - enaConn = enabled->signal_toggled().connect( sigc::mem_fun(*this, &ColorDenoise::enabledChanged) ); - amount->setAdjusterListener (this); - - show_all_children (); -} +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include +#include -void ColorDenoise::read (const ProcParams* pp, const ParamsEdited* pedited) { - - disableListener (); - - if (pedited) { - amount->setEditedState (pedited->colorDenoise.amount ? Edited : UnEdited); - enabled->set_inconsistent (!pedited->colorDenoise.enabled); - } - - enaConn.block (true); - enabled->set_active (pp->colorDenoise.enabled); - enaConn.block (false); - - lastEnabled = pp->colorDenoise.enabled; - - amount->setValue (pp->colorDenoise.amount); - - enableListener (); -} - -void ColorDenoise::write (ProcParams* pp, ParamsEdited* pedited) { - - pp->colorDenoise.amount = amount->getValue (); - pp->colorDenoise.enabled = enabled->get_active(); - - if (pedited) { - pedited->colorDenoise.amount = amount->getEditedState (); - pedited->colorDenoise.enabled = !enabled->get_inconsistent(); - } -} - -void ColorDenoise::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { - - amount->setDefault (defParams->colorDenoise.amount); - - if (pedited) - amount->setDefaultEditedState (pedited->colorDenoise.amount ? Edited : UnEdited); - else - amount->setDefaultEditedState (Irrelevant); -} - -void ColorDenoise::adjusterChanged (Adjuster* a, double newval) { - - if (listener && enabled->get_active()) { - - listener->panelChanged (EvCDNRadius, Glib::ustring::format (std::setw(2), std::fixed, std::setprecision(1), a->getValue())); - } -} - -void ColorDenoise::enabledChanged () { - - if (batchMode) { - if (enabled->get_inconsistent()) { - enabled->set_inconsistent (false); - enaConn.block (true); - enabled->set_active (false); - enaConn.block (false); - } - else if (lastEnabled) - enabled->set_inconsistent (true); - - lastEnabled = enabled->get_active (); - } - - if (listener) { - if (enabled->get_active ()) - listener->panelChanged (EvCDNEnabled, M("GENERAL_ENABLED")); - else - listener->panelChanged (EvCDNEnabled, M("GENERAL_DISABLED")); - } -} - -void ColorDenoise::setBatchMode (bool batchMode) { - - ToolPanel::setBatchMode (batchMode); - amount->showEditedCB (); -} +using namespace rtengine; +using namespace rtengine::procparams; + +ColorDenoise::ColorDenoise () : ToolPanel() { + + enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); + enabled->set_active (false); + + amount = Gtk::manage (new Adjuster (M("TP_DETAIL_AMOUNT"), 1, 100, 1, 30)); + + pack_start (*enabled); + pack_start (*Gtk::manage (new Gtk::HSeparator())); + pack_start (*amount); + + enaConn = enabled->signal_toggled().connect( sigc::mem_fun(*this, &ColorDenoise::enabledChanged) ); + amount->setAdjusterListener (this); + + show_all_children (); +} + +void ColorDenoise::read (const ProcParams* pp, const ParamsEdited* pedited) { + + disableListener (); + + if (pedited) { + amount->setEditedState (pedited->colorDenoise.amount ? Edited : UnEdited); + enabled->set_inconsistent (!pedited->colorDenoise.enabled); + } + + enaConn.block (true); + enabled->set_active (pp->colorDenoise.enabled); + enaConn.block (false); + + lastEnabled = pp->colorDenoise.enabled; + + amount->setValue (pp->colorDenoise.amount); + + enableListener (); +} + +void ColorDenoise::write (ProcParams* pp, ParamsEdited* pedited) { + + pp->colorDenoise.amount = amount->getValue (); + pp->colorDenoise.enabled = enabled->get_active(); + + if (pedited) { + pedited->colorDenoise.amount = amount->getEditedState (); + pedited->colorDenoise.enabled = !enabled->get_inconsistent(); + } +} + +void ColorDenoise::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { + + amount->setDefault (defParams->colorDenoise.amount); + + if (pedited) + amount->setDefaultEditedState (pedited->colorDenoise.amount ? Edited : UnEdited); + else + amount->setDefaultEditedState (Irrelevant); +} + +void ColorDenoise::adjusterChanged (Adjuster* a, double newval) { + + if (listener && enabled->get_active()) { + + listener->panelChanged (EvCDNRadius, Glib::ustring::format (std::setw(2), std::fixed, std::setprecision(1), a->getValue())); + } +} + +void ColorDenoise::enabledChanged () { + + if (batchMode) { + if (enabled->get_inconsistent()) { + enabled->set_inconsistent (false); + enaConn.block (true); + enabled->set_active (false); + enaConn.block (false); + } + else if (lastEnabled) + enabled->set_inconsistent (true); + + lastEnabled = enabled->get_active (); + } + + if (listener) { + if (enabled->get_active ()) + listener->panelChanged (EvCDNEnabled, M("GENERAL_ENABLED")); + else + listener->panelChanged (EvCDNEnabled, M("GENERAL_DISABLED")); + } +} + +void ColorDenoise::setBatchMode (bool batchMode) { + + ToolPanel::setBatchMode (batchMode); + amount->showEditedCB (); +} diff --git a/rtgui/colordenoise.h b/rtgui/colordenoise.h index 0114f7b6a..2980ce30c 100644 --- a/rtgui/colordenoise.h +++ b/rtgui/colordenoise.h @@ -1,47 +1,47 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _COLORDENOISE_H_ -#define _COLORDENOISE_H_ - -#include -#include -#include - -class ColorDenoise : public Gtk::VBox, public AdjusterListener, public ToolPanel { - - protected: - Adjuster* amount; - Gtk::CheckButton* enabled; - bool lastEnabled; - sigc::connection enaConn; - - public: - - ColorDenoise (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); - void setBatchMode (bool batchMode); - - void adjusterChanged (Adjuster* a, double newval); - void enabledChanged (); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _COLORDENOISE_H_ +#define _COLORDENOISE_H_ + +#include +#include +#include + +class ColorDenoise : public Gtk::VBox, public AdjusterListener, public ToolPanel { + + protected: + Adjuster* amount; + Gtk::CheckButton* enabled; + bool lastEnabled; + sigc::connection enaConn; + + public: + + ColorDenoise (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); + void setBatchMode (bool batchMode); + + void adjusterChanged (Adjuster* a, double newval); + void enabledChanged (); +}; + +#endif diff --git a/rtgui/colorshift.cc b/rtgui/colorshift.cc index 63732c48c..a3429792b 100644 --- a/rtgui/colorshift.cc +++ b/rtgui/colorshift.cc @@ -1,108 +1,108 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include - -using namespace rtengine; -using namespace rtengine::procparams; - -ColorShift::ColorShift () : ToolPanel(), aAdd(false), bAdd(false) { - - ashift = Gtk::manage (new Adjuster (M("TP_COLORSHIFT_GREENMAGENTA"), -25, 25, 0.1, 0)); - pack_start (*ashift); - - bshift = Gtk::manage (new Adjuster (M("TP_COLORSHIFT_BLUEYELLOW"), -25, 25, 0.1, 0)); - pack_start (*bshift); - - ashift->setAdjusterListener (this); +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include + +using namespace rtengine; +using namespace rtengine::procparams; + +ColorShift::ColorShift () : ToolPanel(), aAdd(false), bAdd(false) { + + ashift = Gtk::manage (new Adjuster (M("TP_COLORSHIFT_GREENMAGENTA"), -25, 25, 0.1, 0)); + pack_start (*ashift); + + bshift = Gtk::manage (new Adjuster (M("TP_COLORSHIFT_BLUEYELLOW"), -25, 25, 0.1, 0)); + pack_start (*bshift); + + ashift->setAdjusterListener (this); bshift->setAdjusterListener (this); - show_all (); -} - -void ColorShift::read (const ProcParams* pp, const ParamsEdited* pedited) { - - disableListener (); - - if (pedited) { - ashift->setEditedState (pedited->colorShift.a ? Edited : UnEdited); - bshift->setEditedState (pedited->colorShift.b ? Edited : UnEdited); - } - - ashift->setValue (pp->colorShift.a); - bshift->setValue (pp->colorShift.b); - - enableListener (); -} - -void ColorShift::write (ProcParams* pp, ParamsEdited* pedited) { - - pp->colorShift.a = ashift->getValue (); - pp->colorShift.b = bshift->getValue (); - - if (pedited) { - pedited->colorShift.a = ashift->getEditedState (); - pedited->colorShift.b = bshift->getEditedState (); - } -} - -void ColorShift::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { - - ashift->setDefault (defParams->colorShift.a); - bshift->setDefault (defParams->colorShift.b); - - if (pedited) { - ashift->setDefaultEditedState (pedited->colorShift.a ? Edited : UnEdited); - bshift->setDefaultEditedState (pedited->colorShift.b ? Edited : UnEdited); - } - else { - ashift->setDefaultEditedState (Irrelevant); - bshift->setDefaultEditedState (Irrelevant); - } -} - -void ColorShift::adjusterChanged (Adjuster* a, double newval) { - - if (!listener) - return; - - if (a==ashift) - listener->panelChanged (EvCShiftA, Glib::ustring::format (std::setw(2), std::fixed, std::setprecision(1), a->getValue())); - else if (a==bshift) - listener->panelChanged (EvCShiftB, Glib::ustring::format (std::setw(2), std::fixed, std::setprecision(1), a->getValue())); -} - -void ColorShift::setAdjusterBehavior (bool baadd, bool bbadd) { - - if (!aAdd && baadd || aAdd && !baadd) - ashift->setLimits (-25, 25, 0.1, 0); - - if (!bAdd && bbadd || bAdd && !bbadd) - bshift->setLimits (-25, 25, 0.1, 0); - - aAdd = baadd; - bAdd = bbadd; -} - -void ColorShift::setBatchMode (bool batchMode) { - - ToolPanel::setBatchMode (batchMode); - ashift->showEditedCB (); - bshift->showEditedCB (); -} + show_all (); +} + +void ColorShift::read (const ProcParams* pp, const ParamsEdited* pedited) { + + disableListener (); + + if (pedited) { + ashift->setEditedState (pedited->colorShift.a ? Edited : UnEdited); + bshift->setEditedState (pedited->colorShift.b ? Edited : UnEdited); + } + + ashift->setValue (pp->colorShift.a); + bshift->setValue (pp->colorShift.b); + + enableListener (); +} + +void ColorShift::write (ProcParams* pp, ParamsEdited* pedited) { + + pp->colorShift.a = ashift->getValue (); + pp->colorShift.b = bshift->getValue (); + + if (pedited) { + pedited->colorShift.a = ashift->getEditedState (); + pedited->colorShift.b = bshift->getEditedState (); + } +} + +void ColorShift::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { + + ashift->setDefault (defParams->colorShift.a); + bshift->setDefault (defParams->colorShift.b); + + if (pedited) { + ashift->setDefaultEditedState (pedited->colorShift.a ? Edited : UnEdited); + bshift->setDefaultEditedState (pedited->colorShift.b ? Edited : UnEdited); + } + else { + ashift->setDefaultEditedState (Irrelevant); + bshift->setDefaultEditedState (Irrelevant); + } +} + +void ColorShift::adjusterChanged (Adjuster* a, double newval) { + + if (!listener) + return; + + if (a==ashift) + listener->panelChanged (EvCShiftA, Glib::ustring::format (std::setw(2), std::fixed, std::setprecision(1), a->getValue())); + else if (a==bshift) + listener->panelChanged (EvCShiftB, Glib::ustring::format (std::setw(2), std::fixed, std::setprecision(1), a->getValue())); +} + +void ColorShift::setAdjusterBehavior (bool baadd, bool bbadd) { + + if (!aAdd && baadd || aAdd && !baadd) + ashift->setLimits (-25, 25, 0.1, 0); + + if (!bAdd && bbadd || bAdd && !bbadd) + bshift->setLimits (-25, 25, 0.1, 0); + + aAdd = baadd; + bAdd = bbadd; +} + +void ColorShift::setBatchMode (bool batchMode) { + + ToolPanel::setBatchMode (batchMode); + ashift->showEditedCB (); + bshift->showEditedCB (); +} diff --git a/rtgui/colorshift.h b/rtgui/colorshift.h index 0dc3d009d..7445398df 100644 --- a/rtgui/colorshift.h +++ b/rtgui/colorshift.h @@ -1,46 +1,46 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _COLORSHIFT_H_ -#define _COLORSHIFT_H_ - -#include -#include -#include - -class ColorShift : public Gtk::VBox, public AdjusterListener, public ToolPanel { - - protected: - Adjuster* ashift; - Adjuster* bshift; - bool aAdd, bAdd; - - public: - - ColorShift (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); - void setBatchMode (bool batchMode); - - void adjusterChanged (Adjuster* a, double newval); - void setAdjusterBehavior (bool baadd, bool bbadd); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _COLORSHIFT_H_ +#define _COLORSHIFT_H_ + +#include +#include +#include + +class ColorShift : public Gtk::VBox, public AdjusterListener, public ToolPanel { + + protected: + Adjuster* ashift; + Adjuster* bshift; + bool aAdd, bAdd; + + public: + + ColorShift (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); + void setBatchMode (bool batchMode); + + void adjusterChanged (Adjuster* a, double newval); + void setAdjusterBehavior (bool baadd, bool bbadd); +}; + +#endif diff --git a/rtgui/createicon.cc b/rtgui/createicon.cc index ac11a61e2..485b33027 100644 --- a/rtgui/createicon.cc +++ b/rtgui/createicon.cc @@ -1,200 +1,200 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include - -void png_read_data(png_structp png_ptr, png_bytep data, png_size_t length) { - png_size_t check; - - /* fread() returns 0 on error, so it is OK to store this in a png_size_t - * instead of an int, which is what fread() actually returns. - */ - check = (png_size_t)fread(data, (png_size_t)1, length, (FILE *)png_ptr->io_ptr); - - if (check != length) - { - png_error(png_ptr, "Read Error"); - } -} - -void png_write_data(png_structp png_ptr, png_bytep data, png_size_t length) { - png_uint_32 check; - - check = fwrite(data, 1, length, (FILE *)(png_ptr->io_ptr)); - if (check != length) - { - png_error(png_ptr, "Write Error"); - } -} - -void png_flush(png_structp png_ptr) { - FILE *io_ptr; - io_ptr = (FILE *)CVT_PTR((png_ptr->io_ptr)); - if (io_ptr != NULL) - fflush(io_ptr); -} - - -unsigned char* loadPNG (char* fname, int& w, int& h) { - - FILE *file = fopen (fname,"rb"); - - unsigned char header[8]; - fread (header, 1, 8, file); - - png_structp png = png_create_read_struct (PNG_LIBPNG_VER_STRING, 0, 0, 0); - png_infop info = png_create_info_struct (png); - png_infop end_info = png_create_info_struct (png); - if (setjmp (png_jmpbuf(png))) { - png_destroy_read_struct (&png, &info, &end_info); - fclose (file); - return NULL; - } - //set up png read - png_set_read_fn (png, file, png_read_data); - png_set_sig_bytes (png,8); - - png_read_info(png,info); - - unsigned long width,height; - int bit_depth,color_type,interlace_type,compression_type,filter_method; - png_get_IHDR(png,info,&width,&height,&bit_depth,&color_type,&interlace_type, - &compression_type, &filter_method); - - //converting to 32bpp format - if (color_type==PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png); - - if (color_type==PNG_COLOR_TYPE_GRAY || color_type==PNG_COLOR_TYPE_GRAY_ALPHA) - png_set_gray_to_rgb(png); - - if (png_get_valid(png,info,PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png); - - if (interlace_type!=PNG_INTERLACE_NONE) { - png_destroy_read_struct (&png, &info, &end_info); - fclose (file); - return NULL; - } - - if (color_type & PNG_COLOR_MASK_ALPHA) - png_set_strip_alpha(png); - - //setting gamma - double gamma; - if (png_get_gAMA(png,info,&gamma)) - png_set_gamma(png, 2.0, gamma); - else - png_set_gamma(png,2.0, 0.45455); - - int bps = 8; - - //updating png info struct - png_read_update_info(png,info); - png_get_IHDR(png,info,&width,&height,&bit_depth,&color_type,&interlace_type, - &compression_type, &filter_method); - - if (color_type & PNG_COLOR_MASK_ALPHA) - png_set_strip_alpha(png); - - png_read_update_info(png,info); - png_get_IHDR(png,info,&width,&height,&bit_depth,&color_type,&interlace_type, - &compression_type, &filter_method); - - - unsigned char* data = new unsigned char[width*height*3]; - int rowlen = width*3; - unsigned char *row = new unsigned char [rowlen]; - - for (unsigned int i=0;i + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include + +void png_read_data(png_structp png_ptr, png_bytep data, png_size_t length) { + png_size_t check; + + /* fread() returns 0 on error, so it is OK to store this in a png_size_t + * instead of an int, which is what fread() actually returns. + */ + check = (png_size_t)fread(data, (png_size_t)1, length, (FILE *)png_ptr->io_ptr); + + if (check != length) + { + png_error(png_ptr, "Read Error"); + } +} + +void png_write_data(png_structp png_ptr, png_bytep data, png_size_t length) { + png_uint_32 check; + + check = fwrite(data, 1, length, (FILE *)(png_ptr->io_ptr)); + if (check != length) + { + png_error(png_ptr, "Write Error"); + } +} + +void png_flush(png_structp png_ptr) { + FILE *io_ptr; + io_ptr = (FILE *)CVT_PTR((png_ptr->io_ptr)); + if (io_ptr != NULL) + fflush(io_ptr); +} + + +unsigned char* loadPNG (char* fname, int& w, int& h) { + + FILE *file = fopen (fname,"rb"); + + unsigned char header[8]; + fread (header, 1, 8, file); + + png_structp png = png_create_read_struct (PNG_LIBPNG_VER_STRING, 0, 0, 0); + png_infop info = png_create_info_struct (png); + png_infop end_info = png_create_info_struct (png); + if (setjmp (png_jmpbuf(png))) { + png_destroy_read_struct (&png, &info, &end_info); + fclose (file); + return NULL; + } + //set up png read + png_set_read_fn (png, file, png_read_data); + png_set_sig_bytes (png,8); + + png_read_info(png,info); + + unsigned long width,height; + int bit_depth,color_type,interlace_type,compression_type,filter_method; + png_get_IHDR(png,info,&width,&height,&bit_depth,&color_type,&interlace_type, + &compression_type, &filter_method); + + //converting to 32bpp format + if (color_type==PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png); + + if (color_type==PNG_COLOR_TYPE_GRAY || color_type==PNG_COLOR_TYPE_GRAY_ALPHA) + png_set_gray_to_rgb(png); + + if (png_get_valid(png,info,PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png); + + if (interlace_type!=PNG_INTERLACE_NONE) { + png_destroy_read_struct (&png, &info, &end_info); + fclose (file); + return NULL; + } + + if (color_type & PNG_COLOR_MASK_ALPHA) + png_set_strip_alpha(png); + + //setting gamma + double gamma; + if (png_get_gAMA(png,info,&gamma)) + png_set_gamma(png, 2.0, gamma); + else + png_set_gamma(png,2.0, 0.45455); + + int bps = 8; + + //updating png info struct + png_read_update_info(png,info); + png_get_IHDR(png,info,&width,&height,&bit_depth,&color_type,&interlace_type, + &compression_type, &filter_method); + + if (color_type & PNG_COLOR_MASK_ALPHA) + png_set_strip_alpha(png); + + png_read_update_info(png,info); + png_get_IHDR(png,info,&width,&height,&bit_depth,&color_type,&interlace_type, + &compression_type, &filter_method); + + + unsigned char* data = new unsigned char[width*height*3]; + int rowlen = width*3; + unsigned char *row = new unsigned char [rowlen]; + + for (unsigned int i=0;i - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include -using namespace rtengine; -using namespace rtengine::procparams; - -extern Glib::ustring argv0; -extern Options options; - -class RefreshSpinHelper { - - public: - Crop* crop; - bool notify; - RefreshSpinHelper (Crop* _crop, bool _notify) - : crop(_crop), notify(_notify) {} -}; - -Crop::Crop () { - - clistener = NULL; - - maxw = 3000; - maxh = 2000; - - enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); - enabled->set_active (false); - pack_start(*enabled); - - pack_start(*Gtk::manage (new Gtk::HSeparator())); - - Gtk::HBox* hb1 = Gtk::manage (new Gtk::HBox ()); - - hb1->pack_start (*Gtk::manage (new Gtk::Label (Glib::ustring(" ") + M("TP_CROP_X") +": "))); - x = Gtk::manage (new Gtk::SpinButton ()); - x->set_size_request (60, -1); - hb1->pack_start (*x); - - hb1->pack_start (*Gtk::manage (new Gtk::Label (Glib::ustring(" ") + M("TP_CROP_Y") + ": "))); - y = Gtk::manage (new Gtk::SpinButton ()); - y->set_size_request (60, -1); - hb1->pack_start (*y); - - pack_start (*hb1, Gtk::PACK_SHRINK, 2); - - Gtk::HBox* hb2 = Gtk::manage (new Gtk::HBox ()); - - hb2->pack_start (*Gtk::manage (new Gtk::Label (M("TP_CROP_W") + ": "))); - w = Gtk::manage (new Gtk::SpinButton ()); - w->set_size_request (60, -1); - hb2->pack_start (*w); - - hb2->pack_start (*Gtk::manage (new Gtk::Label (M("TP_CROP_H") + ": "))); - h = Gtk::manage (new Gtk::SpinButton ()); - h->set_size_request (60, -1); - hb2->pack_start (*h); - - pack_start (*hb2, Gtk::PACK_SHRINK, 4); - - selectCrop = Gtk::manage (new Gtk::Button (M("TP_CROP_SELECTCROP"))); - selectCrop->set_image (*Gtk::manage (new Gtk::Image (argv0+"/images/crop16.png"))); - - pack_start (*selectCrop, Gtk::PACK_SHRINK, 2); - - Gtk::HBox* hb3 = Gtk::manage (new Gtk::HBox ()); - - fixr = Gtk::manage (new Gtk::CheckButton (M("TP_CROP_FIXRATIO"))); - fixr->set_active (1); - - hb3->pack_start (*fixr, Gtk::PACK_SHRINK, 4); - - ratio = Gtk::manage (new Gtk::ComboBoxText ()); - hb3->pack_start (*ratio, Gtk::PACK_SHRINK, 4); - - orientation = Gtk::manage (new Gtk::ComboBoxText ()); - hb3->pack_start (*orientation); - - pack_start (*hb3, Gtk::PACK_SHRINK, 4); - - Gtk::HBox* hb31 = Gtk::manage (new Gtk::HBox ()); - - hb31->pack_start (*Gtk::manage (new Gtk::Label (M("TP_CROP_GUIDETYPE"))), Gtk::PACK_SHRINK, 4); - guide = Gtk::manage (new Gtk::ComboBoxText ()); - hb31->pack_start (*guide); - - pack_start (*hb31, Gtk::PACK_SHRINK, 4); - - dpibox = Gtk::manage (new Gtk::VBox()); - dpibox->pack_start (*Gtk::manage (new Gtk::HSeparator()), Gtk::PACK_SHRINK, 2); - - Gtk::HBox* hb4 = Gtk::manage (new Gtk::HBox ()); - hb4->pack_start (*Gtk::manage (new Gtk::Label (M("TP_CROP_DPI")))); - dpi = Gtk::manage (new Gtk::SpinButton ()); - dpi->set_size_request (60, -1); - hb4->pack_start (*dpi); - - dpibox->pack_start (*hb4, Gtk::PACK_SHRINK, 2); - - sizecm = Gtk::manage (new Gtk::Label (M("GENERAL_NA") + " cm x " + M("GENERAL_NA") + " cm")); - sizein = Gtk::manage (new Gtk::Label (M("GENERAL_NA") + " in x " + M("GENERAL_NA") + " in")); - - dpibox->pack_start (*sizecm, Gtk::PACK_SHRINK, 1); - dpibox->pack_start (*sizein, Gtk::PACK_SHRINK, 1); - - pack_start (*dpibox, Gtk::PACK_SHRINK, 0); - - dpi->set_value (300); - - ratio->append_text ("3:2"); - ratio->append_text ("4:3"); - ratio->append_text ("16:9"); - ratio->append_text ("16:10"); - ratio->append_text ("5:4"); - ratio->append_text ("2:1"); - ratio->append_text ("1:1"); - ratio->append_text ("DIN"); - ratio->set_active (0); - - orientation->append_text (M("GENERAL_LANDSCAPE")); - orientation->append_text (M("GENERAL_PORTRAIT")); - orientation->set_active (0); - - guide->append_text (M("TP_CROP_GTNONE")); - guide->append_text (M("TP_CROP_GTRULETHIRDS")); - guide->append_text (M("TP_CROP_GTDIAGONALS")); - guide->append_text (M("TP_CROP_GTHARMMEANS1")); - guide->append_text (M("TP_CROP_GTHARMMEANS2")); - guide->append_text (M("TP_CROP_GTHARMMEANS3")); - guide->append_text (M("TP_CROP_GTHARMMEANS4")); - guide->set_active (0); - - w->set_range (0, maxw); - h->set_range (0, maxh); - x->set_range (0, maxw); - y->set_range (0, maxh); - - x->set_digits (0); - x->set_increments (1,100); - x->set_value (0); - - y->set_digits (0); - y->set_increments (1,100); - y->set_value (0); - - w->set_digits (0); - w->set_increments (1,100); - w->set_value (200); - - h->set_digits (0); - h->set_increments (1,100); - h->set_value (200); - - dpi->set_digits (0); - dpi->set_increments (1,100); - dpi->set_range (50, 12000); - dpi->set_value (300); - - xconn = x->signal_value_changed().connect ( sigc::mem_fun(*this, &Crop::positionChanged), true); - yconn = y->signal_value_changed().connect ( sigc::mem_fun(*this, &Crop::positionChanged), true); - wconn = w->signal_value_changed().connect ( sigc::mem_fun(*this, &Crop::widthChanged), true); - hconn = h->signal_value_changed().connect ( sigc::mem_fun(*this, &Crop::heightChanged), true); - econn = enabled->signal_toggled().connect( sigc::mem_fun(*this, &Crop::enabledChanged) ); - fconn = fixr->signal_toggled().connect( sigc::mem_fun(*this, &Crop::ratioChanged) ); - rconn = ratio->signal_changed().connect( sigc::mem_fun(*this, &Crop::ratioChanged) ); - oconn = orientation->signal_changed().connect( sigc::mem_fun(*this, &Crop::ratioChanged) ); - gconn = guide->signal_changed().connect( sigc::mem_fun(*this, &Crop::notifyListener) ); - selectCrop->signal_pressed().connect( sigc::mem_fun(*this, &Crop::selectPressed) ); - dpi->signal_value_changed().connect( sigc::mem_fun(*this, &Crop::refreshSize) ); - - nx = ny = nw = nh = 0; - nsx = nsy = nsw = nsh = 0; - lastScale = 1.0; - lastRotationDeg = 0; - show_all (); -} - -void Crop::writeOptions () { - - options.cropDPI = (int)dpi->get_value (); -} - -void Crop::readOptions () { - - disableListener (); - - dpi->set_value (options.cropDPI); - - enableListener (); -} - -void Crop::read (const ProcParams* pp, const ParamsEdited* pedited) { - - disableListener (); - - xconn.block (true); - yconn.block (true); - wconn.block (true); - hconn.block (true); - rconn.block (true); - fconn.block (true); - oconn.block (true); - gconn.block (true); - enabled->set_active (pp->crop.enabled); - - // check if the new values are larger than the maximum - double tmp, maxw, maxh; - w->get_range (tmp, maxw); - h->get_range (tmp, maxh); - if (pp->crop.x + pp->crop.w > maxw || pp->crop.y + pp->crop.h > maxh) - setDimensions (pp->crop.x + pp->crop.w, pp->crop.y + pp->crop.h); - - ratio->set_active_text (pp->crop.ratio); - fixr->set_active (pp->crop.fixratio); - - if (pp->crop.orientation == "Landscape") - orientation->set_active (0); - else if (pp->crop.orientation == "Portrait") - orientation->set_active (1); - - if (pp->crop.guide == "None") - guide->set_active (0); - else if (pp->crop.guide == "Rule of thirds") - guide->set_active (1); - else if (pp->crop.guide == "Rule of diagonals") - guide->set_active (2); - else if (pp->crop.guide == "Harmonic means 1") - guide->set_active (3); - else if (pp->crop.guide == "Harmonic means 2") - guide->set_active (4); - else if (pp->crop.guide == "Harmonic means 3") - guide->set_active (5); - else if (pp->crop.guide == "Harmonic means 4") - guide->set_active (6); - - x->set_value (pp->crop.x); - y->set_value (pp->crop.y); - w->set_value (pp->crop.w); - h->set_value (pp->crop.h); - - nx = pp->crop.x; - ny = pp->crop.y; - nw = pp->crop.w; - nh = pp->crop.h; - - if (pp->resize.enabled) - lastScale = pp->resize.scale; - else - lastScale = 1.0; - nsx = nx / lastScale; - nsy = ny / lastScale; - nsw = nw / lastScale; - nsh = nh / lastScale; - lastRotationDeg = pp->coarse.rotate; - - wDirty = false; - hDirty = false; - xDirty = false; - yDirty = false; - - if (pedited) { - wDirty = pedited->crop.w; - hDirty = pedited->crop.h; - xDirty = pedited->crop.x; - yDirty = pedited->crop.y; - if (!pedited->crop.ratio) - ratio->set_active (8); - if (!pedited->crop.orientation) - orientation->set_active (2); - if (!pedited->crop.guide) - guide->set_active (7); - enabled->set_inconsistent (!pedited->crop.enabled); - fixr->set_inconsistent (!pedited->crop.fixratio); - } - - lastEnabled = pp->crop.enabled; - lastAspect = pp->crop.fixratio; - - xconn.block (false); - yconn.block (false); - wconn.block (false); - hconn.block (false); - rconn.block (false); - fconn.block (false); - oconn.block (false); - gconn.block (false); - - enableListener (); -} - -void Crop::write (ProcParams* pp, ParamsEdited* pedited) { - - pp->crop.enabled = enabled->get_active (); - pp->crop.x = nx; - pp->crop.y = ny; - pp->crop.w = nw; - pp->crop.h = nh; - pp->crop.fixratio = fixr->get_active (); - pp->crop.ratio = ratio->get_active_text (); - - if (orientation->get_active_row_number()==0) - pp->crop.orientation = "Landscape"; - else if (orientation->get_active_row_number()==1) - pp->crop.orientation = "Portrait"; - - if (guide->get_active_row_number()==0) - pp->crop.guide = "None"; - else if (guide->get_active_row_number()==1) - pp->crop.guide = "Rule of thirds"; - else if (guide->get_active_row_number()==2) - pp->crop.guide = "Rule of diagonals"; - else if (guide->get_active_row_number()==3) - pp->crop.guide = "Harmonic means 1"; - else if (guide->get_active_row_number()==4) - pp->crop.guide = "Harmonic means 2"; - else if (guide->get_active_row_number()==5) - pp->crop.guide = "Harmonic means 3"; - else if (guide->get_active_row_number()==6) - pp->crop.guide = "Harmonic means 4"; - - if (pedited) { - pedited->crop.enabled = !enabled->get_inconsistent(); - pedited->crop.ratio = ratio->get_active_row_number() != 8; - pedited->crop.orientation = orientation->get_active_row_number() != 2; - pedited->crop.guide = guide->get_active_row_number() != 7; - pedited->crop.fixratio = !fixr->get_inconsistent(); - pedited->crop.w = wDirty; - pedited->crop.h = hDirty; - pedited->crop.x = xDirty; - pedited->crop.y = yDirty; - } - -} - -void Crop::selectPressed () { - - if (clistener) - clistener->cropSelectRequested (); -} - -void Crop::notifyListener () { - - if (listener && enabled->get_active ()) - listener->panelChanged (EvCrop, Glib::ustring::compose ("%1=%2, %3=%4\n%5=%6, %7=%8", M("TP_CROP_X"), nx, M("TP_CROP_Y"), ny, M("TP_CROP_W"), nw, M("TP_CROP_H"), nh)); -} - -void Crop::enabledChanged () { - - if (batchMode) { - if (enabled->get_inconsistent()) { - enabled->set_inconsistent (false); - econn.block (true); - enabled->set_active (false); - econn.block (false); - } - else if (lastEnabled) - enabled->set_inconsistent (true); - - lastEnabled = enabled->get_active (); - } - - if (listener) { - if (enabled->get_active ()) - listener->panelChanged (EvCrop, Glib::ustring::compose ("%1=%2, %3=%4\n%5=%6, %7=%8", M("TP_CROP_X"), nx, M("TP_CROP_Y"), ny, M("TP_CROP_W"), nw, M("TP_CROP_H"), nh)); - else - listener->panelChanged (EvCrop, M("GENERAL_DISABLED")); - } -} - -int notifylistener (void* data) { - - gdk_threads_enter (); - ((Crop*)data)->notifyListener (); - gdk_threads_leave (); - return 0; -} - -int refreshspins (void* data) { - - gdk_threads_enter (); - RefreshSpinHelper* rsh = (RefreshSpinHelper*) data; - rsh->crop->refreshSpins (rsh->notify); - delete rsh; - gdk_threads_leave (); - return 0; -} - -void Crop::resizeScaleChanged (double rsc) { - - lastScale = rsc; - - nx = (int)round (nsx * rsc); - ny = (int)round (nsy * rsc); - nw = (int)round (nsw * rsc); - nh = (int)round (nsh * rsc); - - if (nx+nw > maxw || ny+nh > maxh) - setDimensions (nx+nw, ny+nh); - - g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); -} - -void Crop::hFlipCrop () { - - nx = maxw - nx - nw; - nsx = nx / lastScale; - g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); -} - -void Crop::vFlipCrop () { - - ny = maxh - ny - nh; - nsy = ny / lastScale; - g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); -} - -void Crop::rotateCrop (int deg) { - - int tmp; - switch ((360+deg-lastRotationDeg)%360) { - case 90: - tmp = nx; - nx = maxh - ny - nh; - ny = tmp; - tmp = nw; - nw = nh; - nh = tmp; - break; - case 270: - tmp = ny; - ny = maxw - nx - nw; - nx = tmp; - tmp = nw; - nw = nh; - nh = tmp; - break; - case 180: - nx = maxw - nx - nw; - ny = maxh - ny - nh; - break; - } - nsx = nx / lastScale; - nsy = ny / lastScale; - nsw = nw / lastScale; - nsh = nh / lastScale; - - lastRotationDeg = deg; - g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); -} - -void Crop::positionChanged () { - - xDirty = true; - yDirty = true; - - int X = (int)x->get_value (); - int Y = (int)y->get_value (); - int W = nw; - int H = nh; - cropMoved (X, Y, W, H); - g_idle_add (notifylistener, this); -} - -void Crop::widthChanged () { - - wDirty = true; - - int X = nx; - int Y = ny; - int W = (int)w->get_value (); - int H = nh; - cropWidth2Resized (X, Y, W, H); - g_idle_add (notifylistener, this); -} - -void Crop::heightChanged () { - - hDirty = true; - - int X = nx; - int Y = ny; - int W = nw; - int H = (int)h->get_value (); - cropHeight2Resized (X, Y, W, H); - g_idle_add (notifylistener, this); -} - - -void Crop::ratioChanged () { - - if (batchMode && lastAspect != fixr->get_active ()) { - if (fixr->get_inconsistent()) { - fixr->set_inconsistent (false); - fconn.block (true); - fixr->set_active (false); - fconn.block (false); - } - else if (lastAspect) - fixr->set_inconsistent (true); - - lastAspect = fixr->get_active (); - } - - - if (fixr->get_active() && !fixr->get_inconsistent()) { - -// int W = w->get_value (); -// int H = h->get_value (); - int W = nw; - int H = nh; - int X = nx; - int Y = ny; - if (W>=H) - cropWidth2Resized (X, Y, W, H); - else - cropHeight2Resized (X, Y, W, H); - - g_idle_add (refreshspins, new RefreshSpinHelper (this, true)); - } -} - -void Crop::refreshSize () { - - if (!batchMode) { - - std::ostringstream ostrin; - ostrin.precision (3); - // ostrin << h->get_value()/dpi->get_value() << " in x " << w->get_value()/dpi->get_value() << " in";; - ostrin << nh/dpi->get_value() << " in x " << nw/dpi->get_value() << " in";; - - sizein->set_text (ostrin.str ()); - - std::ostringstream ostrcm; - ostrcm.precision (3); - // ostrcm << h->get_value()/dpi->get_value()*2.54 << " cm x " << w->get_value()/dpi->get_value()*2.54 << " cm";; - ostrcm << nh/dpi->get_value()*2.54 << " cm x " << nw/dpi->get_value()*2.54 << " cm";; - - sizecm->set_text (ostrcm.str ()); - } -} - -void Crop::setDimensions (int mw, int mh) { - - maxw = mw; - maxh = mh; - - xconn.block (true); - yconn.block (true); - wconn.block (true); - hconn.block (true); - - w->set_range (0, maxw); - h->set_range (0, maxh); - x->set_range (0, maxw); - y->set_range (0, maxh); - - xconn.block (false); - yconn.block (false); - wconn.block (false); - hconn.block (false); - - if (enabled->get_active()==false) { - nx = 0; - ny = 0; - nw = mw; - nh = mh; - - nsx = nx / lastScale; - nsy = ny / lastScale; - nsw = nw / lastScale; - nsh = nh / lastScale; - refreshSpins (); - } - refreshSize (); -} - -struct setdimparams { - Crop* crop; - int x; - int y; -}; - -int setdim (void* data) { - - gdk_threads_enter (); - setdimparams* params = (setdimparams*)data; - params->crop->setDimensions (params->x, params->y); - delete params; - gdk_threads_leave (); - return 0; -} - -void Crop::sizeChanged (int x, int y, int ow, int oh) { - - setdimparams* params = new setdimparams; - params->x = x; - params->y = y; - params->crop = this; - g_idle_add (setdim, params); -} - -bool Crop::refreshSpins (bool notify) { - - xconn.block (true); - yconn.block (true); - wconn.block (true); - hconn.block (true); - - x->set_value (nx); - y->set_value (ny); - w->set_value (nw); - h->set_value (nh); - - xDirty = true; - yDirty = true; - wDirty = true; - hDirty = true; - - xconn.block (false); - yconn.block (false); - wconn.block (false); - hconn.block (false); - - refreshSize (); - if (notify) - notifyListener (); - - return false; -} - -void Crop::cropMoved (int &X, int &Y, int &W, int &H) { - -// W = w->get_value (); -// H = h->get_value (); - W = nw; - H = nh; - - if (X+W>maxw) - X = maxw-W; - if (Y+H>maxh) - Y = maxh-H; - if (X<0) - X = 0; - if (Y<0) - Y = 0; - - nx = X; - ny = Y; - nw = W; - nh = H; - - nsx = nx / lastScale; - nsy = ny / lastScale; - nsw = nw / lastScale; - nsh = nh / lastScale; - - g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); -// Glib::signal_idle().connect (sigc::mem_fun(*this, &Crop::refreshSpins)); -} - -void Crop::cropWidth1Resized (int &X, int &Y, int &W, int &H) { - - if (W<0) - W = 0; - if (H<0) - H = 0; - - if (X<0) { - W += X; - X = 0; - } - if (fixr->get_active()) { - double r = getRatio(); - int W2max = (int)round(r*(maxh-Y)); - if (W>W2max) { - X += W - W2max; - W = W2max; - } - H = (int)round(W / r); - } - - nx = X; - ny = Y; - nw = W; - nh = H; - - nsx = nx / lastScale; - nsy = ny / lastScale; - nsw = nw / lastScale; - nsh = nh / lastScale; - - g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); -// Glib::signal_idle().connect (sigc::mem_fun(*this, &Crop::refreshSpins)); -} - -void Crop::cropWidth2Resized (int &X, int &Y, int &W, int &H) { - -// X = x->get_value (); -// Y = y->get_value (); - X = nx; - Y = ny; - - if (W<0) - W = 0; - if (H<0) - H = 0; - - if (W>maxw-X) - W = maxw-X; - - if (fixr->get_active()) { - double r = getRatio(); - int W2max = (int)round(r*(maxh-Y)); - if (W>W2max) - W = W2max; - H = (int)round(W / r); - } - - nx = X; - ny = Y; - nw = W; - nh = H; - - nsx = nx / lastScale; - nsy = ny / lastScale; - nsw = nw / lastScale; - nsh = nh / lastScale; - - g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); -// Glib::signal_idle().connect (sigc::mem_fun(*this, &Crop::refreshSpins)); -} - -void Crop::cropHeight1Resized (int &X, int &Y, int &W, int &H) { - - if (W<0) - W = 0; - if (H<0) - H = 0; - - if (Y<0) { - H += Y; - Y = 0; - } - - if (fixr->get_active()) { - double r = getRatio(); - int H2max = (int)round((maxw-X) / r); - if (H>H2max) { - Y += H - H2max; - H = H2max; - } - W = (int)round(H * r); - } - - nx = X; - ny = Y; - nw = W; - nh = H; - - nsx = nx / lastScale; - nsy = ny / lastScale; - nsw = nw / lastScale; - nsh = nh / lastScale; - - g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); -// Glib::signal_idle().connect (sigc::mem_fun(*this, &Crop::refreshSpins)); -} - -void Crop::cropHeight2Resized (int &X, int &Y, int &W, int &H) { - -// X = x->get_value (); -// Y = y->get_value (); - X = nx; - Y = ny; - - if (W<0) - W = 0; - if (H<0) - H = 0; - int H1max = maxh-Y; - if (H>H1max) - H = H1max; - if (fixr->get_active()) { - double r = getRatio (); - int H2max = (int)round ((maxw-X) / r); - if (H>H2max) - H = H2max; - W = (int)round(H * r); - } - - nx = X; - ny = Y; - nw = W; - nh = H; - - nsx = nx / lastScale; - nsy = ny / lastScale; - nsw = nw / lastScale; - nsh = nh / lastScale; - - g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); -// Glib::signal_idle().connect (sigc::mem_fun(*this, &Crop::refreshSpins)); -} - -void Crop::cropInit (int &x, int &y, int &w, int &h) { - - nx = x; - ny = y; - nw = 1; - nh = 1; - - nsx = nx / lastScale; - nsy = ny / lastScale; - nsw = nw / lastScale; - nsh = nh / lastScale; - - w = 1; h = 1; - - econn.block (true); - enabled->set_active (1); - econn.block (false); - g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); -// Glib::signal_idle().connect (sigc::mem_fun(*this, &Crop::refreshSpins)); -} - -void Crop::cropResized (int &x, int &y, int& x2, int& y2) { - - if (x2<0) - x2 = 0; - if (y2<0) - y2 = 0; - if (x2>=maxw) - x2 = maxw-1; - if (y2>=maxh) - y2 = maxh-1; - - int X, Y; - int W; - if (xmaxw) - W = maxw; - if (H>maxh) - H = maxh; - - if (fixr->get_active()) { - double r = getRatio (); - if (y<=y2) { - int W2max = (int)round ((maxh-Y) * r); - if (W>W2max) - W = W2max; - } - else { - int W2max = (int)round (y * r); - if (W>W2max) - W = W2max; - } - H = (int)round(W / r); - if (xget_active()==false) - return r; - if (ratio->get_active_row_number()==0) - r = 3.0/2.0; - else if (ratio->get_active_row_number()==1) - r = 4.0/3.0; - else if (ratio->get_active_row_number()==2) - r = 16.0/9.0; - else if (ratio->get_active_row_number()==3) - r = 16.0/10.0; - else if (ratio->get_active_row_number()==4) - r = 5.0/4.0; - else if (ratio->get_active_row_number()==5) - r = 2.0/1.0; - else if (ratio->get_active_row_number()==6) - r = 1.0/1.0; - else if (ratio->get_active_row_number()==7) - r = 1.414; - if (orientation->get_active_row_number()==0) - return r; - else - return 1.0 / r; -} - -void Crop::setBatchMode (bool batchMode) { - - ToolPanel::setBatchMode (batchMode); - - ratio->append_text ("(Unchanged)"); - orientation->append_text ("(Unchanged)"); - guide->append_text ("(Unchanged)"); - removeIfThere (this, dpibox); -} +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include +using namespace rtengine; +using namespace rtengine::procparams; + +extern Glib::ustring argv0; +extern Options options; + +class RefreshSpinHelper { + + public: + Crop* crop; + bool notify; + RefreshSpinHelper (Crop* _crop, bool _notify) + : crop(_crop), notify(_notify) {} +}; + +Crop::Crop () { + + clistener = NULL; + + maxw = 3000; + maxh = 2000; + + enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); + enabled->set_active (false); + pack_start(*enabled); + + pack_start(*Gtk::manage (new Gtk::HSeparator())); + + Gtk::HBox* hb1 = Gtk::manage (new Gtk::HBox ()); + + hb1->pack_start (*Gtk::manage (new Gtk::Label (Glib::ustring(" ") + M("TP_CROP_X") +": "))); + x = Gtk::manage (new Gtk::SpinButton ()); + x->set_size_request (60, -1); + hb1->pack_start (*x); + + hb1->pack_start (*Gtk::manage (new Gtk::Label (Glib::ustring(" ") + M("TP_CROP_Y") + ": "))); + y = Gtk::manage (new Gtk::SpinButton ()); + y->set_size_request (60, -1); + hb1->pack_start (*y); + + pack_start (*hb1, Gtk::PACK_SHRINK, 2); + + Gtk::HBox* hb2 = Gtk::manage (new Gtk::HBox ()); + + hb2->pack_start (*Gtk::manage (new Gtk::Label (M("TP_CROP_W") + ": "))); + w = Gtk::manage (new Gtk::SpinButton ()); + w->set_size_request (60, -1); + hb2->pack_start (*w); + + hb2->pack_start (*Gtk::manage (new Gtk::Label (M("TP_CROP_H") + ": "))); + h = Gtk::manage (new Gtk::SpinButton ()); + h->set_size_request (60, -1); + hb2->pack_start (*h); + + pack_start (*hb2, Gtk::PACK_SHRINK, 4); + + selectCrop = Gtk::manage (new Gtk::Button (M("TP_CROP_SELECTCROP"))); + selectCrop->set_image (*Gtk::manage (new Gtk::Image (argv0+"/images/crop16.png"))); + + pack_start (*selectCrop, Gtk::PACK_SHRINK, 2); + + Gtk::HBox* hb3 = Gtk::manage (new Gtk::HBox ()); + + fixr = Gtk::manage (new Gtk::CheckButton (M("TP_CROP_FIXRATIO"))); + fixr->set_active (1); + + hb3->pack_start (*fixr, Gtk::PACK_SHRINK, 4); + + ratio = Gtk::manage (new Gtk::ComboBoxText ()); + hb3->pack_start (*ratio, Gtk::PACK_SHRINK, 4); + + orientation = Gtk::manage (new Gtk::ComboBoxText ()); + hb3->pack_start (*orientation); + + pack_start (*hb3, Gtk::PACK_SHRINK, 4); + + Gtk::HBox* hb31 = Gtk::manage (new Gtk::HBox ()); + + hb31->pack_start (*Gtk::manage (new Gtk::Label (M("TP_CROP_GUIDETYPE"))), Gtk::PACK_SHRINK, 4); + guide = Gtk::manage (new Gtk::ComboBoxText ()); + hb31->pack_start (*guide); + + pack_start (*hb31, Gtk::PACK_SHRINK, 4); + + dpibox = Gtk::manage (new Gtk::VBox()); + dpibox->pack_start (*Gtk::manage (new Gtk::HSeparator()), Gtk::PACK_SHRINK, 2); + + Gtk::HBox* hb4 = Gtk::manage (new Gtk::HBox ()); + hb4->pack_start (*Gtk::manage (new Gtk::Label (M("TP_CROP_DPI")))); + dpi = Gtk::manage (new Gtk::SpinButton ()); + dpi->set_size_request (60, -1); + hb4->pack_start (*dpi); + + dpibox->pack_start (*hb4, Gtk::PACK_SHRINK, 2); + + sizecm = Gtk::manage (new Gtk::Label (M("GENERAL_NA") + " cm x " + M("GENERAL_NA") + " cm")); + sizein = Gtk::manage (new Gtk::Label (M("GENERAL_NA") + " in x " + M("GENERAL_NA") + " in")); + + dpibox->pack_start (*sizecm, Gtk::PACK_SHRINK, 1); + dpibox->pack_start (*sizein, Gtk::PACK_SHRINK, 1); + + pack_start (*dpibox, Gtk::PACK_SHRINK, 0); + + dpi->set_value (300); + + ratio->append_text ("3:2"); + ratio->append_text ("4:3"); + ratio->append_text ("16:9"); + ratio->append_text ("16:10"); + ratio->append_text ("5:4"); + ratio->append_text ("2:1"); + ratio->append_text ("1:1"); + ratio->append_text ("DIN"); + ratio->set_active (0); + + orientation->append_text (M("GENERAL_LANDSCAPE")); + orientation->append_text (M("GENERAL_PORTRAIT")); + orientation->set_active (0); + + guide->append_text (M("TP_CROP_GTNONE")); + guide->append_text (M("TP_CROP_GTRULETHIRDS")); + guide->append_text (M("TP_CROP_GTDIAGONALS")); + guide->append_text (M("TP_CROP_GTHARMMEANS1")); + guide->append_text (M("TP_CROP_GTHARMMEANS2")); + guide->append_text (M("TP_CROP_GTHARMMEANS3")); + guide->append_text (M("TP_CROP_GTHARMMEANS4")); + guide->set_active (0); + + w->set_range (0, maxw); + h->set_range (0, maxh); + x->set_range (0, maxw); + y->set_range (0, maxh); + + x->set_digits (0); + x->set_increments (1,100); + x->set_value (0); + + y->set_digits (0); + y->set_increments (1,100); + y->set_value (0); + + w->set_digits (0); + w->set_increments (1,100); + w->set_value (200); + + h->set_digits (0); + h->set_increments (1,100); + h->set_value (200); + + dpi->set_digits (0); + dpi->set_increments (1,100); + dpi->set_range (50, 12000); + dpi->set_value (300); + + xconn = x->signal_value_changed().connect ( sigc::mem_fun(*this, &Crop::positionChanged), true); + yconn = y->signal_value_changed().connect ( sigc::mem_fun(*this, &Crop::positionChanged), true); + wconn = w->signal_value_changed().connect ( sigc::mem_fun(*this, &Crop::widthChanged), true); + hconn = h->signal_value_changed().connect ( sigc::mem_fun(*this, &Crop::heightChanged), true); + econn = enabled->signal_toggled().connect( sigc::mem_fun(*this, &Crop::enabledChanged) ); + fconn = fixr->signal_toggled().connect( sigc::mem_fun(*this, &Crop::ratioChanged) ); + rconn = ratio->signal_changed().connect( sigc::mem_fun(*this, &Crop::ratioChanged) ); + oconn = orientation->signal_changed().connect( sigc::mem_fun(*this, &Crop::ratioChanged) ); + gconn = guide->signal_changed().connect( sigc::mem_fun(*this, &Crop::notifyListener) ); + selectCrop->signal_pressed().connect( sigc::mem_fun(*this, &Crop::selectPressed) ); + dpi->signal_value_changed().connect( sigc::mem_fun(*this, &Crop::refreshSize) ); + + nx = ny = nw = nh = 0; + nsx = nsy = nsw = nsh = 0; + lastScale = 1.0; + lastRotationDeg = 0; + show_all (); +} + +void Crop::writeOptions () { + + options.cropDPI = (int)dpi->get_value (); +} + +void Crop::readOptions () { + + disableListener (); + + dpi->set_value (options.cropDPI); + + enableListener (); +} + +void Crop::read (const ProcParams* pp, const ParamsEdited* pedited) { + + disableListener (); + + xconn.block (true); + yconn.block (true); + wconn.block (true); + hconn.block (true); + rconn.block (true); + fconn.block (true); + oconn.block (true); + gconn.block (true); + enabled->set_active (pp->crop.enabled); + + // check if the new values are larger than the maximum + double tmp, maxw, maxh; + w->get_range (tmp, maxw); + h->get_range (tmp, maxh); + if (pp->crop.x + pp->crop.w > maxw || pp->crop.y + pp->crop.h > maxh) + setDimensions (pp->crop.x + pp->crop.w, pp->crop.y + pp->crop.h); + + ratio->set_active_text (pp->crop.ratio); + fixr->set_active (pp->crop.fixratio); + + if (pp->crop.orientation == "Landscape") + orientation->set_active (0); + else if (pp->crop.orientation == "Portrait") + orientation->set_active (1); + + if (pp->crop.guide == "None") + guide->set_active (0); + else if (pp->crop.guide == "Rule of thirds") + guide->set_active (1); + else if (pp->crop.guide == "Rule of diagonals") + guide->set_active (2); + else if (pp->crop.guide == "Harmonic means 1") + guide->set_active (3); + else if (pp->crop.guide == "Harmonic means 2") + guide->set_active (4); + else if (pp->crop.guide == "Harmonic means 3") + guide->set_active (5); + else if (pp->crop.guide == "Harmonic means 4") + guide->set_active (6); + + x->set_value (pp->crop.x); + y->set_value (pp->crop.y); + w->set_value (pp->crop.w); + h->set_value (pp->crop.h); + + nx = pp->crop.x; + ny = pp->crop.y; + nw = pp->crop.w; + nh = pp->crop.h; + + if (pp->resize.enabled) + lastScale = pp->resize.scale; + else + lastScale = 1.0; + nsx = nx / lastScale; + nsy = ny / lastScale; + nsw = nw / lastScale; + nsh = nh / lastScale; + lastRotationDeg = pp->coarse.rotate; + + wDirty = false; + hDirty = false; + xDirty = false; + yDirty = false; + + if (pedited) { + wDirty = pedited->crop.w; + hDirty = pedited->crop.h; + xDirty = pedited->crop.x; + yDirty = pedited->crop.y; + if (!pedited->crop.ratio) + ratio->set_active (8); + if (!pedited->crop.orientation) + orientation->set_active (2); + if (!pedited->crop.guide) + guide->set_active (7); + enabled->set_inconsistent (!pedited->crop.enabled); + fixr->set_inconsistent (!pedited->crop.fixratio); + } + + lastEnabled = pp->crop.enabled; + lastAspect = pp->crop.fixratio; + + xconn.block (false); + yconn.block (false); + wconn.block (false); + hconn.block (false); + rconn.block (false); + fconn.block (false); + oconn.block (false); + gconn.block (false); + + enableListener (); +} + +void Crop::write (ProcParams* pp, ParamsEdited* pedited) { + + pp->crop.enabled = enabled->get_active (); + pp->crop.x = nx; + pp->crop.y = ny; + pp->crop.w = nw; + pp->crop.h = nh; + pp->crop.fixratio = fixr->get_active (); + pp->crop.ratio = ratio->get_active_text (); + + if (orientation->get_active_row_number()==0) + pp->crop.orientation = "Landscape"; + else if (orientation->get_active_row_number()==1) + pp->crop.orientation = "Portrait"; + + if (guide->get_active_row_number()==0) + pp->crop.guide = "None"; + else if (guide->get_active_row_number()==1) + pp->crop.guide = "Rule of thirds"; + else if (guide->get_active_row_number()==2) + pp->crop.guide = "Rule of diagonals"; + else if (guide->get_active_row_number()==3) + pp->crop.guide = "Harmonic means 1"; + else if (guide->get_active_row_number()==4) + pp->crop.guide = "Harmonic means 2"; + else if (guide->get_active_row_number()==5) + pp->crop.guide = "Harmonic means 3"; + else if (guide->get_active_row_number()==6) + pp->crop.guide = "Harmonic means 4"; + + if (pedited) { + pedited->crop.enabled = !enabled->get_inconsistent(); + pedited->crop.ratio = ratio->get_active_row_number() != 8; + pedited->crop.orientation = orientation->get_active_row_number() != 2; + pedited->crop.guide = guide->get_active_row_number() != 7; + pedited->crop.fixratio = !fixr->get_inconsistent(); + pedited->crop.w = wDirty; + pedited->crop.h = hDirty; + pedited->crop.x = xDirty; + pedited->crop.y = yDirty; + } + +} + +void Crop::selectPressed () { + + if (clistener) + clistener->cropSelectRequested (); +} + +void Crop::notifyListener () { + + if (listener && enabled->get_active ()) + listener->panelChanged (EvCrop, Glib::ustring::compose ("%1=%2, %3=%4\n%5=%6, %7=%8", M("TP_CROP_X"), nx, M("TP_CROP_Y"), ny, M("TP_CROP_W"), nw, M("TP_CROP_H"), nh)); +} + +void Crop::enabledChanged () { + + if (batchMode) { + if (enabled->get_inconsistent()) { + enabled->set_inconsistent (false); + econn.block (true); + enabled->set_active (false); + econn.block (false); + } + else if (lastEnabled) + enabled->set_inconsistent (true); + + lastEnabled = enabled->get_active (); + } + + if (listener) { + if (enabled->get_active ()) + listener->panelChanged (EvCrop, Glib::ustring::compose ("%1=%2, %3=%4\n%5=%6, %7=%8", M("TP_CROP_X"), nx, M("TP_CROP_Y"), ny, M("TP_CROP_W"), nw, M("TP_CROP_H"), nh)); + else + listener->panelChanged (EvCrop, M("GENERAL_DISABLED")); + } +} + +int notifylistener (void* data) { + + gdk_threads_enter (); + ((Crop*)data)->notifyListener (); + gdk_threads_leave (); + return 0; +} + +int refreshspins (void* data) { + + gdk_threads_enter (); + RefreshSpinHelper* rsh = (RefreshSpinHelper*) data; + rsh->crop->refreshSpins (rsh->notify); + delete rsh; + gdk_threads_leave (); + return 0; +} + +void Crop::resizeScaleChanged (double rsc) { + + lastScale = rsc; + + nx = (int)round (nsx * rsc); + ny = (int)round (nsy * rsc); + nw = (int)round (nsw * rsc); + nh = (int)round (nsh * rsc); + + if (nx+nw > maxw || ny+nh > maxh) + setDimensions (nx+nw, ny+nh); + + g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); +} + +void Crop::hFlipCrop () { + + nx = maxw - nx - nw; + nsx = nx / lastScale; + g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); +} + +void Crop::vFlipCrop () { + + ny = maxh - ny - nh; + nsy = ny / lastScale; + g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); +} + +void Crop::rotateCrop (int deg) { + + int tmp; + switch ((360+deg-lastRotationDeg)%360) { + case 90: + tmp = nx; + nx = maxh - ny - nh; + ny = tmp; + tmp = nw; + nw = nh; + nh = tmp; + break; + case 270: + tmp = ny; + ny = maxw - nx - nw; + nx = tmp; + tmp = nw; + nw = nh; + nh = tmp; + break; + case 180: + nx = maxw - nx - nw; + ny = maxh - ny - nh; + break; + } + nsx = nx / lastScale; + nsy = ny / lastScale; + nsw = nw / lastScale; + nsh = nh / lastScale; + + lastRotationDeg = deg; + g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); +} + +void Crop::positionChanged () { + + xDirty = true; + yDirty = true; + + int X = (int)x->get_value (); + int Y = (int)y->get_value (); + int W = nw; + int H = nh; + cropMoved (X, Y, W, H); + g_idle_add (notifylistener, this); +} + +void Crop::widthChanged () { + + wDirty = true; + + int X = nx; + int Y = ny; + int W = (int)w->get_value (); + int H = nh; + cropWidth2Resized (X, Y, W, H); + g_idle_add (notifylistener, this); +} + +void Crop::heightChanged () { + + hDirty = true; + + int X = nx; + int Y = ny; + int W = nw; + int H = (int)h->get_value (); + cropHeight2Resized (X, Y, W, H); + g_idle_add (notifylistener, this); +} + + +void Crop::ratioChanged () { + + if (batchMode && lastAspect != fixr->get_active ()) { + if (fixr->get_inconsistent()) { + fixr->set_inconsistent (false); + fconn.block (true); + fixr->set_active (false); + fconn.block (false); + } + else if (lastAspect) + fixr->set_inconsistent (true); + + lastAspect = fixr->get_active (); + } + + + if (fixr->get_active() && !fixr->get_inconsistent()) { + +// int W = w->get_value (); +// int H = h->get_value (); + int W = nw; + int H = nh; + int X = nx; + int Y = ny; + if (W>=H) + cropWidth2Resized (X, Y, W, H); + else + cropHeight2Resized (X, Y, W, H); + + g_idle_add (refreshspins, new RefreshSpinHelper (this, true)); + } +} + +void Crop::refreshSize () { + + if (!batchMode) { + + std::ostringstream ostrin; + ostrin.precision (3); + // ostrin << h->get_value()/dpi->get_value() << " in x " << w->get_value()/dpi->get_value() << " in";; + ostrin << nh/dpi->get_value() << " in x " << nw/dpi->get_value() << " in";; + + sizein->set_text (ostrin.str ()); + + std::ostringstream ostrcm; + ostrcm.precision (3); + // ostrcm << h->get_value()/dpi->get_value()*2.54 << " cm x " << w->get_value()/dpi->get_value()*2.54 << " cm";; + ostrcm << nh/dpi->get_value()*2.54 << " cm x " << nw/dpi->get_value()*2.54 << " cm";; + + sizecm->set_text (ostrcm.str ()); + } +} + +void Crop::setDimensions (int mw, int mh) { + + maxw = mw; + maxh = mh; + + xconn.block (true); + yconn.block (true); + wconn.block (true); + hconn.block (true); + + w->set_range (0, maxw); + h->set_range (0, maxh); + x->set_range (0, maxw); + y->set_range (0, maxh); + + xconn.block (false); + yconn.block (false); + wconn.block (false); + hconn.block (false); + + if (enabled->get_active()==false) { + nx = 0; + ny = 0; + nw = mw; + nh = mh; + + nsx = nx / lastScale; + nsy = ny / lastScale; + nsw = nw / lastScale; + nsh = nh / lastScale; + refreshSpins (); + } + refreshSize (); +} + +struct setdimparams { + Crop* crop; + int x; + int y; +}; + +int setdim (void* data) { + + gdk_threads_enter (); + setdimparams* params = (setdimparams*)data; + params->crop->setDimensions (params->x, params->y); + delete params; + gdk_threads_leave (); + return 0; +} + +void Crop::sizeChanged (int x, int y, int ow, int oh) { + + setdimparams* params = new setdimparams; + params->x = x; + params->y = y; + params->crop = this; + g_idle_add (setdim, params); +} + +bool Crop::refreshSpins (bool notify) { + + xconn.block (true); + yconn.block (true); + wconn.block (true); + hconn.block (true); + + x->set_value (nx); + y->set_value (ny); + w->set_value (nw); + h->set_value (nh); + + xDirty = true; + yDirty = true; + wDirty = true; + hDirty = true; + + xconn.block (false); + yconn.block (false); + wconn.block (false); + hconn.block (false); + + refreshSize (); + if (notify) + notifyListener (); + + return false; +} + +void Crop::cropMoved (int &X, int &Y, int &W, int &H) { + +// W = w->get_value (); +// H = h->get_value (); + W = nw; + H = nh; + + if (X+W>maxw) + X = maxw-W; + if (Y+H>maxh) + Y = maxh-H; + if (X<0) + X = 0; + if (Y<0) + Y = 0; + + nx = X; + ny = Y; + nw = W; + nh = H; + + nsx = nx / lastScale; + nsy = ny / lastScale; + nsw = nw / lastScale; + nsh = nh / lastScale; + + g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); +// Glib::signal_idle().connect (sigc::mem_fun(*this, &Crop::refreshSpins)); +} + +void Crop::cropWidth1Resized (int &X, int &Y, int &W, int &H) { + + if (W<0) + W = 0; + if (H<0) + H = 0; + + if (X<0) { + W += X; + X = 0; + } + if (fixr->get_active()) { + double r = getRatio(); + int W2max = (int)round(r*(maxh-Y)); + if (W>W2max) { + X += W - W2max; + W = W2max; + } + H = (int)round(W / r); + } + + nx = X; + ny = Y; + nw = W; + nh = H; + + nsx = nx / lastScale; + nsy = ny / lastScale; + nsw = nw / lastScale; + nsh = nh / lastScale; + + g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); +// Glib::signal_idle().connect (sigc::mem_fun(*this, &Crop::refreshSpins)); +} + +void Crop::cropWidth2Resized (int &X, int &Y, int &W, int &H) { + +// X = x->get_value (); +// Y = y->get_value (); + X = nx; + Y = ny; + + if (W<0) + W = 0; + if (H<0) + H = 0; + + if (W>maxw-X) + W = maxw-X; + + if (fixr->get_active()) { + double r = getRatio(); + int W2max = (int)round(r*(maxh-Y)); + if (W>W2max) + W = W2max; + H = (int)round(W / r); + } + + nx = X; + ny = Y; + nw = W; + nh = H; + + nsx = nx / lastScale; + nsy = ny / lastScale; + nsw = nw / lastScale; + nsh = nh / lastScale; + + g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); +// Glib::signal_idle().connect (sigc::mem_fun(*this, &Crop::refreshSpins)); +} + +void Crop::cropHeight1Resized (int &X, int &Y, int &W, int &H) { + + if (W<0) + W = 0; + if (H<0) + H = 0; + + if (Y<0) { + H += Y; + Y = 0; + } + + if (fixr->get_active()) { + double r = getRatio(); + int H2max = (int)round((maxw-X) / r); + if (H>H2max) { + Y += H - H2max; + H = H2max; + } + W = (int)round(H * r); + } + + nx = X; + ny = Y; + nw = W; + nh = H; + + nsx = nx / lastScale; + nsy = ny / lastScale; + nsw = nw / lastScale; + nsh = nh / lastScale; + + g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); +// Glib::signal_idle().connect (sigc::mem_fun(*this, &Crop::refreshSpins)); +} + +void Crop::cropHeight2Resized (int &X, int &Y, int &W, int &H) { + +// X = x->get_value (); +// Y = y->get_value (); + X = nx; + Y = ny; + + if (W<0) + W = 0; + if (H<0) + H = 0; + int H1max = maxh-Y; + if (H>H1max) + H = H1max; + if (fixr->get_active()) { + double r = getRatio (); + int H2max = (int)round ((maxw-X) / r); + if (H>H2max) + H = H2max; + W = (int)round(H * r); + } + + nx = X; + ny = Y; + nw = W; + nh = H; + + nsx = nx / lastScale; + nsy = ny / lastScale; + nsw = nw / lastScale; + nsh = nh / lastScale; + + g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); +// Glib::signal_idle().connect (sigc::mem_fun(*this, &Crop::refreshSpins)); +} + +void Crop::cropInit (int &x, int &y, int &w, int &h) { + + nx = x; + ny = y; + nw = 1; + nh = 1; + + nsx = nx / lastScale; + nsy = ny / lastScale; + nsw = nw / lastScale; + nsh = nh / lastScale; + + w = 1; h = 1; + + econn.block (true); + enabled->set_active (1); + econn.block (false); + g_idle_add (refreshspins, new RefreshSpinHelper (this, false)); +// Glib::signal_idle().connect (sigc::mem_fun(*this, &Crop::refreshSpins)); +} + +void Crop::cropResized (int &x, int &y, int& x2, int& y2) { + + if (x2<0) + x2 = 0; + if (y2<0) + y2 = 0; + if (x2>=maxw) + x2 = maxw-1; + if (y2>=maxh) + y2 = maxh-1; + + int X, Y; + int W; + if (xmaxw) + W = maxw; + if (H>maxh) + H = maxh; + + if (fixr->get_active()) { + double r = getRatio (); + if (y<=y2) { + int W2max = (int)round ((maxh-Y) * r); + if (W>W2max) + W = W2max; + } + else { + int W2max = (int)round (y * r); + if (W>W2max) + W = W2max; + } + H = (int)round(W / r); + if (xget_active()==false) + return r; + if (ratio->get_active_row_number()==0) + r = 3.0/2.0; + else if (ratio->get_active_row_number()==1) + r = 4.0/3.0; + else if (ratio->get_active_row_number()==2) + r = 16.0/9.0; + else if (ratio->get_active_row_number()==3) + r = 16.0/10.0; + else if (ratio->get_active_row_number()==4) + r = 5.0/4.0; + else if (ratio->get_active_row_number()==5) + r = 2.0/1.0; + else if (ratio->get_active_row_number()==6) + r = 1.0/1.0; + else if (ratio->get_active_row_number()==7) + r = 1.414; + if (orientation->get_active_row_number()==0) + return r; + else + return 1.0 / r; +} + +void Crop::setBatchMode (bool batchMode) { + + ToolPanel::setBatchMode (batchMode); + + ratio->append_text ("(Unchanged)"); + orientation->append_text ("(Unchanged)"); + guide->append_text ("(Unchanged)"); + removeIfThere (this, dpibox); +} diff --git a/rtgui/crop.h b/rtgui/crop.h index c607b0e1e..31fb7cacb 100644 --- a/rtgui/crop.h +++ b/rtgui/crop.h @@ -1,100 +1,100 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _CROP_H_ -#define _CROP_H_ - -#include -#include -#include - -class CropPanelListener { - - public: - virtual void cropSelectRequested () {} -}; - - -class Crop : public Gtk::VBox, public CropGUIListener, public ToolPanel, public rtengine::SizeListener { - - protected: - Gtk::CheckButton* enabled; - Gtk::CheckButton* fixr; - Gtk::ComboBoxText* ratio; - Gtk::ComboBoxText* orientation; - Gtk::ComboBoxText* guide; - Gtk::Button* selectCrop; - CropPanelListener* clistener; - int opt; - Gtk::SpinButton* x; - Gtk::SpinButton* y; - Gtk::SpinButton* w; - Gtk::SpinButton* h; - Gtk::SpinButton* dpi; - Gtk::Label* sizecm; - Gtk::Label* sizein; - Gtk::VBox* dpibox; - int maxw, maxh; - int nx, ny, nw, nh; - double nsx, nsy, nsw, nsh, lastScale; - int lastRotationDeg; - sigc::connection xconn, yconn, wconn, hconn, econn, fconn, rconn, oconn, gconn; - bool wDirty, hDirty, xDirty, yDirty, lastEnabled, lastAspect; - - public: - - Crop (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setBatchMode (bool batchMode); - - void ratioChanged (); - void refreshSize (); - void selectPressed (); - void setDimensions (int mw, int mh); - void enabledChanged (); - void positionChanged (); - void widthChanged (); - void heightChanged (); - bool refreshSpins (bool notify=false); - void notifyListener (); - void sizeChanged (int w, int h, int ow, int oh); - - void readOptions (); - void writeOptions (); - - void cropMoved (int &x, int &y, int &w, int &h); - void cropWidth1Resized (int &x, int &y, int &w, int &h); - void cropWidth2Resized (int &x, int &y, int &w, int &h); - void cropHeight1Resized (int &x, int &y, int &w, int &h); - void cropHeight2Resized (int &x, int &y, int &w, int &h); - void cropInit (int &x, int &y, int &w, int &h); - void cropResized (int &x, int &y, int& x2, int& y2); - void cropManipReady (); - double getRatio (); - - void setCropPanelListener (CropPanelListener* cl) { clistener = cl; } - - void resizeScaleChanged (double rsc); - void hFlipCrop (); - void vFlipCrop (); - void rotateCrop (int deg); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _CROP_H_ +#define _CROP_H_ + +#include +#include +#include + +class CropPanelListener { + + public: + virtual void cropSelectRequested () {} +}; + + +class Crop : public Gtk::VBox, public CropGUIListener, public ToolPanel, public rtengine::SizeListener { + + protected: + Gtk::CheckButton* enabled; + Gtk::CheckButton* fixr; + Gtk::ComboBoxText* ratio; + Gtk::ComboBoxText* orientation; + Gtk::ComboBoxText* guide; + Gtk::Button* selectCrop; + CropPanelListener* clistener; + int opt; + Gtk::SpinButton* x; + Gtk::SpinButton* y; + Gtk::SpinButton* w; + Gtk::SpinButton* h; + Gtk::SpinButton* dpi; + Gtk::Label* sizecm; + Gtk::Label* sizein; + Gtk::VBox* dpibox; + int maxw, maxh; + int nx, ny, nw, nh; + double nsx, nsy, nsw, nsh, lastScale; + int lastRotationDeg; + sigc::connection xconn, yconn, wconn, hconn, econn, fconn, rconn, oconn, gconn; + bool wDirty, hDirty, xDirty, yDirty, lastEnabled, lastAspect; + + public: + + Crop (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setBatchMode (bool batchMode); + + void ratioChanged (); + void refreshSize (); + void selectPressed (); + void setDimensions (int mw, int mh); + void enabledChanged (); + void positionChanged (); + void widthChanged (); + void heightChanged (); + bool refreshSpins (bool notify=false); + void notifyListener (); + void sizeChanged (int w, int h, int ow, int oh); + + void readOptions (); + void writeOptions (); + + void cropMoved (int &x, int &y, int &w, int &h); + void cropWidth1Resized (int &x, int &y, int &w, int &h); + void cropWidth2Resized (int &x, int &y, int &w, int &h); + void cropHeight1Resized (int &x, int &y, int &w, int &h); + void cropHeight2Resized (int &x, int &y, int &w, int &h); + void cropInit (int &x, int &y, int &w, int &h); + void cropResized (int &x, int &y, int& x2, int& y2); + void cropManipReady (); + double getRatio (); + + void setCropPanelListener (CropPanelListener* cl) { clistener = cl; } + + void resizeScaleChanged (double rsc); + void hFlipCrop (); + void vFlipCrop (); + void rotateCrop (int deg); +}; + +#endif diff --git a/rtgui/cropguilistener.h b/rtgui/cropguilistener.h index 75248b9a8..c06113c36 100644 --- a/rtgui/cropguilistener.h +++ b/rtgui/cropguilistener.h @@ -1,36 +1,36 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef __CROPGUILISTENER__ -#define __CROPGUILISTENER__ - -class CropGUIListener { - - public: - virtual void cropMoved (int &x, int &y, int &w, int &h) =0; - virtual void cropWidth1Resized (int &x, int &y, int &w, int &h) =0; - virtual void cropWidth2Resized (int &x, int &y, int &w, int &h) =0; - virtual void cropHeight1Resized (int &x, int &y, int &w, int &h) =0; - virtual void cropHeight2Resized (int &x, int &y, int &w, int &h) =0; - virtual void cropInit (int &x, int &y, int &w, int &h) =0; - virtual void cropResized (int &x, int &y, int& x2, int& y2) =0; - virtual void cropManipReady () =0; - virtual double getRatio () =0; -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef __CROPGUILISTENER__ +#define __CROPGUILISTENER__ + +class CropGUIListener { + + public: + virtual void cropMoved (int &x, int &y, int &w, int &h) =0; + virtual void cropWidth1Resized (int &x, int &y, int &w, int &h) =0; + virtual void cropWidth2Resized (int &x, int &y, int &w, int &h) =0; + virtual void cropHeight1Resized (int &x, int &y, int &w, int &h) =0; + virtual void cropHeight2Resized (int &x, int &y, int &w, int &h) =0; + virtual void cropInit (int &x, int &y, int &w, int &h) =0; + virtual void cropResized (int &x, int &y, int& x2, int& y2) =0; + virtual void cropManipReady () =0; + virtual double getRatio () =0; +}; + +#endif diff --git a/rtgui/crophandler.cc b/rtgui/crophandler.cc index 9e26c40a6..cec7ada5f 100644 --- a/rtgui/crophandler.cc +++ b/rtgui/crophandler.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #undef THREAD_PRIORITY_NORMAL diff --git a/rtgui/crophandler.h b/rtgui/crophandler.h index 990316342..0b6e8d5f2 100644 --- a/rtgui/crophandler.h +++ b/rtgui/crophandler.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef __CROPHANDLER__ #define __CROPHANDLER__ diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index 37f90003b..6fb3e5865 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include @@ -250,37 +250,37 @@ void CropWindow::buttonPress (int button, int type, int bstate, int x, int y) { } else if (button==1 && type==GDK_BUTTON_PRESS && state==SNormal && onArea (CropImage, x, y)) { if (onArea (CropTop, x, y)) { - state = SResizeH1; - press_y = y; - action_y = cropHandler.cropParams.y; + state = SResizeH1; + press_y = y; + action_y = cropHandler.cropParams.y; } else if (onArea (CropBottom, x, y)) { - state = SResizeH2; - press_y = y; - action_y = cropHandler.cropParams.h; + state = SResizeH2; + press_y = y; + action_y = cropHandler.cropParams.h; } else if (onArea (CropLeft, x, y)) { - state = SResizeW1; - press_x = x; - action_x = cropHandler.cropParams.x; + state = SResizeW1; + press_x = x; + action_x = cropHandler.cropParams.x; } else if (onArea (CropRight, x, y)) { - state = SResizeW2; - press_x = x; - action_x = cropHandler.cropParams.w; + state = SResizeW2; + press_x = x; + action_x = cropHandler.cropParams.w; } else if (onArea (CropObserved, x, y)) { state = SObservedMove; press_x = x; press_y = y; } - else if ((bstate & GDK_SHIFT_MASK) && onArea (CropInside, x, y)) { - state = SCropMove; - press_x = x; - press_y = y; - action_x = cropHandler.cropParams.x; - action_y = cropHandler.cropParams.y; - } + else if ((bstate & GDK_SHIFT_MASK) && onArea (CropInside, x, y)) { + state = SCropMove; + press_x = x; + press_y = y; + action_x = cropHandler.cropParams.x; + action_y = cropHandler.cropParams.y; + } else if (iarea->getToolMode () == TMHand) { state = SCropImgMove; action_x = 0; @@ -289,25 +289,25 @@ void CropWindow::buttonPress (int button, int type, int bstate, int x, int y) { press_y = y; } else if (iarea->getToolMode () == TMStraighten) { - state = SRotateSelecting; - press_x = x; - press_y = y; - action_x = x; + state = SRotateSelecting; + press_x = x; + press_y = y; + action_x = x; action_y = y; - rot_deg = 0; + rot_deg = 0; } else if (iarea->getToolMode () == TMSpotWB) { translateCoord (x, y, action_x, action_y); iarea->spotWBSelected (action_x, action_y); } - else if (iarea->getToolMode () == TMCropSelect && cropgl) { - state = SCropSelecting; + else if (iarea->getToolMode () == TMCropSelect && cropgl) { + state = SCropSelecting; translateCoord (x, y, press_x, press_y); cropHandler.cropParams.x = press_x; cropHandler.cropParams.y = press_y; - cropHandler.cropParams.w = cropHandler.cropParams.h = 1; - cropgl->cropInit (cropHandler.cropParams.x, cropHandler.cropParams.y, cropHandler.cropParams.w, cropHandler.cropParams.h); - } + cropHandler.cropParams.w = cropHandler.cropParams.h = 1; + cropgl->cropInit (cropHandler.cropParams.x, cropHandler.cropParams.y, cropHandler.cropParams.w, cropHandler.cropParams.h); + } } if (button==3) { state = SNormal; @@ -342,8 +342,8 @@ void CropWindow::buttonRelease (int button, int num, int bstate, int x, int y) { observedCropWin->remoteMoveReady (); state = SNormal; } - if (cropgl && (state==SCropSelecting || state==SResizeH1 || state==SResizeH2 || state==SResizeW1 || state==SResizeW2 || state==SCropMove)) { - cropgl->cropManipReady (); + if (cropgl && (state==SCropSelecting || state==SResizeH1 || state==SResizeH2 || state==SResizeW1 || state==SResizeW2 || state==SCropMove)) { + cropgl->cropManipReady (); iarea->setToolHand (); } @@ -388,40 +388,40 @@ void CropWindow::pointerMoved (int x, int y) { iarea->redraw (); } else if (state==SResizeH1 && cropgl) { - int oy = cropHandler.cropParams.y; + int oy = cropHandler.cropParams.y; cropHandler.cropParams.y = action_y + (y-press_y) / zoomSteps[cropZoom].zoom; - cropHandler.cropParams.h += oy - cropHandler.cropParams.y; - cropgl->cropHeight1Resized (cropHandler.cropParams.x, cropHandler.cropParams.y, cropHandler.cropParams.w, cropHandler.cropParams.h); + cropHandler.cropParams.h += oy - cropHandler.cropParams.y; + cropgl->cropHeight1Resized (cropHandler.cropParams.x, cropHandler.cropParams.y, cropHandler.cropParams.w, cropHandler.cropParams.h); iarea->redraw (); - } + } else if (state==SResizeH2 && cropgl) { cropHandler.cropParams.h = action_y + (y-press_y) / zoomSteps[cropZoom].zoom; - cropgl->cropHeight2Resized (cropHandler.cropParams.x, cropHandler.cropParams.y, cropHandler.cropParams.w, cropHandler.cropParams.h); + cropgl->cropHeight2Resized (cropHandler.cropParams.x, cropHandler.cropParams.y, cropHandler.cropParams.w, cropHandler.cropParams.h); iarea->redraw (); - } + } else if (state==SResizeW1 && cropgl) { - int ox = cropHandler.cropParams.x; + int ox = cropHandler.cropParams.x; cropHandler.cropParams.x = action_x + (x-press_x) / zoomSteps[cropZoom].zoom; - cropHandler.cropParams.w += ox - cropHandler.cropParams.x; - cropgl->cropWidth1Resized (cropHandler.cropParams.x, cropHandler.cropParams.y, cropHandler.cropParams.w, cropHandler.cropParams.h); + cropHandler.cropParams.w += ox - cropHandler.cropParams.x; + cropgl->cropWidth1Resized (cropHandler.cropParams.x, cropHandler.cropParams.y, cropHandler.cropParams.w, cropHandler.cropParams.h); iarea->redraw (); - } + } else if (state==SResizeW2 && cropgl) { cropHandler.cropParams.w = action_x + (x-press_x) / zoomSteps[cropZoom].zoom; - cropgl->cropWidth2Resized (cropHandler.cropParams.x, cropHandler.cropParams.y, cropHandler.cropParams.w, cropHandler.cropParams.h); + cropgl->cropWidth2Resized (cropHandler.cropParams.x, cropHandler.cropParams.y, cropHandler.cropParams.w, cropHandler.cropParams.h); + iarea->redraw (); + } + else if (state==SCropMove && cropgl) { + cropHandler.cropParams.x = action_x + (x-press_x) / zoomSteps[cropZoom].zoom; + cropHandler.cropParams.y = action_y + (y-press_y) / zoomSteps[cropZoom].zoom; + cropgl->cropMoved (cropHandler.cropParams.x, cropHandler.cropParams.y, cropHandler.cropParams.w, cropHandler.cropParams.h); iarea->redraw (); - } - else if (state==SCropMove && cropgl) { - cropHandler.cropParams.x = action_x + (x-press_x) / zoomSteps[cropZoom].zoom; - cropHandler.cropParams.y = action_y + (y-press_y) / zoomSteps[cropZoom].zoom; - cropgl->cropMoved (cropHandler.cropParams.x, cropHandler.cropParams.y, cropHandler.cropParams.w, cropHandler.cropParams.h); - iarea->redraw (); } else if (state==SCropSelecting && cropgl) { translateCoord (x, y, action_x, action_y); int cx1 = press_x, cy1 = press_y; int cx2 = action_x, cy2 = action_y; - cropgl->cropResized (cx1, cy1, cx2, cy2); + cropgl->cropResized (cx1, cy1, cx2, cy2); if (cx2 > cx1) { cropHandler.cropParams.x = cx1; cropHandler.cropParams.w = cx2 - cx1 + 1; @@ -438,12 +438,12 @@ void CropWindow::pointerMoved (int x, int y) { cropHandler.cropParams.y = cy2; cropHandler.cropParams.h = cy1 - cy2 + 1; } - iarea->redraw (); + iarea->redraw (); } else if (state==SObservedMove) { observedCropWin->remoteMove ((x - press_x)/zoomSteps[cropZoom].zoom, (y - press_y)/zoomSteps[cropZoom].zoom); iarea->redraw (); - } + } updateCursor (x, y); bool oRA = onArea (CropResize, x, y); @@ -852,66 +852,66 @@ void CropWindow::drawDecoration (Cairo::RefPtr cr) { void CropWindow::drawStraightenGuide (Cairo::RefPtr cr) { - if (action_x!=press_x || action_y!=press_y) { - double arg = (press_x-action_x) / sqrt(double((press_x-action_x)*(press_x-action_x)+(press_y-action_y)*(press_y-action_y))); - double sol1, sol2; - double pi = M_PI; - if (press_y>action_y) { - sol1 = acos(arg)*180/pi; - sol2 = -acos(-arg)*180/pi; - } - else { - sol1 = acos(-arg)*180/pi; - sol2 = -acos(arg)*180/pi; - } - if (fabs(sol1)45) - rot_deg = - 90.0 + rot_deg; - } - else - rot_deg = 0; - - Glib::RefPtr context = iarea->get_pango_context () ; - Pango::FontDescription fontd = context->get_font_description (); - fontd.set_weight (Pango::WEIGHT_BOLD); - fontd.set_size (8*Pango::SCALE); - context->set_font_description (fontd); - Glib::RefPtr deglayout = iarea->create_pango_layout(Glib::ustring::compose ("%1 deg", Glib::ustring::format(std::setprecision(2), rot_deg))); + if (action_x!=press_x || action_y!=press_y) { + double arg = (press_x-action_x) / sqrt(double((press_x-action_x)*(press_x-action_x)+(press_y-action_y)*(press_y-action_y))); + double sol1, sol2; + double pi = M_PI; + if (press_y>action_y) { + sol1 = acos(arg)*180/pi; + sol2 = -acos(-arg)*180/pi; + } + else { + sol1 = acos(-arg)*180/pi; + sol2 = -acos(arg)*180/pi; + } + if (fabs(sol1)=image->getWidth()) x2 = image->getWidth()-1; - if (y2>=image->getHeight()) y2 = image->getHeight()-1; - if (x1>=image->getWidth()) x1 = image->getWidth()-1; - if (y1>=image->getHeight()) y1 = image->getHeight()-1; -*/ + if (rot_deg<-45) + rot_deg = 90.0 + rot_deg; + else if (rot_deg>45) + rot_deg = - 90.0 + rot_deg; + } + else + rot_deg = 0; - cr->set_line_width (1.5); - cr->set_source_rgb (1.0, 1.0, 1.0); - cr->move_to (x1, y1); - cr->line_to (x2, y2); - cr->stroke (); - cr->set_source_rgb (0.0, 0.0, 0.0); - std::valarray ds (1); - ds[0] = 4; - cr->set_dash (ds, 0); - cr->move_to (x1, y1); - cr->line_to (x2, y2); - cr->stroke (); - - if (press_x!=action_x && press_y!=action_y) { + Glib::RefPtr context = iarea->get_pango_context () ; + Pango::FontDescription fontd = context->get_font_description (); + fontd.set_weight (Pango::WEIGHT_BOLD); + fontd.set_size (8*Pango::SCALE); + context->set_font_description (fontd); + Glib::RefPtr deglayout = iarea->create_pango_layout(Glib::ustring::compose ("%1 deg", Glib::ustring::format(std::setprecision(2), rot_deg))); + + int x1 = press_x; + int y1 = press_y; + int y2 = action_y; + int x2 = action_x; +/* if (x1<0) x1 = 0; + if (y1<0) y1 = 0; + if (x2<0) x2 = 0; + if (y2<0) y2 = 0; + if (x2>=image->getWidth()) x2 = image->getWidth()-1; + if (y2>=image->getHeight()) y2 = image->getHeight()-1; + if (x1>=image->getWidth()) x1 = image->getWidth()-1; + if (y1>=image->getHeight()) y1 = image->getHeight()-1; +*/ + + cr->set_line_width (1.5); + cr->set_source_rgb (1.0, 1.0, 1.0); + cr->move_to (x1, y1); + cr->line_to (x2, y2); + cr->stroke (); + cr->set_source_rgb (0.0, 0.0, 0.0); + std::valarray ds (1); + ds[0] = 4; + cr->set_dash (ds, 0); + cr->move_to (x1, y1); + cr->line_to (x2, y2); + cr->stroke (); + + if (press_x!=action_x && press_y!=action_y) { cr->set_source_rgb (0.0, 0.0, 0.0); cr->move_to ((x1+x2)/2+1, (y1+y2)/2+1); deglayout->add_to_cairo_context (cr); @@ -926,16 +926,16 @@ void CropWindow::drawStraightenGuide (Cairo::RefPtr cr) { cr->move_to ((x1+x2)/2, (y1+y2)/2); deglayout->add_to_cairo_context (cr); cr->fill (); - } + } } void CropWindow::drawSpotWBRectangle (Cairo::RefPtr cr) { int rectsize = iarea->getSpotWBRectSize (); - int x1 = action_x/zoomSteps[cropZoom].zoom - rectsize; - int y1 = action_y/zoomSteps[cropZoom].zoom - rectsize; - int y2 = action_y/zoomSteps[cropZoom].zoom + rectsize; - int x2 = action_x/zoomSteps[cropZoom].zoom + rectsize; + int x1 = action_x/zoomSteps[cropZoom].zoom - rectsize; + int y1 = action_y/zoomSteps[cropZoom].zoom - rectsize; + int y2 = action_y/zoomSteps[cropZoom].zoom + rectsize; + int x2 = action_x/zoomSteps[cropZoom].zoom + rectsize; cr->set_line_width (1.0); cr->rectangle (xpos+imgX-0.5, ypos+imgY-0.5, imgW, imgH); diff --git a/rtgui/cropwindow.h b/rtgui/cropwindow.h index 35372efca..5a69154d1 100644 --- a/rtgui/cropwindow.h +++ b/rtgui/cropwindow.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _CROPWINDOW_ #define _CROPWINDOW_ diff --git a/rtgui/cursormanager.cc b/rtgui/cursormanager.cc index 8dee294df..44479a0b0 100644 --- a/rtgui/cursormanager.cc +++ b/rtgui/cursormanager.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include @@ -24,49 +24,49 @@ CursorManager cursorManager; void CursorManager::init (Glib::RefPtr mainWin) { - cResizeWidth = new Gdk::Cursor (Gdk::SB_H_DOUBLE_ARROW); - cResizeHeight = new Gdk::Cursor (Gdk::SB_V_DOUBLE_ARROW); - cResizeDiag = new Gdk::Cursor (Gdk::BOTTOM_RIGHT_CORNER); - cCropMove = new Gdk::Cursor (Gdk::FLEUR); - cCropMoving = new Gdk::Cursor (Gdk::HAND2); - cCropSelection = new Gdk::Cursor (Gdk::CROSSHAIR); -#ifdef _WIN32 - cNormal = new Gdk::Cursor (Gdk::LAST_CURSOR); -#else - cNormal = new Gdk::Cursor (Gdk::ARROW); -#endif + cResizeWidth = new Gdk::Cursor (Gdk::SB_H_DOUBLE_ARROW); + cResizeHeight = new Gdk::Cursor (Gdk::SB_V_DOUBLE_ARROW); + cResizeDiag = new Gdk::Cursor (Gdk::BOTTOM_RIGHT_CORNER); + cCropMove = new Gdk::Cursor (Gdk::FLEUR); + cCropMoving = new Gdk::Cursor (Gdk::HAND2); + cCropSelection = new Gdk::Cursor (Gdk::CROSSHAIR); +#ifdef _WIN32 + cNormal = new Gdk::Cursor (Gdk::LAST_CURSOR); +#else + cNormal = new Gdk::Cursor (Gdk::ARROW); +#endif Glib::RefPtr hand = safe_create_from_file(argv0+"/images/openhand22.png"); Glib::RefPtr close_hand = safe_create_from_file(argv0+"/images/closedhand22.png"); Glib::RefPtr wbpick = safe_create_from_file(argv0+"/images/wbpicker16.png"); cHand = hand ? new Gdk::Cursor (cNormal->get_display(), hand, 10, 10) : new Gdk::Cursor (Gdk::HAND2); cClosedHand = close_hand ? new Gdk::Cursor (cNormal->get_display(), close_hand, 10, 10) : new Gdk::Cursor (Gdk::HAND2); - cWB = wbpick ? new Gdk::Cursor (cNormal->get_display(), wbpick, 1, 12) : new Gdk::Cursor (Gdk::ARROW); + cWB = wbpick ? new Gdk::Cursor (cNormal->get_display(), wbpick, 1, 12) : new Gdk::Cursor (Gdk::ARROW); mainWindow = mainWin; } void CursorManager::setCursor (Glib::RefPtr window, CursorShape shape) { - if (shape==CSArrow) - window->set_cursor (*cNormal); - else if (shape==CSOpenHand) - window->set_cursor (*cHand); - else if (shape==CSClosedHand) - window->set_cursor (*cClosedHand); - else if (shape==CSMove) - window->set_cursor (*cCropMove); - else if (shape==CSResizeWidth) - window->set_cursor (*cResizeWidth); - else if (shape==CSResizeHeight) - window->set_cursor (*cResizeHeight); - else if (shape==CSResizeDiagonal) - window->set_cursor (*cResizeDiag); - else if (shape==CSSpotWB) - window->set_cursor (*cWB); - else if (shape==CSCropSelect) - window->set_cursor (*cCropSelection); - else if (shape==CSStraighten) - window->set_cursor (*cCropSelection); + if (shape==CSArrow) + window->set_cursor (*cNormal); + else if (shape==CSOpenHand) + window->set_cursor (*cHand); + else if (shape==CSClosedHand) + window->set_cursor (*cClosedHand); + else if (shape==CSMove) + window->set_cursor (*cCropMove); + else if (shape==CSResizeWidth) + window->set_cursor (*cResizeWidth); + else if (shape==CSResizeHeight) + window->set_cursor (*cResizeHeight); + else if (shape==CSResizeDiagonal) + window->set_cursor (*cResizeDiag); + else if (shape==CSSpotWB) + window->set_cursor (*cWB); + else if (shape==CSCropSelect) + window->set_cursor (*cCropSelection); + else if (shape==CSStraighten) + window->set_cursor (*cCropSelection); } diff --git a/rtgui/cursormanager.h b/rtgui/cursormanager.h index f214416c0..6417d3058 100644 --- a/rtgui/cursormanager.h +++ b/rtgui/cursormanager.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _CURSORMANAGER_ #define _CURSORMANAGER_ @@ -26,17 +26,17 @@ enum CursorShape {CSArrow, CSOpenHand, CSClosedHand, CSMove, CSResizeWidth, CSRe class CursorManager { protected: - Gdk::Cursor* cResizeWidth; - Gdk::Cursor* cResizeHeight; - Gdk::Cursor* cResizeDiag; - Gdk::Cursor* cCropMove; - Gdk::Cursor* cCropMoving; - Gdk::Cursor* cNormal; - Gdk::Cursor* cCropSelection; - Gdk::Cursor* cHand; - Gdk::Cursor* cClosedHand; + Gdk::Cursor* cResizeWidth; + Gdk::Cursor* cResizeHeight; + Gdk::Cursor* cResizeDiag; + Gdk::Cursor* cCropMove; + Gdk::Cursor* cCropMoving; + Gdk::Cursor* cNormal; + Gdk::Cursor* cCropSelection; + Gdk::Cursor* cHand; + Gdk::Cursor* cClosedHand; Gdk::Cursor* cWB; - Glib::RefPtr mainWindow; + Glib::RefPtr mainWindow; public: void init (Glib::RefPtr mainWin); diff --git a/rtgui/curveeditor.cc b/rtgui/curveeditor.cc index 0a74b74bb..2d20ac13e 100644 --- a/rtgui/curveeditor.cc +++ b/rtgui/curveeditor.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include diff --git a/rtgui/curveeditor.h b/rtgui/curveeditor.h index 35fd715e8..33fcabe3c 100644 --- a/rtgui/curveeditor.h +++ b/rtgui/curveeditor.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _CURVEEDITOR_ #define _CURVEEDITOR_ diff --git a/rtgui/curvelistener.h b/rtgui/curvelistener.h index 87102db6b..e07fed2d5 100644 --- a/rtgui/curvelistener.h +++ b/rtgui/curvelistener.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _CURVELISTENER_ #define _CURVELISTENER_ diff --git a/rtgui/dirbrowser.cc b/rtgui/dirbrowser.cc index 8475a09fd..18e60040a 100644 --- a/rtgui/dirbrowser.cc +++ b/rtgui/dirbrowser.cc @@ -1,367 +1,367 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#ifdef WIN32 -#define _WIN32_WINNT 0x0600 -#include -#endif -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#ifdef WIN32 +#define _WIN32_WINNT 0x0600 +#include +#endif +#include #include - -#define CHECKTIME 5000 -extern Glib::ustring argv0; - -DirBrowser::DirBrowser () { - - dirtree = new Gtk::TreeView(); - scrolledwindow4 = new Gtk::ScrolledWindow(); - -// dirtree->set_flags(Gtk::CAN_FOCUS); - dirtree->set_headers_visible(false); - dirtree->set_rules_hint(false); - dirtree->set_reorderable(false); - dirtree->set_enable_search(false); - scrolledwindow4->set_flags(Gtk::CAN_FOCUS); - scrolledwindow4->set_border_width(2); - scrolledwindow4->set_shadow_type(Gtk::SHADOW_NONE); - scrolledwindow4->set_policy(Gtk::POLICY_ALWAYS, Gtk::POLICY_ALWAYS); - scrolledwindow4->property_window_placement().set_value(Gtk::CORNER_TOP_LEFT); - scrolledwindow4->add(*dirtree); - - pack_start (*scrolledwindow4); - dirtree->show (); - scrolledwindow4->show (); -} -void DirBrowser::fillDirTree () { - - openfolder = safe_create_from_file (argv0+"/images/folder_open.png"); - closedfolder = safe_create_from_file (argv0+"/images/folder.png"); - icdrom = safe_create_from_file (argv0+"/images/cdrom.png"); - ifloppy = safe_create_from_file (argv0+"/images/floppy.png"); - ihdd = safe_create_from_file (argv0+"/images/hdd.png"); - iremovable = safe_create_from_file (argv0+"/images/usbpendrive.png"); - inetwork = safe_create_from_file (argv0+"/images/network.png"); - - //Create the Tree model: - dirTreeModel = Gtk::TreeStore::create(dtColumns); - dirtree->set_model (dirTreeModel); - - fillRoot (); - - Gtk::CellRendererPixbuf* render_pb = new Gtk::CellRendererPixbuf (); - tvc.pack_start (*render_pb, false); - tvc.add_attribute(*render_pb, "pixbuf-expander-closed", 1); - tvc.add_attribute(*render_pb, "pixbuf", 1); - tvc.add_attribute(*render_pb, "pixbuf-expander-open", 0); - tvc.pack_start (crt); - tvc.add_attribute(crt, "text", 2); - - crt.property_ypad() = 0; - render_pb->property_ypad() = 0; - - dirtree->append_column(tvc); - - dirtree->signal_row_expanded().connect(sigc::mem_fun(*this, &DirBrowser::row_expanded)); - dirtree->signal_row_activated().connect(sigc::mem_fun(*this, &DirBrowser::row_activated)); -} - -#ifdef WIN32 -void DirBrowser::addRoot (char letter) { - - char volume[4]; - volume[0] = letter; - strcpy (volume+1, ":\\"); - - Gtk::TreeModel::iterator root = dirTreeModel->append(); - root->set_value (dtColumns.filename, Glib::ustring(volume)); - root->set_value (dtColumns.dirname, Glib::ustring(volume)); - - int type = GetDriveType (volume); - if (type==DRIVE_CDROM) { - root->set_value (0, icdrom); - root->set_value (1, icdrom); - } - else if (type==DRIVE_REMOVABLE) { - if (letter-'A'<2) { - root->set_value (0, ifloppy); - root->set_value (1, ifloppy); - } - else { - root->set_value (0, iremovable); - root->set_value (1, iremovable); - } - } - else if (type==DRIVE_REMOTE) { - root->set_value (0, inetwork); - root->set_value (1, inetwork); - } - else if (type==DRIVE_FIXED) { - root->set_value (0, ihdd); - root->set_value (1, ihdd); - } - - Gtk::TreeModel::iterator child = dirTreeModel->append (root->children()); - child->set_value (dtColumns.filename, Glib::ustring("foo")); -} - -void DirBrowser::updateDirTreeRoot () { - - for (Gtk::TreeModel::iterator i=dirTreeModel->children().begin(); i!=dirTreeModel->children().end(); i++) - updateDirTree (i); -} - -void DirBrowser::updateDirTree (const Gtk::TreeModel::iterator& iter) { - - if (dirtree->row_expanded (dirTreeModel->get_path (iter))) { - updateDir (iter); - for (Gtk::TreeModel::iterator i=iter->children().begin(); i!=iter->children().end(); i++) - updateDirTree (i); - } -} - -void DirBrowser::updateVolumes () { - - int nvolumes = GetLogicalDrives (); - if (nvolumes!=volumes) { - for (int i=0; i<32; i++) - if (((volumes >> i) & 1) && !((nvolumes >> i) & 1)) { // volume i has been deleted - for (Gtk::TreeModel::iterator iter = dirTreeModel->children().begin(); iter!=dirTreeModel->children().end(); iter++) - if (iter->get_value (dtColumns.filename).c_str()[0]-'A' == i) { - dirTreeModel->erase (iter); - break; - } - } - else if (!((volumes >> i) & 1) && ((nvolumes >> i) & 1)) - addRoot ('A'+i); // volume i has been added - volumes = nvolumes; - } -} - -int _updateVolumes (void* br) { - - gdk_threads_enter (); - ((DirBrowser*)br)->updateVolumes (); - gdk_threads_leave (); - return 1; -} -int _updateDirTree (void* br) { - - gdk_threads_enter (); - ((DirBrowser*)br)->updateDirTreeRoot (); - gdk_threads_leave (); - return 0; -} - -void DirBrowser::winDirChanged () { - - g_idle_add (_updateDirTree, this); -} -#endif - -void DirBrowser::fillRoot () { - -#ifdef WIN32 - volumes = GetLogicalDrives (); - for (int i=0; i<32; i++) - if ((volumes >> i) & 1) - addRoot ('A'+i); - // since sigc++ is not thread safe, we have to use the glib function - g_timeout_add (CHECKTIME, _updateVolumes, this); -#else - Gtk::TreeModel::Row rootRow = *(dirTreeModel->append()); - rootRow[dtColumns.filename] = "/"; - rootRow[dtColumns.dirname] = "/"; - Gtk::TreeModel::Row childRow = *(dirTreeModel->append(rootRow.children())); - childRow[dtColumns.filename] = "foo"; -#endif -} - -void DirBrowser::row_expanded (const Gtk::TreeModel::iterator& iter, const Gtk::TreeModel::Path& path) { - - expandSuccess = false; - - int todel = iter->children().size(); - - std::vector subDirs; +#define CHECKTIME 5000 +extern Glib::ustring argv0; + +DirBrowser::DirBrowser () { + + dirtree = new Gtk::TreeView(); + scrolledwindow4 = new Gtk::ScrolledWindow(); + +// dirtree->set_flags(Gtk::CAN_FOCUS); + dirtree->set_headers_visible(false); + dirtree->set_rules_hint(false); + dirtree->set_reorderable(false); + dirtree->set_enable_search(false); + scrolledwindow4->set_flags(Gtk::CAN_FOCUS); + scrolledwindow4->set_border_width(2); + scrolledwindow4->set_shadow_type(Gtk::SHADOW_NONE); + scrolledwindow4->set_policy(Gtk::POLICY_ALWAYS, Gtk::POLICY_ALWAYS); + scrolledwindow4->property_window_placement().set_value(Gtk::CORNER_TOP_LEFT); + scrolledwindow4->add(*dirtree); + + pack_start (*scrolledwindow4); + dirtree->show (); + scrolledwindow4->show (); +} + +void DirBrowser::fillDirTree () { + + openfolder = safe_create_from_file (argv0+"/images/folder_open.png"); + closedfolder = safe_create_from_file (argv0+"/images/folder.png"); + icdrom = safe_create_from_file (argv0+"/images/cdrom.png"); + ifloppy = safe_create_from_file (argv0+"/images/floppy.png"); + ihdd = safe_create_from_file (argv0+"/images/hdd.png"); + iremovable = safe_create_from_file (argv0+"/images/usbpendrive.png"); + inetwork = safe_create_from_file (argv0+"/images/network.png"); + + //Create the Tree model: + dirTreeModel = Gtk::TreeStore::create(dtColumns); + dirtree->set_model (dirTreeModel); + + fillRoot (); + + Gtk::CellRendererPixbuf* render_pb = new Gtk::CellRendererPixbuf (); + tvc.pack_start (*render_pb, false); + tvc.add_attribute(*render_pb, "pixbuf-expander-closed", 1); + tvc.add_attribute(*render_pb, "pixbuf", 1); + tvc.add_attribute(*render_pb, "pixbuf-expander-open", 0); + tvc.pack_start (crt); + tvc.add_attribute(crt, "text", 2); + + crt.property_ypad() = 0; + render_pb->property_ypad() = 0; + + dirtree->append_column(tvc); + + dirtree->signal_row_expanded().connect(sigc::mem_fun(*this, &DirBrowser::row_expanded)); + dirtree->signal_row_activated().connect(sigc::mem_fun(*this, &DirBrowser::row_activated)); +} + +#ifdef WIN32 +void DirBrowser::addRoot (char letter) { + + char volume[4]; + volume[0] = letter; + strcpy (volume+1, ":\\"); + + Gtk::TreeModel::iterator root = dirTreeModel->append(); + root->set_value (dtColumns.filename, Glib::ustring(volume)); + root->set_value (dtColumns.dirname, Glib::ustring(volume)); + + int type = GetDriveType (volume); + if (type==DRIVE_CDROM) { + root->set_value (0, icdrom); + root->set_value (1, icdrom); + } + else if (type==DRIVE_REMOVABLE) { + if (letter-'A'<2) { + root->set_value (0, ifloppy); + root->set_value (1, ifloppy); + } + else { + root->set_value (0, iremovable); + root->set_value (1, iremovable); + } + } + else if (type==DRIVE_REMOTE) { + root->set_value (0, inetwork); + root->set_value (1, inetwork); + } + else if (type==DRIVE_FIXED) { + root->set_value (0, ihdd); + root->set_value (1, ihdd); + } + + Gtk::TreeModel::iterator child = dirTreeModel->append (root->children()); + child->set_value (dtColumns.filename, Glib::ustring("foo")); +} + +void DirBrowser::updateDirTreeRoot () { + + for (Gtk::TreeModel::iterator i=dirTreeModel->children().begin(); i!=dirTreeModel->children().end(); i++) + updateDirTree (i); +} + +void DirBrowser::updateDirTree (const Gtk::TreeModel::iterator& iter) { + + if (dirtree->row_expanded (dirTreeModel->get_path (iter))) { + updateDir (iter); + for (Gtk::TreeModel::iterator i=iter->children().begin(); i!=iter->children().end(); i++) + updateDirTree (i); + } +} + +void DirBrowser::updateVolumes () { + + int nvolumes = GetLogicalDrives (); + if (nvolumes!=volumes) { + for (int i=0; i<32; i++) + if (((volumes >> i) & 1) && !((nvolumes >> i) & 1)) { // volume i has been deleted + for (Gtk::TreeModel::iterator iter = dirTreeModel->children().begin(); iter!=dirTreeModel->children().end(); iter++) + if (iter->get_value (dtColumns.filename).c_str()[0]-'A' == i) { + dirTreeModel->erase (iter); + break; + } + } + else if (!((volumes >> i) & 1) && ((nvolumes >> i) & 1)) + addRoot ('A'+i); // volume i has been added + volumes = nvolumes; + } +} + +int _updateVolumes (void* br) { + + gdk_threads_enter (); + ((DirBrowser*)br)->updateVolumes (); + gdk_threads_leave (); + return 1; +} +int _updateDirTree (void* br) { + + gdk_threads_enter (); + ((DirBrowser*)br)->updateDirTreeRoot (); + gdk_threads_leave (); + return 0; +} + +void DirBrowser::winDirChanged () { + + g_idle_add (_updateDirTree, this); +} +#endif + +void DirBrowser::fillRoot () { + +#ifdef WIN32 + volumes = GetLogicalDrives (); + for (int i=0; i<32; i++) + if ((volumes >> i) & 1) + addRoot ('A'+i); + // since sigc++ is not thread safe, we have to use the glib function + g_timeout_add (CHECKTIME, _updateVolumes, this); +#else + Gtk::TreeModel::Row rootRow = *(dirTreeModel->append()); + rootRow[dtColumns.filename] = "/"; + rootRow[dtColumns.dirname] = "/"; + Gtk::TreeModel::Row childRow = *(dirTreeModel->append(rootRow.children())); + childRow[dtColumns.filename] = "foo"; +#endif +} + +void DirBrowser::row_expanded (const Gtk::TreeModel::iterator& iter, const Gtk::TreeModel::Path& path) { + + expandSuccess = false; + + int todel = iter->children().size(); + + std::vector subDirs; Glib::RefPtr dir = Gio::File::create_for_path (iter->get_value (dtColumns.dirname)); - safe_build_subdir_list (dir, subDirs, options.fbShowHidden); + safe_build_subdir_list (dir, subDirs, options.fbShowHidden); if (subDirs.size() == 0) dirtree->collapse_row (path); else { - std::sort (subDirs.begin(), subDirs.end()); - for (int i=0; ierase (iter->children().begin()); - expandSuccess = true; - } -#ifdef _WIN32 - Glib::RefPtr monitor = Glib::RefPtr(new WinDirMonitor (iter->get_value (dtColumns.dirname), this)); - iter->set_value (dtColumns.monitor, monitor); -#elif defined __APPLE__ - printf("TODO fix dir->monitor_directory () for OSX\n"); -#else - Glib::RefPtr monitor = dir->monitor_directory (); - iter->set_value (dtColumns.monitor, monitor); - monitor->signal_changed().connect (sigc::bind(sigc::mem_fun(*this, &DirBrowser::file_changed), iter, dir->get_parse_name())); -#endif -} - -void DirBrowser::updateDir (const Gtk::TreeModel::iterator& iter) { - - // first test if some files are deleted - bool change = true; - while (change) { - change = false; - for (Gtk::TreeModel::iterator it=iter->children().begin(); it!=iter->children().end(); it++) - if (!Glib::file_test (it->get_value (dtColumns.dirname), Glib::FILE_TEST_EXISTS) - || !Glib::file_test (it->get_value (dtColumns.dirname), Glib::FILE_TEST_IS_DIR)) { - dirTreeModel->erase (it); - change = true; - break; - } - } - // test if new files are created - std::vector subDirs; - Glib::RefPtr dir = Gio::File::create_for_path (iter->get_value (dtColumns.dirname)); - safe_build_subdir_list (dir, subDirs, options.fbShowHidden); - - for (int i=0; ichildren().begin(); it!=iter->children().end() && !found ; it++) - found = (it->get_value (dtColumns.filename)==subDirs[i]); + std::sort (subDirs.begin(), subDirs.end()); + for (int i=0; ierase (iter->children().begin()); + expandSuccess = true; + } +#ifdef _WIN32 + Glib::RefPtr monitor = Glib::RefPtr(new WinDirMonitor (iter->get_value (dtColumns.dirname), this)); + iter->set_value (dtColumns.monitor, monitor); +#elif defined __APPLE__ + printf("TODO fix dir->monitor_directory () for OSX\n"); +#else + Glib::RefPtr monitor = dir->monitor_directory (); + iter->set_value (dtColumns.monitor, monitor); + monitor->signal_changed().connect (sigc::bind(sigc::mem_fun(*this, &DirBrowser::file_changed), iter, dir->get_parse_name())); +#endif +} + +void DirBrowser::updateDir (const Gtk::TreeModel::iterator& iter) { + + // first test if some files are deleted + bool change = true; + while (change) { + change = false; + for (Gtk::TreeModel::iterator it=iter->children().begin(); it!=iter->children().end(); it++) + if (!Glib::file_test (it->get_value (dtColumns.dirname), Glib::FILE_TEST_EXISTS) + || !Glib::file_test (it->get_value (dtColumns.dirname), Glib::FILE_TEST_IS_DIR)) { + dirTreeModel->erase (it); + change = true; + break; + } + } + // test if new files are created + std::vector subDirs; + Glib::RefPtr dir = Gio::File::create_for_path (iter->get_value (dtColumns.dirname)); + safe_build_subdir_list (dir, subDirs, options.fbShowHidden); + + for (int i=0; ichildren().begin(); it!=iter->children().end() && !found ; it++) + found = (it->get_value (dtColumns.filename)==subDirs[i]); + + if (!found) + addDir (iter, subDirs[i]); + } +} + +void DirBrowser::addDir (const Gtk::TreeModel::iterator& iter, const Glib::ustring& dirname) { + + Gtk::TreeModel::iterator child = dirTreeModel->append(iter->children()); + child->set_value (dtColumns.filename, dirname); + child->set_value (0, openfolder); + child->set_value (1, closedfolder); + Glib::ustring fullname = Glib::build_filename (iter->get_value (dtColumns.dirname), dirname); + child->set_value (dtColumns.dirname, fullname); + Glib::RefPtr f = Gio::File::create_for_path (fullname); + Gtk::TreeModel::iterator fooRow = dirTreeModel->append(child->children()); + fooRow->set_value (dtColumns.filename, Glib::ustring("foo")); +} + +void DirBrowser::row_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column) { + + Glib::ustring dname = dirTreeModel->get_iter (path)->get_value (dtColumns.dirname); + if (Glib::file_test (dname, Glib::FILE_TEST_IS_DIR)) + for (int i=0; idirSelected (dname); +} + +Gtk::TreePath DirBrowser::expandToDir (const Glib::ustring& absDirPath) { + + Gtk::TreeModel::Path path; + path.append_index(0); + + int end = 0; + int beg = 0; + char* dcpy = strdup (absDirPath.c_str()); + char* dir = strtok (dcpy, "/\\"); + int count = 0; + expandSuccess = true; + +#ifndef _WIN32 + Gtk::TreeModel::iterator j = dirTreeModel->get_iter (path); + path.up (); + path.append_index (0); + row_expanded(j, path); + path.append_index (0); +#endif + + while (dir) { + Glib::ustring dirstr = dir; +#ifdef _WIN32 + if (count==0) + dirstr = dirstr + "\\"; +#endif + Gtk::TreeModel::iterator i = dirTreeModel->get_iter (path); + int ix = 0; + while (i && expandSuccess) { + Gtk::TreeModel::Row crow = *i; + Glib::ustring str =crow[dtColumns.filename]; +#ifdef _WIN32 + if (str.casefold()==dirstr.casefold()) { +#else + if (str==dirstr) { +#endif + path.up (); + path.append_index (ix); + row_expanded(i, path); + path.append_index (0); + break; + } + ix++; + i++; + } + count++; + dir = strtok(NULL, "/\\"); + } + + free(dcpy); + + path.up (); + dirtree->expand_to_path (path); + + return path; +} + +void DirBrowser::open (const Glib::ustring& dirname, const Glib::ustring& fileName) { + + dirtree->collapse_all (); + + Glib::ustring absDirPath = Gio::File::create_for_path(dirname)->get_parse_name (); + Gtk::TreePath path = expandToDir (absDirPath); + + if (expandSuccess) { + dirtree->scroll_to_row (path); + dirtree->get_selection()->select (path); + for (int i=0; idirSelected (absDirPath, Glib::build_filename (absDirPath, fileName)); + } +} + +void DirBrowser::file_changed (const Glib::RefPtr& file, const Glib::RefPtr& other_file, Gio::FileMonitorEvent event_type, const Gtk::TreeModel::iterator& iter, const Glib::ustring& dirName) { + + if (!file || !Glib::file_test (dirName, Glib::FILE_TEST_IS_DIR) || event_type==Gio::FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED) + return; + + gdk_threads_enter(); + updateDir (iter); + gdk_threads_leave(); +} + +void DirBrowser::selectDir (Glib::ustring dir) { + + open (dir, ""); +} - if (!found) - addDir (iter, subDirs[i]); - } -} - -void DirBrowser::addDir (const Gtk::TreeModel::iterator& iter, const Glib::ustring& dirname) { - - Gtk::TreeModel::iterator child = dirTreeModel->append(iter->children()); - child->set_value (dtColumns.filename, dirname); - child->set_value (0, openfolder); - child->set_value (1, closedfolder); - Glib::ustring fullname = Glib::build_filename (iter->get_value (dtColumns.dirname), dirname); - child->set_value (dtColumns.dirname, fullname); - Glib::RefPtr f = Gio::File::create_for_path (fullname); - Gtk::TreeModel::iterator fooRow = dirTreeModel->append(child->children()); - fooRow->set_value (dtColumns.filename, Glib::ustring("foo")); -} - -void DirBrowser::row_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column) { - - Glib::ustring dname = dirTreeModel->get_iter (path)->get_value (dtColumns.dirname); - if (Glib::file_test (dname, Glib::FILE_TEST_IS_DIR)) - for (int i=0; idirSelected (dname); -} - -Gtk::TreePath DirBrowser::expandToDir (const Glib::ustring& absDirPath) { - - Gtk::TreeModel::Path path; - path.append_index(0); - - int end = 0; - int beg = 0; - char* dcpy = strdup (absDirPath.c_str()); - char* dir = strtok (dcpy, "/\\"); - int count = 0; - expandSuccess = true; - -#ifndef _WIN32 - Gtk::TreeModel::iterator j = dirTreeModel->get_iter (path); - path.up (); - path.append_index (0); - row_expanded(j, path); - path.append_index (0); -#endif - - while (dir) { - Glib::ustring dirstr = dir; -#ifdef _WIN32 - if (count==0) - dirstr = dirstr + "\\"; -#endif - Gtk::TreeModel::iterator i = dirTreeModel->get_iter (path); - int ix = 0; - while (i && expandSuccess) { - Gtk::TreeModel::Row crow = *i; - Glib::ustring str =crow[dtColumns.filename]; -#ifdef _WIN32 - if (str.casefold()==dirstr.casefold()) { -#else - if (str==dirstr) { -#endif - path.up (); - path.append_index (ix); - row_expanded(i, path); - path.append_index (0); - break; - } - ix++; - i++; - } - count++; - dir = strtok(NULL, "/\\"); - } - - free(dcpy); - - path.up (); - dirtree->expand_to_path (path); - - return path; -} - -void DirBrowser::open (const Glib::ustring& dirname, const Glib::ustring& fileName) { - - dirtree->collapse_all (); - - Glib::ustring absDirPath = Gio::File::create_for_path(dirname)->get_parse_name (); - Gtk::TreePath path = expandToDir (absDirPath); - - if (expandSuccess) { - dirtree->scroll_to_row (path); - dirtree->get_selection()->select (path); - for (int i=0; idirSelected (absDirPath, Glib::build_filename (absDirPath, fileName)); - } -} - -void DirBrowser::file_changed (const Glib::RefPtr& file, const Glib::RefPtr& other_file, Gio::FileMonitorEvent event_type, const Gtk::TreeModel::iterator& iter, const Glib::ustring& dirName) { - - if (!file || !Glib::file_test (dirName, Glib::FILE_TEST_IS_DIR) || event_type==Gio::FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED) - return; - - gdk_threads_enter(); - updateDir (iter); - gdk_threads_leave(); -} - -void DirBrowser::selectDir (Glib::ustring dir) { - - open (dir, ""); -} - diff --git a/rtgui/dirbrowser.h b/rtgui/dirbrowser.h index 3c9ba970b..b71e2dcd3 100644 --- a/rtgui/dirbrowser.h +++ b/rtgui/dirbrowser.h @@ -1,103 +1,103 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _DIRBROWSER_ -#define _DIRBROWSER_ - -#include -#include -#ifdef _WIN32 -#include -#endif -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _DIRBROWSER_ +#define _DIRBROWSER_ + +#include +#include +#ifdef _WIN32 +#include +#endif +#include #include - -class DirBrowser : public Gtk::VBox, public DirBrowserRemoteInterface -#ifdef _WIN32 - , public WinDirChangeListener -#endif - { - - private: - - Glib::RefPtr dirTreeModel; - - struct DirTreeColumns : public Gtk::TreeModelColumnRecord { - public: - Gtk::TreeModelColumn filename; - Gtk::TreeModelColumn > icon1; - Gtk::TreeModelColumn > icon2; - Gtk::TreeModelColumn dirname; - #ifdef _WIN32 - Gtk::TreeModelColumn > monitor; - #else - Gtk::TreeModelColumn > monitor; - #endif - - DirTreeColumns() { add(icon1); add(icon2); add(filename); add(dirname); add(monitor); } - }; - - Gtk::TreeViewColumn tvc; - Gtk::CellRendererText crt; - Gtk::CellRendererPixbuf crb; - DirTreeColumns dtColumns; - - Gtk::TreeView *dirtree; - Gtk::ScrolledWindow *scrolledwindow4; - std::vector dllisteners; - - void fillRoot (); - - Glib::RefPtr openfolder; - Glib::RefPtr closedfolder; - Glib::RefPtr icdrom; - Glib::RefPtr ifloppy; - Glib::RefPtr ihdd; - Glib::RefPtr inetwork; - Glib::RefPtr iremovable; - - bool expandSuccess; - - #ifdef WIN32 - int volumes; - public: - void updateVolumes (); - void updateDirTree (const Gtk::TreeModel::iterator& iter); - void updateDirTreeRoot (); - void winDirChanged (); - private: - void addRoot (char letter); - #endif - void addDir (const Gtk::TreeModel::iterator& iter, const Glib::ustring& dirname); - Gtk::TreePath expandToDir (const Glib::ustring& dirName); - void updateDir (const Gtk::TreeModel::iterator& iter); + +class DirBrowser : public Gtk::VBox, public DirBrowserRemoteInterface +#ifdef _WIN32 + , public WinDirChangeListener +#endif + { + + private: + + Glib::RefPtr dirTreeModel; + + struct DirTreeColumns : public Gtk::TreeModelColumnRecord { + public: + Gtk::TreeModelColumn filename; + Gtk::TreeModelColumn > icon1; + Gtk::TreeModelColumn > icon2; + Gtk::TreeModelColumn dirname; + #ifdef _WIN32 + Gtk::TreeModelColumn > monitor; + #else + Gtk::TreeModelColumn > monitor; + #endif + + DirTreeColumns() { add(icon1); add(icon2); add(filename); add(dirname); add(monitor); } + }; + + Gtk::TreeViewColumn tvc; + Gtk::CellRendererText crt; + Gtk::CellRendererPixbuf crb; + DirTreeColumns dtColumns; + + Gtk::TreeView *dirtree; + Gtk::ScrolledWindow *scrolledwindow4; + std::vector dllisteners; + + void fillRoot (); + + Glib::RefPtr openfolder; + Glib::RefPtr closedfolder; + Glib::RefPtr icdrom; + Glib::RefPtr ifloppy; + Glib::RefPtr ihdd; + Glib::RefPtr inetwork; + Glib::RefPtr iremovable; + + bool expandSuccess; + + #ifdef WIN32 + int volumes; + public: + void updateVolumes (); + void updateDirTree (const Gtk::TreeModel::iterator& iter); + void updateDirTreeRoot (); + void winDirChanged (); + private: + void addRoot (char letter); + #endif + void addDir (const Gtk::TreeModel::iterator& iter, const Glib::ustring& dirname); + Gtk::TreePath expandToDir (const Glib::ustring& dirName); + void updateDir (const Gtk::TreeModel::iterator& iter); void notifyListeners (); - - public: - DirBrowser (); - - void fillDirTree (); - void row_expanded (const Gtk::TreeModel::iterator& iter, const Gtk::TreeModel::Path& path); - void row_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column); - void file_changed (const Glib::RefPtr& file, const Glib::RefPtr& other_file, Gio::FileMonitorEvent event_type, const Gtk::TreeModel::iterator& iter, const Glib::ustring& dirName); - void open (const Glib::ustring& dirName, const Glib::ustring& fileName=""); // goes to dir "dirName" and selects file "fileName" + + public: + DirBrowser (); + + void fillDirTree (); + void row_expanded (const Gtk::TreeModel::iterator& iter, const Gtk::TreeModel::Path& path); + void row_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column); + void file_changed (const Glib::RefPtr& file, const Glib::RefPtr& other_file, Gio::FileMonitorEvent event_type, const Gtk::TreeModel::iterator& iter, const Glib::ustring& dirName); + void open (const Glib::ustring& dirName, const Glib::ustring& fileName=""); // goes to dir "dirName" and selects file "fileName" void addDirSelectionListener (DirSelectionListener* l) { dllisteners.push_back (l); } - void selectDir (Glib::ustring dir); -}; - -#endif + void selectDir (Glib::ustring dir); +}; + +#endif diff --git a/rtgui/dirbrowserremoteinterface.h b/rtgui/dirbrowserremoteinterface.h index 7e435a93f..e5ae9c847 100644 --- a/rtgui/dirbrowserremoteinterface.h +++ b/rtgui/dirbrowserremoteinterface.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _DIRBROWSERREMOTEINTERFACE_ #define _DIRBROWSERREMOTEINTERFACE_ diff --git a/rtgui/dirselectionlistener.h b/rtgui/dirselectionlistener.h index b68238727..6dd09a3a6 100644 --- a/rtgui/dirselectionlistener.h +++ b/rtgui/dirselectionlistener.h @@ -1,30 +1,30 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _DIRSELECTIONLISTENER_ #define _DIRSELECTIONLISTENER_ #include -class DirSelectionListener { - - public: - virtual void dirSelected (const Glib::ustring& dirname, const Glib::ustring& openfile="") {} +class DirSelectionListener { + + public: + virtual void dirSelected (const Glib::ustring& dirname, const Glib::ustring& openfile="") {} }; #endif diff --git a/rtgui/distortion.cc b/rtgui/distortion.cc index e16711181..25ba08a05 100644 --- a/rtgui/distortion.cc +++ b/rtgui/distortion.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include diff --git a/rtgui/distortion.h b/rtgui/distortion.h index c4160bf94..dc1f927ef 100644 --- a/rtgui/distortion.h +++ b/rtgui/distortion.h @@ -1,45 +1,45 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _DISTORTION_H_ -#define _DISTORTION_H_ - -#include -#include -#include - -class Distortion : public Gtk::VBox, public AdjusterListener, public ToolPanel { - - protected: - Adjuster* distor; - bool distAdd; - - public: - - Distortion (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); - void setBatchMode (bool batchMode); - - void adjusterChanged (Adjuster* a, double newval); - void setAdjusterBehavior (bool bvadd); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _DISTORTION_H_ +#define _DISTORTION_H_ + +#include +#include +#include + +class Distortion : public Gtk::VBox, public AdjusterListener, public ToolPanel { + + protected: + Adjuster* distor; + bool distAdd; + + public: + + Distortion (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); + void setBatchMode (bool batchMode); + + void adjusterChanged (Adjuster* a, double newval); + void setAdjusterBehavior (bool bvadd); +}; + +#endif diff --git a/rtgui/editedstate.h b/rtgui/editedstate.h index 1409f1237..003c2f29f 100644 --- a/rtgui/editedstate.h +++ b/rtgui/editedstate.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _EDITEDSTATE_ #define _EDITEDSTATE_ diff --git a/rtgui/editenums.h b/rtgui/editenums.h index adfc1e2a5..bfccf3e65 100644 --- a/rtgui/editenums.h +++ b/rtgui/editenums.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _EDITENUMS_ #define _EDITENUMS_ diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index aba24a1e5..ef0673f8c 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -1,28 +1,28 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include #include #include #include -#include +#include using namespace rtengine::procparams; @@ -63,58 +63,58 @@ EditorPanel::EditorPanel (Thumbnail* tmb, rtengine::InitialImage* isrc) : parent // build the middle of the screen Gtk::VBox* editbox = Gtk::manage (new Gtk::VBox ()); - info = Gtk::manage (new Gtk::ToggleButton ()); - Gtk::Image* infoimg = Gtk::manage (new Gtk::Image (argv0+"/images/info.png")); - info->add (*infoimg); - info->set_relief(Gtk::RELIEF_NONE); - info->set_tooltip_text (M("MAIN_TOOLTIP_QINFO")); + info = Gtk::manage (new Gtk::ToggleButton ()); + Gtk::Image* infoimg = Gtk::manage (new Gtk::Image (argv0+"/images/info.png")); + info->add (*infoimg); + info->set_relief(Gtk::RELIEF_NONE); + info->set_tooltip_text (M("MAIN_TOOLTIP_QINFO")); + + beforeAfter = Gtk::manage (new Gtk::ToggleButton (M("MAIN_TOGGLE_BEFORE_AFTER"))); + beforeAfter->set_tooltip_text (M("MAIN_TOOLTIP_TOGGLE")); - beforeAfter = Gtk::manage (new Gtk::ToggleButton (M("MAIN_TOGGLE_BEFORE_AFTER"))); - beforeAfter->set_tooltip_text (M("MAIN_TOOLTIP_TOGGLE")); - Gtk::VSeparator* vsept = Gtk::manage (new Gtk::VSeparator ()); Gtk::VSeparator* vsepz = Gtk::manage (new Gtk::VSeparator ()); - Gtk::VSeparator* vsepi = Gtk::manage (new Gtk::VSeparator ()); - Gtk::VSeparator* vseph = Gtk::manage (new Gtk::VSeparator ()); - - hidehp = Gtk::manage (new Gtk::ToggleButton ()); - Gtk::Label* hidehpLabel = Gtk::manage (new Gtk::Label ()); - hidehpLabel->set_markup ("H"); - Gtk::Image* hpimg = Gtk::manage (new Gtk::Image (argv0+"/images/left.png")); - Gtk::HBox* hidehpBox = Gtk::manage (new Gtk::HBox ()); - hidehpBox->pack_start (*hpimg, Gtk::PACK_SHRINK, 2); - hidehpBox->pack_start (*hidehpLabel, Gtk::PACK_SHRINK, 2); - hidehp->add (*hidehpBox); - hidehp->set_relief(Gtk::RELIEF_NONE); - hidehp->set_active (options.showHistory); - hidehp->set_tooltip_text (M("MAIN_TOOLTIP_HIDEHP")); - + Gtk::VSeparator* vsepi = Gtk::manage (new Gtk::VSeparator ()); + Gtk::VSeparator* vseph = Gtk::manage (new Gtk::VSeparator ()); + + hidehp = Gtk::manage (new Gtk::ToggleButton ()); + Gtk::Label* hidehpLabel = Gtk::manage (new Gtk::Label ()); + hidehpLabel->set_markup ("H"); + Gtk::Image* hpimg = Gtk::manage (new Gtk::Image (argv0+"/images/left.png")); + Gtk::HBox* hidehpBox = Gtk::manage (new Gtk::HBox ()); + hidehpBox->pack_start (*hpimg, Gtk::PACK_SHRINK, 2); + hidehpBox->pack_start (*hidehpLabel, Gtk::PACK_SHRINK, 2); + hidehp->add (*hidehpBox); + hidehp->set_relief(Gtk::RELIEF_NONE); + hidehp->set_active (options.showHistory); + hidehp->set_tooltip_text (M("MAIN_TOOLTIP_HIDEHP")); + Gtk::VSeparator* vsepcl = Gtk::manage (new Gtk::VSeparator ()); Gtk::VSeparator* vsepz2 = Gtk::manage (new Gtk::VSeparator ()); iarea = new ImageAreaPanel (); - Gtk::HBox* toolBarPanel = Gtk::manage (new Gtk::HBox ()); - toolBarPanel->pack_start (*hidehp, Gtk::PACK_SHRINK, 1); - toolBarPanel->pack_start (*vseph, Gtk::PACK_SHRINK, 2); - toolBarPanel->pack_start (*info, Gtk::PACK_SHRINK, 1); - toolBarPanel->pack_start (*beforeAfter, Gtk::PACK_SHRINK, 1); - toolBarPanel->pack_start (*vsepi, Gtk::PACK_SHRINK, 2); + Gtk::HBox* toolBarPanel = Gtk::manage (new Gtk::HBox ()); + toolBarPanel->pack_start (*hidehp, Gtk::PACK_SHRINK, 1); + toolBarPanel->pack_start (*vseph, Gtk::PACK_SHRINK, 2); + toolBarPanel->pack_start (*info, Gtk::PACK_SHRINK, 1); + toolBarPanel->pack_start (*beforeAfter, Gtk::PACK_SHRINK, 1); + toolBarPanel->pack_start (*vsepi, Gtk::PACK_SHRINK, 2); toolBarPanel->pack_start (*tpc->getToolBar(), Gtk::PACK_SHRINK, 1); toolBarPanel->pack_start (*vsept, Gtk::PACK_SHRINK, 2); - toolBarPanel->pack_end (*tpc->coarse, Gtk::PACK_SHRINK, 4); - toolBarPanel->pack_end (*vsepcl, Gtk::PACK_SHRINK, 4); - toolBarPanel->pack_end (*iarea->imageArea->indClippedPanel, Gtk::PACK_SHRINK, 0); + toolBarPanel->pack_end (*tpc->coarse, Gtk::PACK_SHRINK, 4); + toolBarPanel->pack_end (*vsepcl, Gtk::PACK_SHRINK, 4); + toolBarPanel->pack_end (*iarea->imageArea->indClippedPanel, Gtk::PACK_SHRINK, 0); toolBarPanel->pack_end (*vsepz, Gtk::PACK_SHRINK, 2); - + afterBox = Gtk::manage (new Gtk::VBox ()); afterBox->pack_start (*iarea); beforeAfterBox = Gtk::manage (new Gtk::HBox()); beforeAfterBox->pack_start (*afterBox); - editbox->pack_start (*toolBarPanel, Gtk::PACK_SHRINK); + editbox->pack_start (*toolBarPanel, Gtk::PACK_SHRINK); editbox->pack_start (*beforeAfterBox); // build right side panel @@ -193,17 +193,17 @@ EditorPanel::EditorPanel (Thumbnail* tmb, rtengine::InitialImage* isrc) : parent iarea->imageArea->setPointerMotionListener (navigator); iarea->imageArea->setImageAreaToolListener (tpc); -// initialize components - info->set_active (options.showInfo); - tpc->readOptions (); +// initialize components + info->set_active (options.showInfo); + tpc->readOptions (); // connect event handlers - info->signal_toggled().connect( sigc::mem_fun(*this, &EditorPanel::info_toggled) ); - beforeAfter->signal_toggled().connect( sigc::mem_fun(*this, &EditorPanel::beforeAfterToggled) ); - hidehp->signal_toggled().connect( sigc::mem_fun(*this, &EditorPanel::hideHistoryActivated) ); - saveimgas->signal_pressed().connect( sigc::mem_fun(*this, &EditorPanel::saveAsPressed) ); - queueimg->signal_pressed().connect( sigc::mem_fun(*this, &EditorPanel::queueImgPressed) ); - sendtogimp->signal_pressed().connect( sigc::mem_fun(*this, &EditorPanel::sendToGimpPressed) ); + info->signal_toggled().connect( sigc::mem_fun(*this, &EditorPanel::info_toggled) ); + beforeAfter->signal_toggled().connect( sigc::mem_fun(*this, &EditorPanel::beforeAfterToggled) ); + hidehp->signal_toggled().connect( sigc::mem_fun(*this, &EditorPanel::hideHistoryActivated) ); + saveimgas->signal_pressed().connect( sigc::mem_fun(*this, &EditorPanel::saveAsPressed) ); + queueimg->signal_pressed().connect( sigc::mem_fun(*this, &EditorPanel::queueImgPressed) ); + sendtogimp->signal_pressed().connect( sigc::mem_fun(*this, &EditorPanel::sendToGimpPressed) ); // open image open (tmb, isrc); @@ -223,9 +223,9 @@ EditorPanel::~EditorPanel () { delete beforeIarea; if (ipc) - ipc->setPreviewImageListener (NULL); + ipc->setPreviewImageListener (NULL); if (beforeIpc) - beforeIpc->setPreviewImageListener (NULL); + beforeIpc->setPreviewImageListener (NULL); delete previewHandler; delete beforePreviewHandler; @@ -256,88 +256,88 @@ void EditorPanel::on_realize () { rtengine::InitialImage* EditorPanel::loadImage (Thumbnail* tmb) { - // try to load the image - Glib::ustring filename = tmb->getFileName (); - int error; -// InitialImage* isrc = InitialImage::load (filename, tmb->getType()==FT_Raw, error, this); - ProgressDialog* pdload = new ProgressDialog (M("PROGRESSDLG_LOADING")); - rtengine::InitialImage* isrc; - pdload->setFunc (sigc::bind(sigc::ptr_fun(&rtengine::InitialImage::load), filename, tmb->getType()==FT_Raw, &error, pdload->getProgressListener()), &isrc); - pdload->start (); - delete pdload; - + // try to load the image + Glib::ustring filename = tmb->getFileName (); + int error; +// InitialImage* isrc = InitialImage::load (filename, tmb->getType()==FT_Raw, error, this); + ProgressDialog* pdload = new ProgressDialog (M("PROGRESSDLG_LOADING")); + rtengine::InitialImage* isrc; + pdload->setFunc (sigc::bind(sigc::ptr_fun(&rtengine::InitialImage::load), filename, tmb->getType()==FT_Raw, &error, pdload->getProgressListener()), &isrc); + pdload->start (); + delete pdload; + if (error) return NULL; else - return isrc; + return isrc; } void EditorPanel::open (Thumbnail* tmb, rtengine::InitialImage* isrc) { - // initialize everything - openThm = tmb; - openThm->increaseRef (); + // initialize everything + openThm = tmb; + openThm->increaseRef (); previewHandler = new PreviewHandler (); - this->isrc = isrc; - ipc = rtengine::StagedImageProcessor::create (isrc); - ipc->setProgressListener (this); - ipc->setPreviewImageListener (previewHandler); - ipc->setPreviewScale (10); - tpc->initImage (ipc, tmb->getType()==FT_Raw); - ipc->setHistogramListener (this); - -// iarea->fitZoom (); // tell to the editorPanel that the next image has to be fitted to the screen + this->isrc = isrc; + ipc = rtengine::StagedImageProcessor::create (isrc); + ipc->setProgressListener (this); + ipc->setPreviewImageListener (previewHandler); + ipc->setPreviewScale (10); + tpc->initImage (ipc, tmb->getType()==FT_Raw); + ipc->setHistogramListener (this); + +// iarea->fitZoom (); // tell to the editorPanel that the next image has to be fitted to the screen iarea->imageArea->setPreviewHandler (previewHandler); iarea->imageArea->setImProcCoordinator (ipc); navigator->previewWindow->setPreviewHandler (previewHandler); navigator->previewWindow->setImageArea (iarea->imageArea); - - // try to load the last saved parameters from the cache or from the pp2 file - ProcParams* ldprof = NULL; - if (openThm->hasProcParams()) { - ldprof = new ProcParams (); - *ldprof = openThm->getProcParams (); - } - // initialize profile - if (openThm->getType()!=FT_Raw) - profilep->initProfile (options.defProfImg, ldprof, NULL); - else - profilep->initProfile (options.defProfRaw, ldprof, NULL); + // try to load the last saved parameters from the cache or from the pp2 file + ProcParams* ldprof = NULL; + if (openThm->hasProcParams()) { + ldprof = new ProcParams (); + *ldprof = openThm->getProcParams (); + } + + // initialize profile + if (openThm->getType()!=FT_Raw) + profilep->initProfile (options.defProfImg, ldprof, NULL); + else + profilep->initProfile (options.defProfRaw, ldprof, NULL); openThm->addThumbnailListener (this); - info_toggled (); + info_toggled (); } void EditorPanel::close () { - saveProfile (); + saveProfile (); - // close image processor and the current thumbnail - tpc->closeImage (); // this call stops image processing - tpc->writeOptions (); + // close image processor and the current thumbnail + tpc->closeImage (); // this call stops image processing + tpc->writeOptions (); if (ipc) - rtengine::StagedImageProcessor::destroy (ipc); + rtengine::StagedImageProcessor::destroy (ipc); if (beforeIpc) - rtengine::StagedImageProcessor::destroy (beforeIpc); + rtengine::StagedImageProcessor::destroy (beforeIpc); openThm->removeThumbnailListener (this); - openThm->decreaseRef (); + openThm->decreaseRef (); } -void EditorPanel::saveProfile () { - - ProcParams params; - ipc->getParams (¶ms); - - if (options.saveParamsFile) - params.save (openThm->getFileName() + ".pp2"); - if (openThm && options.saveParamsCache) - openThm->setProcParams (params, EDITOR); -} +void EditorPanel::saveProfile () { + + ProcParams params; + ipc->getParams (¶ms); + + if (options.saveParamsFile) + params.save (openThm->getFileName() + ".pp2"); + if (openThm && options.saveParamsCache) + openThm->setProcParams (params, EDITOR); +} Glib::ustring EditorPanel::getShortName () { @@ -352,19 +352,19 @@ Glib::ustring EditorPanel::getFileName () { // TODO!!! void EditorPanel::procParamsChanged (rtengine::procparams::ProcParams* params, rtengine::ProcEvent ev, Glib::ustring descr, ParamsEdited* paramsEdited) { -// if (ev!=EvPhotoLoaded) +// if (ev!=EvPhotoLoaded) // saveLabel->set_markup (Glib::ustring("") + M("MAIN_BUTTON_SAVE") + ""); } - -struct spsparams { - bool state; - EditorPanelIdleHelper* epih; -}; - -int setprocstate (void* data) { - - gdk_threads_enter (); - spsparams* p = (spsparams*)data; + +struct spsparams { + bool state; + EditorPanelIdleHelper* epih; +}; + +int setprocstate (void* data) { + + gdk_threads_enter (); + spsparams* p = (spsparams*)data; if (p->epih->destroyed) { if (p->epih->pending == 1) @@ -377,30 +377,30 @@ int setprocstate (void* data) { } p->epih->epanel->refreshProcessingState (p->state); - p->epih->pending--; - delete p; - gdk_threads_leave (); - return 0; -} - -void EditorPanel::setProgressState (int state) { + p->epih->pending--; + delete p; + gdk_threads_leave (); + return 0; +} + +void EditorPanel::setProgressState (int state) { epih->pending++; - - spsparams* p = new spsparams; - p->state = state; - p->epih = epih; - g_idle_add (setprocstate, p); -} - -void EditorPanel::refreshProcessingState (bool state) { + + spsparams* p = new spsparams; + p->state = state; + p->epih = epih; + g_idle_add (setprocstate, p); +} + +void EditorPanel::refreshProcessingState (bool state) { // Set proc params of thumbnail. It saves it into the cache and updates the file browser. - if (ipc && openThm && !state && tpc->getChangedState()) { - rtengine::procparams::ProcParams pparams; - ipc->getParams (&pparams); + if (ipc && openThm && !state && tpc->getChangedState()) { + rtengine::procparams::ProcParams pparams; + ipc->getParams (&pparams); openThm->setProcParams (pparams, EDITOR, false); - } + } // change state of the led std::vector children = (std::vector) statusBox->get_children(); @@ -413,26 +413,26 @@ void EditorPanel::refreshProcessingState (bool state) { statusBox->pack_end (*red, Gtk::PACK_SHRINK, 4); else statusBox->pack_end (*green, Gtk::PACK_SHRINK, 4); -} - -struct errparams { - Glib::ustring descr; - EditorPanelIdleHelper* epih; -}; - -void EditorPanel::displayError (Glib::ustring descr) { - +} + +struct errparams { + Glib::ustring descr; + EditorPanelIdleHelper* epih; +}; + +void EditorPanel::displayError (Glib::ustring descr) { + if (parent) { Gtk::MessageDialog* msgd = new Gtk::MessageDialog (*parent, descr, true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); msgd->set_title (M("MAIN_MSG_CANNOTSAVE")); msgd->run (); delete msgd; } -} - -int disperror (void* data) { - - gdk_threads_enter (); +} + +int disperror (void* data) { + + gdk_threads_enter (); errparams* p = (errparams*)data; if (p->epih->destroyed) { @@ -444,48 +444,48 @@ int disperror (void* data) { gdk_threads_leave (); return 0; } - - p->epih->epanel->displayError (p->descr); + + p->epih->epanel->displayError (p->descr); p->epih->pending--; delete p; - gdk_threads_leave (); - return 0; -} - -void EditorPanel::error (Glib::ustring descr) { + gdk_threads_leave (); + return 0; +} - epih->pending++; - errparams* p = new errparams; - p->descr = descr; - p->epih = epih; - g_idle_add (disperror, p); -} - -void EditorPanel::info_toggled () { +void EditorPanel::error (Glib::ustring descr) { + + epih->pending++; + errparams* p = new errparams; + p->descr = descr; + p->epih = epih; + g_idle_add (disperror, p); +} + +void EditorPanel::info_toggled () { Glib::ustring infoString; - const rtengine::ImageMetaData* idata = ipc->getInitialImage()->getMetaData(); - if (idata && idata->hasExif()) - infoString = Glib::ustring::compose ("%1 %2\nF/%3 %4 sec\n%5: %6\n%7: %8 mm\n", - Glib::ustring(idata->getMake()), Glib::ustring(idata->getModel()), - Glib::ustring(idata->apertureToString(idata->getFNumber())), Glib::ustring(idata->shutterToString(idata->getShutterSpeed())), - M("QINFO_ISO"), idata->getISOSpeed(), - M("QINFO_FOCALLENGTH"), idata->getFocalLen()) - + Glib::ustring::compose ("%1: %2", M("QINFO_LENS"), Glib::ustring(idata->getLens())); - else - infoString = M("QINFO_NOEXIF"); + const rtengine::ImageMetaData* idata = ipc->getInitialImage()->getMetaData(); + if (idata && idata->hasExif()) + infoString = Glib::ustring::compose ("%1 %2\nF/%3 %4 sec\n%5: %6\n%7: %8 mm\n", + Glib::ustring(idata->getMake()), Glib::ustring(idata->getModel()), + Glib::ustring(idata->apertureToString(idata->getFNumber())), Glib::ustring(idata->shutterToString(idata->getShutterSpeed())), + M("QINFO_ISO"), idata->getISOSpeed(), + M("QINFO_FOCALLENGTH"), idata->getFocalLen()) + + Glib::ustring::compose ("%1: %2", M("QINFO_LENS"), Glib::ustring(idata->getLens())); + else + infoString = M("QINFO_NOEXIF"); - iarea->imageArea->setInfoText (infoString); - iarea->imageArea->infoEnabled (info->get_active ()); -} - -void EditorPanel::hideHistoryActivated () { + iarea->imageArea->setInfoText (infoString); + iarea->imageArea->infoEnabled (info->get_active ()); +} + +void EditorPanel::hideHistoryActivated () { removeIfThere (hpanedl, leftbox, false); if (hidehp->get_active()) hpanedl->pack1 (*leftbox, false, true); -} +} bool EditorPanel::handleShortcutKey (GdkEventKey* event) { @@ -529,27 +529,27 @@ void EditorPanel::procParamsChanged (Thumbnail* thm, int whoChangedIt) { rtengine::IImage16* EditorPanel::processImage () { - rtengine::procparams::ProcParams pparams; - ipc->getParams (&pparams); - rtengine::ProcessingJob* job = rtengine::ProcessingJob::create (ipc->getInitialImage(), pparams); - int err = 0; - ProgressDialog* pdproc = new ProgressDialog (M("PROGRESSDLG_PROCESSING")); - rtengine::IImage16* img; - pdproc->setFunc (sigc::bind(sigc::ptr_fun(&rtengine::processImage), job, err, pdproc->getProgressListener()), &img); - pdproc->start (); + rtengine::procparams::ProcParams pparams; + ipc->getParams (&pparams); + rtengine::ProcessingJob* job = rtengine::ProcessingJob::create (ipc->getInitialImage(), pparams); + int err = 0; + ProgressDialog* pdproc = new ProgressDialog (M("PROGRESSDLG_PROCESSING")); + rtengine::IImage16* img; + pdproc->setFunc (sigc::bind(sigc::ptr_fun(&rtengine::processImage), job, err, pdproc->getProgressListener()), &img); + pdproc->start (); delete pdproc; - return img; + return img; } BatchQueueEntry* EditorPanel::createBatchQueueEntry () { - rtengine::procparams::ProcParams pparams; - ipc->getParams (&pparams); - rtengine::ProcessingJob* job = rtengine::ProcessingJob::create (ipc->getInitialImage(), pparams); - int prevh = options.maxThumbnailHeight; - int prevw = prevh; - guint8* prev = NULL;//(guint8*) previewHandler->getImagePreview (prevw, prevh); - return new BatchQueueEntry (job, pparams, openThm->getFileName(), prev, prevw, prevh, openThm); + rtengine::procparams::ProcParams pparams; + ipc->getParams (&pparams); + rtengine::ProcessingJob* job = rtengine::ProcessingJob::create (ipc->getInitialImage(), pparams); + int prevh = options.maxThumbnailHeight; + int prevw = prevh; + guint8* prev = NULL;//(guint8*) previewHandler->getImagePreview (prevw, prevh); + return new BatchQueueEntry (job, pparams, openThm->getFileName(), prev, prevw, prevh, openThm); } int EditorPanel::saveImage (rtengine::IImage16* img, Glib::ustring& fname, SaveFormat sf, bool findNewNameIfNeeded) { @@ -560,26 +560,26 @@ int EditorPanel::saveImage (rtengine::IImage16* img, Glib::ustring& fname, SaveF while (Glib::file_test (fileName, Glib::FILE_TEST_EXISTS) && tries<1000) { fileName = Glib::ustring::compose("%1-%2.%3", fname, tries, sf.format); tries++; - } + } if (tries==1000) return -1000; } - ProgressDialog* pdsave = new ProgressDialog (M("PROGRESSDLG_SAVING")); + ProgressDialog* pdsave = new ProgressDialog (M("PROGRESSDLG_SAVING")); img->setSaveProgressListener (pdsave->getProgressListener()); - int err; - if (sf.format=="tif") - pdsave->setFunc (sigc::bind(sigc::mem_fun(img, &rtengine::IImage16::saveAsTIFF), fileName, sf.tiffBits), &err); - else if (sf.format=="png") - pdsave->setFunc (sigc::bind(sigc::mem_fun(img, &rtengine::IImage16::saveAsPNG), fileName, sf.pngCompression, sf.pngBits), &err); - else if (sf.format=="jpg") - pdsave->setFunc (sigc::bind(sigc::mem_fun(img, &rtengine::IImage16::saveAsJPEG), fileName, sf.jpegQuality), &err); - pdsave->start (); + int err; + if (sf.format=="tif") + pdsave->setFunc (sigc::bind(sigc::mem_fun(img, &rtengine::IImage16::saveAsTIFF), fileName, sf.tiffBits), &err); + else if (sf.format=="png") + pdsave->setFunc (sigc::bind(sigc::mem_fun(img, &rtengine::IImage16::saveAsPNG), fileName, sf.pngCompression, sf.pngBits), &err); + else if (sf.format=="jpg") + pdsave->setFunc (sigc::bind(sigc::mem_fun(img, &rtengine::IImage16::saveAsJPEG), fileName, sf.jpegQuality), &err); + pdsave->start (); delete pdsave; fname = fileName; - return err; + return err; } void EditorPanel::saveAsPressed () { @@ -610,22 +610,22 @@ void EditorPanel::saveAsPressed () { if (img) { fname = removeExtension (fname); err = saveImage (img, fname, sf, false); - img->free (); - if (!err) { - openThm->imageDeveloped (); - // save processing parameters, if needed - if (sf.saveParams) { - rtengine::procparams::ProcParams pparams; - ipc->getParams (&pparams); + img->free (); + if (!err) { + openThm->imageDeveloped (); + // save processing parameters, if needed + if (sf.saveParams) { + rtengine::procparams::ProcParams pparams; + ipc->getParams (&pparams); pparams.save (removeExtension (fname) + ".out.pp2"); - } + } } } - if (!img || err) { + if (!img || err) { Glib::ustring msg_ = Glib::ustring("") + fname + ": " + M("MAIN_MSG_ERRORDURINGIMAGESAVING") + "\n"; Gtk::MessageDialog msgd (*parent, msg_, true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); msgd.run (); - } + } } else { BatchQueueEntry* bqe = createBatchQueueEntry (); @@ -640,79 +640,79 @@ void EditorPanel::saveAsPressed () { void EditorPanel::queueImgPressed () { saveProfile (); - parent->addBatchQueueJob (createBatchQueueEntry ()); + parent->addBatchQueueJob (createBatchQueueEntry ()); +} + +void EditorPanel::sendToGimpPressed () { + + // develop image + rtengine::IImage16* img = processImage (); + if (img) { + // get file name base + Glib::ustring shortname = removeExtension (Glib::path_get_basename (openThm->getFileName())); + Glib::ustring dirname = Glib::get_tmp_dir (); + Glib::ustring filename = Glib::build_filename (dirname, shortname); + + SaveFormat sf; + sf.format = "tif"; + sf.tiffBits = 16; + int err = saveImage (img, filename, sf, true); + img->free (); + if (!err) { + bool success=false; + Glib::ustring cmdLine; + // start gimp + if (options.editorToSendTo==1) { +#ifdef _WIN32 + cmdLine = Glib::ustring("\"") + Glib::build_filename (Glib::build_filename(options.gimpDir,"bin"), "gimp-win-remote") + "\" gimp-2.4.exe" + " \"" + filename + "\""; +#else + cmdLine = Glib::ustring("gimp-remote ") + " \"" + filename + "\""; +#endif + success = safe_spawn_command_line_async (cmdLine); + if (!success){ +#ifdef _WIN32 + int ver = 12; + while (!success && ver) { + cmdLine = Glib::ustring("\"") + Glib::build_filename (Glib::build_filename(options.gimpDir,"bin"), Glib::ustring::compose("gimp-2.%1.exe",ver)) + "\" \"" + filename + "\""; + ver--; + success = safe_spawn_command_line_async (cmdLine); + } +#elif defined __APPLE__ + cmdLine = Glib::ustring("gimp ") + " \"" + filename + "\""; + success = safe_spawn_command_line_async (cmdLine); +#else + cmdLine = Glib::ustring("gimp ") + " \"" + filename + "\""; + success = safe_spawn_command_line_async (cmdLine); +#endif + } + } + else if (options.editorToSendTo==2) { +#ifdef __APPLE__ + cmdLine = Glib::ustring("open -a \'") + Glib::build_filename(options.psDir,"Photoshop.app\' ") + "\'" + filename + "\'"; +#else + cmdLine = Glib::ustring("\"") + Glib::build_filename(options.psDir,"Photoshop.exe") + "\" \"" + filename + "\""; +#endif + success = safe_spawn_command_line_async (cmdLine); + } + else if (options.editorToSendTo==3) { +#ifdef __APPLE__ + cmdLine = Glib::ustring("") + options.customEditorProg + filename; +#else + cmdLine = Glib::ustring("\"") + options.customEditorProg + "\" \"" + filename + "\""; +#endif + success = safe_spawn_command_line_async (cmdLine); + } + + if (!success) { + Gtk::MessageDialog* msgd = new Gtk::MessageDialog (*parent, M("MAIN_MSG_CANNOTSTARTEDITOR"), false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); + msgd->set_secondary_text (M("MAIN_MSG_CANNOTSTARTEDITOR_SECONDARY")); + msgd->set_title (M("MAIN_BUTTON_SENDTOEDITOR")); + msgd->run (); + delete msgd; + } + } + } } - -void EditorPanel::sendToGimpPressed () { - - // develop image - rtengine::IImage16* img = processImage (); - if (img) { - // get file name base - Glib::ustring shortname = removeExtension (Glib::path_get_basename (openThm->getFileName())); - Glib::ustring dirname = Glib::get_tmp_dir (); - Glib::ustring filename = Glib::build_filename (dirname, shortname); - - SaveFormat sf; - sf.format = "tif"; - sf.tiffBits = 16; - int err = saveImage (img, filename, sf, true); - img->free (); - if (!err) { - bool success=false; - Glib::ustring cmdLine; - // start gimp - if (options.editorToSendTo==1) { -#ifdef _WIN32 - cmdLine = Glib::ustring("\"") + Glib::build_filename (Glib::build_filename(options.gimpDir,"bin"), "gimp-win-remote") + "\" gimp-2.4.exe" + " \"" + filename + "\""; -#else - cmdLine = Glib::ustring("gimp-remote ") + " \"" + filename + "\""; -#endif - success = safe_spawn_command_line_async (cmdLine); - if (!success){ -#ifdef _WIN32 - int ver = 12; - while (!success && ver) { - cmdLine = Glib::ustring("\"") + Glib::build_filename (Glib::build_filename(options.gimpDir,"bin"), Glib::ustring::compose("gimp-2.%1.exe",ver)) + "\" \"" + filename + "\""; - ver--; - success = safe_spawn_command_line_async (cmdLine); - } -#elif defined __APPLE__ - cmdLine = Glib::ustring("gimp ") + " \"" + filename + "\""; - success = safe_spawn_command_line_async (cmdLine); -#else - cmdLine = Glib::ustring("gimp ") + " \"" + filename + "\""; - success = safe_spawn_command_line_async (cmdLine); -#endif - } - } - else if (options.editorToSendTo==2) { -#ifdef __APPLE__ - cmdLine = Glib::ustring("open -a \'") + Glib::build_filename(options.psDir,"Photoshop.app\' ") + "\'" + filename + "\'"; -#else - cmdLine = Glib::ustring("\"") + Glib::build_filename(options.psDir,"Photoshop.exe") + "\" \"" + filename + "\""; -#endif - success = safe_spawn_command_line_async (cmdLine); - } - else if (options.editorToSendTo==3) { -#ifdef __APPLE__ - cmdLine = Glib::ustring("") + options.customEditorProg + filename; -#else - cmdLine = Glib::ustring("\"") + options.customEditorProg + "\" \"" + filename + "\""; -#endif - success = safe_spawn_command_line_async (cmdLine); - } - - if (!success) { - Gtk::MessageDialog* msgd = new Gtk::MessageDialog (*parent, M("MAIN_MSG_CANNOTSTARTEDITOR"), false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); - msgd->set_secondary_text (M("MAIN_MSG_CANNOTSTARTEDITOR_SECONDARY")); - msgd->set_title (M("MAIN_BUTTON_SENDTOEDITOR")); - msgd->run (); - delete msgd; - } - } - } -} void EditorPanel::saveOptions () { @@ -746,7 +746,7 @@ void EditorPanel::beforeAfterToggled () { beforePreviewHandler = NULL; if (beforeIpc) rtengine::StagedImageProcessor::destroy (beforeIpc); - beforeIpc = NULL; + beforeIpc = NULL; } if (beforeAfter->get_active ()) { @@ -770,9 +770,9 @@ void EditorPanel::beforeAfterToggled () { beforePreviewHandler = new PreviewHandler (); isrc->increaseRef (); - beforeIpc = rtengine::StagedImageProcessor::create (isrc); - beforeIpc->setPreviewScale (10); - beforeIpc->setPreviewImageListener (beforePreviewHandler); + beforeIpc = rtengine::StagedImageProcessor::create (isrc); + beforeIpc->setPreviewScale (10); + beforeIpc->setPreviewImageListener (beforePreviewHandler); beforeIarea->imageArea->setPreviewHandler (beforePreviewHandler); beforeIarea->imageArea->setImProcCoordinator (beforeIpc); diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index e55c64bc7..20be3fb60 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -1,36 +1,36 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _EDITORPANEL_ -#define _EDITORPANEL_ - -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _EDITORPANEL_ +#define _EDITORPANEL_ + +#include +#include #include #include -#include -#include +#include +#include #include #include #include #include #include -#include +#include class EditorPanel; struct EditorPanelIdleHelper { @@ -40,18 +40,18 @@ struct EditorPanelIdleHelper { }; class RTWindow; -class EditorPanel : public Gtk::VBox, - public PParamsChangeListener, +class EditorPanel : public Gtk::VBox, + public PParamsChangeListener, public rtengine::ProgressListener, public ThumbnailListener, public HistoryBeforeLineListener, - public rtengine::HistogramListener { - - protected: + public rtengine::HistogramListener { + + protected: Gtk::Label *progressLabel; - Gtk::ToggleButton* info; - Gtk::ToggleButton* hidehp; - Gtk::ToggleButton* beforeAfter; + Gtk::ToggleButton* info; + Gtk::ToggleButton* hidehp; + Gtk::ToggleButton* beforeAfter; Gtk::HPaned* hpanedl; Gtk::HPaned* hpanedr; Gtk::HBox* statusBox; @@ -63,7 +63,7 @@ class EditorPanel : public Gtk::VBox, Gtk::Button* saveimgas; Gtk::Button* sendtogimp; - ImageAreaPanel* iarea; + ImageAreaPanel* iarea; PreviewHandler* previewHandler; PreviewHandler* beforePreviewHandler; // for the before-after view Navigator* navigator; @@ -81,8 +81,8 @@ class EditorPanel : public Gtk::VBox, RTWindow* parent; SaveAsDialog* saveAsDialog; - Thumbnail* openThm; - rtengine::InitialImage* isrc; + Thumbnail* openThm; + rtengine::InitialImage* isrc; rtengine::StagedImageProcessor* ipc; rtengine::StagedImageProcessor* beforeIpc; // for the before-after view @@ -94,27 +94,27 @@ class EditorPanel : public Gtk::VBox, rtengine::IImage16* processImage (); BatchQueueEntry* createBatchQueueEntry (); int saveImage (rtengine::IImage16* img, Glib::ustring& fname, SaveFormat sf, bool findNewNameIfNeeded); - - public: + + public: static rtengine::InitialImage* loadImage (Thumbnail* tmb); - + EditorPanel (Thumbnail* tmb, rtengine::InitialImage* isrc); - virtual ~EditorPanel (); + virtual ~EditorPanel (); bool beforeClosing (); void on_realize (); void setParent (RTWindow* p) { parent = p; } - // progresslistener interface - void setProgressState (int state); - void error (Glib::ustring descr); - void refreshProcessingState (bool state); // this is called by setProcessingState in the gtk thread - void displayError (Glib::ustring descr); // this is called by error in the gtk thread - - // PParamsChangeListener interface - void procParamsChanged (rtengine::procparams::ProcParams* params, rtengine::ProcEvent ev, Glib::ustring descr, ParamsEdited* paramsEdited=NULL); + // progresslistener interface + void setProgressState (int state); + void error (Glib::ustring descr); + void refreshProcessingState (bool state); // this is called by setProcessingState in the gtk thread + void displayError (Glib::ustring descr); // this is called by error in the gtk thread + + // PParamsChangeListener interface + void procParamsChanged (rtengine::procparams::ProcParams* params, rtengine::ProcEvent ev, Glib::ustring descr, ParamsEdited* paramsEdited=NULL); // thumbnaillistener interface void procParamsChanged (Thumbnail* thm, int whoChangedIt); @@ -125,9 +125,9 @@ class EditorPanel : public Gtk::VBox, // HistogramListener void histogramChanged (unsigned int* rh, unsigned int* gh, unsigned int* bh, unsigned int* lh, unsigned int* bcrgb, unsigned int* bcl); - // event handlers - void info_toggled (); - void hideHistoryActivated (); + // event handlers + void info_toggled (); + void hideHistoryActivated (); void beforeAfterToggled (); void saveAsPressed (); void queueImgPressed (); diff --git a/rtgui/exiffiltersettings.cc b/rtgui/exiffiltersettings.cc index 5a5fcd856..d0cb43be5 100644 --- a/rtgui/exiffiltersettings.cc +++ b/rtgui/exiffiltersettings.cc @@ -1,44 +1,44 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include - -ExifFilterSettings::ExifFilterSettings () { - - clear (); -} - -void ExifFilterSettings::clear () { - fnumberFrom = 100; - fnumberTo = 0; - shutterFrom = 100; - shutterTo = 0; - isoFrom = 100000000; - isoTo = 0; - focalFrom = 1e8; - focalTo = 0; - lenses.clear (); - cameras.clear (); - - filterFNumber = false; - filterShutter = false; - filterFocalLen = false; - filterISO = false; - filterCamera = false; - filterLens = false; -} +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include + +ExifFilterSettings::ExifFilterSettings () { + + clear (); +} + +void ExifFilterSettings::clear () { + fnumberFrom = 100; + fnumberTo = 0; + shutterFrom = 100; + shutterTo = 0; + isoFrom = 100000000; + isoTo = 0; + focalFrom = 1e8; + focalTo = 0; + lenses.clear (); + cameras.clear (); + + filterFNumber = false; + filterShutter = false; + filterFocalLen = false; + filterISO = false; + filterCamera = false; + filterLens = false; +} diff --git a/rtgui/exiffiltersettings.h b/rtgui/exiffiltersettings.h index cfcfce8b2..8d8a32fe1 100644 --- a/rtgui/exiffiltersettings.h +++ b/rtgui/exiffiltersettings.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _EXIFFILTERSETTINGS_ #define _EXIFFILTERSETTINGS_ diff --git a/rtgui/exifpanel.cc b/rtgui/exifpanel.cc index 5a51eb0f3..92464029d 100644 --- a/rtgui/exifpanel.cc +++ b/rtgui/exifpanel.cc @@ -1,486 +1,486 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include -#include - -using namespace rtengine; -using namespace rtengine::procparams; -using namespace rtexif; -extern Glib::ustring argv0; - -ExifPanel::ExifPanel () : idata(NULL) { - - recursiveOp = true; - - exifTree = Gtk::manage(new Gtk::TreeView()); - scrolledWindow = Gtk::manage(new Gtk::ScrolledWindow()); - - exifTree->set_headers_visible(false); - exifTree->set_rules_hint(false); - exifTree->set_reorderable(false); - exifTree->set_enable_search(true); - exifTree->get_selection()->set_mode (Gtk::SELECTION_MULTIPLE); - scrolledWindow->set_border_width(2); - scrolledWindow->set_shadow_type(Gtk::SHADOW_NONE); - scrolledWindow->set_policy(Gtk::POLICY_ALWAYS, Gtk::POLICY_ALWAYS); - scrolledWindow->property_window_placement().set_value(Gtk::CORNER_TOP_LEFT); - scrolledWindow->add(*exifTree); - - exifTreeModel = Gtk::TreeStore::create(exifColumns); - exifTree->set_model (exifTreeModel); - - delicon = safe_create_from_file (argv0+"/images/deltags.png"); - keepicon = safe_create_from_file (argv0+"/images/addtags.png"); - editicon = safe_create_from_file (argv0+"/images/logoicon16.png"); - - Gtk::TreeView::Column *viewcol = Gtk::manage(new Gtk::TreeView::Column ("Field Name")); - Gtk::CellRendererPixbuf* render_pb = Gtk::manage(new Gtk::CellRendererPixbuf ()); - Gtk::CellRendererText *render_txt = Gtk::manage(new Gtk::CellRendererText()); - viewcol->pack_start (*render_pb, false); - viewcol->pack_start (*render_txt, true); - viewcol->add_attribute (*render_pb, "pixbuf", exifColumns.icon); - viewcol->add_attribute (*render_txt, "markup", exifColumns.field); - - render_pb->property_ypad() = 0; - render_txt->property_ypad() = 0; - render_pb->property_yalign() = 0; - render_txt->property_yalign() = 0; - - exifTree->append_column (*viewcol); - - Gtk::TreeView::Column *viewcolv = Gtk::manage(new Gtk::TreeView::Column ("Value")); - Gtk::CellRendererText *render_txtv = Gtk::manage(new Gtk::CellRendererText()); - viewcolv->pack_start (*render_txtv, true); - viewcolv->add_attribute (*render_txtv, "markup", exifColumns.value); - - render_txtv->property_ypad() = 0; - - exifTree->append_column (*viewcolv); - - pack_start (*scrolledWindow); - - Gtk::HBox* buttons1 = Gtk::manage(new Gtk::HBox ()); - Gtk::HBox* buttons2 = Gtk::manage(new Gtk::HBox ()); - - remove = Gtk::manage(new Gtk::Button (M("EXIFPANEL_REMOVE"))); - remove->set_image (*Gtk::manage(new Gtk::Image (delicon))); - remove->set_tooltip_text (M("EXIFPANEL_REMOVEHINT")); - buttons1->pack_start (*remove); - - keep = Gtk::manage(new Gtk::Button (M("EXIFPANEL_KEEP"))); - keep->set_image (*Gtk::manage(new Gtk::Image (keepicon))); - keep->set_tooltip_text (M("EXIFPANEL_KEEPHINT")); - buttons1->pack_start (*keep); - - add = Gtk::manage(new Gtk::Button (M("EXIFPANEL_ADDEDIT"))); - add->set_image (*Gtk::manage(new Gtk::Image (editicon))); - add->set_tooltip_text (M("EXIFPANEL_ADDEDITHINT")); - buttons1->pack_start (*add); - - reset = Gtk::manage(new Gtk::Button (M("EXIFPANEL_RESET"))); - reset->set_image (*Gtk::manage(new Gtk::Image (Gtk::StockID ("gtk-undo"), Gtk::IconSize (2)))); - reset->set_tooltip_text (M("EXIFPANEL_RESETHINT")); - buttons2->pack_start (*reset); - - resetAll = Gtk::manage(new Gtk::Button (M("EXIFPANEL_RESETALL"))); - resetAll->set_image (*Gtk::manage(new Gtk::Image (argv0+"/images/gtk-undo-ltr.png"))); - resetAll->set_tooltip_text (M("EXIFPANEL_RESETALLHINT")); - buttons2->pack_start (*resetAll); - - pack_end (*buttons2, Gtk::PACK_SHRINK); - pack_end (*buttons1, Gtk::PACK_SHRINK); - - exifTree->get_selection()->signal_changed().connect(sigc::mem_fun(*this, &ExifPanel::exifSelectionChanged)); - exifTree->signal_row_activated().connect(sigc::mem_fun(*this, &ExifPanel::row_activated)); - - remove->signal_clicked().connect( sigc::mem_fun(*this, &ExifPanel::removePressed) ); - keep->signal_clicked().connect( sigc::mem_fun(*this, &ExifPanel::keepPressed) ); - reset->signal_clicked().connect( sigc::mem_fun(*this, &ExifPanel::resetPressed) ); - resetAll->signal_clicked().connect( sigc::mem_fun(*this, &ExifPanel::resetAllPressed) ); - add->signal_clicked().connect( sigc::mem_fun(*this, &ExifPanel::addPressed) ); - - show_all (); -} +#include + +using namespace rtengine; +using namespace rtengine::procparams; +using namespace rtexif; +extern Glib::ustring argv0; + +ExifPanel::ExifPanel () : idata(NULL) { + + recursiveOp = true; + + exifTree = Gtk::manage(new Gtk::TreeView()); + scrolledWindow = Gtk::manage(new Gtk::ScrolledWindow()); + + exifTree->set_headers_visible(false); + exifTree->set_rules_hint(false); + exifTree->set_reorderable(false); + exifTree->set_enable_search(true); + exifTree->get_selection()->set_mode (Gtk::SELECTION_MULTIPLE); + scrolledWindow->set_border_width(2); + scrolledWindow->set_shadow_type(Gtk::SHADOW_NONE); + scrolledWindow->set_policy(Gtk::POLICY_ALWAYS, Gtk::POLICY_ALWAYS); + scrolledWindow->property_window_placement().set_value(Gtk::CORNER_TOP_LEFT); + scrolledWindow->add(*exifTree); + + exifTreeModel = Gtk::TreeStore::create(exifColumns); + exifTree->set_model (exifTreeModel); + + delicon = safe_create_from_file (argv0+"/images/deltags.png"); + keepicon = safe_create_from_file (argv0+"/images/addtags.png"); + editicon = safe_create_from_file (argv0+"/images/logoicon16.png"); + + Gtk::TreeView::Column *viewcol = Gtk::manage(new Gtk::TreeView::Column ("Field Name")); + Gtk::CellRendererPixbuf* render_pb = Gtk::manage(new Gtk::CellRendererPixbuf ()); + Gtk::CellRendererText *render_txt = Gtk::manage(new Gtk::CellRendererText()); + viewcol->pack_start (*render_pb, false); + viewcol->pack_start (*render_txt, true); + viewcol->add_attribute (*render_pb, "pixbuf", exifColumns.icon); + viewcol->add_attribute (*render_txt, "markup", exifColumns.field); + + render_pb->property_ypad() = 0; + render_txt->property_ypad() = 0; + render_pb->property_yalign() = 0; + render_txt->property_yalign() = 0; + + exifTree->append_column (*viewcol); + + Gtk::TreeView::Column *viewcolv = Gtk::manage(new Gtk::TreeView::Column ("Value")); + Gtk::CellRendererText *render_txtv = Gtk::manage(new Gtk::CellRendererText()); + viewcolv->pack_start (*render_txtv, true); + viewcolv->add_attribute (*render_txtv, "markup", exifColumns.value); + + render_txtv->property_ypad() = 0; + + exifTree->append_column (*viewcolv); + + pack_start (*scrolledWindow); + + Gtk::HBox* buttons1 = Gtk::manage(new Gtk::HBox ()); + Gtk::HBox* buttons2 = Gtk::manage(new Gtk::HBox ()); + + remove = Gtk::manage(new Gtk::Button (M("EXIFPANEL_REMOVE"))); + remove->set_image (*Gtk::manage(new Gtk::Image (delicon))); + remove->set_tooltip_text (M("EXIFPANEL_REMOVEHINT")); + buttons1->pack_start (*remove); + + keep = Gtk::manage(new Gtk::Button (M("EXIFPANEL_KEEP"))); + keep->set_image (*Gtk::manage(new Gtk::Image (keepicon))); + keep->set_tooltip_text (M("EXIFPANEL_KEEPHINT")); + buttons1->pack_start (*keep); + + add = Gtk::manage(new Gtk::Button (M("EXIFPANEL_ADDEDIT"))); + add->set_image (*Gtk::manage(new Gtk::Image (editicon))); + add->set_tooltip_text (M("EXIFPANEL_ADDEDITHINT")); + buttons1->pack_start (*add); + + reset = Gtk::manage(new Gtk::Button (M("EXIFPANEL_RESET"))); + reset->set_image (*Gtk::manage(new Gtk::Image (Gtk::StockID ("gtk-undo"), Gtk::IconSize (2)))); + reset->set_tooltip_text (M("EXIFPANEL_RESETHINT")); + buttons2->pack_start (*reset); + + resetAll = Gtk::manage(new Gtk::Button (M("EXIFPANEL_RESETALL"))); + resetAll->set_image (*Gtk::manage(new Gtk::Image (argv0+"/images/gtk-undo-ltr.png"))); + resetAll->set_tooltip_text (M("EXIFPANEL_RESETALLHINT")); + buttons2->pack_start (*resetAll); + + pack_end (*buttons2, Gtk::PACK_SHRINK); + pack_end (*buttons1, Gtk::PACK_SHRINK); + + exifTree->get_selection()->signal_changed().connect(sigc::mem_fun(*this, &ExifPanel::exifSelectionChanged)); + exifTree->signal_row_activated().connect(sigc::mem_fun(*this, &ExifPanel::row_activated)); + + remove->signal_clicked().connect( sigc::mem_fun(*this, &ExifPanel::removePressed) ); + keep->signal_clicked().connect( sigc::mem_fun(*this, &ExifPanel::keepPressed) ); + reset->signal_clicked().connect( sigc::mem_fun(*this, &ExifPanel::resetPressed) ); + resetAll->signal_clicked().connect( sigc::mem_fun(*this, &ExifPanel::resetAllPressed) ); + add->signal_clicked().connect( sigc::mem_fun(*this, &ExifPanel::addPressed) ); + + show_all (); +} ExifPanel::~ExifPanel () { } - -void ExifPanel::read (const ProcParams* pp, const ParamsEdited* pedited) { - + +void ExifPanel::read (const ProcParams* pp, const ParamsEdited* pedited) { + disableListener (); - changeList = pp->exif; - setImageData (idata); - applyChangeList (); - exifSelectionChanged (); + changeList = pp->exif; + setImageData (idata); + applyChangeList (); + exifSelectionChanged (); enableListener (); -} - -void ExifPanel::write (ProcParams* pp, ParamsEdited* pedited) { - -// updateChangeList (); - pp->exif = changeList; -} - -void ExifPanel::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { - - defChangeList = defParams->exif; -} - -void ExifPanel::setImageData (const ImageMetaData* id) { - - idata = id; - exifTreeModel->clear (); - - const std::vector& defTags = ExifManager::getDefaultTIFFTags (NULL); - for (int i=0; inameToString() == "ImageWidth" || defTags[i]->nameToString() == "ImageHeight" || defTags[i]->nameToString() == "BitsPerSample") - addTag (exifTreeModel->children(), defTags[i]->nameToString(), "?", SYSTEM, false); - else - addTag (exifTreeModel->children(), defTags[i]->nameToString(), defTags[i]->valueToString(), SYSTEM, false); - - if (id && id->getExifData ()) { -// id->getExifData ()->printAll (); - addDirectory (id->getExifData (), exifTreeModel->children()); - } -} - -Gtk::TreeModel::Children ExifPanel::addTag (const Gtk::TreeModel::Children& root, Glib::ustring field, Glib::ustring value, int action, bool editable) { - - Gtk::TreeModel::Row row = *(exifTreeModel->append(root)); - row[exifColumns.action] = action; - row[exifColumns.editable] = editable; - row[exifColumns.edited] = false; - row[exifColumns.field_nopango] = field; - row[exifColumns.value_nopango] = value; - row[exifColumns.orig_value] = value; - - if (action==WRITE) - row[exifColumns.icon] = keepicon; - else if (action==DONTWRITE) - row[exifColumns.icon] = delicon; - - if (editable) { - row[exifColumns.field] = Glib::ustring("") + field + ""; - row[exifColumns.value] = Glib::ustring("") + value + ""; - } - else if (action==SYSTEM) { - row[exifColumns.field] = Glib::ustring("") + field + ""; - row[exifColumns.value] = Glib::ustring("") + value + ""; - } - else { - row[exifColumns.field] = field; - row[exifColumns.value] = value; - } - - return row.children(); -} - -void ExifPanel::addDirectory (const TagDirectory* dir, Gtk::TreeModel::Children root) { - - for (int i=0; igetCount(); i++) { - Tag* t = ((TagDirectory*)dir)->getTagByIndex (i); - if (t->getAttrib() && t->getAttrib()->action==SYSTEM) - continue; - if (t->isDirectory()) - for (int j=0; t->getDirectory(j); j++) { - Gtk::TreeModel::Children ch = addTag (root, t->nameToString (j), M("EXIFPANEL_SUBDIRECTORY"), t->getAttrib() ? t->getAttrib()->action : 0, t->getAttrib() && t->getAttrib()->editable); - addDirectory (t->getDirectory(j), ch); - } - else - addTag (root, t->nameToString (), t->valueToString (), t->getAttrib() ? t->getAttrib()->action : 0, t->getAttrib() && t->getAttrib()->editable); - } -} - -void ExifPanel::exifSelectionChanged () { - - Glib::RefPtr selection = exifTree->get_selection(); - std::vector sel = selection->get_selected_rows(); - if (sel.size()>1) { - remove->set_sensitive (1); - keep->set_sensitive (1); - reset->set_sensitive (1); - } - else if (sel.size()==1) { - Gtk::TreeModel::iterator iter = exifTreeModel->get_iter (sel[0]); - if (iter->get_value (exifColumns.action)==SYSTEM) { - remove->set_sensitive (0); - keep->set_sensitive (0); - reset->set_sensitive (0); - } - else if (iter->children().size()>0) { - remove->set_sensitive (1); - keep->set_sensitive (1); - reset->set_sensitive (1); - } - else if (iter->get_value(exifColumns.icon)==delicon) { - remove->set_sensitive (0); - keep->set_sensitive (1); - reset->set_sensitive (1); - } - else if (iter->get_value(exifColumns.icon)==keepicon || iter->get_value(exifColumns.icon)==editicon) { - keep->set_sensitive (0); - remove->set_sensitive (1); - reset->set_sensitive (1); - } - } - else { - remove->set_sensitive (0); - keep->set_sensitive (0); - reset->set_sensitive (0); - } -} - -void ExifPanel::delIt (Gtk::TreeModel::iterator iter) { - - if (!iter) - return; - - if (iter->get_value (exifColumns.action) != SYSTEM) - iter->set_value (exifColumns.icon, delicon); - if (recursiveOp) - for (Gtk::TreeModel::iterator i=iter->children().begin(); i!=iter->children().end(); i++) - delIt (i); -} - -void ExifPanel::removePressed () { - - std::vector sel = exifTree->get_selection()->get_selected_rows(); - for (int i=0; iget_iter (sel[i])); - - exifSelectionChanged (); - updateChangeList (); - notifyListener (); -} - -void ExifPanel::keepIt (Gtk::TreeModel::iterator iter) { - - if (!iter) - return; - - if (iter->get_value (exifColumns.action) != SYSTEM) - iter->set_value (exifColumns.icon, iter->get_value (exifColumns.edited) ? editicon : keepicon); - if (recursiveOp) - for (Gtk::TreeModel::iterator i=iter->children().begin(); i!=iter->children().end(); i++) - keepIt (i); -} - -void ExifPanel::keepPressed () { - - std::vector sel = exifTree->get_selection()->get_selected_rows(); - for (int i=0; iget_iter (sel[i])); - - exifSelectionChanged (); - updateChangeList (); - notifyListener (); -} - -/*void ExifPanel::resetIt (Gtk::TreeModel::iterator iter) { - - if (!iter) - return; - - if (iter->get_value (exifColumns.action)!=SYSTEM) - iter->set_value (exifColumns.icon, iter->get_value (exifColumns.action) ? keepicon : delicon); - if (iter->get_value (exifColumns.edited)) { - iter->set_value (exifColumns.value, Glib::ustring("") + iter->get_value(exifColumns.orig_value) + ""); - iter->set_value (exifColumns.value_nopango, iter->get_value(exifColumns.orig_value)); - iter->set_value (exifColumns.edited, false); - } - if (iter->get_value (exifColumns.action)==100) - exifTreeModel->erase (iter); - else - if (recursiveOp) - for (Gtk::TreeModel::iterator i=iter->children().begin(); i!=iter->children().end(); i++) - resetIt (i); -}*/ -Gtk::TreeModel::iterator ExifPanel::resetIt (Gtk::TreeModel::iterator iter) { - - if (!iter) - return iter; - - if (iter->get_value (exifColumns.action)!=SYSTEM) - iter->set_value (exifColumns.icon, iter->get_value (exifColumns.action) ? keepicon : delicon); - if (iter->get_value (exifColumns.edited)) { - iter->set_value (exifColumns.value, Glib::ustring("") + iter->get_value(exifColumns.orig_value) + ""); - iter->set_value (exifColumns.value_nopango, iter->get_value(exifColumns.orig_value)); - iter->set_value (exifColumns.edited, false); - } - if (iter->get_value (exifColumns.action)==100) { - return exifTreeModel->erase (iter); - } - else - if (recursiveOp) { - Gtk::TreeModel::iterator i = iter->children().begin(); - while (i && i != iter->children().end()) - i = resetIt (i); - } - return ++iter; -} -void ExifPanel::resetPressed () { - - std::vector sel = exifTree->get_selection()->get_selected_rows(); - for (int i=0; iget_iter (sel[i])); - - exifSelectionChanged (); - updateChangeList (); - notifyListener (); -} - -void ExifPanel::resetAllPressed () { - - setImageData (idata); - changeList = defChangeList; - applyChangeList (); - exifSelectionChanged (); - notifyListener (); -} - -void ExifPanel::addPressed () { - - Gtk::Dialog* dialog = new Gtk::Dialog (M("EXIFPANEL_ADDTAGDLG_TITLE"), *((Gtk::Window*)get_toplevel()), true, true); - dialog->add_button (Gtk::Stock::OK, Gtk::RESPONSE_OK); - dialog->add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - - Gtk::HBox* hb1 = new Gtk::HBox (); - Gtk::HBox* hb2 = new Gtk::HBox (); - - Gtk::Label* tlabel = new Gtk::Label (M("EXIFPANEL_ADDTAGDLG_SELECTTAG")+":"); - Gtk::ComboBoxText* tcombo = new Gtk::ComboBoxText (); - - tcombo->append_text ("Artist"); - tcombo->append_text ("Copyright"); - tcombo->append_text ("ImageDescription"); - tcombo->append_text ("Exif.UserComment"); - - hb1->pack_start (*tlabel, Gtk::PACK_SHRINK, 4); - hb1->pack_start (*tcombo); - - Gtk::Label* vlabel = new Gtk::Label (M("EXIFPANEL_ADDTAGDLG_ENTERVALUE")+":"); - Gtk::Entry* ventry = new Gtk::Entry (); - hb2->pack_start (*vlabel, Gtk::PACK_SHRINK, 4); - hb2->pack_start (*ventry); - - Glib::ustring sel = getSelection (true); - if (sel=="") - tcombo->set_active_text ("Exif.UserComment"); - else { - tcombo->set_active_text (sel); - if (tcombo->get_active ()<0) { - tcombo->append_text (sel); - tcombo->set_active_text (sel); - } - ventry->set_text (getSelectedValue ()); - } - - ventry->set_activates_default (true); - dialog->set_default_response (Gtk::RESPONSE_OK); - dialog->get_vbox()->pack_start (*hb1, Gtk::PACK_SHRINK); - dialog->get_vbox()->pack_start (*hb2, Gtk::PACK_SHRINK, 4); - tlabel->show (); - tcombo->show (); - vlabel->show (); - ventry->show (); - hb1->show (); - hb2->show (); - - if (dialog->run ()== Gtk::RESPONSE_OK) { - editTag (exifTreeModel->children(), tcombo->get_active_text(), ventry->get_text()); - updateChangeList (); - notifyListener (); - } - - delete dialog; - delete tlabel; - delete tcombo; - delete vlabel; - delete ventry; - delete hb1; - delete hb2; -} - -void ExifPanel::editTag (Gtk::TreeModel::Children root, Glib::ustring name, Glib::ustring value) { - - Glib::ustring::size_type dp = name.find_first_of ('.'); - Glib::ustring fseg = name.substr (0,dp); - // look up first segment of the path - Gtk::TreeModel::iterator iter; - for (iter = root.begin(); iter!=root.end(); iter++) - if (iter->get_value (exifColumns.field_nopango) == fseg) - break; - - if (iter==root.end() && value!="#keep" && value!="#delete") { - iter = exifTreeModel->append(root); - iter->set_value (exifColumns.field_nopango, fseg); - iter->set_value (exifColumns.action, 100); - if (dp==Glib::ustring::npos) { - iter->set_value (exifColumns.value, Glib::ustring("") + value + ""); - iter->set_value (exifColumns.value_nopango, value); - iter->set_value (exifColumns.orig_value, value); - iter->set_value (exifColumns.field, Glib::ustring("") + fseg + ""); - iter->set_value (exifColumns.edited, true); - iter->set_value (exifColumns.editable, true); - iter->set_value (exifColumns.icon, editicon); - } - else { - iter->set_value (exifColumns.value, Glib::ustring(M("EXIFPANEL_SUBDIRECTORY"))); - iter->set_value (exifColumns.value_nopango, Glib::ustring(M("EXIFPANEL_SUBDIRECTORY"))); - iter->set_value (exifColumns.field, fseg); - iter->set_value (exifColumns.icon, keepicon); - iter->set_value (exifColumns.orig_value, Glib::ustring(M("EXIFPANEL_SUBDIRECTORY"))); - } - } - - if (dp==Glib::ustring::npos) { - if (value=="#keep" && iter->get_value (exifColumns.action)!=SYSTEM) - iter->set_value (exifColumns.icon, iter->get_value (exifColumns.edited) ? editicon : keepicon); - else if (value=="#delete" && iter->get_value (exifColumns.action)!=SYSTEM) - iter->set_value (exifColumns.icon, delicon); - else { - iter->set_value (exifColumns.value, Glib::ustring("") + value + ""); - iter->set_value (exifColumns.value_nopango, value); - iter->set_value (exifColumns.edited, true); - iter->set_value (exifColumns.icon, editicon); - } - } - else - editTag (iter->children(), name.substr (dp+1, Glib::ustring::npos), value); -} - -Glib::ustring ExifPanel::getSelectedValue () { - - Glib::RefPtr selection = exifTree->get_selection(); +} + +void ExifPanel::write (ProcParams* pp, ParamsEdited* pedited) { + +// updateChangeList (); + pp->exif = changeList; +} + +void ExifPanel::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { + + defChangeList = defParams->exif; +} + +void ExifPanel::setImageData (const ImageMetaData* id) { + + idata = id; + exifTreeModel->clear (); + + const std::vector& defTags = ExifManager::getDefaultTIFFTags (NULL); + for (int i=0; inameToString() == "ImageWidth" || defTags[i]->nameToString() == "ImageHeight" || defTags[i]->nameToString() == "BitsPerSample") + addTag (exifTreeModel->children(), defTags[i]->nameToString(), "?", SYSTEM, false); + else + addTag (exifTreeModel->children(), defTags[i]->nameToString(), defTags[i]->valueToString(), SYSTEM, false); + + if (id && id->getExifData ()) { +// id->getExifData ()->printAll (); + addDirectory (id->getExifData (), exifTreeModel->children()); + } +} + +Gtk::TreeModel::Children ExifPanel::addTag (const Gtk::TreeModel::Children& root, Glib::ustring field, Glib::ustring value, int action, bool editable) { + + Gtk::TreeModel::Row row = *(exifTreeModel->append(root)); + row[exifColumns.action] = action; + row[exifColumns.editable] = editable; + row[exifColumns.edited] = false; + row[exifColumns.field_nopango] = field; + row[exifColumns.value_nopango] = value; + row[exifColumns.orig_value] = value; + + if (action==WRITE) + row[exifColumns.icon] = keepicon; + else if (action==DONTWRITE) + row[exifColumns.icon] = delicon; + + if (editable) { + row[exifColumns.field] = Glib::ustring("") + field + ""; + row[exifColumns.value] = Glib::ustring("") + value + ""; + } + else if (action==SYSTEM) { + row[exifColumns.field] = Glib::ustring("") + field + ""; + row[exifColumns.value] = Glib::ustring("") + value + ""; + } + else { + row[exifColumns.field] = field; + row[exifColumns.value] = value; + } + + return row.children(); +} + +void ExifPanel::addDirectory (const TagDirectory* dir, Gtk::TreeModel::Children root) { + + for (int i=0; igetCount(); i++) { + Tag* t = ((TagDirectory*)dir)->getTagByIndex (i); + if (t->getAttrib() && t->getAttrib()->action==SYSTEM) + continue; + if (t->isDirectory()) + for (int j=0; t->getDirectory(j); j++) { + Gtk::TreeModel::Children ch = addTag (root, t->nameToString (j), M("EXIFPANEL_SUBDIRECTORY"), t->getAttrib() ? t->getAttrib()->action : 0, t->getAttrib() && t->getAttrib()->editable); + addDirectory (t->getDirectory(j), ch); + } + else + addTag (root, t->nameToString (), t->valueToString (), t->getAttrib() ? t->getAttrib()->action : 0, t->getAttrib() && t->getAttrib()->editable); + } +} + +void ExifPanel::exifSelectionChanged () { + + Glib::RefPtr selection = exifTree->get_selection(); + std::vector sel = selection->get_selected_rows(); + if (sel.size()>1) { + remove->set_sensitive (1); + keep->set_sensitive (1); + reset->set_sensitive (1); + } + else if (sel.size()==1) { + Gtk::TreeModel::iterator iter = exifTreeModel->get_iter (sel[0]); + if (iter->get_value (exifColumns.action)==SYSTEM) { + remove->set_sensitive (0); + keep->set_sensitive (0); + reset->set_sensitive (0); + } + else if (iter->children().size()>0) { + remove->set_sensitive (1); + keep->set_sensitive (1); + reset->set_sensitive (1); + } + else if (iter->get_value(exifColumns.icon)==delicon) { + remove->set_sensitive (0); + keep->set_sensitive (1); + reset->set_sensitive (1); + } + else if (iter->get_value(exifColumns.icon)==keepicon || iter->get_value(exifColumns.icon)==editicon) { + keep->set_sensitive (0); + remove->set_sensitive (1); + reset->set_sensitive (1); + } + } + else { + remove->set_sensitive (0); + keep->set_sensitive (0); + reset->set_sensitive (0); + } +} + +void ExifPanel::delIt (Gtk::TreeModel::iterator iter) { + + if (!iter) + return; + + if (iter->get_value (exifColumns.action) != SYSTEM) + iter->set_value (exifColumns.icon, delicon); + if (recursiveOp) + for (Gtk::TreeModel::iterator i=iter->children().begin(); i!=iter->children().end(); i++) + delIt (i); +} + +void ExifPanel::removePressed () { + + std::vector sel = exifTree->get_selection()->get_selected_rows(); + for (int i=0; iget_iter (sel[i])); + + exifSelectionChanged (); + updateChangeList (); + notifyListener (); +} + +void ExifPanel::keepIt (Gtk::TreeModel::iterator iter) { + + if (!iter) + return; + + if (iter->get_value (exifColumns.action) != SYSTEM) + iter->set_value (exifColumns.icon, iter->get_value (exifColumns.edited) ? editicon : keepicon); + if (recursiveOp) + for (Gtk::TreeModel::iterator i=iter->children().begin(); i!=iter->children().end(); i++) + keepIt (i); +} + +void ExifPanel::keepPressed () { + + std::vector sel = exifTree->get_selection()->get_selected_rows(); + for (int i=0; iget_iter (sel[i])); + + exifSelectionChanged (); + updateChangeList (); + notifyListener (); +} + +/*void ExifPanel::resetIt (Gtk::TreeModel::iterator iter) { + + if (!iter) + return; + + if (iter->get_value (exifColumns.action)!=SYSTEM) + iter->set_value (exifColumns.icon, iter->get_value (exifColumns.action) ? keepicon : delicon); + if (iter->get_value (exifColumns.edited)) { + iter->set_value (exifColumns.value, Glib::ustring("") + iter->get_value(exifColumns.orig_value) + ""); + iter->set_value (exifColumns.value_nopango, iter->get_value(exifColumns.orig_value)); + iter->set_value (exifColumns.edited, false); + } + if (iter->get_value (exifColumns.action)==100) + exifTreeModel->erase (iter); + else + if (recursiveOp) + for (Gtk::TreeModel::iterator i=iter->children().begin(); i!=iter->children().end(); i++) + resetIt (i); +}*/ +Gtk::TreeModel::iterator ExifPanel::resetIt (Gtk::TreeModel::iterator iter) { + + if (!iter) + return iter; + + if (iter->get_value (exifColumns.action)!=SYSTEM) + iter->set_value (exifColumns.icon, iter->get_value (exifColumns.action) ? keepicon : delicon); + if (iter->get_value (exifColumns.edited)) { + iter->set_value (exifColumns.value, Glib::ustring("") + iter->get_value(exifColumns.orig_value) + ""); + iter->set_value (exifColumns.value_nopango, iter->get_value(exifColumns.orig_value)); + iter->set_value (exifColumns.edited, false); + } + if (iter->get_value (exifColumns.action)==100) { + return exifTreeModel->erase (iter); + } + else + if (recursiveOp) { + Gtk::TreeModel::iterator i = iter->children().begin(); + while (i && i != iter->children().end()) + i = resetIt (i); + } + return ++iter; +} +void ExifPanel::resetPressed () { + + std::vector sel = exifTree->get_selection()->get_selected_rows(); + for (int i=0; iget_iter (sel[i])); + + exifSelectionChanged (); + updateChangeList (); + notifyListener (); +} + +void ExifPanel::resetAllPressed () { + + setImageData (idata); + changeList = defChangeList; + applyChangeList (); + exifSelectionChanged (); + notifyListener (); +} + +void ExifPanel::addPressed () { + + Gtk::Dialog* dialog = new Gtk::Dialog (M("EXIFPANEL_ADDTAGDLG_TITLE"), *((Gtk::Window*)get_toplevel()), true, true); + dialog->add_button (Gtk::Stock::OK, Gtk::RESPONSE_OK); + dialog->add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); + + Gtk::HBox* hb1 = new Gtk::HBox (); + Gtk::HBox* hb2 = new Gtk::HBox (); + + Gtk::Label* tlabel = new Gtk::Label (M("EXIFPANEL_ADDTAGDLG_SELECTTAG")+":"); + Gtk::ComboBoxText* tcombo = new Gtk::ComboBoxText (); + + tcombo->append_text ("Artist"); + tcombo->append_text ("Copyright"); + tcombo->append_text ("ImageDescription"); + tcombo->append_text ("Exif.UserComment"); + + hb1->pack_start (*tlabel, Gtk::PACK_SHRINK, 4); + hb1->pack_start (*tcombo); + + Gtk::Label* vlabel = new Gtk::Label (M("EXIFPANEL_ADDTAGDLG_ENTERVALUE")+":"); + Gtk::Entry* ventry = new Gtk::Entry (); + hb2->pack_start (*vlabel, Gtk::PACK_SHRINK, 4); + hb2->pack_start (*ventry); + + Glib::ustring sel = getSelection (true); + if (sel=="") + tcombo->set_active_text ("Exif.UserComment"); + else { + tcombo->set_active_text (sel); + if (tcombo->get_active ()<0) { + tcombo->append_text (sel); + tcombo->set_active_text (sel); + } + ventry->set_text (getSelectedValue ()); + } + + ventry->set_activates_default (true); + dialog->set_default_response (Gtk::RESPONSE_OK); + dialog->get_vbox()->pack_start (*hb1, Gtk::PACK_SHRINK); + dialog->get_vbox()->pack_start (*hb2, Gtk::PACK_SHRINK, 4); + tlabel->show (); + tcombo->show (); + vlabel->show (); + ventry->show (); + hb1->show (); + hb2->show (); + + if (dialog->run ()== Gtk::RESPONSE_OK) { + editTag (exifTreeModel->children(), tcombo->get_active_text(), ventry->get_text()); + updateChangeList (); + notifyListener (); + } + + delete dialog; + delete tlabel; + delete tcombo; + delete vlabel; + delete ventry; + delete hb1; + delete hb2; +} + +void ExifPanel::editTag (Gtk::TreeModel::Children root, Glib::ustring name, Glib::ustring value) { + + Glib::ustring::size_type dp = name.find_first_of ('.'); + Glib::ustring fseg = name.substr (0,dp); + // look up first segment of the path + Gtk::TreeModel::iterator iter; + for (iter = root.begin(); iter!=root.end(); iter++) + if (iter->get_value (exifColumns.field_nopango) == fseg) + break; + + if (iter==root.end() && value!="#keep" && value!="#delete") { + iter = exifTreeModel->append(root); + iter->set_value (exifColumns.field_nopango, fseg); + iter->set_value (exifColumns.action, 100); + if (dp==Glib::ustring::npos) { + iter->set_value (exifColumns.value, Glib::ustring("") + value + ""); + iter->set_value (exifColumns.value_nopango, value); + iter->set_value (exifColumns.orig_value, value); + iter->set_value (exifColumns.field, Glib::ustring("") + fseg + ""); + iter->set_value (exifColumns.edited, true); + iter->set_value (exifColumns.editable, true); + iter->set_value (exifColumns.icon, editicon); + } + else { + iter->set_value (exifColumns.value, Glib::ustring(M("EXIFPANEL_SUBDIRECTORY"))); + iter->set_value (exifColumns.value_nopango, Glib::ustring(M("EXIFPANEL_SUBDIRECTORY"))); + iter->set_value (exifColumns.field, fseg); + iter->set_value (exifColumns.icon, keepicon); + iter->set_value (exifColumns.orig_value, Glib::ustring(M("EXIFPANEL_SUBDIRECTORY"))); + } + } + + if (dp==Glib::ustring::npos) { + if (value=="#keep" && iter->get_value (exifColumns.action)!=SYSTEM) + iter->set_value (exifColumns.icon, iter->get_value (exifColumns.edited) ? editicon : keepicon); + else if (value=="#delete" && iter->get_value (exifColumns.action)!=SYSTEM) + iter->set_value (exifColumns.icon, delicon); + else { + iter->set_value (exifColumns.value, Glib::ustring("") + value + ""); + iter->set_value (exifColumns.value_nopango, value); + iter->set_value (exifColumns.edited, true); + iter->set_value (exifColumns.icon, editicon); + } + } + else + editTag (iter->children(), name.substr (dp+1, Glib::ustring::npos), value); +} + +Glib::ustring ExifPanel::getSelectedValue () { + + Glib::RefPtr selection = exifTree->get_selection(); std::vector rows = selection->get_selected_rows(); if (rows.size()!=1) return ""; Gtk::TreeModel::iterator iter = exifTreeModel->get_iter (rows[0]); - if (iter) - return iter->get_value (exifColumns.value_nopango); - return ""; -} - -Glib::ustring ExifPanel::getSelection (bool onlyeditable) { - + if (iter) + return iter->get_value (exifColumns.value_nopango); + return ""; +} + +Glib::ustring ExifPanel::getSelection (bool onlyeditable) { + Glib::RefPtr selection = exifTree->get_selection(); std::vector rows = selection->get_selected_rows(); @@ -488,82 +488,82 @@ Glib::ustring ExifPanel::getSelection (bool onlyeditable) { return ""; Gtk::TreeModel::iterator iter = exifTreeModel->get_iter (rows[0]); - Glib::ustring ret = ""; - bool first = true; - bool editable = false; - while (iter) { - if (first) - ret = iter->get_value (exifColumns.field_nopango); - else - ret = iter->get_value (exifColumns.field_nopango) + "." + ret; - editable = iter->get_value (exifColumns.editable); - iter = iter->parent (); - first = false; - } - if (!editable && onlyeditable) - return ""; - return ret; -} - -void ExifPanel::updateChangeList (Gtk::TreeModel::Children root, std::string prefix) { - - if (prefix!="") - prefix = prefix + "."; - - Gtk::TreeModel::iterator iter; - for (iter = root.begin(); iter!=root.end(); iter++) { - if (iter->get_value (exifColumns.edited) == true) { - ExifPair ec; - ec.field = prefix + iter->get_value (exifColumns.field_nopango); - ec.value = iter->get_value (exifColumns.value_nopango); - changeList.push_back (ec); - } - else if (iter->get_value (exifColumns.action) == WRITE && iter->get_value (exifColumns.icon) == delicon) { - ExifPair ec; - ec.field = prefix + iter->get_value (exifColumns.field_nopango); - ec.value = "#delete"; - changeList.push_back (ec); - } - else if (iter->get_value (exifColumns.action) == DONTWRITE && iter->get_value (exifColumns.icon) == keepicon) { - ExifPair ec; - ec.field = prefix + iter->get_value (exifColumns.field_nopango); - ec.value = "#keep"; - changeList.push_back (ec); - } - if (iter->get_value (exifColumns.icon) == keepicon) - updateChangeList (iter->children(), prefix + iter->get_value (exifColumns.field_nopango)); - } -} - -void ExifPanel::updateChangeList () { - - changeList.clear (); - updateChangeList (exifTreeModel->children(), ""); -} - -void ExifPanel::applyChangeList () { - - for (int i=0; ichildren(), changeList[i].field, changeList[i].value); -} - -void ExifPanel::row_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column) { - - Gtk::TreeModel::iterator iter = exifTreeModel->get_iter (path); - if (iter) { - if (iter->children().size()>0) - if (exifTree->row_expanded (path)) - exifTree->collapse_row (path); - else - exifTree->expand_row (path, false); - else if (iter->get_value (exifColumns.editable)) - addPressed (); - } -} - - -void ExifPanel::notifyListener () { - - if (listener) - listener->panelChanged (EvExif, M("HISTORY_CHANGED")); -} + Glib::ustring ret = ""; + bool first = true; + bool editable = false; + while (iter) { + if (first) + ret = iter->get_value (exifColumns.field_nopango); + else + ret = iter->get_value (exifColumns.field_nopango) + "." + ret; + editable = iter->get_value (exifColumns.editable); + iter = iter->parent (); + first = false; + } + if (!editable && onlyeditable) + return ""; + return ret; +} + +void ExifPanel::updateChangeList (Gtk::TreeModel::Children root, std::string prefix) { + + if (prefix!="") + prefix = prefix + "."; + + Gtk::TreeModel::iterator iter; + for (iter = root.begin(); iter!=root.end(); iter++) { + if (iter->get_value (exifColumns.edited) == true) { + ExifPair ec; + ec.field = prefix + iter->get_value (exifColumns.field_nopango); + ec.value = iter->get_value (exifColumns.value_nopango); + changeList.push_back (ec); + } + else if (iter->get_value (exifColumns.action) == WRITE && iter->get_value (exifColumns.icon) == delicon) { + ExifPair ec; + ec.field = prefix + iter->get_value (exifColumns.field_nopango); + ec.value = "#delete"; + changeList.push_back (ec); + } + else if (iter->get_value (exifColumns.action) == DONTWRITE && iter->get_value (exifColumns.icon) == keepicon) { + ExifPair ec; + ec.field = prefix + iter->get_value (exifColumns.field_nopango); + ec.value = "#keep"; + changeList.push_back (ec); + } + if (iter->get_value (exifColumns.icon) == keepicon) + updateChangeList (iter->children(), prefix + iter->get_value (exifColumns.field_nopango)); + } +} + +void ExifPanel::updateChangeList () { + + changeList.clear (); + updateChangeList (exifTreeModel->children(), ""); +} + +void ExifPanel::applyChangeList () { + + for (int i=0; ichildren(), changeList[i].field, changeList[i].value); +} + +void ExifPanel::row_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column) { + + Gtk::TreeModel::iterator iter = exifTreeModel->get_iter (path); + if (iter) { + if (iter->children().size()>0) + if (exifTree->row_expanded (path)) + exifTree->collapse_row (path); + else + exifTree->expand_row (path, false); + else if (iter->get_value (exifColumns.editable)) + addPressed (); + } +} + + +void ExifPanel::notifyListener () { + + if (listener) + listener->panelChanged (EvExif, M("HISTORY_CHANGED")); +} diff --git a/rtgui/exifpanel.h b/rtgui/exifpanel.h index 54e310db0..c558e02cf 100644 --- a/rtgui/exifpanel.h +++ b/rtgui/exifpanel.h @@ -1,97 +1,97 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _EXIFPANEL_ -#define _EXIFPANEL_ - -#include -#include - -class ExifPanel : public Gtk::VBox, public ToolPanel { - - private: - const rtengine::ImageMetaData* idata; - int fullw, fullh, cx, cy, cw, ch; - bool crenabled; - std::vector changeList; - std::vector defChangeList; - bool recursiveOp; - - class ExifColumns : public Gtk::TreeModelColumnRecord { - public: - Gtk::TreeModelColumn > icon; - Gtk::TreeModelColumn field; - Gtk::TreeModelColumn field_nopango; - Gtk::TreeModelColumn value; - Gtk::TreeModelColumn value_nopango; - Gtk::TreeModelColumn orig_value; - Gtk::TreeModelColumn action; // = 0: dont write to output, =1: write to output, =2: chagned by RT (not editable/deletable), =3: new addition - Gtk::TreeModelColumn editable; - Gtk::TreeModelColumn edited; - - ExifColumns() { add(field); add(value); add(icon); add(action); add(edited); add(field_nopango); add(value_nopango); add(editable); add(orig_value); } - }; - Glib::RefPtr delicon; - Glib::RefPtr keepicon; - Glib::RefPtr editicon; - - ExifColumns exifColumns; - Gtk::TreeView* exifTree; - Gtk::ScrolledWindow* scrolledWindow; - Glib::RefPtr exifTreeModel; - - Gtk::Button* remove; - Gtk::Button* keep; - Gtk::Button* add; - Gtk::Button* reset; - Gtk::Button* resetAll; - - Gtk::TreeModel::Children addTag (const Gtk::TreeModel::Children& root, Glib::ustring field, Glib::ustring value, int action, bool editable); - void editTag (Gtk::TreeModel::Children root, Glib::ustring name, Glib::ustring value); - void updateChangeList (Gtk::TreeModel::Children root, std::string prefix); - void addDirectory (const rtexif::TagDirectory* dir, Gtk::TreeModel::Children root); - Glib::ustring getSelection (bool onlyifeditable=false); - Glib::ustring getSelectedValue (); - void updateChangeList (); - void applyChangeList (); - void keepIt (Gtk::TreeModel::iterator iter); - void delIt (Gtk::TreeModel::iterator iter); - Gtk::TreeModel::iterator resetIt (Gtk::TreeModel::iterator iter); - public: - ExifPanel (); - virtual ~ExifPanel (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); - - void setImageData (const rtengine::ImageMetaData* id); - - void exifSelectionChanged (); - void removePressed (); - void keepPressed (); - void resetPressed (); - void resetAllPressed (); - void addPressed (); - void row_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column); - - void notifyListener (); - -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _EXIFPANEL_ +#define _EXIFPANEL_ + +#include +#include + +class ExifPanel : public Gtk::VBox, public ToolPanel { + + private: + const rtengine::ImageMetaData* idata; + int fullw, fullh, cx, cy, cw, ch; + bool crenabled; + std::vector changeList; + std::vector defChangeList; + bool recursiveOp; + + class ExifColumns : public Gtk::TreeModelColumnRecord { + public: + Gtk::TreeModelColumn > icon; + Gtk::TreeModelColumn field; + Gtk::TreeModelColumn field_nopango; + Gtk::TreeModelColumn value; + Gtk::TreeModelColumn value_nopango; + Gtk::TreeModelColumn orig_value; + Gtk::TreeModelColumn action; // = 0: dont write to output, =1: write to output, =2: chagned by RT (not editable/deletable), =3: new addition + Gtk::TreeModelColumn editable; + Gtk::TreeModelColumn edited; + + ExifColumns() { add(field); add(value); add(icon); add(action); add(edited); add(field_nopango); add(value_nopango); add(editable); add(orig_value); } + }; + Glib::RefPtr delicon; + Glib::RefPtr keepicon; + Glib::RefPtr editicon; + + ExifColumns exifColumns; + Gtk::TreeView* exifTree; + Gtk::ScrolledWindow* scrolledWindow; + Glib::RefPtr exifTreeModel; + + Gtk::Button* remove; + Gtk::Button* keep; + Gtk::Button* add; + Gtk::Button* reset; + Gtk::Button* resetAll; + + Gtk::TreeModel::Children addTag (const Gtk::TreeModel::Children& root, Glib::ustring field, Glib::ustring value, int action, bool editable); + void editTag (Gtk::TreeModel::Children root, Glib::ustring name, Glib::ustring value); + void updateChangeList (Gtk::TreeModel::Children root, std::string prefix); + void addDirectory (const rtexif::TagDirectory* dir, Gtk::TreeModel::Children root); + Glib::ustring getSelection (bool onlyifeditable=false); + Glib::ustring getSelectedValue (); + void updateChangeList (); + void applyChangeList (); + void keepIt (Gtk::TreeModel::iterator iter); + void delIt (Gtk::TreeModel::iterator iter); + Gtk::TreeModel::iterator resetIt (Gtk::TreeModel::iterator iter); + public: + ExifPanel (); + virtual ~ExifPanel (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); + + void setImageData (const rtengine::ImageMetaData* id); + + void exifSelectionChanged (); + void removePressed (); + void keepPressed (); + void resetPressed (); + void resetAllPressed (); + void addPressed (); + void row_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column); + + void notifyListener (); + +}; + +#endif diff --git a/rtgui/favoritbrowser.cc b/rtgui/favoritbrowser.cc index 706fbdcd8..5280a83a6 100644 --- a/rtgui/favoritbrowser.cc +++ b/rtgui/favoritbrowser.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include @@ -39,7 +39,7 @@ FavoritBrowser::FavoritBrowser () : listener (NULL), lastSelectedDir ("") { Gtk::TreeView::Column *iviewcol = Gtk::manage (new Gtk::TreeView::Column ("icon")); Gtk::CellRendererPixbuf *iconCR = Gtk::manage (new Gtk::CellRendererPixbuf()); iviewcol->pack_start (*iconCR, false); - iviewcol->add_attribute (*iconCR, "gicon", 0); + iviewcol->add_attribute (*iconCR, "gicon", 0); treeView->append_column (*iviewcol); treeView->append_column ("text", favoritColumns.shortdir); diff --git a/rtgui/favoritbrowser.h b/rtgui/favoritbrowser.h index b50cc5cba..344f332c3 100644 --- a/rtgui/favoritbrowser.h +++ b/rtgui/favoritbrowser.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _FAVORITBROWSER_ #define _FAVORITBROWSER_ @@ -27,7 +27,7 @@ class FavoritBrowser : public Gtk::VBox, public DirSelectionListener { class FavoritColumns : public Gtk::TreeModel::ColumnRecord { public: - Gtk::TreeModelColumn > icon; + Gtk::TreeModelColumn > icon; Gtk::TreeModelColumn shortdir; Gtk::TreeModelColumn fulldir; FavoritColumns() { add(icon); add(shortdir), add(fulldir); } diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index 3298cd32c..c43e70d2d 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -1,67 +1,67 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include -#include -#include -#include -#include - -FileBrowser::FileBrowser () - : tbl(NULL) { - - fbih = new FileBrowserIdleHelper; - fbih->fbrowser = this; - fbih->destroyed = false; - fbih->pending = 0; +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include +#include +#include +#include +#include + +FileBrowser::FileBrowser () + : tbl(NULL) { + + fbih = new FileBrowserIdleHelper; + fbih->fbrowser = this; + fbih->destroyed = false; + fbih->pending = 0; profileStore.parseProfiles (); - - signal_style_changed().connect( sigc::mem_fun(*this, &FileBrowser::styleChanged) ); - - int p = 0; - pmenu = new Gtk::Menu (); - pmenu->attach (*(open = new Gtk::MenuItem (M("FILEBROWSER_POPUPOPEN"))), 0, 1, p, p+1); p++; - pmenu->attach (*(develop = new Gtk::MenuItem (M("FILEBROWSER_POPUPPROCESS"))), 0, 1, p, p+1); p++; - pmenu->attach (*(new Gtk::SeparatorMenuItem ()), 0, 1, p, p+1); p++; - pmenu->attach (*(rank[0] = new Gtk::MenuItem (M("FILEBROWSER_POPUPUNRANK"))), 0, 1, p, p+1); p++; - pmenu->attach (*(rank[1] = new Gtk::MenuItem (M("FILEBROWSER_POPUPRANK1"))), 0, 1, p, p+1); p++; - pmenu->attach (*(rank[2] = new Gtk::MenuItem (M("FILEBROWSER_POPUPRANK2"))), 0, 1, p, p+1); p++; - pmenu->attach (*(rank[3] = new Gtk::MenuItem (M("FILEBROWSER_POPUPRANK3"))), 0, 1, p, p+1); p++; - pmenu->attach (*(rank[4] = new Gtk::MenuItem (M("FILEBROWSER_POPUPRANK4"))), 0, 1, p, p+1); p++; - pmenu->attach (*(rank[5] = new Gtk::MenuItem (M("FILEBROWSER_POPUPRANK5"))), 0, 1, p, p+1); p++; - pmenu->attach (*(new Gtk::SeparatorMenuItem ()), 0, 1, p, p+1); p++; - pmenu->attach (*(trash = new Gtk::MenuItem (M("FILEBROWSER_POPUPTRASH"))), 0, 1, p, p+1); p++; - pmenu->attach (*(untrash = new Gtk::MenuItem (M("FILEBROWSER_POPUPUNTRASH"))), 0, 1, p, p+1); p++; - pmenu->attach (*(new Gtk::SeparatorMenuItem ()), 0, 1, p, p+1); p++; - pmenu->attach (*(rename = new Gtk::MenuItem (M("FILEBROWSER_POPUPRENAME"))), 0, 1, p, p+1); p++; - pmenu->attach (*(remove = new Gtk::MenuItem (M("FILEBROWSER_POPUPREMOVE"))), 0, 1, p, p+1); p++; - pmenu->attach (*(new Gtk::SeparatorMenuItem ()), 0, 1, p, p+1); p++; - pmenu->attach (*(selall = new Gtk::MenuItem (M("FILEBROWSER_POPUPSELECTALL"))), 0, 1, p, p+1); p++; - pmenu->attach (*(new Gtk::SeparatorMenuItem ()), 0, 1, p, p+1); p++; - pmenu->attach (*(copyprof = new Gtk::MenuItem (M("FILEBROWSER_COPYPROFILE"))), 0, 1, p, p+1); p++; - pmenu->attach (*(pasteprof = new Gtk::MenuItem (M("FILEBROWSER_PASTEPROFILE"))), 0, 1, p, p+1); p++; - pmenu->attach (*(partpasteprof = new Gtk::MenuItem (M("FILEBROWSER_PARTIALPASTEPROFILE"))), 0, 1, p, p+1); p++; - pmenu->attach (*(applyprof = new Gtk::MenuItem (M("FILEBROWSER_APPLYPROFILE"))), 0, 1, p, p+1); p++; - pmenu->attach (*(clearprof = new Gtk::MenuItem (M("FILEBROWSER_CLEARPROFILE"))), 0, 1, p, p+1); p++; - pmenu->show_all (); + + signal_style_changed().connect( sigc::mem_fun(*this, &FileBrowser::styleChanged) ); + + int p = 0; + pmenu = new Gtk::Menu (); + pmenu->attach (*(open = new Gtk::MenuItem (M("FILEBROWSER_POPUPOPEN"))), 0, 1, p, p+1); p++; + pmenu->attach (*(develop = new Gtk::MenuItem (M("FILEBROWSER_POPUPPROCESS"))), 0, 1, p, p+1); p++; + pmenu->attach (*(new Gtk::SeparatorMenuItem ()), 0, 1, p, p+1); p++; + pmenu->attach (*(rank[0] = new Gtk::MenuItem (M("FILEBROWSER_POPUPUNRANK"))), 0, 1, p, p+1); p++; + pmenu->attach (*(rank[1] = new Gtk::MenuItem (M("FILEBROWSER_POPUPRANK1"))), 0, 1, p, p+1); p++; + pmenu->attach (*(rank[2] = new Gtk::MenuItem (M("FILEBROWSER_POPUPRANK2"))), 0, 1, p, p+1); p++; + pmenu->attach (*(rank[3] = new Gtk::MenuItem (M("FILEBROWSER_POPUPRANK3"))), 0, 1, p, p+1); p++; + pmenu->attach (*(rank[4] = new Gtk::MenuItem (M("FILEBROWSER_POPUPRANK4"))), 0, 1, p, p+1); p++; + pmenu->attach (*(rank[5] = new Gtk::MenuItem (M("FILEBROWSER_POPUPRANK5"))), 0, 1, p, p+1); p++; + pmenu->attach (*(new Gtk::SeparatorMenuItem ()), 0, 1, p, p+1); p++; + pmenu->attach (*(trash = new Gtk::MenuItem (M("FILEBROWSER_POPUPTRASH"))), 0, 1, p, p+1); p++; + pmenu->attach (*(untrash = new Gtk::MenuItem (M("FILEBROWSER_POPUPUNTRASH"))), 0, 1, p, p+1); p++; + pmenu->attach (*(new Gtk::SeparatorMenuItem ()), 0, 1, p, p+1); p++; + pmenu->attach (*(rename = new Gtk::MenuItem (M("FILEBROWSER_POPUPRENAME"))), 0, 1, p, p+1); p++; + pmenu->attach (*(remove = new Gtk::MenuItem (M("FILEBROWSER_POPUPREMOVE"))), 0, 1, p, p+1); p++; + pmenu->attach (*(new Gtk::SeparatorMenuItem ()), 0, 1, p, p+1); p++; + pmenu->attach (*(selall = new Gtk::MenuItem (M("FILEBROWSER_POPUPSELECTALL"))), 0, 1, p, p+1); p++; + pmenu->attach (*(new Gtk::SeparatorMenuItem ()), 0, 1, p, p+1); p++; + pmenu->attach (*(copyprof = new Gtk::MenuItem (M("FILEBROWSER_COPYPROFILE"))), 0, 1, p, p+1); p++; + pmenu->attach (*(pasteprof = new Gtk::MenuItem (M("FILEBROWSER_PASTEPROFILE"))), 0, 1, p, p+1); p++; + pmenu->attach (*(partpasteprof = new Gtk::MenuItem (M("FILEBROWSER_PARTIALPASTEPROFILE"))), 0, 1, p, p+1); p++; + pmenu->attach (*(applyprof = new Gtk::MenuItem (M("FILEBROWSER_APPLYPROFILE"))), 0, 1, p, p+1); p++; + pmenu->attach (*(clearprof = new Gtk::MenuItem (M("FILEBROWSER_CLEARPROFILE"))), 0, 1, p, p+1); p++; + pmenu->show_all (); pmaccelgroup = Gtk::AccelGroup::create (); pmenu->set_accel_group (pmaccelgroup); @@ -72,486 +72,486 @@ FileBrowser::FileBrowser () copyprof->add_accelerator ("activate", pmenu->get_accel_group(), GDK_C, Gdk::CONTROL_MASK, Gtk::ACCEL_VISIBLE); pasteprof->add_accelerator ("activate", pmenu->get_accel_group(), GDK_V, Gdk::CONTROL_MASK, Gtk::ACCEL_VISIBLE); partpasteprof->add_accelerator ("activate", pmenu->get_accel_group(), GDK_V, Gdk::CONTROL_MASK | Gdk::SHIFT_MASK, Gtk::ACCEL_VISIBLE); - - profmenu = new Gtk::Menu (); - - open->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), open)); - for (int i=0; i<6; i++) - rank[i]->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), rank[i])); - trash->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), trash)); - untrash->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), untrash)); - develop->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), develop)); - rename->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), rename)); - remove->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), remove)); - selall->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), selall)); - copyprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), copyprof)); - pasteprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), pasteprof)); - partpasteprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), partpasteprof)); - applyprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), applyprof)); - clearprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), clearprof)); -} - -void FileBrowser::rightClicked (ThumbBrowserEntryBase* entry) { - - trash->set_sensitive (false); - untrash->set_sensitive (false); - for (int i=0; ithumbnail->getStage()==1) { - untrash->set_sensitive (true); - break; - } - for (int i=0; ithumbnail->getStage()==0) { - trash->set_sensitive (true); - break; - } - - pasteprof->set_sensitive (clipboard.hasProcParams()); - partpasteprof->set_sensitive (clipboard.hasProcParams()); - copyprof->set_sensitive (selected.size()==1); - clearprof->set_sensitive (selected.size()>0); - - int p = 0; - Gtk::Menu* applmenu = Gtk::manage (new Gtk::Menu ()); - std::vector profnames = profileStore.getProfileNames (); - for (int i=0; iattach (*mi, 0, 1, p, p+1); p++; - mi->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::applyMenuItemActivated), profnames[i])); - mi->show (); - } - applyprof->set_submenu (*applmenu); - - pmenu->popup (3, this->eventTime); -} - -void FileBrowser::doubleClicked (ThumbBrowserEntryBase* entry) { - + + profmenu = new Gtk::Menu (); + + open->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), open)); + for (int i=0; i<6; i++) + rank[i]->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), rank[i])); + trash->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), trash)); + untrash->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), untrash)); + develop->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), develop)); + rename->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), rename)); + remove->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), remove)); + selall->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), selall)); + copyprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), copyprof)); + pasteprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), pasteprof)); + partpasteprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), partpasteprof)); + applyprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), applyprof)); + clearprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), clearprof)); +} + +void FileBrowser::rightClicked (ThumbBrowserEntryBase* entry) { + + trash->set_sensitive (false); + untrash->set_sensitive (false); + for (int i=0; ithumbnail->getStage()==1) { + untrash->set_sensitive (true); + break; + } + for (int i=0; ithumbnail->getStage()==0) { + trash->set_sensitive (true); + break; + } + + pasteprof->set_sensitive (clipboard.hasProcParams()); + partpasteprof->set_sensitive (clipboard.hasProcParams()); + copyprof->set_sensitive (selected.size()==1); + clearprof->set_sensitive (selected.size()>0); + + int p = 0; + Gtk::Menu* applmenu = Gtk::manage (new Gtk::Menu ()); + std::vector profnames = profileStore.getProfileNames (); + for (int i=0; iattach (*mi, 0, 1, p, p+1); p++; + mi->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::applyMenuItemActivated), profnames[i])); + mi->show (); + } + applyprof->set_submenu (*applmenu); + + pmenu->popup (3, this->eventTime); +} + +void FileBrowser::doubleClicked (ThumbBrowserEntryBase* entry) { + if (tbl && entry) { std::vector entries; - entries.push_back (((FileBrowserEntry*)entry)->thumbnail); + entries.push_back (((FileBrowserEntry*)entry)->thumbnail); tbl->openRequested (entries); - } -} - -struct addparams { - FileBrowserIdleHelper* fbih; - FileBrowserEntry* entry; -}; - -int addfl (void* data) { - - addparams* ap = (addparams*) data; - FileBrowserIdleHelper* fbih = ap->fbih; - - gdk_threads_enter(); - - if (fbih->destroyed) { - if (fbih->pending == 1) - delete fbih; - else - fbih->pending--; - delete ap->entry; - delete ap; - gdk_threads_leave (); - return 0; - } - - ap->fbih->fbrowser->addEntry_ (ap->entry); - delete ap; - fbih->pending--; - gdk_threads_leave(); - return 0; -} - -void FileBrowser::addEntry (FileBrowserEntry* entry) { + } +} + +struct addparams { + FileBrowserIdleHelper* fbih; + FileBrowserEntry* entry; +}; + +int addfl (void* data) { + + addparams* ap = (addparams*) data; + FileBrowserIdleHelper* fbih = ap->fbih; + + gdk_threads_enter(); + + if (fbih->destroyed) { + if (fbih->pending == 1) + delete fbih; + else + fbih->pending--; + delete ap->entry; + delete ap; + gdk_threads_leave (); + return 0; + } + + ap->fbih->fbrowser->addEntry_ (ap->entry); + delete ap; + fbih->pending--; + gdk_threads_leave(); + return 0; +} + +void FileBrowser::addEntry (FileBrowserEntry* entry) { fbih->pending++; - entry->setParent (this); - addparams* ap = new addparams; - ap->fbih = fbih; - ap->entry = entry; - g_idle_add (addfl, ap); -} - -void FileBrowser::addEntry_ (FileBrowserEntry* entry) { - - entry->selected = false; - entry->drawable = false; - entry->framed = editedFiles.find (entry->filename)!=editedFiles.end(); - - // add button set to the thumbbrowserentry - entry->addButtonSet (new FileThumbnailButtonSet (entry)); - entry->getThumbButtonSet()->setRank (entry->thumbnail->getRank()); - entry->getThumbButtonSet()->setInTrash (entry->thumbnail->getStage()==1); - entry->getThumbButtonSet()->setButtonListener (this); - entry->resize (options.thumbSize); + entry->setParent (this); + addparams* ap = new addparams; + ap->fbih = fbih; + ap->entry = entry; + g_idle_add (addfl, ap); +} - // find place in abc order - std::vector::iterator i = fd.begin(); - while (i!=fd.end() && *entry < *((FileBrowserEntry*)*i)) - i++; - - fd.insert (i, entry); - - initEntry (entry); - redraw (); -} - -FileBrowserEntry* FileBrowser::delEntry (const Glib::ustring& fname) { - - for (std::vector::iterator i=fd.begin(); i!=fd.end(); i++) - if ((*i)->filename==fname) { - ThumbBrowserEntryBase* entry = *i; - entry->selected = false; - fd.erase (i); - std::vector::iterator j = std::find (selected.begin(), selected.end(), entry); - if (j!=selected.end()) { +void FileBrowser::addEntry_ (FileBrowserEntry* entry) { + + entry->selected = false; + entry->drawable = false; + entry->framed = editedFiles.find (entry->filename)!=editedFiles.end(); + + // add button set to the thumbbrowserentry + entry->addButtonSet (new FileThumbnailButtonSet (entry)); + entry->getThumbButtonSet()->setRank (entry->thumbnail->getRank()); + entry->getThumbButtonSet()->setInTrash (entry->thumbnail->getStage()==1); + entry->getThumbButtonSet()->setButtonListener (this); + entry->resize (options.thumbSize); + + // find place in abc order + std::vector::iterator i = fd.begin(); + while (i!=fd.end() && *entry < *((FileBrowserEntry*)*i)) + i++; + + fd.insert (i, entry); + + initEntry (entry); + redraw (); +} + +FileBrowserEntry* FileBrowser::delEntry (const Glib::ustring& fname) { + + for (std::vector::iterator i=fd.begin(); i!=fd.end(); i++) + if ((*i)->filename==fname) { + ThumbBrowserEntryBase* entry = *i; + entry->selected = false; + fd.erase (i); + std::vector::iterator j = std::find (selected.begin(), selected.end(), entry); + if (j!=selected.end()) { selected.erase (j); notifySelectionListener (); - } - if (lastClicked==entry) - lastClicked = NULL; - redraw (); - return (FileBrowserEntry*)entry; - } - return NULL; -} - -FileBrowserEntry* FileBrowser::findEntry (const Glib::ustring& fname) { - - for (std::vector::iterator i=fd.begin(); i!=fd.end(); i++) - if ((*i)->filename==fname) - return (FileBrowserEntry*)*i; - return NULL; -} - -void FileBrowser::close () { - if (fbih->pending) - fbih->destroyed = true; - else - delete fbih; - - fbih = new FileBrowserIdleHelper; - fbih->fbrowser = this; - fbih->destroyed = false; - fbih->pending = 0; - - for (int i=0; ithumbnail->decreaseRef (); -} - -void FileBrowser::menuItemActivated (Gtk::MenuItem* m) { - - std::vector mselected; - for (int i=0; i::iterator i=fd.begin(); i!=fd.end(); i++) + if ((*i)->filename==fname) + return (FileBrowserEntry*)*i; + return NULL; +} + +void FileBrowser::close () { + if (fbih->pending) + fbih->destroyed = true; + else + delete fbih; + + fbih = new FileBrowserIdleHelper; + fbih->fbrowser = this; + fbih->destroyed = false; + fbih->pending = 0; + + for (int i=0; ithumbnail->decreaseRef (); +} + +void FileBrowser::menuItemActivated (Gtk::MenuItem* m) { + + std::vector mselected; + for (int i=0; i entries; for (int i=0; ithumbnail); tbl->openRequested (entries); - } - else if (m==remove) - tbl->deleteRequested (mselected); - else if (m==trash) - toTrashRequested (mselected); - else if (m==untrash) - fromTrashRequested (mselected); - else if (m==develop) - tbl->developRequested (mselected); - else if (m==rename) - tbl->renameRequested (mselected); - else if (m==selall) { - lastClicked = NULL; - selected.clear (); - for (int i=0; iselected = true; - selected.push_back (fd[i]); - } + } + else if (m==remove) + tbl->deleteRequested (mselected); + else if (m==trash) + toTrashRequested (mselected); + else if (m==untrash) + fromTrashRequested (mselected); + else if (m==develop) + tbl->developRequested (mselected); + else if (m==rename) + tbl->renameRequested (mselected); + else if (m==selall) { + lastClicked = NULL; + selected.clear (); + for (int i=0; iselected = true; + selected.push_back (fd[i]); + } queue_draw (); - notifySelectionListener (); - } - else if (m==copyprof) - copyProfile (); - else if (m==pasteprof) - pasteProfile (); - else if (m==partpasteprof) - partPasteProfile (); - else if (m==clearprof) { - for (int i=0; ithumbnail->clearProcParams (FILEBROWSER); - queue_draw (); - } -} - -void FileBrowser::copyProfile () { - - if (selected.size()==1) - clipboard.setProcParams (((FileBrowserEntry*)selected[0])->thumbnail->getProcParams()); -} - -void FileBrowser::pasteProfile () { - - std::vector mselected; - for (int i=0; ithumbnail->setProcParams (clipboard.getProcParams(), FILEBROWSER); - - queue_draw (); -} - -void FileBrowser::partPasteProfile () { - - std::vector mselected; - for (int i=0; ithumbnail->getProcParams (); - partialPasteDlg.applyPaste (¶ms, &clipboard.getProcParams()); - mselected[i]->thumbnail->setProcParams (params, FILEBROWSER); - } + queue_draw (); + } +} + +void FileBrowser::copyProfile () { + + if (selected.size()==1) + clipboard.setProcParams (((FileBrowserEntry*)selected[0])->thumbnail->getProcParams()); +} + +void FileBrowser::pasteProfile () { + + std::vector mselected; + for (int i=0; ithumbnail->setProcParams (clipboard.getProcParams(), FILEBROWSER); + + queue_draw (); +} + +void FileBrowser::partPasteProfile () { + + std::vector mselected; + for (int i=0; ithumbnail->getProcParams (); + partialPasteDlg.applyPaste (¶ms, &clipboard.getProcParams()); + mselected[i]->thumbnail->setProcParams (params, FILEBROWSER); + } + + queue_draw (); + } + partialPasteDlg.hide (); +} + +bool FileBrowser::keyPressed (GdkEventKey* event) { + + if ((event->keyval==GDK_C || event->keyval==GDK_c) && event->state & GDK_CONTROL_MASK) { + copyProfile (); + return true; + } + else if ((event->keyval==GDK_V || event->keyval==GDK_v) && event->state & GDK_CONTROL_MASK && !(event->state & GDK_SHIFT_MASK)) { + pasteProfile (); + return true; + } + else if ((event->keyval==GDK_V || event->keyval==GDK_v) && event->state & GDK_CONTROL_MASK && event->state & GDK_SHIFT_MASK) { + partPasteProfile (); + return true; + } + else if (event->keyval==GDK_Delete && !(event->state & GDK_SHIFT_MASK)) { + menuItemActivated (trash); + return true; + } + else if (event->keyval==GDK_Delete && event->state & GDK_SHIFT_MASK) { + menuItemActivated (untrash); + return true; + } + else if ((event->keyval==GDK_Q || event->keyval==GDK_q) && event->state & GDK_CONTROL_MASK) { + menuItemActivated (develop); + return true; + } + else if ((event->keyval==GDK_A || event->keyval==GDK_a) && event->state & GDK_CONTROL_MASK) { + menuItemActivated (selall); + return true; + } + + return false; +} + +void FileBrowser::applyMenuItemActivated (Glib::ustring ppname) { + + rtengine::procparams::ProcParams* pparams = profileStore.getProfile (ppname); + if (pparams && selected.size()>0) { + for (int i=0; ithumbnail->setProcParams (*pparams, FILEBROWSER); + queue_draw (); + } +} + +void FileBrowser::applyFilter (const BrowserFilter& filter) { + + this->filter = filter; - queue_draw (); - } - partialPasteDlg.hide (); -} - -bool FileBrowser::keyPressed (GdkEventKey* event) { - - if ((event->keyval==GDK_C || event->keyval==GDK_c) && event->state & GDK_CONTROL_MASK) { - copyProfile (); - return true; - } - else if ((event->keyval==GDK_V || event->keyval==GDK_v) && event->state & GDK_CONTROL_MASK && !(event->state & GDK_SHIFT_MASK)) { - pasteProfile (); - return true; - } - else if ((event->keyval==GDK_V || event->keyval==GDK_v) && event->state & GDK_CONTROL_MASK && event->state & GDK_SHIFT_MASK) { - partPasteProfile (); - return true; - } - else if (event->keyval==GDK_Delete && !(event->state & GDK_SHIFT_MASK)) { - menuItemActivated (trash); - return true; - } - else if (event->keyval==GDK_Delete && event->state & GDK_SHIFT_MASK) { - menuItemActivated (untrash); - return true; - } - else if ((event->keyval==GDK_Q || event->keyval==GDK_q) && event->state & GDK_CONTROL_MASK) { - menuItemActivated (develop); - return true; - } - else if ((event->keyval==GDK_A || event->keyval==GDK_a) && event->state & GDK_CONTROL_MASK) { - menuItemActivated (selall); - return true; - } - - return false; -} - -void FileBrowser::applyMenuItemActivated (Glib::ustring ppname) { - - rtengine::procparams::ProcParams* pparams = profileStore.getProfile (ppname); - if (pparams && selected.size()>0) { - for (int i=0; ithumbnail->setProcParams (*pparams, FILEBROWSER); - queue_draw (); - } -} - -void FileBrowser::applyFilter (const BrowserFilter& filter) { - - this->filter = filter; - // remove items not complying the filter from the selection - bool selchanged = false; - for (int i=0; iselected && !checkFilter (fd[i])) { - fd[i]->selected = false; - std::vector::iterator j = std::find (selected.begin(), selected.end(), fd[i]); - selected.erase (j); - if (lastClicked==fd[i]) + bool selchanged = false; + for (int i=0; iselected && !checkFilter (fd[i])) { + fd[i]->selected = false; + std::vector::iterator j = std::find (selected.begin(), selected.end(), fd[i]); + selected.erase (j); + if (lastClicked==fd[i]) lastClicked = NULL; - selchanged = true; + selchanged = true; } if (selchanged) notifySelectionListener (); - redraw (); -} - -bool FileBrowser::checkFilter (ThumbBrowserEntryBase* entryb) { // true -> entry complies filter - - FileBrowserEntry* entry = (FileBrowserEntry*)entryb; - // return false if basic filter settings are not satisfied - if (filter.showRanked[entry->thumbnail->getRank()]==false || (entry->thumbnail->getStage()==1 && !filter.showTrash) || (entry->thumbnail->getStage()==0 && !filter.showNotTrash)) - return false; - - // check exif filter - const CacheImageData* cfs = entry->thumbnail->getCacheImageData(); - double tol = 0.01; - double tol2 = 1e-8; - - if (!filter.exifFilterEnabled) - return true; - - if (!cfs->exifValid) - return (!filter.exifFilter.filterCamera || filter.exifFilter.cameras.count(cfs->camera)>0) - && (!filter.exifFilter.filterLens || filter.exifFilter.lenses.count(cfs->lens)>0); - - return - (!filter.exifFilter.filterShutter || (rtengine::ImageMetaData::shutterFromString(rtengine::ImageMetaData::shutterToString(cfs->shutter)) >= filter.exifFilter.shutterFrom-tol2 && rtengine::ImageMetaData::shutterFromString(rtengine::ImageMetaData::shutterToString(cfs->shutter)) <= filter.exifFilter.shutterTo+tol2)) - && (!filter.exifFilter.filterFNumber || (rtengine::ImageMetaData::apertureFromString(rtengine::ImageMetaData::apertureToString(cfs->fnumber)) >= filter.exifFilter.fnumberFrom-tol2 && rtengine::ImageMetaData::apertureFromString(rtengine::ImageMetaData::apertureToString(cfs->fnumber)) <= filter.exifFilter.fnumberTo+tol2)) - && (!filter.exifFilter.filterFocalLen || (cfs->focalLen >= filter.exifFilter.focalFrom-tol && cfs->focalLen <= filter.exifFilter.focalTo+tol)) - && (!filter.exifFilter.filterISO || (cfs->iso >= filter.exifFilter.isoFrom && cfs->iso <= filter.exifFilter.isoTo)) - && (!filter.exifFilter.filterCamera || filter.exifFilter.cameras.count(cfs->camera)>0) - && (!filter.exifFilter.filterLens || filter.exifFilter.lenses.count(cfs->lens)>0); -} - -void FileBrowser::toTrashRequested (std::vector tbe) { - - for (int i=0; ithumbnail->getStage()==1) - continue; - tbe[i]->thumbnail->setStage (1); - if (tbe[i]->getThumbButtonSet()) { - tbe[i]->getThumbButtonSet()->setRank (tbe[i]->thumbnail->getRank()); - tbe[i]->getThumbButtonSet()->setInTrash (true); - } + redraw (); +} + +bool FileBrowser::checkFilter (ThumbBrowserEntryBase* entryb) { // true -> entry complies filter + + FileBrowserEntry* entry = (FileBrowserEntry*)entryb; + // return false if basic filter settings are not satisfied + if (filter.showRanked[entry->thumbnail->getRank()]==false || (entry->thumbnail->getStage()==1 && !filter.showTrash) || (entry->thumbnail->getStage()==0 && !filter.showNotTrash)) + return false; + + // check exif filter + const CacheImageData* cfs = entry->thumbnail->getCacheImageData(); + double tol = 0.01; + double tol2 = 1e-8; + + if (!filter.exifFilterEnabled) + return true; + + if (!cfs->exifValid) + return (!filter.exifFilter.filterCamera || filter.exifFilter.cameras.count(cfs->camera)>0) + && (!filter.exifFilter.filterLens || filter.exifFilter.lenses.count(cfs->lens)>0); + + return + (!filter.exifFilter.filterShutter || (rtengine::ImageMetaData::shutterFromString(rtengine::ImageMetaData::shutterToString(cfs->shutter)) >= filter.exifFilter.shutterFrom-tol2 && rtengine::ImageMetaData::shutterFromString(rtengine::ImageMetaData::shutterToString(cfs->shutter)) <= filter.exifFilter.shutterTo+tol2)) + && (!filter.exifFilter.filterFNumber || (rtengine::ImageMetaData::apertureFromString(rtengine::ImageMetaData::apertureToString(cfs->fnumber)) >= filter.exifFilter.fnumberFrom-tol2 && rtengine::ImageMetaData::apertureFromString(rtengine::ImageMetaData::apertureToString(cfs->fnumber)) <= filter.exifFilter.fnumberTo+tol2)) + && (!filter.exifFilter.filterFocalLen || (cfs->focalLen >= filter.exifFilter.focalFrom-tol && cfs->focalLen <= filter.exifFilter.focalTo+tol)) + && (!filter.exifFilter.filterISO || (cfs->iso >= filter.exifFilter.isoFrom && cfs->iso <= filter.exifFilter.isoTo)) + && (!filter.exifFilter.filterCamera || filter.exifFilter.cameras.count(cfs->camera)>0) + && (!filter.exifFilter.filterLens || filter.exifFilter.lenses.count(cfs->lens)>0); +} + +void FileBrowser::toTrashRequested (std::vector tbe) { + + for (int i=0; ithumbnail->getStage()==1) + continue; + tbe[i]->thumbnail->setStage (1); + if (tbe[i]->getThumbButtonSet()) { + tbe[i]->getThumbButtonSet()->setRank (tbe[i]->thumbnail->getRank()); + tbe[i]->getThumbButtonSet()->setInTrash (true); + } } - trash_changed().emit(); - applyFilter (filter); -} - -void FileBrowser::fromTrashRequested (std::vector tbe) { - - for (int i=0; ithumbnail->getStage()==0) - continue; - tbe[i]->thumbnail->setStage (0); - if (tbe[i]->getThumbButtonSet()) { - tbe[i]->getThumbButtonSet()->setRank (tbe[i]->thumbnail->getRank()); - tbe[i]->getThumbButtonSet()->setInTrash (false); - } + trash_changed().emit(); + applyFilter (filter); +} + +void FileBrowser::fromTrashRequested (std::vector tbe) { + + for (int i=0; ithumbnail->getStage()==0) + continue; + tbe[i]->thumbnail->setStage (0); + if (tbe[i]->getThumbButtonSet()) { + tbe[i]->getThumbButtonSet()->setRank (tbe[i]->thumbnail->getRank()); + tbe[i]->getThumbButtonSet()->setInTrash (false); + } } - trash_changed().emit(); - applyFilter (filter); -} - -void FileBrowser::rankingRequested (std::vector tbe, int rank) { - - for (int i=0; ithumbnail->setRank (rank); - if (tbe[i]->getThumbButtonSet()) - tbe[i]->getThumbButtonSet()->setRank (tbe[i]->thumbnail->getRank()); - } - applyFilter (filter); -} - -void FileBrowser::buttonPressed (LWButton* button, int actionCode, void* actionData) { - - if (actionCode>=0 && actionCode<=5) { // rank - std::vector tbe; - tbe.push_back ((FileBrowserEntry*)actionData); - rankingRequested (tbe, actionCode); - } - else if (actionCode==6 && tbl) { // to processin queue - std::vector tbe; - tbe.push_back ((FileBrowserEntry*)actionData); - tbl->developRequested (tbe); - } - else if (actionCode==7) { // to trash / undelete - std::vector tbe; - FileBrowserEntry* entry = (FileBrowserEntry*)actionData; - tbe.push_back (entry); - if (entry->thumbnail->getStage()==0) - toTrashRequested (tbe); - else - fromTrashRequested (tbe); - } -} - -void FileBrowser::openNextImage () { - - if (fd.size()>0) { - for (int i=fd.size()-1; i>=0; i--) - if (editedFiles.find (fd[i]->filename)!=editedFiles.end()) - if (i tbe, int rank) { + + for (int i=0; ithumbnail->setRank (rank); + if (tbe[i]->getThumbButtonSet()) + tbe[i]->getThumbButtonSet()->setRank (tbe[i]->thumbnail->getRank()); + } + applyFilter (filter); +} + +void FileBrowser::buttonPressed (LWButton* button, int actionCode, void* actionData) { + + if (actionCode>=0 && actionCode<=5) { // rank + std::vector tbe; + tbe.push_back ((FileBrowserEntry*)actionData); + rankingRequested (tbe, actionCode); + } + else if (actionCode==6 && tbl) { // to processin queue + std::vector tbe; + tbe.push_back ((FileBrowserEntry*)actionData); + tbl->developRequested (tbe); + } + else if (actionCode==7) { // to trash / undelete + std::vector tbe; + FileBrowserEntry* entry = (FileBrowserEntry*)actionData; + tbe.push_back (entry); + if (entry->thumbnail->getStage()==0) + toTrashRequested (tbe); + else + fromTrashRequested (tbe); + } +} + +void FileBrowser::openNextImage () { + + if (fd.size()>0) { + for (int i=fd.size()-1; i>=0; i--) + if (editedFiles.find (fd[i]->filename)!=editedFiles.end()) + if (i entries; entries.push_back (((FileBrowserEntry*)fd[i+1])->thumbnail); - tbl->openRequested (entries); - return; - } - if (tbl) { + tbl->openRequested (entries); + return; + } + if (tbl) { std::vector entries; entries.push_back (((FileBrowserEntry*)fd[0])->thumbnail); - tbl->openRequested (entries); + tbl->openRequested (entries); } - } -} - -void FileBrowser::openPrevImage () { - - if (fd.size()>0) { - for (int i=0; ifilename)!=editedFiles.end()) - if (i>0 && tbl) { + } +} + +void FileBrowser::openPrevImage () { + + if (fd.size()>0) { + for (int i=0; ifilename)!=editedFiles.end()) + if (i>0 && tbl) { std::vector entries; entries.push_back (((FileBrowserEntry*)fd[i-1])->thumbnail); - tbl->openRequested (entries); - return; - } - if (tbl) { + tbl->openRequested (entries); + return; + } + if (tbl) { std::vector entries; entries.push_back (((FileBrowserEntry*)fd[fd.size()-1])->thumbnail); - tbl->openRequested (entries); - } - } -} - -int redrawtb (void* data) { - - ((FileBrowser*)data)->_thumbRearrangementNeeded (); - return 0; -} - -void FileBrowser::_thumbRearrangementNeeded () { - + tbl->openRequested (entries); + } + } +} + +int redrawtb (void* data) { + + ((FileBrowser*)data)->_thumbRearrangementNeeded (); + return 0; +} + +void FileBrowser::_thumbRearrangementNeeded () { + refreshThumbImages (); -} - -void FileBrowser::thumbRearrangementNeeded () { - - g_idle_add (redrawtb, this); -} +} + +void FileBrowser::thumbRearrangementNeeded () { + + g_idle_add (redrawtb, this); +} void FileBrowser::selectionChanged () { notifySelectionListener (); @@ -568,19 +568,19 @@ void FileBrowser::notifySelectionListener () { } void FileBrowser::redrawNeeded (ThumbBrowserEntryBase* entry) { - - if (entry->insideWindow (0, 0, internal.get_width(), internal.get_height())) { - if (!internal.isDirty ()) { - internal.setDirty (); - internal.queue_draw (); - } + + if (entry->insideWindow (0, 0, internal.get_width(), internal.get_height())) { + if (!internal.isDirty ()) { + internal.setDirty (); + internal.queue_draw (); + } } } -void FileBrowser::redrawNeeded (LWButton* button) { - - queue_draw (); -} +void FileBrowser::redrawNeeded (LWButton* button) { + + queue_draw (); +} FileBrowser::type_trash_changed FileBrowser::trash_changed () { return m_trash_changed; } diff --git a/rtgui/filebrowser.h b/rtgui/filebrowser.h index 8b3e99a6d..bfe22f934 100644 --- a/rtgui/filebrowser.h +++ b/rtgui/filebrowser.h @@ -1,122 +1,122 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _FILEBROWSER_ -#define _FILEBROWSER_ - -#include -#include -#include -#include -#include -#include - -class FileBrowser; -class FileBrowserEntry; -class FileBrowserListener { - - public: - virtual void openRequested (std::vector tbe) {} - virtual void developRequested (std::vector tbe) {} - virtual void renameRequested (std::vector tbe) {} - virtual void deleteRequested (std::vector tbe) {} - virtual void selectionChanged (std::vector tbe) {} -}; - -struct FileBrowserIdleHelper { - FileBrowser* fbrowser; - bool destroyed; - int pending; -}; - -class FileBrowser : public ThumbBrowserBase, public LWButtonListener { +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _FILEBROWSER_ +#define _FILEBROWSER_ + +#include +#include +#include +#include +#include +#include + +class FileBrowser; +class FileBrowserEntry; +class FileBrowserListener { + + public: + virtual void openRequested (std::vector tbe) {} + virtual void developRequested (std::vector tbe) {} + virtual void renameRequested (std::vector tbe) {} + virtual void deleteRequested (std::vector tbe) {} + virtual void selectionChanged (std::vector tbe) {} +}; + +struct FileBrowserIdleHelper { + FileBrowser* fbrowser; + bool destroyed; + int pending; +}; + +class FileBrowser : public ThumbBrowserBase, public LWButtonListener { typedef sigc::signal type_trash_changed; - - protected: - - Gtk::MenuItem* rank[6]; - Gtk::MenuItem* trash; - Gtk::MenuItem* untrash; - Gtk::MenuItem* develop; - Gtk::MenuItem* rename; - Gtk::MenuItem* remove; - Gtk::MenuItem* open; - Gtk::MenuItem* selall; - Gtk::MenuItem* copyprof; - Gtk::MenuItem* pasteprof; - Gtk::MenuItem* partpasteprof; - Gtk::MenuItem* applyprof; - Gtk::MenuItem* clearprof; - Gtk::Menu* pmenu; + + protected: + + Gtk::MenuItem* rank[6]; + Gtk::MenuItem* trash; + Gtk::MenuItem* untrash; + Gtk::MenuItem* develop; + Gtk::MenuItem* rename; + Gtk::MenuItem* remove; + Gtk::MenuItem* open; + Gtk::MenuItem* selall; + Gtk::MenuItem* copyprof; + Gtk::MenuItem* pasteprof; + Gtk::MenuItem* partpasteprof; + Gtk::MenuItem* applyprof; + Gtk::MenuItem* clearprof; + Gtk::Menu* pmenu; Gtk::Menu* profmenu; - Glib::RefPtr pmaccelgroup; - - FileBrowserListener* tbl; - BrowserFilter filter; - PartialPasteDlg partialPasteDlg; - - FileBrowserIdleHelper* fbih; - - void toTrashRequested (std::vector tbe); - void fromTrashRequested (std::vector tbe); - void rankingRequested (std::vector tbe, int rank); + Glib::RefPtr pmaccelgroup; + + FileBrowserListener* tbl; + BrowserFilter filter; + PartialPasteDlg partialPasteDlg; + + FileBrowserIdleHelper* fbih; + + void toTrashRequested (std::vector tbe); + void fromTrashRequested (std::vector tbe); + void rankingRequested (std::vector tbe, int rank); void notifySelectionListener (); type_trash_changed m_trash_changed; - - public: - - FileBrowser (); - - void addEntry (FileBrowserEntry* entry); // can be called from any thread - void addEntry_ (FileBrowserEntry* entry); // this must be executed inside the gtk thread - FileBrowserEntry* delEntry (const Glib::ustring& fname); // return the entry if found here return NULL otherwise - FileBrowserEntry* findEntry (const Glib::ustring& fname); // return the entry if found here return NULL otherwise - void close (); - - void setFileBrowserListener (FileBrowserListener* l) { tbl = l; } - - void menuItemActivated (Gtk::MenuItem* m); - void applyMenuItemActivated (Glib::ustring ppname); - - void applyFilter (const BrowserFilter& filter); - - void buttonPressed (LWButton* button, int actionCode, void* actionData); - void redrawNeeded (LWButton* button); - bool checkFilter (ThumbBrowserEntryBase* entry); - void rightClicked (ThumbBrowserEntryBase* entry); - void doubleClicked (ThumbBrowserEntryBase* entry); - bool keyPressed (GdkEventKey* event); - - void openNextImage (); - void openPrevImage (); - void copyProfile (); - void pasteProfile (); - void partPasteProfile (); - + + public: + + FileBrowser (); + + void addEntry (FileBrowserEntry* entry); // can be called from any thread + void addEntry_ (FileBrowserEntry* entry); // this must be executed inside the gtk thread + FileBrowserEntry* delEntry (const Glib::ustring& fname); // return the entry if found here return NULL otherwise + FileBrowserEntry* findEntry (const Glib::ustring& fname); // return the entry if found here return NULL otherwise + void close (); + + void setFileBrowserListener (FileBrowserListener* l) { tbl = l; } + + void menuItemActivated (Gtk::MenuItem* m); + void applyMenuItemActivated (Glib::ustring ppname); + + void applyFilter (const BrowserFilter& filter); + + void buttonPressed (LWButton* button, int actionCode, void* actionData); + void redrawNeeded (LWButton* button); + bool checkFilter (ThumbBrowserEntryBase* entry); + void rightClicked (ThumbBrowserEntryBase* entry); + void doubleClicked (ThumbBrowserEntryBase* entry); + bool keyPressed (GdkEventKey* event); + + void openNextImage (); + void openPrevImage (); + void copyProfile (); + void pasteProfile (); + void partPasteProfile (); + void redrawNeeded (ThumbBrowserEntryBase* entry); - void thumbRearrangementNeeded (); + void thumbRearrangementNeeded (); void _thumbRearrangementNeeded (); void selectionChanged (); - type_trash_changed trash_changed(); -}; - -#endif + type_trash_changed trash_changed(); +}; + +#endif diff --git a/rtgui/filebrowserentry.cc b/rtgui/filebrowserentry.cc index 7b955c00b..e5f69c7c8 100644 --- a/rtgui/filebrowserentry.cc +++ b/rtgui/filebrowserentry.cc @@ -1,22 +1,22 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include #include #include #include @@ -25,34 +25,34 @@ #define CROPRESIZEBORDER 4 -bool FileBrowserEntry::iconsLoaded = false; -Glib::RefPtr FileBrowserEntry::editedIcon; -Glib::RefPtr FileBrowserEntry::recentlySavedIcon; -Glib::RefPtr FileBrowserEntry::enqueuedIcon; - -FileBrowserEntry::FileBrowserEntry (Thumbnail* thm, const Glib::ustring& fname) - : ThumbBrowserEntryBase (fname), thumbnail(thm), iatlistener(NULL), state(SNormal), cropgl(NULL) { +bool FileBrowserEntry::iconsLoaded = false; +Glib::RefPtr FileBrowserEntry::editedIcon; +Glib::RefPtr FileBrowserEntry::recentlySavedIcon; +Glib::RefPtr FileBrowserEntry::enqueuedIcon; + +FileBrowserEntry::FileBrowserEntry (Thumbnail* thm, const Glib::ustring& fname) + : ThumbBrowserEntryBase (fname), thumbnail(thm), iatlistener(NULL), state(SNormal), cropgl(NULL) { feih = new FileBrowserEntryIdleHelper; feih->fbentry = this; feih->destroyed = false; feih->pending = 0; - - italicstyle = thumbnail->getType() != FT_Raw; - datetimeline = thumbnail->getDateTimeString (); + + italicstyle = thumbnail->getType() != FT_Raw; + datetimeline = thumbnail->getDateTimeString (); exifline = thumbnail->getExifString (); scale = 1; if (!iconsLoaded) { - editedIcon = safe_create_from_file (argv0+"/images/edited.png"); - recentlySavedIcon = safe_create_from_file (argv0+"/images/saved.png"); - enqueuedIcon = safe_create_from_file (argv0+"/images/processing.png"); + editedIcon = safe_create_from_file (argv0+"/images/edited.png"); + recentlySavedIcon = safe_create_from_file (argv0+"/images/saved.png"); + enqueuedIcon = safe_create_from_file (argv0+"/images/processing.png"); } if (thm) - thm->addThumbnailListener (this); -} + thm->addThumbnailListener (this); +} FileBrowserEntry::~FileBrowserEntry () { @@ -64,8 +64,8 @@ FileBrowserEntry::~FileBrowserEntry () { feih->destroyed = true; else delete feih; -} - +} + void FileBrowserEntry::refreshThumbnailImage () { if (!thumbnail) @@ -73,30 +73,30 @@ void FileBrowserEntry::refreshThumbnailImage () { thumbImageUpdater.add (thumbnail, thumbnail->getProcParams(), preh, &updatepriority, this); thumbImageUpdater.process (); -} - -void FileBrowserEntry::calcThumbnailSize () { - - if (thumbnail) - thumbnail->getThumbnailSize (prew, preh); -} +} -std::vector > FileBrowserEntry::getIconsOnImageArea () { - - std::vector > ret; - - if (!thumbnail) - return ret; - - if (thumbnail->hasProcParams() && editedIcon) - ret.push_back (editedIcon); - if (thumbnail->isRecentlySaved() && recentlySavedIcon) - ret.push_back (recentlySavedIcon); - if (thumbnail->isEnqueued () && enqueuedIcon) - ret.push_back (enqueuedIcon); - - return ret; -} +void FileBrowserEntry::calcThumbnailSize () { + + if (thumbnail) + thumbnail->getThumbnailSize (prew, preh); +} + +std::vector > FileBrowserEntry::getIconsOnImageArea () { + + std::vector > ret; + + if (!thumbnail) + return ret; + + if (thumbnail->hasProcParams() && editedIcon) + ret.push_back (editedIcon); + if (thumbnail->isRecentlySaved() && recentlySavedIcon) + ret.push_back (recentlySavedIcon); + if (thumbnail->isEnqueued () && enqueuedIcon) + ret.push_back (enqueuedIcon); + + return ret; +} void FileBrowserEntry::customBackBufferUpdate (Cairo::RefPtr c) { @@ -113,17 +113,17 @@ void FileBrowserEntry::getIconSize (int& w, int& h) { w = editedIcon->get_width (); h = editedIcon->get_height (); -} - -FileThumbnailButtonSet* FileBrowserEntry::getThumbButtonSet () { - - return (FileThumbnailButtonSet*)buttonSet; -} +} + +FileThumbnailButtonSet* FileBrowserEntry::getThumbButtonSet () { + + return (FileThumbnailButtonSet*)buttonSet; +} void FileBrowserEntry::procParamsChanged (Thumbnail* thm, int whoChangedIt) { refreshThumbnailImage (); -} +} struct tiupdate { FileBrowserEntryIdleHelper* feih; @@ -315,17 +315,17 @@ bool FileBrowserEntry::pressNotify (int button, int type, int bstate, int x, i } else if (onArea (CropImage, ix, iy)) { if (tm == TMStraighten) { - state = SRotateSelecting; - press_x = x; - press_y = y; - action_x = x; + state = SRotateSelecting; + press_x = x; + press_y = y; + action_x = x; action_y = y; rot_deg = 0; - b = true; + b = true; } else if (tm == TMSpotWB) { iatlistener->spotWBselected ((ix-prex)/scale, (iy-prey)/scale, thumbnail); - b = true; + b = true; } else if (tm == TMCropSelect) { cropgl = iatlistener->startCropEditing (thumbnail); @@ -471,41 +471,41 @@ void FileBrowserEntry::draw () { void FileBrowserEntry::drawStraightenGuide (Cairo::RefPtr cr) { - if (action_x!=press_x || action_y!=press_y) { - double arg = (press_x-action_x) / sqrt(double((press_x-action_x)*(press_x-action_x)+(press_y-action_y)*(press_y-action_y))); - double sol1, sol2; - double pi = M_PI; - if (press_y>action_y) { - sol1 = acos(arg)*180/pi; - sol2 = -acos(-arg)*180/pi; - } - else { - sol1 = acos(-arg)*180/pi; - sol2 = -acos(arg)*180/pi; - } - if (fabs(sol1)45) - rot_deg = - 90.0 + rot_deg; - } - else - rot_deg = 0; - - Glib::RefPtr context = parent->getDrawingArea()->get_pango_context () ; - Pango::FontDescription fontd = context->get_font_description (); - fontd.set_weight (Pango::WEIGHT_BOLD); - fontd.set_size (8*Pango::SCALE); - context->set_font_description (fontd); - Glib::RefPtr deglayout = parent->getDrawingArea()->create_pango_layout(Glib::ustring::compose ("%1 deg", Glib::ustring::format(std::setprecision(2), rot_deg))); + if (action_x!=press_x || action_y!=press_y) { + double arg = (press_x-action_x) / sqrt(double((press_x-action_x)*(press_x-action_x)+(press_y-action_y)*(press_y-action_y))); + double sol1, sol2; + double pi = M_PI; + if (press_y>action_y) { + sol1 = acos(arg)*180/pi; + sol2 = -acos(-arg)*180/pi; + } + else { + sol1 = acos(-arg)*180/pi; + sol2 = -acos(arg)*180/pi; + } + if (fabs(sol1)45) + rot_deg = - 90.0 + rot_deg; + } + else + rot_deg = 0; + + Glib::RefPtr context = parent->getDrawingArea()->get_pango_context () ; + Pango::FontDescription fontd = context->get_font_description (); + fontd.set_weight (Pango::WEIGHT_BOLD); + fontd.set_size (8*Pango::SCALE); + context->set_font_description (fontd); + Glib::RefPtr deglayout = parent->getDrawingArea()->create_pango_layout(Glib::ustring::compose ("%1 deg", Glib::ustring::format(std::setprecision(2), rot_deg))); + + int x1 = press_x; + int y1 = press_y; + int y2 = action_y; int x2 = action_x; if (x2 cr) { y2 = preh+prey+ofsY+starty-1; } - cr->set_line_width (1.5); - cr->set_source_rgb (1.0, 1.0, 1.0); - cr->move_to (x1, y1); - cr->line_to (x2, y2); - cr->stroke (); - cr->set_source_rgb (0.0, 0.0, 0.0); - std::valarray ds (1); - ds[0] = 4; - cr->set_dash (ds, 0); - cr->move_to (x1, y1); - cr->line_to (x2, y2); - cr->stroke (); - - if (press_x!=action_x && press_y!=action_y) { + cr->set_line_width (1.5); + cr->set_source_rgb (1.0, 1.0, 1.0); + cr->move_to (x1, y1); + cr->line_to (x2, y2); + cr->stroke (); + cr->set_source_rgb (0.0, 0.0, 0.0); + std::valarray ds (1); + ds[0] = 4; + cr->set_dash (ds, 0); + cr->move_to (x1, y1); + cr->line_to (x2, y2); + cr->stroke (); + + if (press_x!=action_x && press_y!=action_y) { cr->set_source_rgb (0.0, 0.0, 0.0); cr->move_to ((x1+x2)/2+1, (y1+y2)/2+1); deglayout->add_to_cairo_context (cr); @@ -553,6 +553,6 @@ void FileBrowserEntry::drawStraightenGuide (Cairo::RefPtr cr) { cr->move_to ((x1+x2)/2, (y1+y2)/2); deglayout->add_to_cairo_context (cr); cr->fill (); - } + } } diff --git a/rtgui/filebrowserentry.h b/rtgui/filebrowserentry.h index 6c503ed4f..53a1fcf16 100644 --- a/rtgui/filebrowserentry.h +++ b/rtgui/filebrowserentry.h @@ -1,95 +1,95 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _FILEBROWSERENTRY_ -#define _FILEBROWSERENTRY_ - -#include -#include -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _FILEBROWSERENTRY_ +#define _FILEBROWSERENTRY_ + +#include +#include +#include +#include #include #include -#include -#include -#include -#include - - -class FileBrowserEntry; -struct FileBrowserEntryIdleHelper { - FileBrowserEntry* fbentry; - bool destroyed; - int pending; -}; - -class FileThumbnailButtonSet; -class FileBrowserEntry : public ThumbBrowserEntryBase, - public ThumbnailListener, - public ThumbImageUpdateListener { +#include +#include +#include +#include - double scale; - static bool iconsLoaded; - ImageAreaToolListener* iatlistener; + +class FileBrowserEntry; +struct FileBrowserEntryIdleHelper { + FileBrowserEntry* fbentry; + bool destroyed; + int pending; +}; + +class FileThumbnailButtonSet; +class FileBrowserEntry : public ThumbBrowserEntryBase, + public ThumbnailListener, + public ThumbImageUpdateListener { + + double scale; + static bool iconsLoaded; + ImageAreaToolListener* iatlistener; int press_x, press_y, action_x, action_y; double rot_deg; - rtengine::procparams::CropParams cropParams; - CropGUIListener* cropgl; - FileBrowserEntryIdleHelper* feih; - - ImgEditState state; - - bool onArea (CursorArea a, int x, int y); + rtengine::procparams::CropParams cropParams; + CropGUIListener* cropgl; + FileBrowserEntryIdleHelper* feih; + + ImgEditState state; + + bool onArea (CursorArea a, int x, int y); void updateCursor (int x, int y); - void drawStraightenGuide (Cairo::RefPtr c); - void customBackBufferUpdate (Cairo::RefPtr c); - -public: - + void drawStraightenGuide (Cairo::RefPtr c); + void customBackBufferUpdate (Cairo::RefPtr c); + +public: + static Glib::RefPtr editedIcon; static Glib::RefPtr recentlySavedIcon; static Glib::RefPtr enqueuedIcon; - - Thumbnail* thumbnail; - + + Thumbnail* thumbnail; + FileBrowserEntry (Thumbnail* thm, const Glib::ustring& fname); ~FileBrowserEntry (); - void draw (); - - void setImageAreaToolListener (ImageAreaToolListener* l) { iatlistener = l; } - - FileThumbnailButtonSet* getThumbButtonSet (); - - void refreshThumbnailImage (); + void draw (); + + void setImageAreaToolListener (ImageAreaToolListener* l) { iatlistener = l; } + + FileThumbnailButtonSet* getThumbButtonSet (); + + void refreshThumbnailImage (); void calcThumbnailSize (); - + std::vector > getIconsOnImageArea (); void getIconSize (int& w, int& h); // thumbnaillistener interface - void procParamsChanged (Thumbnail* thm, int whoChangedIt); + void procParamsChanged (Thumbnail* thm, int whoChangedIt); // thumbimageupdatelistener interface void updateImage (rtengine::IImage8* img, double scale, rtengine::procparams::CropParams cropParams); void _updateImage (rtengine::IImage8* img, double scale, rtengine::procparams::CropParams cropParams); // inside gtk thread - - bool motionNotify (int x, int y); - bool pressNotify (int button, int type, int bstate, int x, int y); - bool releaseNotify (int button, int type, int bstate, int x, int y); -}; - -#endif + + bool motionNotify (int x, int y); + bool pressNotify (int button, int type, int bstate, int x, int y); + bool releaseNotify (int button, int type, int bstate, int x, int y); +}; + +#endif diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index a567a8cbb..c05a9eb3d 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -1,814 +1,814 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include -#include -#include -#include -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include +#include +#include +#include +#include +#include #include -#include - -#define CHECKTIME 2000 - -extern Glib::ustring argv0; - -#ifdef _WIN32 -int _directoryUpdater (void* cat) { - - ((FileCatalog*)cat)->checkCounter++; - if (((FileCatalog*)cat)->checkCounter==2) { - gdk_threads_enter (); - ((FileCatalog*)cat)->reparseDirectory (); - gdk_threads_leave (); - } - return 1; -} -#endif - -FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb) : listener(NULL), fslistener(NULL), hasValidCurrentEFS(false), coarsePanel(cp), filterPanel(NULL), toolBar(tb) { - - previewLoader.setPreviewLoaderListener (this); - - // construct and initialize thumbnail browsers - fileBrowser = new FileBrowser(); - fileBrowser->setFileBrowserListener (this); - fileBrowser->setArrangement (ThumbBrowserBase::TB_Vertical); - fileBrowser->show (); - - // construct trash panel with the extra "empty trash" button - trashButtonBox = new Gtk::VBox; - Gtk::Button* emptyT = new Gtk::Button (M("FILEBROWSER_EMPTYTRASH")); - emptyT->set_tooltip_text (M("FILEBROWSER_EMPTYTRASHHINT")); - emptyT->set_image (*(new Gtk::Image (Gtk::StockID("gtk-delete"), Gtk::ICON_SIZE_BUTTON))); - emptyT->signal_pressed().connect (sigc::mem_fun(*this, &FileCatalog::emptyTrash)); - trashButtonBox->pack_start (*emptyT, Gtk::PACK_SHRINK, 4); - emptyT->show (); - trashButtonBox->show (); - - // setup button bar - buttonBar = new Gtk::HBox (); - pack_start (*buttonBar, Gtk::PACK_SHRINK); - - buttonBar->pack_start (*(new Gtk::VSeparator), Gtk::PACK_SHRINK); - bDir = new Gtk::ToggleButton (); - bDir->set_active (true); - bDir->set_image (*(new Gtk::Image (argv0+"/images/folder.png"))); - bDir->set_relief (Gtk::RELIEF_NONE); - bDir->set_tooltip_text (M("FILEBROWSER_SHOWDIRHINT")); - bCateg[0] = bDir->signal_toggled().connect (sigc::bind(sigc::mem_fun(*this, &FileCatalog::categoryButtonToggled), bDir)); - buttonBar->pack_start (*bDir, Gtk::PACK_SHRINK); - buttonBar->pack_start (*(new Gtk::VSeparator), Gtk::PACK_SHRINK); - - bUnRanked = new Gtk::ToggleButton (); - bUnRanked->set_active (false); - bUnRanked->set_image (*(new Gtk::Image (argv0+"/images/unrated.png"))); - bUnRanked->set_relief (Gtk::RELIEF_NONE); - bUnRanked->set_tooltip_text (M("FILEBROWSER_SHOWUNRANKHINT")); - bCateg[1] = bUnRanked->signal_toggled().connect (sigc::bind(sigc::mem_fun(*this, &FileCatalog::categoryButtonToggled), bUnRanked)); - buttonBar->pack_start (*bUnRanked, Gtk::PACK_SHRINK); - buttonBar->pack_start (*(new Gtk::VSeparator), Gtk::PACK_SHRINK); - - for (int i=0; i<5; i++) { - iranked[i] = new Gtk::Image (argv0+"/images/rated.png"); - igranked[i] = new Gtk::Image (argv0+"/images/grayrated.png"); - iranked[i]->show (); - igranked[i]->show (); - bRank[i] = new Gtk::ToggleButton (); - bRank[i]->set_image (*igranked[i]); - bRank[i]->set_relief (Gtk::RELIEF_NONE); - buttonBar->pack_start (*bRank[i], Gtk::PACK_SHRINK); - bCateg[i+2] = bRank[i]->signal_toggled().connect (sigc::bind(sigc::mem_fun(*this, &FileCatalog::categoryButtonToggled), bRank[i])); - } - bRank[0]->set_tooltip_text (M("FILEBROWSER_SHOWRANK1HINT")); - bRank[1]->set_tooltip_text (M("FILEBROWSER_SHOWRANK2HINT")); - bRank[2]->set_tooltip_text (M("FILEBROWSER_SHOWRANK3HINT")); - bRank[3]->set_tooltip_text (M("FILEBROWSER_SHOWRANK4HINT")); - bRank[4]->set_tooltip_text (M("FILEBROWSER_SHOWRANK5HINT")); - buttonBar->pack_start (*(new Gtk::VSeparator), Gtk::PACK_SHRINK); +#include + +#define CHECKTIME 2000 + +extern Glib::ustring argv0; + +#ifdef _WIN32 +int _directoryUpdater (void* cat) { + + ((FileCatalog*)cat)->checkCounter++; + if (((FileCatalog*)cat)->checkCounter==2) { + gdk_threads_enter (); + ((FileCatalog*)cat)->reparseDirectory (); + gdk_threads_leave (); + } + return 1; +} +#endif + +FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb) : listener(NULL), fslistener(NULL), hasValidCurrentEFS(false), coarsePanel(cp), filterPanel(NULL), toolBar(tb) { + + previewLoader.setPreviewLoaderListener (this); + + // construct and initialize thumbnail browsers + fileBrowser = new FileBrowser(); + fileBrowser->setFileBrowserListener (this); + fileBrowser->setArrangement (ThumbBrowserBase::TB_Vertical); + fileBrowser->show (); + + // construct trash panel with the extra "empty trash" button + trashButtonBox = new Gtk::VBox; + Gtk::Button* emptyT = new Gtk::Button (M("FILEBROWSER_EMPTYTRASH")); + emptyT->set_tooltip_text (M("FILEBROWSER_EMPTYTRASHHINT")); + emptyT->set_image (*(new Gtk::Image (Gtk::StockID("gtk-delete"), Gtk::ICON_SIZE_BUTTON))); + emptyT->signal_pressed().connect (sigc::mem_fun(*this, &FileCatalog::emptyTrash)); + trashButtonBox->pack_start (*emptyT, Gtk::PACK_SHRINK, 4); + emptyT->show (); + trashButtonBox->show (); + + // setup button bar + buttonBar = new Gtk::HBox (); + pack_start (*buttonBar, Gtk::PACK_SHRINK); + + buttonBar->pack_start (*(new Gtk::VSeparator), Gtk::PACK_SHRINK); + bDir = new Gtk::ToggleButton (); + bDir->set_active (true); + bDir->set_image (*(new Gtk::Image (argv0+"/images/folder.png"))); + bDir->set_relief (Gtk::RELIEF_NONE); + bDir->set_tooltip_text (M("FILEBROWSER_SHOWDIRHINT")); + bCateg[0] = bDir->signal_toggled().connect (sigc::bind(sigc::mem_fun(*this, &FileCatalog::categoryButtonToggled), bDir)); + buttonBar->pack_start (*bDir, Gtk::PACK_SHRINK); + buttonBar->pack_start (*(new Gtk::VSeparator), Gtk::PACK_SHRINK); + + bUnRanked = new Gtk::ToggleButton (); + bUnRanked->set_active (false); + bUnRanked->set_image (*(new Gtk::Image (argv0+"/images/unrated.png"))); + bUnRanked->set_relief (Gtk::RELIEF_NONE); + bUnRanked->set_tooltip_text (M("FILEBROWSER_SHOWUNRANKHINT")); + bCateg[1] = bUnRanked->signal_toggled().connect (sigc::bind(sigc::mem_fun(*this, &FileCatalog::categoryButtonToggled), bUnRanked)); + buttonBar->pack_start (*bUnRanked, Gtk::PACK_SHRINK); + buttonBar->pack_start (*(new Gtk::VSeparator), Gtk::PACK_SHRINK); + + for (int i=0; i<5; i++) { + iranked[i] = new Gtk::Image (argv0+"/images/rated.png"); + igranked[i] = new Gtk::Image (argv0+"/images/grayrated.png"); + iranked[i]->show (); + igranked[i]->show (); + bRank[i] = new Gtk::ToggleButton (); + bRank[i]->set_image (*igranked[i]); + bRank[i]->set_relief (Gtk::RELIEF_NONE); + buttonBar->pack_start (*bRank[i], Gtk::PACK_SHRINK); + bCateg[i+2] = bRank[i]->signal_toggled().connect (sigc::bind(sigc::mem_fun(*this, &FileCatalog::categoryButtonToggled), bRank[i])); + } + bRank[0]->set_tooltip_text (M("FILEBROWSER_SHOWRANK1HINT")); + bRank[1]->set_tooltip_text (M("FILEBROWSER_SHOWRANK2HINT")); + bRank[2]->set_tooltip_text (M("FILEBROWSER_SHOWRANK3HINT")); + bRank[3]->set_tooltip_text (M("FILEBROWSER_SHOWRANK4HINT")); + bRank[4]->set_tooltip_text (M("FILEBROWSER_SHOWRANK5HINT")); + buttonBar->pack_start (*(new Gtk::VSeparator), Gtk::PACK_SHRINK); iTrashEmpty = new Gtk::Image(argv0+"/images/trash-show-empty.png"); iTrashFull = new Gtk::Image(argv0+"/images/trash-show-full.png"); - - bTrash = new Gtk::ToggleButton (); - bTrash->set_image (*iTrashEmpty); - bTrash->set_relief (Gtk::RELIEF_NONE); - bTrash->set_tooltip_text (M("FILEBROWSER_SHOWTRASHHINT")); - bCateg[7] = bTrash->signal_toggled().connect (sigc::bind(sigc::mem_fun(*this, &FileCatalog::categoryButtonToggled), bTrash)); - buttonBar->pack_start (*bTrash, Gtk::PACK_SHRINK); + + bTrash = new Gtk::ToggleButton (); + bTrash->set_image (*iTrashEmpty); + bTrash->set_relief (Gtk::RELIEF_NONE); + bTrash->set_tooltip_text (M("FILEBROWSER_SHOWTRASHHINT")); + bCateg[7] = bTrash->signal_toggled().connect (sigc::bind(sigc::mem_fun(*this, &FileCatalog::categoryButtonToggled), bTrash)); + buttonBar->pack_start (*bTrash, Gtk::PACK_SHRINK); buttonBar->pack_start (*(new Gtk::VSeparator), Gtk::PACK_SHRINK); - fileBrowser->trash_changed().connect( sigc::mem_fun(*this, &FileCatalog::trashChanged) ); - - categoryButtons[0] = bDir; - categoryButtons[1] = bUnRanked; - for (int i=0; i<5; i++) - categoryButtons[i+2] = bRank[i]; - categoryButtons[7] = bTrash; - - exifInfo = Gtk::manage(new Gtk::ToggleButton ()); - exifInfo->set_image (*(new Gtk::Image (argv0+"/images/info.png"))); - exifInfo->set_relief (Gtk::RELIEF_NONE); - exifInfo->set_active( options.showFileNames ); - exifInfo->signal_toggled().connect(sigc::mem_fun(*this, &FileCatalog::exifInfoButtonToggled)); - buttonBar->pack_start (*exifInfo, Gtk::PACK_SHRINK); - - // thumbnail zoom - Gtk::HBox* zoomBox = new Gtk::HBox (); - zoomInButton = new Gtk::Button (); - zoomInButton->set_image (*(new Gtk::Image (Gtk::StockID("gtk-zoom-in"), Gtk::ICON_SIZE_SMALL_TOOLBAR))); - zoomInButton->signal_pressed().connect (sigc::mem_fun(*this, &FileCatalog::zoomIn)); - zoomInButton->set_relief (Gtk::RELIEF_NONE); - zoomInButton->set_tooltip_text (M("FILEBROWSER_ZOOMINHINT")); - zoomBox->pack_end (*zoomInButton, Gtk::PACK_SHRINK); - zoomOutButton = new Gtk::Button (); - zoomOutButton->set_image (*(new Gtk::Image (Gtk::StockID("gtk-zoom-out"), Gtk::ICON_SIZE_SMALL_TOOLBAR))); - zoomOutButton->signal_pressed().connect (sigc::mem_fun(*this, &FileCatalog::zoomOut)); - zoomOutButton->set_relief (Gtk::RELIEF_NONE); - zoomOutButton->set_tooltip_text (M("FILEBROWSER_ZOOMOUTHINT")); - zoomBox->pack_end (*zoomOutButton, Gtk::PACK_SHRINK); - - // add default panel - hBox = new Gtk::HBox (); - hBox->show (); - hBox->pack_end (*fileBrowser); - fileBrowser->applyFilter (getFilter()); - pack_start (*hBox); - - buttonBar2 = new Gtk::HBox (); - pack_end (*buttonBar2, Gtk::PACK_SHRINK); - progressBar = new Gtk::ProgressBar (); - buttonBar2->pack_start (*progressBar, Gtk::PACK_SHRINK, 4); - progressBar->set_size_request (-1, 16); - - buttonBar->pack_start (*zoomBox, Gtk::PACK_SHRINK); - - buttonBar->pack_end (*coarsePanel, Gtk::PACK_SHRINK); - buttonBar->pack_end (*Gtk::manage(new Gtk::VSeparator), Gtk::PACK_SHRINK, 4); - buttonBar->pack_end (*toolBar, Gtk::PACK_SHRINK); - buttonBar->pack_end (*Gtk::manage(new Gtk::VSeparator), Gtk::PACK_SHRINK, 4); - - enabled = true; - - lastScrollPos = 0; - for (int i=0; i<8; i++) { - hScrollPos[i] = 0; - vScrollPos[i] = 0; - } - - selectedDirectory = ""; -#ifdef _WIN32 - wdMonitor = NULL; - checkCounter = 2; - g_timeout_add (CHECKTIME, _directoryUpdater, this); -#endif -} - -void FileCatalog::exifInfoButtonToggled() -{ - options.showFileNames = exifInfo->get_active(); - fileBrowser->refreshThumbImages (); -} - -void FileCatalog::on_realize() { - - Gtk::VBox::on_realize(); - Pango::FontDescription fontd = get_pango_context()->get_font_description (); - fileBrowser->get_pango_context()->set_font_description (fontd); -// batchQueue->get_pango_context()->set_font_description (fontd); -} - -void FileCatalog::closeDir () { - - if (filterPanel) - filterPanel->set_sensitive (false); - -#ifndef _WIN32 - if (dirMonitor) - dirMonitor->cancel (); -#else - if (wdMonitor) { - delete wdMonitor; - wdMonitor = NULL; - } -#endif - // terminate thumbnail preview loading - previewLoader.terminate (); - - // terminate thumbnail updater - thumbImageUpdater.terminate (); - - // remove entries - fileBrowser->close (); - fileNameList.clear (); - - dirEFS.clear (); - hasValidCurrentEFS = false; - selectedDirectory = ""; - redrawAll (); -} - -std::vector FileCatalog::getFileList () { - - std::vector names; - Glib::RefPtr dir = Gio::File::create_for_path (selectedDirectory); + fileBrowser->trash_changed().connect( sigc::mem_fun(*this, &FileCatalog::trashChanged) ); + + categoryButtons[0] = bDir; + categoryButtons[1] = bUnRanked; + for (int i=0; i<5; i++) + categoryButtons[i+2] = bRank[i]; + categoryButtons[7] = bTrash; + + exifInfo = Gtk::manage(new Gtk::ToggleButton ()); + exifInfo->set_image (*(new Gtk::Image (argv0+"/images/info.png"))); + exifInfo->set_relief (Gtk::RELIEF_NONE); + exifInfo->set_active( options.showFileNames ); + exifInfo->signal_toggled().connect(sigc::mem_fun(*this, &FileCatalog::exifInfoButtonToggled)); + buttonBar->pack_start (*exifInfo, Gtk::PACK_SHRINK); + + // thumbnail zoom + Gtk::HBox* zoomBox = new Gtk::HBox (); + zoomInButton = new Gtk::Button (); + zoomInButton->set_image (*(new Gtk::Image (Gtk::StockID("gtk-zoom-in"), Gtk::ICON_SIZE_SMALL_TOOLBAR))); + zoomInButton->signal_pressed().connect (sigc::mem_fun(*this, &FileCatalog::zoomIn)); + zoomInButton->set_relief (Gtk::RELIEF_NONE); + zoomInButton->set_tooltip_text (M("FILEBROWSER_ZOOMINHINT")); + zoomBox->pack_end (*zoomInButton, Gtk::PACK_SHRINK); + zoomOutButton = new Gtk::Button (); + zoomOutButton->set_image (*(new Gtk::Image (Gtk::StockID("gtk-zoom-out"), Gtk::ICON_SIZE_SMALL_TOOLBAR))); + zoomOutButton->signal_pressed().connect (sigc::mem_fun(*this, &FileCatalog::zoomOut)); + zoomOutButton->set_relief (Gtk::RELIEF_NONE); + zoomOutButton->set_tooltip_text (M("FILEBROWSER_ZOOMOUTHINT")); + zoomBox->pack_end (*zoomOutButton, Gtk::PACK_SHRINK); + + // add default panel + hBox = new Gtk::HBox (); + hBox->show (); + hBox->pack_end (*fileBrowser); + fileBrowser->applyFilter (getFilter()); + pack_start (*hBox); + + buttonBar2 = new Gtk::HBox (); + pack_end (*buttonBar2, Gtk::PACK_SHRINK); + progressBar = new Gtk::ProgressBar (); + buttonBar2->pack_start (*progressBar, Gtk::PACK_SHRINK, 4); + progressBar->set_size_request (-1, 16); + + buttonBar->pack_start (*zoomBox, Gtk::PACK_SHRINK); + + buttonBar->pack_end (*coarsePanel, Gtk::PACK_SHRINK); + buttonBar->pack_end (*Gtk::manage(new Gtk::VSeparator), Gtk::PACK_SHRINK, 4); + buttonBar->pack_end (*toolBar, Gtk::PACK_SHRINK); + buttonBar->pack_end (*Gtk::manage(new Gtk::VSeparator), Gtk::PACK_SHRINK, 4); + + enabled = true; + + lastScrollPos = 0; + for (int i=0; i<8; i++) { + hScrollPos[i] = 0; + vScrollPos[i] = 0; + } + + selectedDirectory = ""; +#ifdef _WIN32 + wdMonitor = NULL; + checkCounter = 2; + g_timeout_add (CHECKTIME, _directoryUpdater, this); +#endif +} + +void FileCatalog::exifInfoButtonToggled() +{ + options.showFileNames = exifInfo->get_active(); + fileBrowser->refreshThumbImages (); +} + +void FileCatalog::on_realize() { + + Gtk::VBox::on_realize(); + Pango::FontDescription fontd = get_pango_context()->get_font_description (); + fileBrowser->get_pango_context()->set_font_description (fontd); +// batchQueue->get_pango_context()->set_font_description (fontd); +} + +void FileCatalog::closeDir () { + + if (filterPanel) + filterPanel->set_sensitive (false); + +#ifndef _WIN32 + if (dirMonitor) + dirMonitor->cancel (); +#else + if (wdMonitor) { + delete wdMonitor; + wdMonitor = NULL; + } +#endif + // terminate thumbnail preview loading + previewLoader.terminate (); + + // terminate thumbnail updater + thumbImageUpdater.terminate (); + + // remove entries + fileBrowser->close (); + fileNameList.clear (); + + dirEFS.clear (); + hasValidCurrentEFS = false; + selectedDirectory = ""; + redrawAll (); +} + +std::vector FileCatalog::getFileList () { + + std::vector names; + Glib::RefPtr dir = Gio::File::create_for_path (selectedDirectory); safe_build_file_list (dir, names, selectedDirectory); - return names; -} - -void FileCatalog::dirSelected (const Glib::ustring& dirname, const Glib::ustring& openfile) { - - try { - Glib::RefPtr dir = Gio::File::create_for_path (dirname); - - if (!dir) - return; - closeDir (); - previewsToLoad = 0; - previewsLoaded = 0; - // if openfile exists, we have to open it first (it is a command line argument) - if (openfile!="") - addAndOpenFile (openfile); - - selectedDirectory = dir->get_parse_name(); - fileNameList = getFileList (); - - for (int i=0; i f = Gio::File::create_for_path(fileNameList[i]); - if (f->get_parse_name() != openfile) // if we opened a file at the beginning dont add it again - checkAndAddFile (f); - } - - _refreshProgressBar (); - previewLoader.process (); - -#ifdef _WIN32 - wdMonitor = new WinDirMonitor (selectedDirectory, this); -#elif defined __APPLE__ - printf("TODO fix dir->monitor_directory () for OSX\n"); -#else - dirMonitor = dir->monitor_directory (); - dirMonitor->signal_changed().connect (sigc::bind(sigc::mem_fun(*this, &FileCatalog::on_dir_changed), false)); -#endif - } - catch (Glib::Exception& ex) { - std::cout << ex.what(); - } -} - -void FileCatalog::_refreshProgressBar () { - - // check if progress bar is visible -/* Glib::ListHandle list = buttonBar2->get_children (); - Glib::ListHandle::iterator i = list.begin (); - for (; i!=list.end() && *i!=progressBar; i++); - if (i==list.end()) { - buttonBar2->pack_start (*progressBar, Gtk::PACK_SHRINK, 4); - buttonBar2->reorder_child (*progressBar, 2); - } -*/ - progressBar->show (); - if (previewsToLoad>0) - progressBar->set_fraction ((double)previewsLoaded / previewsToLoad); - else - progressBar->set_fraction (1.0); -} - -int refreshpb (void* data) { - - gdk_threads_enter (); - ((FileCatalog*)data)->_refreshProgressBar (); - gdk_threads_leave (); - return 0; -} - -void FileCatalog::previewReady (FileBrowserEntry* fdn) { - - // put it into the "full directory" browser - fdn->setImageAreaToolListener (iatlistener); - fileBrowser->addEntry (fdn); - - // update exif filter settings (minimal & maximal values of exif tags, cameras, lenses, etc...) - const CacheImageData* cfs = fdn->thumbnail->getCacheImageData(); - if (cfs->exifValid) { - if (cfs->fnumber < dirEFS.fnumberFrom) - dirEFS.fnumberFrom = cfs->fnumber; - if (cfs->fnumber > dirEFS.fnumberTo) - dirEFS.fnumberTo = cfs->fnumber; - if (cfs->shutter < dirEFS.shutterFrom) - dirEFS.shutterFrom = cfs->shutter; - if (cfs->shutter > dirEFS.shutterTo) - dirEFS.shutterTo = cfs->shutter; - if (cfs->iso>0 && cfs->iso < dirEFS.isoFrom) - dirEFS.isoFrom = cfs->iso; - if (cfs->iso>0 && cfs->iso > dirEFS.isoTo) - dirEFS.isoTo = cfs->iso; - if (cfs->focalLen < dirEFS.focalFrom) - dirEFS.focalFrom = cfs->focalLen; - if (cfs->focalLen > dirEFS.focalTo) - dirEFS.focalTo = cfs->focalLen; - } - dirEFS.cameras.insert (cfs->camera); - dirEFS.lenses.insert (cfs->lens); - previewsLoaded++; - g_idle_add (refreshpb, this); -} - -int prevfinished (void* data) { - - gdk_threads_enter(); - ((FileCatalog*)data)->_previewsFinished (); - gdk_threads_leave(); - return 0; -} - -void FileCatalog::_previewsFinished () { - - redrawAll (); - previewsToLoad = 0; - previewsLoaded = 0; -// removeIfThere (buttonBar2, progressBar); - progressBar->hide (); - if (filterPanel) { - filterPanel->set_sensitive (true); - if ( !hasValidCurrentEFS ){ - currentEFS = dirEFS; - filterPanel->setFilter ( dirEFS,true ); - }else { - filterPanel->setFilter ( currentEFS,false ); - } - } -} - -void FileCatalog::previewsFinished () { - - if (!hasValidCurrentEFS) - currentEFS = dirEFS; - g_idle_add (prevfinished, this); -} - -void PreviewLoader::remove (Glib::ustring fname) { - std::list::iterator i; - for (i=jqueue.begin(); i!=jqueue.end(); i++) - if (i->fullName==fname) - break; - if (i!=jqueue.end()) - jqueue.erase (i); -} - -void PreviewLoader::start () { - - jqueue.sort (); -} - -void PreviewLoader::process (DirEntry& current) { - - if (Glib::file_test (current.fullName, Glib::FILE_TEST_EXISTS)) { - Thumbnail* tmb = cacheMgr.getEntry (current.fullName); - if (tmb && pl) - pl->previewReady (new FileBrowserEntry (tmb, current.fullName)); - } -} - -void PreviewLoader::end () { - - if (pl) - pl->previewsFinished (); -} - -void FileCatalog::setEnabled (bool e) { - - enabled = e; -} - -void FileCatalog::redrawAll () { - - fileBrowser->queue_draw (); -} - -void FileCatalog::refreshAll () { - - fileBrowser->refreshThumbImages (); -} - -void FileCatalog::_openImage (std::vector tmb) { - - if (enabled && listener!=NULL) { - previewLoader.stop (); - thumbImageUpdater.stop (); - for (int i=0; igetFileName())==editedFiles.end()) - listener->fileSelected (tmb[i]); - tmb[i]->decreaseRef (); - } - previewLoader.process (); - thumbImageUpdater.process (); - } -} - -struct FCOIParams { - FileCatalog* catalog; - std::vector tmb; -}; - -int fcopenimg (void* p) { - - gdk_threads_enter (); - FCOIParams* params = (FCOIParams*)p; - params->catalog->_openImage (params->tmb); - delete params; - gdk_threads_leave (); - return 0; -} - -void FileCatalog::openRequested (std::vector tmb) { - - FCOIParams* params = new FCOIParams; - params->catalog = this; - params->tmb = tmb; - for (int i=0; iincreaseRef (); - g_idle_add (fcopenimg, params); -} - -void FileCatalog::deleteRequested (std::vector tbe) { - - if (tbe.size()==0) - return; - - Gtk::MessageDialog msd (M("FILEBROWSER_DELETEDLGLABEL"), false, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_YES_NO, true); - msd.set_secondary_text(Glib::ustring::compose (M("FILEBROWSER_DELETEDLGMSG"), tbe.size())); - - if (msd.run()==Gtk::RESPONSE_YES) { - for (int i=0; ifilename; - // remove from browser - FileBrowserEntry* t = fileBrowser->delEntry (fname); -// t->thumbnail->decreaseRef (); - delete t; - // remove from cache - cacheMgr.deleteEntry (fname); - // delete from file system - ::g_remove (fname.c_str()); - // delete .pp2 if found - ::g_remove (Glib::ustring(fname+".pp2").c_str()); - ::g_remove (Glib::ustring(removeExtension(fname)+".pp2").c_str()); - // delete .thm file - ::g_remove (Glib::ustring(removeExtension(fname)+".thm").c_str()); - ::g_remove (Glib::ustring(removeExtension(fname)+".THM").c_str()); - } - redrawAll (); - } -} - -void FileCatalog::developRequested (std::vector tbe) { - - if (listener) { - thumbImageUpdater.stop (); - for (int i=0; ithumbnail->getProcParams(); - rtengine::ProcessingJob* pjob = rtengine::ProcessingJob::create (tbe[i]->filename, tbe[i]->thumbnail->getType()==FT_Raw, params); - double tmpscale; - rtengine::IImage8* img = tbe[i]->thumbnail->processThumbImage (params, options.maxThumbnailHeight, tmpscale); - if (img) { - int pw = img->getWidth (); - int ph = img->getHeight (); - guint8* prev = new guint8 [pw*ph*3]; - memcpy (prev, img->getData (), pw*ph*3); - listener->addBatchQueueJob (new BatchQueueEntry (pjob, params, tbe[i]->filename, prev, pw, ph, tbe[i]->thumbnail)); - } - else { - int pw, ph; - tbe[i]->thumbnail->getThumbnailSize (pw, ph); - listener->addBatchQueueJob (new BatchQueueEntry (pjob, params, tbe[i]->filename, NULL, pw, ph, tbe[i]->thumbnail)); - } - } - thumbImageUpdater.process (); - } -} - -void FileCatalog::renameRequested (std::vector tbe) { - - RenameDialog* renameDlg = new RenameDialog ((Gtk::Window*)get_toplevel()); - - for (int i=0; iinitName (Glib::path_get_basename (tbe[i]->filename), tbe[i]->thumbnail->getCacheImageData()); - - Glib::ustring ofname = tbe[i]->filename; - Glib::ustring dirName = Glib::path_get_dirname (tbe[i]->filename); - Glib::ustring baseName = Glib::path_get_basename (tbe[i]->filename); - - if (renameDlg->run ()== Gtk::RESPONSE_OK) { - Glib::ustring nBaseName = renameDlg->getNewName (); - // if path has directory components, exit - if (Glib::path_get_dirname (nBaseName) != ".") - continue; - // if no extension is given, concatenate the extension of the original file - Glib::ustring ext = getExtension (nBaseName); - if (ext=="") - nBaseName += "." + getExtension (baseName); - Glib::ustring nfname = Glib::build_filename (dirName, nBaseName); - if (!::g_rename (ofname.c_str(), nfname.c_str())) { - cacheMgr.renameEntry (ofname, tbe[i]->thumbnail->getMD5(), nfname); - reparseDirectory (); - } - renameDlg->hide (); - } - } - delete renameDlg; -/* // ask for new file name - Gtk::Dialog dialog (M("FILEBROWSER_RENAMEDLGLABEL"), *((Gtk::Window*)get_toplevel()), true, true); - - dialog.add_button (Gtk::Stock::OK, Gtk::RESPONSE_OK); - dialog.add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - - Gtk::Label l; - dialog.get_vbox()->pack_start (l, Gtk::PACK_SHRINK); - - Gtk::Entry nfentry; - - dialog.get_vbox()->pack_start (nfentry, Gtk::PACK_SHRINK); - dialog.get_vbox()->show_all (); - - nfentry.set_activates_default (true); - dialog.set_default_response (Gtk::RESPONSE_OK); - - for (int i=0; ifilename; - Glib::ustring dirName = Glib::path_get_dirname (tbe[i]->filename); - Glib::ustring baseName = Glib::path_get_basename (tbe[i]->filename); - - l.set_markup (Glib::ustring("") + Glib::ustring::compose (M("FILEBROWSER_RENAMEDLGMSG"), baseName) + Glib::ustring("")); - nfentry.set_text (baseName); - nfentry.select_region (0, baseName.size()); - - if (dialog.run ()== Gtk::RESPONSE_OK) { - Glib::ustring nBaseName = nfentry.get_text (); - // if path has directory components, exit - if (Glib::path_get_dirname (nBaseName) != ".") - continue; - // if no extension is given, concatenate the extension of the original file - if (nBaseName.find ('.')==nBaseName.npos) { - int lastdot = baseName.find_last_of ('.'); - nBaseName += "." + (lastdot!=Glib::ustring::npos ? baseName.substr (lastdot+1) : ""); - } - Glib::ustring nfname = Glib::build_filename (dirName, nBaseName); - if (!::g_rename (ofname.c_str(), nfname.c_str())) { - cacheMgr.renameEntry (ofname, tbe[i]->thumbnail->getMD5(), nfname); - // the remaining part (removing old and adding new entry) is done by the directory monitor - reparseDirectory (); -// on_dir_changed (Gio::File::create_for_path (nfname), Gio::File::create_for_path (nfname), Gio::FILE_MONITOR_EVENT_CHANGED, true); - } - } - } - */ -} - -void FileCatalog::categoryButtonToggled (Gtk::ToggleButton* b) { - - for (int i=0; i<8; i++) - bCateg[i].block (true); - - fileBrowser->getScrollPosition (hScrollPos[lastScrollPos], vScrollPos[lastScrollPos]); - - // seek the one pressed - for (int i=0; i<8; i++) { - categoryButtons[i]->set_active (categoryButtons[i]==b); - if (categoryButtons[i]==b) - lastScrollPos = i; - } - - // change the images of the buttons to reflect current ranking - for (int i=0; i<5; i++) - bRank[i]->set_image (*igranked[i]); - for (int i=0; i<5; i++) - if (b==bRank[i]) - for (int j=0; j<=i; j++) - bRank[j]->set_image (*iranked[j]); - - fileBrowser->applyFilter (getFilter ()); - - // rearrange panels according to the selected filter - removeIfThere (hBox, trashButtonBox); - if (bTrash->get_active ()) - hBox->pack_start (*trashButtonBox, Gtk::PACK_SHRINK, 4); - hBox->queue_draw (); - - fileBrowser->setScrollPosition (hScrollPos[lastScrollPos], vScrollPos[lastScrollPos]); - - for (int i=0; i<8; i++) - bCateg[i].block (false); -} - -BrowserFilter FileCatalog::getFilter () { - - BrowserFilter filter; - filter.showRanked[0] = bDir->get_active() || bUnRanked->get_active () || bTrash->get_active (); - for (int i=1; i<=5; i++) - filter.showRanked[i] = bDir->get_active() || bRank[i-1]->get_active () || bTrash->get_active (); - filter.showTrash = bDir->get_active() || bTrash->get_active (); - filter.showNotTrash = !bTrash->get_active (); - if (!filterPanel) - filter.exifFilterEnabled = false; - else { - if (!hasValidCurrentEFS) - filter.exifFilter = dirEFS; - else - filter.exifFilter = currentEFS; - filter.exifFilterEnabled = filterPanel->isEnabled (); - } - return filter; -} - -void FileCatalog::filterChanged () { - - fileBrowser->applyFilter (getFilter()); -} - -int FileCatalog::reparseDirectory () { - - if (selectedDirectory=="") - return 0; - - if (!Glib::file_test (selectedDirectory, Glib::FILE_TEST_IS_DIR)) { - closeDir (); - return 0; - } - - std::vector nfileNameList = getFileList (); - - // check if a thumbnailed file has been deleted - const std::vector& t = fileBrowser->getEntries (); - std::vector fileNamesToDel; - for (int i=0; ifilename, Glib::FILE_TEST_EXISTS)) - fileNamesToDel.push_back (t[i]->filename); - for (int i=0; idelEntry (fileNamesToDel[i]); - cacheMgr.deleteEntry (fileNamesToDel[i]); - } - - // check if a new file has been added - for (int i=0; i& file, const Glib::RefPtr& other_file, Gio::FileMonitorEvent event_type, bool internal) { - - if (!internal) - gdk_threads_enter(); - - if (event_type == Gio::FILE_MONITOR_EVENT_CREATED || event_type == Gio::FILE_MONITOR_EVENT_DELETED || event_type == Gio::FILE_MONITOR_EVENT_CHANGED) - reparseDirectory (); - - if (!internal) - gdk_threads_leave(); -} - -void FileCatalog::checkAndAddFile (Glib::RefPtr file) { - - if (!file) - return; - Glib::RefPtr info = safe_query_file_info(file); - if (info && info->get_file_type() != Gio::FILE_TYPE_DIRECTORY && (!info->is_hidden() || !options.fbShowHidden)) { - int lastdot = info->get_name().find_last_of ('.'); - if (options.is_extention_enabled(lastdot!=Glib::ustring::npos ? info->get_name().substr (lastdot+1) : "")){ - previewLoader.add (DirEntry (file->get_parse_name())); - previewsToLoad++; - } - } -} - -void FileCatalog::addAndOpenFile (const Glib::ustring& fname) { - - Glib::RefPtr file = Gio::File::create_for_path (fname); - if (!file) - return; - Glib::RefPtr info = safe_query_file_info(file); - int lastdot = info->get_name().find_last_of ('.'); - if (options.is_extention_enabled(lastdot!=Glib::ustring::npos ? info->get_name().substr (lastdot+1) : "")){ - // if supported, load thumbnail first - Thumbnail* tmb = cacheMgr.getEntry (file->get_parse_name()); - if (tmb) { - FileBrowserEntry* entry = new FileBrowserEntry (tmb, file->get_parse_name()); - previewReady (entry); - // open the file - FCOIParams* params = new FCOIParams; - params->catalog = this; - params->tmb.push_back (tmb); - tmb->increaseRef (); - g_idle_add (fcopenimg, params); - } - } -} - -void FileCatalog::emptyTrash () { - - const std::vector t = fileBrowser->getEntries (); - std::vector toDel; - for (int i=0; ithumbnail->getStage()==1) - toDel.push_back (((FileBrowserEntry*)t[i])); - deleteRequested (toDel); + return names; +} + +void FileCatalog::dirSelected (const Glib::ustring& dirname, const Glib::ustring& openfile) { + + try { + Glib::RefPtr dir = Gio::File::create_for_path (dirname); + + if (!dir) + return; + closeDir (); + previewsToLoad = 0; + previewsLoaded = 0; + // if openfile exists, we have to open it first (it is a command line argument) + if (openfile!="") + addAndOpenFile (openfile); + + selectedDirectory = dir->get_parse_name(); + fileNameList = getFileList (); + + for (int i=0; i f = Gio::File::create_for_path(fileNameList[i]); + if (f->get_parse_name() != openfile) // if we opened a file at the beginning dont add it again + checkAndAddFile (f); + } + + _refreshProgressBar (); + previewLoader.process (); + +#ifdef _WIN32 + wdMonitor = new WinDirMonitor (selectedDirectory, this); +#elif defined __APPLE__ + printf("TODO fix dir->monitor_directory () for OSX\n"); +#else + dirMonitor = dir->monitor_directory (); + dirMonitor->signal_changed().connect (sigc::bind(sigc::mem_fun(*this, &FileCatalog::on_dir_changed), false)); +#endif + } + catch (Glib::Exception& ex) { + std::cout << ex.what(); + } +} + +void FileCatalog::_refreshProgressBar () { + + // check if progress bar is visible +/* Glib::ListHandle list = buttonBar2->get_children (); + Glib::ListHandle::iterator i = list.begin (); + for (; i!=list.end() && *i!=progressBar; i++); + if (i==list.end()) { + buttonBar2->pack_start (*progressBar, Gtk::PACK_SHRINK, 4); + buttonBar2->reorder_child (*progressBar, 2); + } +*/ + progressBar->show (); + if (previewsToLoad>0) + progressBar->set_fraction ((double)previewsLoaded / previewsToLoad); + else + progressBar->set_fraction (1.0); +} + +int refreshpb (void* data) { + + gdk_threads_enter (); + ((FileCatalog*)data)->_refreshProgressBar (); + gdk_threads_leave (); + return 0; +} + +void FileCatalog::previewReady (FileBrowserEntry* fdn) { + + // put it into the "full directory" browser + fdn->setImageAreaToolListener (iatlistener); + fileBrowser->addEntry (fdn); + + // update exif filter settings (minimal & maximal values of exif tags, cameras, lenses, etc...) + const CacheImageData* cfs = fdn->thumbnail->getCacheImageData(); + if (cfs->exifValid) { + if (cfs->fnumber < dirEFS.fnumberFrom) + dirEFS.fnumberFrom = cfs->fnumber; + if (cfs->fnumber > dirEFS.fnumberTo) + dirEFS.fnumberTo = cfs->fnumber; + if (cfs->shutter < dirEFS.shutterFrom) + dirEFS.shutterFrom = cfs->shutter; + if (cfs->shutter > dirEFS.shutterTo) + dirEFS.shutterTo = cfs->shutter; + if (cfs->iso>0 && cfs->iso < dirEFS.isoFrom) + dirEFS.isoFrom = cfs->iso; + if (cfs->iso>0 && cfs->iso > dirEFS.isoTo) + dirEFS.isoTo = cfs->iso; + if (cfs->focalLen < dirEFS.focalFrom) + dirEFS.focalFrom = cfs->focalLen; + if (cfs->focalLen > dirEFS.focalTo) + dirEFS.focalTo = cfs->focalLen; + } + dirEFS.cameras.insert (cfs->camera); + dirEFS.lenses.insert (cfs->lens); + previewsLoaded++; + g_idle_add (refreshpb, this); +} + +int prevfinished (void* data) { + + gdk_threads_enter(); + ((FileCatalog*)data)->_previewsFinished (); + gdk_threads_leave(); + return 0; +} + +void FileCatalog::_previewsFinished () { + + redrawAll (); + previewsToLoad = 0; + previewsLoaded = 0; +// removeIfThere (buttonBar2, progressBar); + progressBar->hide (); + if (filterPanel) { + filterPanel->set_sensitive (true); + if ( !hasValidCurrentEFS ){ + currentEFS = dirEFS; + filterPanel->setFilter ( dirEFS,true ); + }else { + filterPanel->setFilter ( currentEFS,false ); + } + } +} + +void FileCatalog::previewsFinished () { + + if (!hasValidCurrentEFS) + currentEFS = dirEFS; + g_idle_add (prevfinished, this); +} + +void PreviewLoader::remove (Glib::ustring fname) { + std::list::iterator i; + for (i=jqueue.begin(); i!=jqueue.end(); i++) + if (i->fullName==fname) + break; + if (i!=jqueue.end()) + jqueue.erase (i); +} + +void PreviewLoader::start () { + + jqueue.sort (); +} + +void PreviewLoader::process (DirEntry& current) { + + if (Glib::file_test (current.fullName, Glib::FILE_TEST_EXISTS)) { + Thumbnail* tmb = cacheMgr.getEntry (current.fullName); + if (tmb && pl) + pl->previewReady (new FileBrowserEntry (tmb, current.fullName)); + } +} + +void PreviewLoader::end () { + + if (pl) + pl->previewsFinished (); +} + +void FileCatalog::setEnabled (bool e) { + + enabled = e; +} + +void FileCatalog::redrawAll () { + + fileBrowser->queue_draw (); +} + +void FileCatalog::refreshAll () { + + fileBrowser->refreshThumbImages (); +} + +void FileCatalog::_openImage (std::vector tmb) { + + if (enabled && listener!=NULL) { + previewLoader.stop (); + thumbImageUpdater.stop (); + for (int i=0; igetFileName())==editedFiles.end()) + listener->fileSelected (tmb[i]); + tmb[i]->decreaseRef (); + } + previewLoader.process (); + thumbImageUpdater.process (); + } +} + +struct FCOIParams { + FileCatalog* catalog; + std::vector tmb; +}; + +int fcopenimg (void* p) { + + gdk_threads_enter (); + FCOIParams* params = (FCOIParams*)p; + params->catalog->_openImage (params->tmb); + delete params; + gdk_threads_leave (); + return 0; +} + +void FileCatalog::openRequested (std::vector tmb) { + + FCOIParams* params = new FCOIParams; + params->catalog = this; + params->tmb = tmb; + for (int i=0; iincreaseRef (); + g_idle_add (fcopenimg, params); +} + +void FileCatalog::deleteRequested (std::vector tbe) { + + if (tbe.size()==0) + return; + + Gtk::MessageDialog msd (M("FILEBROWSER_DELETEDLGLABEL"), false, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_YES_NO, true); + msd.set_secondary_text(Glib::ustring::compose (M("FILEBROWSER_DELETEDLGMSG"), tbe.size())); + + if (msd.run()==Gtk::RESPONSE_YES) { + for (int i=0; ifilename; + // remove from browser + FileBrowserEntry* t = fileBrowser->delEntry (fname); +// t->thumbnail->decreaseRef (); + delete t; + // remove from cache + cacheMgr.deleteEntry (fname); + // delete from file system + ::g_remove (fname.c_str()); + // delete .pp2 if found + ::g_remove (Glib::ustring(fname+".pp2").c_str()); + ::g_remove (Glib::ustring(removeExtension(fname)+".pp2").c_str()); + // delete .thm file + ::g_remove (Glib::ustring(removeExtension(fname)+".thm").c_str()); + ::g_remove (Glib::ustring(removeExtension(fname)+".THM").c_str()); + } + redrawAll (); + } +} + +void FileCatalog::developRequested (std::vector tbe) { + + if (listener) { + thumbImageUpdater.stop (); + for (int i=0; ithumbnail->getProcParams(); + rtengine::ProcessingJob* pjob = rtengine::ProcessingJob::create (tbe[i]->filename, tbe[i]->thumbnail->getType()==FT_Raw, params); + double tmpscale; + rtengine::IImage8* img = tbe[i]->thumbnail->processThumbImage (params, options.maxThumbnailHeight, tmpscale); + if (img) { + int pw = img->getWidth (); + int ph = img->getHeight (); + guint8* prev = new guint8 [pw*ph*3]; + memcpy (prev, img->getData (), pw*ph*3); + listener->addBatchQueueJob (new BatchQueueEntry (pjob, params, tbe[i]->filename, prev, pw, ph, tbe[i]->thumbnail)); + } + else { + int pw, ph; + tbe[i]->thumbnail->getThumbnailSize (pw, ph); + listener->addBatchQueueJob (new BatchQueueEntry (pjob, params, tbe[i]->filename, NULL, pw, ph, tbe[i]->thumbnail)); + } + } + thumbImageUpdater.process (); + } +} + +void FileCatalog::renameRequested (std::vector tbe) { + + RenameDialog* renameDlg = new RenameDialog ((Gtk::Window*)get_toplevel()); + + for (int i=0; iinitName (Glib::path_get_basename (tbe[i]->filename), tbe[i]->thumbnail->getCacheImageData()); + + Glib::ustring ofname = tbe[i]->filename; + Glib::ustring dirName = Glib::path_get_dirname (tbe[i]->filename); + Glib::ustring baseName = Glib::path_get_basename (tbe[i]->filename); + + if (renameDlg->run ()== Gtk::RESPONSE_OK) { + Glib::ustring nBaseName = renameDlg->getNewName (); + // if path has directory components, exit + if (Glib::path_get_dirname (nBaseName) != ".") + continue; + // if no extension is given, concatenate the extension of the original file + Glib::ustring ext = getExtension (nBaseName); + if (ext=="") + nBaseName += "." + getExtension (baseName); + Glib::ustring nfname = Glib::build_filename (dirName, nBaseName); + if (!::g_rename (ofname.c_str(), nfname.c_str())) { + cacheMgr.renameEntry (ofname, tbe[i]->thumbnail->getMD5(), nfname); + reparseDirectory (); + } + renameDlg->hide (); + } + } + delete renameDlg; +/* // ask for new file name + Gtk::Dialog dialog (M("FILEBROWSER_RENAMEDLGLABEL"), *((Gtk::Window*)get_toplevel()), true, true); + + dialog.add_button (Gtk::Stock::OK, Gtk::RESPONSE_OK); + dialog.add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); + + Gtk::Label l; + dialog.get_vbox()->pack_start (l, Gtk::PACK_SHRINK); + + Gtk::Entry nfentry; + + dialog.get_vbox()->pack_start (nfentry, Gtk::PACK_SHRINK); + dialog.get_vbox()->show_all (); + + nfentry.set_activates_default (true); + dialog.set_default_response (Gtk::RESPONSE_OK); + + for (int i=0; ifilename; + Glib::ustring dirName = Glib::path_get_dirname (tbe[i]->filename); + Glib::ustring baseName = Glib::path_get_basename (tbe[i]->filename); + + l.set_markup (Glib::ustring("") + Glib::ustring::compose (M("FILEBROWSER_RENAMEDLGMSG"), baseName) + Glib::ustring("")); + nfentry.set_text (baseName); + nfentry.select_region (0, baseName.size()); + + if (dialog.run ()== Gtk::RESPONSE_OK) { + Glib::ustring nBaseName = nfentry.get_text (); + // if path has directory components, exit + if (Glib::path_get_dirname (nBaseName) != ".") + continue; + // if no extension is given, concatenate the extension of the original file + if (nBaseName.find ('.')==nBaseName.npos) { + int lastdot = baseName.find_last_of ('.'); + nBaseName += "." + (lastdot!=Glib::ustring::npos ? baseName.substr (lastdot+1) : ""); + } + Glib::ustring nfname = Glib::build_filename (dirName, nBaseName); + if (!::g_rename (ofname.c_str(), nfname.c_str())) { + cacheMgr.renameEntry (ofname, tbe[i]->thumbnail->getMD5(), nfname); + // the remaining part (removing old and adding new entry) is done by the directory monitor + reparseDirectory (); +// on_dir_changed (Gio::File::create_for_path (nfname), Gio::File::create_for_path (nfname), Gio::FILE_MONITOR_EVENT_CHANGED, true); + } + } + } + */ +} + +void FileCatalog::categoryButtonToggled (Gtk::ToggleButton* b) { + + for (int i=0; i<8; i++) + bCateg[i].block (true); + + fileBrowser->getScrollPosition (hScrollPos[lastScrollPos], vScrollPos[lastScrollPos]); + + // seek the one pressed + for (int i=0; i<8; i++) { + categoryButtons[i]->set_active (categoryButtons[i]==b); + if (categoryButtons[i]==b) + lastScrollPos = i; + } + + // change the images of the buttons to reflect current ranking + for (int i=0; i<5; i++) + bRank[i]->set_image (*igranked[i]); + for (int i=0; i<5; i++) + if (b==bRank[i]) + for (int j=0; j<=i; j++) + bRank[j]->set_image (*iranked[j]); + + fileBrowser->applyFilter (getFilter ()); + + // rearrange panels according to the selected filter + removeIfThere (hBox, trashButtonBox); + if (bTrash->get_active ()) + hBox->pack_start (*trashButtonBox, Gtk::PACK_SHRINK, 4); + hBox->queue_draw (); + + fileBrowser->setScrollPosition (hScrollPos[lastScrollPos], vScrollPos[lastScrollPos]); + + for (int i=0; i<8; i++) + bCateg[i].block (false); +} + +BrowserFilter FileCatalog::getFilter () { + + BrowserFilter filter; + filter.showRanked[0] = bDir->get_active() || bUnRanked->get_active () || bTrash->get_active (); + for (int i=1; i<=5; i++) + filter.showRanked[i] = bDir->get_active() || bRank[i-1]->get_active () || bTrash->get_active (); + filter.showTrash = bDir->get_active() || bTrash->get_active (); + filter.showNotTrash = !bTrash->get_active (); + if (!filterPanel) + filter.exifFilterEnabled = false; + else { + if (!hasValidCurrentEFS) + filter.exifFilter = dirEFS; + else + filter.exifFilter = currentEFS; + filter.exifFilterEnabled = filterPanel->isEnabled (); + } + return filter; +} + +void FileCatalog::filterChanged () { + + fileBrowser->applyFilter (getFilter()); +} + +int FileCatalog::reparseDirectory () { + + if (selectedDirectory=="") + return 0; + + if (!Glib::file_test (selectedDirectory, Glib::FILE_TEST_IS_DIR)) { + closeDir (); + return 0; + } + + std::vector nfileNameList = getFileList (); + + // check if a thumbnailed file has been deleted + const std::vector& t = fileBrowser->getEntries (); + std::vector fileNamesToDel; + for (int i=0; ifilename, Glib::FILE_TEST_EXISTS)) + fileNamesToDel.push_back (t[i]->filename); + for (int i=0; idelEntry (fileNamesToDel[i]); + cacheMgr.deleteEntry (fileNamesToDel[i]); + } + + // check if a new file has been added + for (int i=0; i& file, const Glib::RefPtr& other_file, Gio::FileMonitorEvent event_type, bool internal) { + + if (!internal) + gdk_threads_enter(); + + if (event_type == Gio::FILE_MONITOR_EVENT_CREATED || event_type == Gio::FILE_MONITOR_EVENT_DELETED || event_type == Gio::FILE_MONITOR_EVENT_CHANGED) + reparseDirectory (); + + if (!internal) + gdk_threads_leave(); +} + +void FileCatalog::checkAndAddFile (Glib::RefPtr file) { + + if (!file) + return; + Glib::RefPtr info = safe_query_file_info(file); + if (info && info->get_file_type() != Gio::FILE_TYPE_DIRECTORY && (!info->is_hidden() || !options.fbShowHidden)) { + int lastdot = info->get_name().find_last_of ('.'); + if (options.is_extention_enabled(lastdot!=Glib::ustring::npos ? info->get_name().substr (lastdot+1) : "")){ + previewLoader.add (DirEntry (file->get_parse_name())); + previewsToLoad++; + } + } +} + +void FileCatalog::addAndOpenFile (const Glib::ustring& fname) { + + Glib::RefPtr file = Gio::File::create_for_path (fname); + if (!file) + return; + Glib::RefPtr info = safe_query_file_info(file); + int lastdot = info->get_name().find_last_of ('.'); + if (options.is_extention_enabled(lastdot!=Glib::ustring::npos ? info->get_name().substr (lastdot+1) : "")){ + // if supported, load thumbnail first + Thumbnail* tmb = cacheMgr.getEntry (file->get_parse_name()); + if (tmb) { + FileBrowserEntry* entry = new FileBrowserEntry (tmb, file->get_parse_name()); + previewReady (entry); + // open the file + FCOIParams* params = new FCOIParams; + params->catalog = this; + params->tmb.push_back (tmb); + tmb->increaseRef (); + g_idle_add (fcopenimg, params); + } + } +} + +void FileCatalog::emptyTrash () { + + const std::vector t = fileBrowser->getEntries (); + std::vector toDel; + for (int i=0; ithumbnail->getStage()==1) + toDel.push_back (((FileBrowserEntry*)t[i])); + deleteRequested (toDel); trashChanged(); -} +} bool FileCatalog::trashIsEmpty () { - const std::vector t = fileBrowser->getEntries (); - for (int i=0; ithumbnail->getStage()==1) + const std::vector t = fileBrowser->getEntries (); + for (int i=0; ithumbnail->getStage()==1) return false; return true; } - -void FileCatalog::zoomIn () { - - bool pLoad = previewLoader.runs(); - if (pLoad) - previewLoader.stop (); - - fileBrowser->zoomIn (); - - if (pLoad) - previewLoader.process (); -} -void FileCatalog::zoomOut () { - - bool pLoad = previewLoader.runs(); - if (pLoad) - previewLoader.stop (); - - fileBrowser->zoomOut (); - - if (pLoad) - previewLoader.process (); -} -void FileCatalog::refreshEditedState (const std::set& efiles) { - - editedFiles = efiles; - fileBrowser->refreshEditedState (efiles); -} - -void FileCatalog::selectionChanged (std::vector tbe) { - - if (fslistener) - fslistener->selectionChanged (tbe); -} - -void FileCatalog::exifFilterChanged () { - - currentEFS = filterPanel->getFilter (); - hasValidCurrentEFS = true; - fileBrowser->applyFilter (getFilter ()); -} - -void FileCatalog::setFilterPanel (FilterPanel* fpanel) { - - filterPanel = fpanel; - filterPanel->set_sensitive (false); - filterPanel->setFilterPanelListener (this); -} + +void FileCatalog::zoomIn () { + + bool pLoad = previewLoader.runs(); + if (pLoad) + previewLoader.stop (); + + fileBrowser->zoomIn (); + + if (pLoad) + previewLoader.process (); +} +void FileCatalog::zoomOut () { + + bool pLoad = previewLoader.runs(); + if (pLoad) + previewLoader.stop (); + + fileBrowser->zoomOut (); + + if (pLoad) + previewLoader.process (); +} +void FileCatalog::refreshEditedState (const std::set& efiles) { + + editedFiles = efiles; + fileBrowser->refreshEditedState (efiles); +} + +void FileCatalog::selectionChanged (std::vector tbe) { + + if (fslistener) + fslistener->selectionChanged (tbe); +} + +void FileCatalog::exifFilterChanged () { + + currentEFS = filterPanel->getFilter (); + hasValidCurrentEFS = true; + fileBrowser->applyFilter (getFilter ()); +} + +void FileCatalog::setFilterPanel (FilterPanel* fpanel) { + + filterPanel = fpanel; + filterPanel->set_sensitive (false); + filterPanel->setFilterPanelListener (this); +} void FileCatalog::trashChanged () { if (trashIsEmpty()) { bTrash->set_image(*iTrashEmpty); diff --git a/rtgui/filecatalog.h b/rtgui/filecatalog.h index 341f10df0..73b5ff8e2 100644 --- a/rtgui/filecatalog.h +++ b/rtgui/filecatalog.h @@ -1,195 +1,195 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _FILECATALOG_ -#define _FILECATALOG_ - -#ifdef _WIN32 -#include -#endif -#include -#include -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _FILECATALOG_ +#define _FILECATALOG_ + +#ifdef _WIN32 +#include +#endif +#include +#include +#include +#include #include #include #include #include -#include -#include -#include - -class PreviewLoaderListener { - public: - virtual void previewReady (FileBrowserEntry* fd) {} - virtual void previewsFinished () {} -}; - -class DirEntry { - - public: - Glib::ustring fullName; - - DirEntry (const Glib::ustring& n) : fullName (n) {} - - bool operator< (DirEntry& other) { - return fullName.casefold() < other.fullName.casefold(); - } -}; - -class PreviewLoader : public ProcessingThread { - - protected: - PreviewLoaderListener* pl; - - public: - PreviewLoader () : pl(NULL) { ProcessingThread(); } - void setPreviewLoaderListener (PreviewLoaderListener* p) { pl = p; } - void start (); - void process () { ProcessingThread::process (); } - void process (DirEntry& current); - void remove (Glib::ustring fname); - void end (); -}; - +#include +#include +#include + +class PreviewLoaderListener { + public: + virtual void previewReady (FileBrowserEntry* fd) {} + virtual void previewsFinished () {} +}; + +class DirEntry { + + public: + Glib::ustring fullName; + + DirEntry (const Glib::ustring& n) : fullName (n) {} + + bool operator< (DirEntry& other) { + return fullName.casefold() < other.fullName.casefold(); + } +}; + +class PreviewLoader : public ProcessingThread { + + protected: + PreviewLoaderListener* pl; + + public: + PreviewLoader () : pl(NULL) { ProcessingThread(); } + void setPreviewLoaderListener (PreviewLoaderListener* p) { pl = p; } + void start (); + void process () { ProcessingThread::process (); } + void process (DirEntry& current); + void remove (Glib::ustring fname); + void end (); +}; + class FileCatalog : public Gtk::VBox, public DirSelectionListener, - public PreviewLoaderListener, + public PreviewLoaderListener, public FilterPanelListener, - public FileBrowserListener -#ifdef _WIN32 - , public WinDirChangeListener -#endif - { - - // thumbnail browsers - FileBrowser* fileBrowser; - - Gtk::HBox* hBox; - Glib::ustring selectedDirectory; - bool enabled; - - PreviewLoader previewLoader; + public FileBrowserListener +#ifdef _WIN32 + , public WinDirChangeListener +#endif + { + + // thumbnail browsers + FileBrowser* fileBrowser; + + Gtk::HBox* hBox; + Glib::ustring selectedDirectory; + bool enabled; + + PreviewLoader previewLoader; FileSelectionListener* listener; - FileSelectionChangeListener* fslistener; - ImageAreaToolListener* iatlistener; - - Gtk::HBox* buttonBar; - Gtk::HBox* buttonBar2; - Gtk::ToggleButton* bDir; - Gtk::ToggleButton* bUnRanked; - Gtk::ToggleButton* bRank[5]; - Gtk::ToggleButton* bTrash; - Gtk::ToggleButton* categoryButtons[8]; - Gtk::ToggleButton* exifInfo; - sigc::connection bCateg[8]; + FileSelectionChangeListener* fslistener; + ImageAreaToolListener* iatlistener; + + Gtk::HBox* buttonBar; + Gtk::HBox* buttonBar2; + Gtk::ToggleButton* bDir; + Gtk::ToggleButton* bUnRanked; + Gtk::ToggleButton* bRank[5]; + Gtk::ToggleButton* bTrash; + Gtk::ToggleButton* categoryButtons[8]; + Gtk::ToggleButton* exifInfo; + sigc::connection bCateg[8]; Gtk::Image* iranked[5], *igranked[5]; - Gtk::Image *iTrashEmpty, *iTrashFull; - - double hScrollPos[8]; - double vScrollPos[8]; - int lastScrollPos; - - Gtk::VBox* trashButtonBox; - - Gtk::Button* zoomInButton; - Gtk::Button* zoomOutButton; - - ExifFilterSettings dirEFS; - ExifFilterSettings currentEFS; - bool hasValidCurrentEFS; - - FilterPanel* filterPanel; - - Glib::RefPtr dirMonitor; + Gtk::Image *iTrashEmpty, *iTrashFull; + + double hScrollPos[8]; + double vScrollPos[8]; + int lastScrollPos; + + Gtk::VBox* trashButtonBox; + + Gtk::Button* zoomInButton; + Gtk::Button* zoomOutButton; + + ExifFilterSettings dirEFS; + ExifFilterSettings currentEFS; + bool hasValidCurrentEFS; + + FilterPanel* filterPanel; + + Glib::RefPtr dirMonitor; Gtk::ProgressBar* progressBar; int previewsToLoad; int previewsLoaded; - -#ifdef _WIN32 - WinDirMonitor* wdMonitor; - public: - int checkCounter; - void winDirChanged (); - private: -#endif - std::vector fileNameList; + +#ifdef _WIN32 + WinDirMonitor* wdMonitor; + public: + int checkCounter; + void winDirChanged (); + private: +#endif + std::vector fileNameList; std::set editedFiles; - - void addAndOpenFile (const Glib::ustring& fname); - void checkAndAddFile (Glib::RefPtr info); - std::vector getFileList (); + + void addAndOpenFile (const Glib::ustring& fname); + void checkAndAddFile (Glib::RefPtr info); + std::vector getFileList (); BrowserFilter getFilter (); - void trashChanged (); - - public: - CoarsePanel* coarsePanel; - ToolBar* toolBar; - - FileCatalog (CoarsePanel* cp, ToolBar* tb); - void dirSelected (const Glib::ustring& dirname, const Glib::ustring& openfile=""); + void trashChanged (); + + public: + CoarsePanel* coarsePanel; + ToolBar* toolBar; + + FileCatalog (CoarsePanel* cp, ToolBar* tb); + void dirSelected (const Glib::ustring& dirname, const Glib::ustring& openfile=""); void closeDir (); void refreshEditedState (const std::set& efiles); - // previewloaderlistener interface - void previewReady (FileBrowserEntry* fdn); + // previewloaderlistener interface + void previewReady (FileBrowserEntry* fdn); void previewsFinished (); void _previewsFinished (); void _refreshProgressBar (); - - // filterpanel interface - void exifFilterChanged (); - - Glib::ustring lastSelectedDir () { return selectedDirectory; } - void setEnabled (bool e); // if not enabled, it does not open image - - void redrawAll (); - void refreshAll (); - - void openRequested (std::vector tbe); - void deleteRequested (std::vector tbe); - void developRequested (std::vector tbe); - void renameRequested (std::vector tbe); - void selectionChanged (std::vector tbe); - void emptyTrash (); - bool trashIsEmpty (); - - void setFileSelectionListener (FileSelectionListener* l) { listener = l; } - void setFileSelectionChangeListener (FileSelectionChangeListener* l) { fslistener = l; } - void setImageAreaToolListener (ImageAreaToolListener* l) { iatlistener = l; } - void setFilterPanel (FilterPanel* fpanel); - void exifInfoButtonToggled(); - void categoryButtonToggled (Gtk::ToggleButton* b); - void filterChanged (); - void runFilterDialog (); - - void on_realize(); - void on_dir_changed (const Glib::RefPtr& file, const Glib::RefPtr& other_file, Gio::FileMonitorEvent event_type, bool internal); - int reparseDirectory (); - void _openImage (std::vector tmb); - - void zoomIn (); - void zoomOut (); - void openNextImage () { fileBrowser->openNextImage(); } + // filterpanel interface + void exifFilterChanged (); + + Glib::ustring lastSelectedDir () { return selectedDirectory; } + void setEnabled (bool e); // if not enabled, it does not open image + + void redrawAll (); + void refreshAll (); + + void openRequested (std::vector tbe); + void deleteRequested (std::vector tbe); + void developRequested (std::vector tbe); + void renameRequested (std::vector tbe); + void selectionChanged (std::vector tbe); + void emptyTrash (); + bool trashIsEmpty (); + + void setFileSelectionListener (FileSelectionListener* l) { listener = l; } + void setFileSelectionChangeListener (FileSelectionChangeListener* l) { fslistener = l; } + void setImageAreaToolListener (ImageAreaToolListener* l) { iatlistener = l; } + void setFilterPanel (FilterPanel* fpanel); + void exifInfoButtonToggled(); + void categoryButtonToggled (Gtk::ToggleButton* b); + void filterChanged (); + void runFilterDialog (); + + void on_realize(); + void on_dir_changed (const Glib::RefPtr& file, const Glib::RefPtr& other_file, Gio::FileMonitorEvent event_type, bool internal); + int reparseDirectory (); + void _openImage (std::vector tmb); + + void zoomIn (); + void zoomOut (); + + void openNextImage () { fileBrowser->openNextImage(); } void openPrevImage () { fileBrowser->openPrevImage(); } -}; - -#endif +}; + +#endif diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc index 2b9e75ff0..57810e77f 100644 --- a/rtgui/filepanel.cc +++ b/rtgui/filepanel.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include @@ -31,14 +31,14 @@ int fbinit (void* data) { FilePanel::FilePanel () : parent(NULL) { dirpaned = new Gtk::HPaned (); - dirpaned->set_position (options.dirBrowserWidth); - - dirBrowser = new DirBrowser (); - placesBrowser = new PlacesBrowser (); - recentBrowser = new RecentBrowser (); + dirpaned->set_position (options.dirBrowserWidth); + + dirBrowser = new DirBrowser (); + placesBrowser = new PlacesBrowser (); + recentBrowser = new RecentBrowser (); placespaned = new Gtk::VPaned (); - placespaned->set_position (options.dirBrowserHeight); + placespaned->set_position (options.dirBrowserHeight); Gtk::VBox* obox = Gtk::manage (new Gtk::VBox ()); obox->pack_start (*recentBrowser, Gtk::PACK_SHRINK, 4); @@ -47,17 +47,17 @@ FilePanel::FilePanel () : parent(NULL) { placespaned->pack1 (*placesBrowser, false, true); placespaned->pack2 (*obox, true, true); - dirpaned->pack1 (*placespaned, Gtk::SHRINK); + dirpaned->pack1 (*placespaned, Gtk::SHRINK); tpc = new BatchToolPanelCoordinator (this); fileCatalog = new FileCatalog (tpc->coarse, tpc->getToolBar()); - dirpaned->pack2 (*fileCatalog, Gtk::EXPAND|Gtk::SHRINK); + dirpaned->pack2 (*fileCatalog, Gtk::EXPAND|Gtk::SHRINK); placesBrowser->setDirBrowserRemoteInterface (dirBrowser); recentBrowser->setDirBrowserRemoteInterface (dirBrowser); - dirBrowser->addDirSelectionListener (fileCatalog); - dirBrowser->addDirSelectionListener (recentBrowser); - dirBrowser->addDirSelectionListener (placesBrowser); + dirBrowser->addDirSelectionListener (fileCatalog); + dirBrowser->addDirSelectionListener (recentBrowser); + dirBrowser->addDirSelectionListener (placesBrowser); fileCatalog->setFileSelectionListener (this); rightBox = new Gtk::HBox (); @@ -117,7 +117,7 @@ void FilePanel::on_realize () { void FilePanel::init () { - dirBrowser->fillDirTree (); + dirBrowser->fillDirTree (); placesBrowser->refreshPlacesList (); if (argv1!="") @@ -155,30 +155,30 @@ bool FilePanel::fileSelected (Thumbnail* thm) { return succ; } -void FilePanel::saveOptions () { - - options.dirBrowserWidth = dirpaned->get_position (); +void FilePanel::saveOptions () { + + options.dirBrowserWidth = dirpaned->get_position (); options.dirBrowserHeight = placespaned->get_position (); options.browserToolPanelWidth = rightBox->get_width (); if (options.startupDir==STARTUPDIR_LAST && fileCatalog->lastSelectedDir ()!="") options.startupPath = fileCatalog->lastSelectedDir (); fileCatalog->closeDir (); -} +} -void FilePanel::open (const Glib::ustring& d) { - - if (Glib::file_test (d, Glib::FILE_TEST_IS_DIR)) - dirBrowser->open (d.c_str()); - else if (Glib::file_test (d, Glib::FILE_TEST_EXISTS)) - dirBrowser->open (Glib::path_get_dirname(d), Glib::path_get_basename(d)); -} +void FilePanel::open (const Glib::ustring& d) { + + if (Glib::file_test (d, Glib::FILE_TEST_IS_DIR)) + dirBrowser->open (d.c_str()); + else if (Glib::file_test (d, Glib::FILE_TEST_EXISTS)) + dirBrowser->open (Glib::path_get_dirname(d), Glib::path_get_basename(d)); +} bool FilePanel::addBatchQueueJob (BatchQueueEntry* bqe) { if (parent) - parent->addBatchQueueJob (bqe); - return true; -} + parent->addBatchQueueJob (bqe); + return true; +} void FilePanel::optionsChanged () { diff --git a/rtgui/filepanel.h b/rtgui/filepanel.h index 383590368..deb60c506 100644 --- a/rtgui/filepanel.h +++ b/rtgui/filepanel.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _FILEPANEL_ #define _FILEPANEL_ @@ -39,10 +39,10 @@ class FilePanel : public Gtk::HPaned, protected: Gtk::VPaned* placespaned; Gtk::HPaned* dirpaned; - DirBrowser* dirBrowser; - PlacesBrowser* placesBrowser; - RecentBrowser* recentBrowser; - FileCatalog* fileCatalog; // filecatalog is the file browser with the button bar above it + DirBrowser* dirBrowser; + PlacesBrowser* placesBrowser; + RecentBrowser* recentBrowser; + FileCatalog* fileCatalog; // filecatalog is the file browser with the button bar above it Gtk::HBox* rightBox; BatchToolPanelCoordinator* tpc; History* history; @@ -57,15 +57,15 @@ class FilePanel : public Gtk::HPaned, void setParent (RTWindow* p) { parent = p; } void init (); // dont call it directly, the constructor calls it as idle source - void open (const Glib::ustring& d); // open a file or a directory + void open (const Glib::ustring& d); // open a file or a directory void refreshEditedState (const std::set& efiles) { fileCatalog->refreshEditedState (efiles); } // call this before closeing rt: it saves file browser relating things into options - void saveOptions (); + void saveOptions (); // interface fileselectionlistener - bool fileSelected (Thumbnail* thm); - bool addBatchQueueJob (BatchQueueEntry* bqe); + bool fileSelected (Thumbnail* thm); + bool addBatchQueueJob (BatchQueueEntry* bqe); void optionsChanged (); }; diff --git a/rtgui/fileselectionchangelistener.h b/rtgui/fileselectionchangelistener.h index d03d4215d..c22f2f174 100644 --- a/rtgui/fileselectionchangelistener.h +++ b/rtgui/fileselectionchangelistener.h @@ -1,30 +1,30 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _FILESELECTIONCHANGELISTENER_ #define _FILESELECTIONCHANGELISTENER_ #include -class FileSelectionChangeListener { - - public: - virtual void selectionChanged (const std::vector& selected) {} +class FileSelectionChangeListener { + + public: + virtual void selectionChanged (const std::vector& selected) {} }; #endif diff --git a/rtgui/fileselectionlistener.h b/rtgui/fileselectionlistener.h index 97c92c4cd..d0a029037 100644 --- a/rtgui/fileselectionlistener.h +++ b/rtgui/fileselectionlistener.h @@ -1,32 +1,32 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _FILESELECTIONLISTENER_ #define _FILESELECTIONLISTENER_ #include #include -class FileSelectionListener { - - public: - virtual bool fileSelected (Thumbnail* thm) =0; - virtual bool addBatchQueueJob (BatchQueueEntry* bqe) =0; +class FileSelectionListener { + + public: + virtual bool fileSelected (Thumbnail* thm) =0; + virtual bool addBatchQueueJob (BatchQueueEntry* bqe) =0; }; #endif diff --git a/rtgui/filethumbnailbuttonset.cc b/rtgui/filethumbnailbuttonset.cc index 13c196f11..39a3e2aca 100644 --- a/rtgui/filethumbnailbuttonset.cc +++ b/rtgui/filethumbnailbuttonset.cc @@ -1,70 +1,70 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include #include - -extern Glib::ustring argv0; - -bool FileThumbnailButtonSet::iconsLoaded = false; - -Cairo::RefPtr FileThumbnailButtonSet::rankIcon; -Cairo::RefPtr FileThumbnailButtonSet::gRankIcon; -Cairo::RefPtr FileThumbnailButtonSet::unRankIcon; -Cairo::RefPtr FileThumbnailButtonSet::trashIcon; -Cairo::RefPtr FileThumbnailButtonSet::unTrashIcon; -Cairo::RefPtr FileThumbnailButtonSet::processIcon; - -FileThumbnailButtonSet::FileThumbnailButtonSet (FileBrowserEntry* myEntry) { - - if (!iconsLoaded) { + +extern Glib::ustring argv0; + +bool FileThumbnailButtonSet::iconsLoaded = false; + +Cairo::RefPtr FileThumbnailButtonSet::rankIcon; +Cairo::RefPtr FileThumbnailButtonSet::gRankIcon; +Cairo::RefPtr FileThumbnailButtonSet::unRankIcon; +Cairo::RefPtr FileThumbnailButtonSet::trashIcon; +Cairo::RefPtr FileThumbnailButtonSet::unTrashIcon; +Cairo::RefPtr FileThumbnailButtonSet::processIcon; + +FileThumbnailButtonSet::FileThumbnailButtonSet (FileBrowserEntry* myEntry) { + + if (!iconsLoaded) { try { - unRankIcon = Cairo::ImageSurface::create_from_png (argv0+"/images/unrated.png"); - rankIcon = Cairo::ImageSurface::create_from_png (argv0+"/images/rated.png"); - gRankIcon = Cairo::ImageSurface::create_from_png (argv0+"/images/grayrated.png"); - trashIcon = Cairo::ImageSurface::create_from_png (argv0+"/images/trash.png"); - unTrashIcon = Cairo::ImageSurface::create_from_png (argv0+"/images/undelete.png"); - processIcon = Cairo::ImageSurface::create_from_png (argv0+"/images/processing.png"); + unRankIcon = Cairo::ImageSurface::create_from_png (argv0+"/images/unrated.png"); + rankIcon = Cairo::ImageSurface::create_from_png (argv0+"/images/rated.png"); + gRankIcon = Cairo::ImageSurface::create_from_png (argv0+"/images/grayrated.png"); + trashIcon = Cairo::ImageSurface::create_from_png (argv0+"/images/trash.png"); + unTrashIcon = Cairo::ImageSurface::create_from_png (argv0+"/images/undelete.png"); + processIcon = Cairo::ImageSurface::create_from_png (argv0+"/images/processing.png"); iconsLoaded = true; } catch (...) {} - } + } - add (new LWButton (unRankIcon, 0, myEntry, LWButton::Left, LWButton::Center, M("FILEBROWSER_POPUPUNRANK"))); - for (int i=0; i<5; i++) - add (new LWButton (rankIcon, i+1, myEntry, LWButton::Left)); - add (new LWButton (processIcon, 6, myEntry, LWButton::Right, LWButton::Center, M("FILEBROWSER_POPUPPROCESS"))); + add (new LWButton (unRankIcon, 0, myEntry, LWButton::Left, LWButton::Center, M("FILEBROWSER_POPUPUNRANK"))); + for (int i=0; i<5; i++) + add (new LWButton (rankIcon, i+1, myEntry, LWButton::Left)); + add (new LWButton (processIcon, 6, myEntry, LWButton::Right, LWButton::Center, M("FILEBROWSER_POPUPPROCESS"))); add (new LWButton (trashIcon, 7, myEntry, LWButton::Right, LWButton::Center, M("FILEBROWSER_POPUPTRASH"))); - buttons[1]->setToolTip (M("FILEBROWSER_POPUPRANK1")); - buttons[2]->setToolTip (M("FILEBROWSER_POPUPRANK2")); - buttons[3]->setToolTip (M("FILEBROWSER_POPUPRANK3")); - buttons[4]->setToolTip (M("FILEBROWSER_POPUPRANK4")); - buttons[5]->setToolTip (M("FILEBROWSER_POPUPRANK5")); -} - -void FileThumbnailButtonSet::setRank (int stars) { - - for (int i=1; i<=5; i++) - buttons[i]->setIcon (i<=stars ? rankIcon : gRankIcon); -} - -void FileThumbnailButtonSet::setInTrash (bool inTrash) { - - buttons[7]->setIcon (inTrash ? unTrashIcon : trashIcon); - buttons[7]->setToolTip (inTrash ? M("FILEBROWSER_POPUPUNTRASH") : M("FILEBROWSER_POPUPTRASH")); -} + buttons[1]->setToolTip (M("FILEBROWSER_POPUPRANK1")); + buttons[2]->setToolTip (M("FILEBROWSER_POPUPRANK2")); + buttons[3]->setToolTip (M("FILEBROWSER_POPUPRANK3")); + buttons[4]->setToolTip (M("FILEBROWSER_POPUPRANK4")); + buttons[5]->setToolTip (M("FILEBROWSER_POPUPRANK5")); +} + +void FileThumbnailButtonSet::setRank (int stars) { + + for (int i=1; i<=5; i++) + buttons[i]->setIcon (i<=stars ? rankIcon : gRankIcon); +} + +void FileThumbnailButtonSet::setInTrash (bool inTrash) { + + buttons[7]->setIcon (inTrash ? unTrashIcon : trashIcon); + buttons[7]->setToolTip (inTrash ? M("FILEBROWSER_POPUPUNTRASH") : M("FILEBROWSER_POPUPTRASH")); +} diff --git a/rtgui/filethumbnailbuttonset.h b/rtgui/filethumbnailbuttonset.h index 228e9e82f..af377c7ba 100644 --- a/rtgui/filethumbnailbuttonset.h +++ b/rtgui/filethumbnailbuttonset.h @@ -1,45 +1,45 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _FILETHUMBNAILBUTTONSET_ -#define _FILETHUMBNAILBUTTONSET_ - -#include -#include -#include - -class FileBrowserEntry; -class FileThumbnailButtonSet : public LWButtonSet { - - static bool iconsLoaded; - - public: - static Cairo::RefPtr rankIcon; - static Cairo::RefPtr gRankIcon; - static Cairo::RefPtr unRankIcon; - static Cairo::RefPtr trashIcon; - static Cairo::RefPtr unTrashIcon; - static Cairo::RefPtr processIcon; - - FileThumbnailButtonSet (FileBrowserEntry* myEntry); - void setRank (int stars); - void setInTrash (bool inTrash); - -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _FILETHUMBNAILBUTTONSET_ +#define _FILETHUMBNAILBUTTONSET_ + +#include +#include +#include + +class FileBrowserEntry; +class FileThumbnailButtonSet : public LWButtonSet { + + static bool iconsLoaded; + + public: + static Cairo::RefPtr rankIcon; + static Cairo::RefPtr gRankIcon; + static Cairo::RefPtr unRankIcon; + static Cairo::RefPtr trashIcon; + static Cairo::RefPtr unTrashIcon; + static Cairo::RefPtr processIcon; + + FileThumbnailButtonSet (FileBrowserEntry* myEntry); + void setRank (int stars); + void setInTrash (bool inTrash); + +}; + +#endif diff --git a/rtgui/filterpanel.cc b/rtgui/filterpanel.cc index 67d3c0898..516f2c3be 100644 --- a/rtgui/filterpanel.cc +++ b/rtgui/filterpanel.cc @@ -1,241 +1,241 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include - -using namespace rtengine; - -FilterPanel::FilterPanel () : listener (NULL) { - - set_border_width (4); - - enabled = Gtk::manage (new Gtk::CheckButton (M("EXIFFILTER_METADATAFILTER"))); - pack_start (*enabled, Gtk::PACK_SHRINK, 2); - pack_start (*Gtk::manage(new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 2); - - enaFNumber = Gtk::manage (new Gtk::CheckButton (M("EXIFFILTER_APERTURE")+":")); - Gtk::VBox* fnvb = Gtk::manage(new Gtk::VBox ()); - Gtk::HBox* fnhb = Gtk::manage(new Gtk::HBox ()); - fnvb->pack_start (*enaFNumber, Gtk::PACK_SHRINK, 0); - fnumberFrom = Gtk::manage(new Gtk::Entry ()); - fnumberTo = Gtk::manage(new Gtk::Entry ()); - fnhb->pack_start (*fnumberFrom, true, true, 2); - fnhb->pack_start (*Gtk::manage(new Gtk::Label(" - ")), false, false, 4); - fnhb->pack_start (*fnumberTo, true, true, 2); - fnvb->pack_start (*fnhb, Gtk::PACK_SHRINK, 0); - pack_start (*fnvb, Gtk::PACK_SHRINK, 4); - - enaShutter = Gtk::manage(new Gtk::CheckButton(M("EXIFFILTER_SHUTTER")+":")); - Gtk::VBox* svb = Gtk::manage(new Gtk::VBox ()); - Gtk::HBox* shb = Gtk::manage(new Gtk::HBox ()); - svb->pack_start (*enaShutter, Gtk::PACK_SHRINK, 0); - shutterFrom = Gtk::manage(new Gtk::Entry ()); - shutterTo = Gtk::manage(new Gtk::Entry ()); - shb->pack_start (*shutterFrom, true, true, 2); - shb->pack_start (*Gtk::manage(new Gtk::Label(" - ")), false, false, 4); - shb->pack_start (*shutterTo, true, true, 2); - svb->pack_start (*shb, Gtk::PACK_SHRINK, 0); - pack_start (*svb, Gtk::PACK_SHRINK, 4); - - enaISO = Gtk::manage(new Gtk::CheckButton(M("EXIFFILTER_ISO")+":")); - Gtk::VBox* ivb = Gtk::manage(new Gtk::VBox ()); - Gtk::HBox* ihb = Gtk::manage(new Gtk::HBox ()); - ivb->pack_start (*enaISO, Gtk::PACK_SHRINK, 0); - isoFrom = Gtk::manage(new Gtk::Entry ()); - isoTo = Gtk::manage(new Gtk::Entry ()); - ihb->pack_start (*isoFrom, true, true, 2); - ihb->pack_start (*Gtk::manage(new Gtk::Label(" - ")), false, false, 4); - ihb->pack_start (*isoTo, true, true, 2); - ivb->pack_start (*ihb, Gtk::PACK_SHRINK, 0); - pack_start (*ivb, Gtk::PACK_SHRINK, 4); - - enaFocalLen = Gtk::manage(new Gtk::CheckButton(M("EXIFFILTER_FOCALLEN")+":")); - Gtk::VBox* fvb = Gtk::manage(new Gtk::VBox ()); - Gtk::HBox* fhb = Gtk::manage(new Gtk::HBox ()); - fvb->pack_start (*enaFocalLen, Gtk::PACK_SHRINK, 0); - focalFrom = Gtk::manage(new Gtk::Entry ()); - focalTo = Gtk::manage(new Gtk::Entry ()); - fhb->pack_start (*focalFrom, true, true, 2); - fhb->pack_start (*Gtk::manage(new Gtk::Label(" - ")), false, false, 4); - fhb->pack_start (*focalTo, true, true, 2); - fvb->pack_start (*fhb, Gtk::PACK_SHRINK, 0); - pack_start (*fvb, Gtk::PACK_SHRINK, 4); - - enaCamera = Gtk::manage(new Gtk::CheckButton(M("EXIFFILTER_CAMERA")+":")); - Gtk::VBox* cvb = Gtk::manage(new Gtk::VBox ()); - cvb->pack_start (*enaCamera, Gtk::PACK_SHRINK, 0); - camera = Gtk::manage(new Gtk::ListViewText (1, false, Gtk::SELECTION_MULTIPLE)); - camera->set_headers_visible (false); - Gtk::ScrolledWindow* scamera = Gtk::manage(new Gtk::ScrolledWindow()); - scamera->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); - scamera->add(*camera); - cvb->pack_start (*scamera, Gtk::PACK_SHRINK, 0); - pack_start (*cvb, Gtk::PACK_SHRINK, 4); - - enaLens = Gtk::manage(new Gtk::CheckButton(M("EXIFFILTER_LENS")+":")); - Gtk::VBox* lvb = Gtk::manage(new Gtk::VBox ()); - lvb->pack_start (*enaLens, Gtk::PACK_SHRINK, 0); - lens = Gtk::manage(new Gtk::ListViewText (1, false, Gtk::SELECTION_MULTIPLE)); - lens->set_headers_visible (false); - Gtk::ScrolledWindow* slens = Gtk::manage(new Gtk::ScrolledWindow()); - slens->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); - slens->add(*lens); - lvb->pack_start (*slens, Gtk::PACK_SHRINK, 0); - pack_start (*lvb, Gtk::PACK_SHRINK, 4); - - conns = 0; - sChange[conns++] = fnumberFrom->signal_changed().connect (sigc::mem_fun(*this, &FilterPanel::valueChanged)); - sChange[conns++] = fnumberTo->signal_changed().connect (sigc::mem_fun(*this, &FilterPanel::valueChanged)); - sChange[conns++] = shutterFrom->signal_changed().connect (sigc::mem_fun(*this, &FilterPanel::valueChanged)); - sChange[conns++] = shutterTo->signal_changed().connect (sigc::mem_fun(*this, &FilterPanel::valueChanged)); - sChange[conns++] = isoFrom->signal_changed().connect (sigc::mem_fun(*this, &FilterPanel::valueChanged)); - sChange[conns++] = isoTo->signal_changed().connect (sigc::mem_fun(*this, &FilterPanel::valueChanged)); - sChange[conns++] = focalFrom->signal_changed().connect (sigc::mem_fun(*this, &FilterPanel::valueChanged)); - sChange[conns++] = focalTo->signal_changed().connect (sigc::mem_fun(*this, &FilterPanel::valueChanged)); - sChange[conns++] = camera->get_selection()->signal_changed().connect(sigc::mem_fun(*this, &FilterPanel::valueChanged)); - sChange[conns++] = lens->get_selection()->signal_changed().connect(sigc::mem_fun(*this, &FilterPanel::valueChanged)); - sChange[conns++] = enaFNumber->signal_toggled().connect( sigc::mem_fun(*this, &FilterPanel::valueChanged) ); - sChange[conns++] = enaShutter->signal_toggled().connect( sigc::mem_fun(*this, &FilterPanel::valueChanged) ); - sChange[conns++] = enaFocalLen->signal_toggled().connect( sigc::mem_fun(*this, &FilterPanel::valueChanged) ); - sChange[conns++] = enaISO->signal_toggled().connect( sigc::mem_fun(*this, &FilterPanel::valueChanged) ); - sChange[conns++] = enaCamera->signal_toggled().connect( sigc::mem_fun(*this, &FilterPanel::valueChanged) ); - sChange[conns++] = enaLens->signal_toggled().connect( sigc::mem_fun(*this, &FilterPanel::valueChanged) ); - sChange[conns++] = enabled->signal_toggled().connect( sigc::mem_fun(*this, &FilterPanel::valueChanged) ); - - set_size_request (0, -1); - - show_all (); -} - -void FilterPanel::setFilter (ExifFilterSettings& defefs, bool updateLists) { - - - for (int i=0; iset_active (curefs.filterFNumber); - fnumberFrom->set_text (ImageMetaData::apertureToString (defefs.fnumberFrom)); - curefs.fnumberFrom = defefs.fnumberFrom; - fnumberTo->set_text (ImageMetaData::apertureToString (defefs.fnumberTo)); - curefs.fnumberTo = defefs.fnumberTo; - -// enaShutter->set_active (curefs.filterShutter); - shutterFrom->set_text (ImageMetaData::shutterToString (defefs.shutterFrom)); - curefs.shutterFrom = defefs.shutterFrom; - shutterTo->set_text (ImageMetaData::shutterToString (defefs.shutterTo)); - curefs.shutterTo = defefs.shutterTo; - -// enaISO->set_active (curefs.filterISO); - isoFrom->set_text (Glib::ustring::format (defefs.isoFrom)); - curefs.isoFrom = defefs.isoFrom; - isoTo->set_text (Glib::ustring::format (defefs.isoTo)); - curefs.isoTo = defefs.isoTo; - -// enaFocalLen->set_active (curefs.filterFocalLen); - focalFrom->set_text (Glib::ustring::format (defefs.focalFrom)); - curefs.focalFrom = defefs.focalFrom; - focalTo->set_text (Glib::ustring::format (defefs.focalTo)); - curefs.focalTo = defefs.focalTo; - -// enaCamera->set_active (curefs.filterCamera); - Glib::RefPtr cselection = camera->get_selection (); - -// enaLens->set_active (curefs.filterLens); - Glib::RefPtr lselection = lens->get_selection (); - if( updateLists ){ - lens->clear_items(); - curefs.lenses.clear(); - for (std::set::iterator i = defefs.lenses.begin(); i!=defefs.lenses.end(); i++) { - lens->append_text (*i); - curefs.lenses.insert(*i); - } - lselection->select_all(); - - camera->clear_items(); - curefs.cameras.clear(); - for (std::set::iterator i = defefs.cameras.begin(); i!=defefs.cameras.end(); i++) { - camera->append_text(*i); - curefs.cameras.insert(*i); - } - cselection->select_all(); - }else{ - for( Gtk::TreeModel::Children::iterator iter = lens->get_model()->children().begin(); iter != lens->get_model()->children().end();iter++){ - Glib::ustring v; - iter->get_value(0,v); - if( defefs.lenses.find( v ) != defefs.lenses.end() ) - lselection->select( iter ); - else - lselection->unselect( iter ); - } - for( Gtk::TreeModel::Children::iterator iter = camera->get_model()->children().begin(); iter != camera->get_model()->children().end();iter++){ - Glib::ustring v; - iter->get_value(0,v); - if( defefs.cameras.find( v ) != defefs.cameras.end() ) - cselection->select(iter); - else - cselection->unselect(iter); - } - } - - curefs = defefs; - - for (int i=0; iget_active () && is_sensitive(); -} - -ExifFilterSettings FilterPanel::getFilter () { - - ExifFilterSettings efs; - efs.fnumberFrom = atof (fnumberFrom->get_text().c_str()); - efs.fnumberTo = atof (fnumberTo->get_text().c_str()); - efs.focalFrom = atof (focalFrom->get_text().c_str()); - efs.focalTo = atof (focalTo->get_text().c_str()); - efs.isoFrom = atoi (isoFrom->get_text().c_str()); - efs.isoTo = atoi (isoTo->get_text().c_str()); - efs.shutterFrom = ImageMetaData::shutterFromString (shutterFrom->get_text()); - efs.shutterTo = ImageMetaData::shutterFromString (shutterTo->get_text()); - - efs.filterFNumber = enaFNumber->get_active (); - efs.filterShutter = enaShutter->get_active (); - efs.filterFocalLen = enaFocalLen->get_active (); - efs.filterISO = enaISO->get_active (); - efs.filterCamera = enaCamera->get_active (); - efs.filterLens = enaLens->get_active (); - - std::vector sel = camera->get_selected (); - for (int i=0; iget_text (sel[i])); - sel = lens->get_selected (); - for (int i=0; iget_text (sel[i])); - - return efs; -} - -void FilterPanel::valueChanged () { - - if (listener) - listener->exifFilterChanged (); -} +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include + +using namespace rtengine; + +FilterPanel::FilterPanel () : listener (NULL) { + + set_border_width (4); + + enabled = Gtk::manage (new Gtk::CheckButton (M("EXIFFILTER_METADATAFILTER"))); + pack_start (*enabled, Gtk::PACK_SHRINK, 2); + pack_start (*Gtk::manage(new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 2); + + enaFNumber = Gtk::manage (new Gtk::CheckButton (M("EXIFFILTER_APERTURE")+":")); + Gtk::VBox* fnvb = Gtk::manage(new Gtk::VBox ()); + Gtk::HBox* fnhb = Gtk::manage(new Gtk::HBox ()); + fnvb->pack_start (*enaFNumber, Gtk::PACK_SHRINK, 0); + fnumberFrom = Gtk::manage(new Gtk::Entry ()); + fnumberTo = Gtk::manage(new Gtk::Entry ()); + fnhb->pack_start (*fnumberFrom, true, true, 2); + fnhb->pack_start (*Gtk::manage(new Gtk::Label(" - ")), false, false, 4); + fnhb->pack_start (*fnumberTo, true, true, 2); + fnvb->pack_start (*fnhb, Gtk::PACK_SHRINK, 0); + pack_start (*fnvb, Gtk::PACK_SHRINK, 4); + + enaShutter = Gtk::manage(new Gtk::CheckButton(M("EXIFFILTER_SHUTTER")+":")); + Gtk::VBox* svb = Gtk::manage(new Gtk::VBox ()); + Gtk::HBox* shb = Gtk::manage(new Gtk::HBox ()); + svb->pack_start (*enaShutter, Gtk::PACK_SHRINK, 0); + shutterFrom = Gtk::manage(new Gtk::Entry ()); + shutterTo = Gtk::manage(new Gtk::Entry ()); + shb->pack_start (*shutterFrom, true, true, 2); + shb->pack_start (*Gtk::manage(new Gtk::Label(" - ")), false, false, 4); + shb->pack_start (*shutterTo, true, true, 2); + svb->pack_start (*shb, Gtk::PACK_SHRINK, 0); + pack_start (*svb, Gtk::PACK_SHRINK, 4); + + enaISO = Gtk::manage(new Gtk::CheckButton(M("EXIFFILTER_ISO")+":")); + Gtk::VBox* ivb = Gtk::manage(new Gtk::VBox ()); + Gtk::HBox* ihb = Gtk::manage(new Gtk::HBox ()); + ivb->pack_start (*enaISO, Gtk::PACK_SHRINK, 0); + isoFrom = Gtk::manage(new Gtk::Entry ()); + isoTo = Gtk::manage(new Gtk::Entry ()); + ihb->pack_start (*isoFrom, true, true, 2); + ihb->pack_start (*Gtk::manage(new Gtk::Label(" - ")), false, false, 4); + ihb->pack_start (*isoTo, true, true, 2); + ivb->pack_start (*ihb, Gtk::PACK_SHRINK, 0); + pack_start (*ivb, Gtk::PACK_SHRINK, 4); + + enaFocalLen = Gtk::manage(new Gtk::CheckButton(M("EXIFFILTER_FOCALLEN")+":")); + Gtk::VBox* fvb = Gtk::manage(new Gtk::VBox ()); + Gtk::HBox* fhb = Gtk::manage(new Gtk::HBox ()); + fvb->pack_start (*enaFocalLen, Gtk::PACK_SHRINK, 0); + focalFrom = Gtk::manage(new Gtk::Entry ()); + focalTo = Gtk::manage(new Gtk::Entry ()); + fhb->pack_start (*focalFrom, true, true, 2); + fhb->pack_start (*Gtk::manage(new Gtk::Label(" - ")), false, false, 4); + fhb->pack_start (*focalTo, true, true, 2); + fvb->pack_start (*fhb, Gtk::PACK_SHRINK, 0); + pack_start (*fvb, Gtk::PACK_SHRINK, 4); + + enaCamera = Gtk::manage(new Gtk::CheckButton(M("EXIFFILTER_CAMERA")+":")); + Gtk::VBox* cvb = Gtk::manage(new Gtk::VBox ()); + cvb->pack_start (*enaCamera, Gtk::PACK_SHRINK, 0); + camera = Gtk::manage(new Gtk::ListViewText (1, false, Gtk::SELECTION_MULTIPLE)); + camera->set_headers_visible (false); + Gtk::ScrolledWindow* scamera = Gtk::manage(new Gtk::ScrolledWindow()); + scamera->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); + scamera->add(*camera); + cvb->pack_start (*scamera, Gtk::PACK_SHRINK, 0); + pack_start (*cvb, Gtk::PACK_SHRINK, 4); + + enaLens = Gtk::manage(new Gtk::CheckButton(M("EXIFFILTER_LENS")+":")); + Gtk::VBox* lvb = Gtk::manage(new Gtk::VBox ()); + lvb->pack_start (*enaLens, Gtk::PACK_SHRINK, 0); + lens = Gtk::manage(new Gtk::ListViewText (1, false, Gtk::SELECTION_MULTIPLE)); + lens->set_headers_visible (false); + Gtk::ScrolledWindow* slens = Gtk::manage(new Gtk::ScrolledWindow()); + slens->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); + slens->add(*lens); + lvb->pack_start (*slens, Gtk::PACK_SHRINK, 0); + pack_start (*lvb, Gtk::PACK_SHRINK, 4); + + conns = 0; + sChange[conns++] = fnumberFrom->signal_changed().connect (sigc::mem_fun(*this, &FilterPanel::valueChanged)); + sChange[conns++] = fnumberTo->signal_changed().connect (sigc::mem_fun(*this, &FilterPanel::valueChanged)); + sChange[conns++] = shutterFrom->signal_changed().connect (sigc::mem_fun(*this, &FilterPanel::valueChanged)); + sChange[conns++] = shutterTo->signal_changed().connect (sigc::mem_fun(*this, &FilterPanel::valueChanged)); + sChange[conns++] = isoFrom->signal_changed().connect (sigc::mem_fun(*this, &FilterPanel::valueChanged)); + sChange[conns++] = isoTo->signal_changed().connect (sigc::mem_fun(*this, &FilterPanel::valueChanged)); + sChange[conns++] = focalFrom->signal_changed().connect (sigc::mem_fun(*this, &FilterPanel::valueChanged)); + sChange[conns++] = focalTo->signal_changed().connect (sigc::mem_fun(*this, &FilterPanel::valueChanged)); + sChange[conns++] = camera->get_selection()->signal_changed().connect(sigc::mem_fun(*this, &FilterPanel::valueChanged)); + sChange[conns++] = lens->get_selection()->signal_changed().connect(sigc::mem_fun(*this, &FilterPanel::valueChanged)); + sChange[conns++] = enaFNumber->signal_toggled().connect( sigc::mem_fun(*this, &FilterPanel::valueChanged) ); + sChange[conns++] = enaShutter->signal_toggled().connect( sigc::mem_fun(*this, &FilterPanel::valueChanged) ); + sChange[conns++] = enaFocalLen->signal_toggled().connect( sigc::mem_fun(*this, &FilterPanel::valueChanged) ); + sChange[conns++] = enaISO->signal_toggled().connect( sigc::mem_fun(*this, &FilterPanel::valueChanged) ); + sChange[conns++] = enaCamera->signal_toggled().connect( sigc::mem_fun(*this, &FilterPanel::valueChanged) ); + sChange[conns++] = enaLens->signal_toggled().connect( sigc::mem_fun(*this, &FilterPanel::valueChanged) ); + sChange[conns++] = enabled->signal_toggled().connect( sigc::mem_fun(*this, &FilterPanel::valueChanged) ); + + set_size_request (0, -1); + + show_all (); +} + +void FilterPanel::setFilter (ExifFilterSettings& defefs, bool updateLists) { + + + for (int i=0; iset_active (curefs.filterFNumber); + fnumberFrom->set_text (ImageMetaData::apertureToString (defefs.fnumberFrom)); + curefs.fnumberFrom = defefs.fnumberFrom; + fnumberTo->set_text (ImageMetaData::apertureToString (defefs.fnumberTo)); + curefs.fnumberTo = defefs.fnumberTo; + +// enaShutter->set_active (curefs.filterShutter); + shutterFrom->set_text (ImageMetaData::shutterToString (defefs.shutterFrom)); + curefs.shutterFrom = defefs.shutterFrom; + shutterTo->set_text (ImageMetaData::shutterToString (defefs.shutterTo)); + curefs.shutterTo = defefs.shutterTo; + +// enaISO->set_active (curefs.filterISO); + isoFrom->set_text (Glib::ustring::format (defefs.isoFrom)); + curefs.isoFrom = defefs.isoFrom; + isoTo->set_text (Glib::ustring::format (defefs.isoTo)); + curefs.isoTo = defefs.isoTo; + +// enaFocalLen->set_active (curefs.filterFocalLen); + focalFrom->set_text (Glib::ustring::format (defefs.focalFrom)); + curefs.focalFrom = defefs.focalFrom; + focalTo->set_text (Glib::ustring::format (defefs.focalTo)); + curefs.focalTo = defefs.focalTo; + +// enaCamera->set_active (curefs.filterCamera); + Glib::RefPtr cselection = camera->get_selection (); + +// enaLens->set_active (curefs.filterLens); + Glib::RefPtr lselection = lens->get_selection (); + if( updateLists ){ + lens->clear_items(); + curefs.lenses.clear(); + for (std::set::iterator i = defefs.lenses.begin(); i!=defefs.lenses.end(); i++) { + lens->append_text (*i); + curefs.lenses.insert(*i); + } + lselection->select_all(); + + camera->clear_items(); + curefs.cameras.clear(); + for (std::set::iterator i = defefs.cameras.begin(); i!=defefs.cameras.end(); i++) { + camera->append_text(*i); + curefs.cameras.insert(*i); + } + cselection->select_all(); + }else{ + for( Gtk::TreeModel::Children::iterator iter = lens->get_model()->children().begin(); iter != lens->get_model()->children().end();iter++){ + Glib::ustring v; + iter->get_value(0,v); + if( defefs.lenses.find( v ) != defefs.lenses.end() ) + lselection->select( iter ); + else + lselection->unselect( iter ); + } + for( Gtk::TreeModel::Children::iterator iter = camera->get_model()->children().begin(); iter != camera->get_model()->children().end();iter++){ + Glib::ustring v; + iter->get_value(0,v); + if( defefs.cameras.find( v ) != defefs.cameras.end() ) + cselection->select(iter); + else + cselection->unselect(iter); + } + } + + curefs = defefs; + + for (int i=0; iget_active () && is_sensitive(); +} + +ExifFilterSettings FilterPanel::getFilter () { + + ExifFilterSettings efs; + efs.fnumberFrom = atof (fnumberFrom->get_text().c_str()); + efs.fnumberTo = atof (fnumberTo->get_text().c_str()); + efs.focalFrom = atof (focalFrom->get_text().c_str()); + efs.focalTo = atof (focalTo->get_text().c_str()); + efs.isoFrom = atoi (isoFrom->get_text().c_str()); + efs.isoTo = atoi (isoTo->get_text().c_str()); + efs.shutterFrom = ImageMetaData::shutterFromString (shutterFrom->get_text()); + efs.shutterTo = ImageMetaData::shutterFromString (shutterTo->get_text()); + + efs.filterFNumber = enaFNumber->get_active (); + efs.filterShutter = enaShutter->get_active (); + efs.filterFocalLen = enaFocalLen->get_active (); + efs.filterISO = enaISO->get_active (); + efs.filterCamera = enaCamera->get_active (); + efs.filterLens = enaLens->get_active (); + + std::vector sel = camera->get_selected (); + for (int i=0; iget_text (sel[i])); + sel = lens->get_selected (); + for (int i=0; iget_text (sel[i])); + + return efs; +} + +void FilterPanel::valueChanged () { + + if (listener) + listener->exifFilterChanged (); +} diff --git a/rtgui/filterpanel.h b/rtgui/filterpanel.h index 04a6248b2..d7f6553c9 100644 --- a/rtgui/filterpanel.h +++ b/rtgui/filterpanel.h @@ -1,71 +1,71 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _FILTERPANEL_ -#define _FILTERPANEL_ - -#include -#include - -class FilterPanelListener { - - public: - virtual void exifFilterChanged () {} -}; - -class FilterPanel : public Gtk::VBox { - - protected: - Gtk::ListViewText* camera; - Gtk::ListViewText* lens; - Gtk::Entry* fnumberFrom; - Gtk::Entry* fnumberTo; - Gtk::Entry* shutterFrom; - Gtk::Entry* shutterTo; - Gtk::Entry* focalFrom; - Gtk::Entry* focalTo; - Gtk::Entry* isoFrom; - Gtk::Entry* isoTo; - Gtk::CheckButton* enabled; - Gtk::CheckButton* enaFNumber; - Gtk::CheckButton* enaShutter; - Gtk::CheckButton* enaFocalLen; - Gtk::CheckButton* enaISO; - Gtk::CheckButton* enaCamera; - Gtk::CheckButton* enaLens; - - int conns; - sigc::connection sChange[20]; - - ExifFilterSettings curefs; - FilterPanelListener* listener; - - public: - FilterPanel (); - - void setFilterPanelListener (FilterPanelListener* l) { listener = l; } - - void setFilter (ExifFilterSettings& defefs, bool updateLists); - ExifFilterSettings getFilter (); - bool isEnabled (); - - - void valueChanged (); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _FILTERPANEL_ +#define _FILTERPANEL_ + +#include +#include + +class FilterPanelListener { + + public: + virtual void exifFilterChanged () {} +}; + +class FilterPanel : public Gtk::VBox { + + protected: + Gtk::ListViewText* camera; + Gtk::ListViewText* lens; + Gtk::Entry* fnumberFrom; + Gtk::Entry* fnumberTo; + Gtk::Entry* shutterFrom; + Gtk::Entry* shutterTo; + Gtk::Entry* focalFrom; + Gtk::Entry* focalTo; + Gtk::Entry* isoFrom; + Gtk::Entry* isoTo; + Gtk::CheckButton* enabled; + Gtk::CheckButton* enaFNumber; + Gtk::CheckButton* enaShutter; + Gtk::CheckButton* enaFocalLen; + Gtk::CheckButton* enaISO; + Gtk::CheckButton* enaCamera; + Gtk::CheckButton* enaLens; + + int conns; + sigc::connection sChange[20]; + + ExifFilterSettings curefs; + FilterPanelListener* listener; + + public: + FilterPanel (); + + void setFilterPanelListener (FilterPanelListener* l) { listener = l; } + + void setFilter (ExifFilterSettings& defefs, bool updateLists); + ExifFilterSettings getFilter (); + bool isEnabled (); + + + void valueChanged (); +}; + +#endif diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index e1f757e0e..368f0135f 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index 8c170a598..6c4a9423c 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef __UTILS_ #define __UTILS_ diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index 899fbb4c1..60439c9bf 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -1,466 +1,466 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include - -HistogramPanel::HistogramPanel () { - - histogramArea = Gtk::manage (new HistogramArea ()); - showRed = Gtk::manage (new Gtk::ToggleButton ("R")); - showGreen = Gtk::manage (new Gtk::ToggleButton ("G")); - showBlue = Gtk::manage (new Gtk::ToggleButton ("B")); - showValue = Gtk::manage (new Gtk::ToggleButton ("L")); - Gtk::VBox* vbox = Gtk::manage (new Gtk::VBox (false, 0)); - - showRed->set_active (true); - showGreen->set_active (true); - showBlue->set_active (true); - showValue->set_active (true); - vbox->pack_start (*showRed, Gtk::PACK_SHRINK, 2); - vbox->pack_start (*showGreen, Gtk::PACK_SHRINK, 2); - vbox->pack_start (*showBlue, Gtk::PACK_SHRINK, 2); - vbox->pack_start (*showValue, Gtk::PACK_SHRINK, 2); - pack_start (*histogramArea); - pack_end (*vbox, Gtk::PACK_SHRINK, 2); - - showRed->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); - showGreen->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); - showBlue->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); - showValue->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); - - show_all (); - - showRed->set_tooltip_text (M("HISTOGRAM_TOOLTIP_R")); - showGreen->set_tooltip_text (M("HISTOGRAM_TOOLTIP_G")); - showBlue->set_tooltip_text (M("HISTOGRAM_TOOLTIP_B")); - showValue->set_tooltip_text (M("HISTOGRAM_TOOLTIP_L")); - - rconn = signal_size_allocate().connect( sigc::mem_fun(*this, &HistogramPanel::resized) ); -} - -void HistogramPanel::resized (Gtk::Allocation& req) { - - rconn.block (true); - - if (req.get_width()/2>150) - set_size_request (req.get_width(), 150); - else - set_size_request (req.get_width(), req.get_width()/2); - rconn.block (false); - histogramArea->renderHistogram (); - histogramArea->queue_draw (); -} - -void HistogramPanel::rgbv_toggled () { - - histogramArea->updateOptions (showRed->get_active(), showGreen->get_active(), showBlue->get_active(), showValue->get_active()); - histogramArea->queue_draw (); -} - -HistogramArea::HistogramArea () : - needVal(true), needRed(true), needGreen(true), needBlue(true), oldwidth(-1), valid(false), showFull(true) { - - haih = new HistogramAreaIdleHelper; - haih->harea = this; - haih->destroyed = false; - haih->pending = 0; - - signal_style_changed().connect( sigc::mem_fun(*this, &HistogramArea::styleChanged) ); -} - -HistogramArea::~HistogramArea () { - - if (haih->pending) - haih->destroyed = true; - else - delete haih; -} - -void HistogramArea::updateOptions (bool r, bool g, bool b, bool v) { - - needRed = r; - needGreen = g; - needBlue = b; - needVal = v; - - renderHistogram (); -} - -int histupdate (void* data) { - - gdk_threads_enter (); - - HistogramAreaIdleHelper* haih = (HistogramAreaIdleHelper*)data; - - if (haih->destroyed) { - if (haih->pending == 1) - delete haih; - else - haih->pending--; - gdk_threads_leave (); - return 0; - } - - haih->harea->renderHistogram (); - haih->harea->queue_draw (); - - haih->pending--; - gdk_threads_leave (); - return 0; -} - -void HistogramArea::update (unsigned int* rh, unsigned int* gh, unsigned int* bh, unsigned int* lh) { - - if (rh!=NULL) { - memcpy (lhist, lh, 256*sizeof(unsigned int)); - memcpy (rhist, rh, 256*sizeof(unsigned int)); - memcpy (ghist, gh, 256*sizeof(unsigned int)); - memcpy (bhist, bh, 256*sizeof(unsigned int)); - valid = true; - } - else - valid = false; - - haih->pending++; - g_idle_add (histupdate, haih); -} - -void HistogramArea::renderHistogram () { - - if (!is_realized ()) - return; - - Glib::RefPtr window = get_window(); - int winx, winy, winw, winh, wind; - window->get_geometry(winx, winy, winw, winh, wind); - - backBuffer = Gdk::Pixmap::create (window, winw, winh, -1); - - Glib::RefPtr bgc = Gdk::GC::create(backBuffer); - - bgc->set_foreground (white); - backBuffer->draw_rectangle (bgc, true, 0, 0, winw, winh); - - if (valid) { +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include - // compute height of the full histogram (realheight) and - - int fullhistheight = 0; - for (int i=0; i<256; i++) { - if (needVal && lhist[i]>fullhistheight) - fullhistheight = lhist[i]; - if (needRed && rhist[i]>fullhistheight) - fullhistheight = rhist[i]; - if (needGreen && ghist[i]>fullhistheight) - fullhistheight = ghist[i]; - if (needBlue && bhist[i]>fullhistheight) - fullhistheight = bhist[i]; - } - - // compute two hights, one for the magnified view and one for the threshold - int realhistheight = fullhistheight; - - if (!showFull) { - int area1thres = 0; - int area2thres = 0; - int area = 0; - for (int i=0; ii) || (needRed && rhist[j]>i) || (needGreen && ghist[j]>i) || (needBlue && bhist[j]>i)) - area++; - if (area1thres==0 && (double)area / (256*(i+1)) < 0.3) - area1thres = i; - if (area2thres==0 && (double)area / (256*(i+1)) < 0.3) - area2thres = i; - if (area1thres && area2thres) - break; - } - if (area1thres>0 && area2thres>0 && area1thres cr = backBuffer->create_cairo_context(); - cr->set_antialias (Cairo::ANTIALIAS_SUBPIXEL); +HistogramPanel::HistogramPanel () { + + histogramArea = Gtk::manage (new HistogramArea ()); + showRed = Gtk::manage (new Gtk::ToggleButton ("R")); + showGreen = Gtk::manage (new Gtk::ToggleButton ("G")); + showBlue = Gtk::manage (new Gtk::ToggleButton ("B")); + showValue = Gtk::manage (new Gtk::ToggleButton ("L")); + Gtk::VBox* vbox = Gtk::manage (new Gtk::VBox (false, 0)); + + showRed->set_active (true); + showGreen->set_active (true); + showBlue->set_active (true); + showValue->set_active (true); + vbox->pack_start (*showRed, Gtk::PACK_SHRINK, 2); + vbox->pack_start (*showGreen, Gtk::PACK_SHRINK, 2); + vbox->pack_start (*showBlue, Gtk::PACK_SHRINK, 2); + vbox->pack_start (*showValue, Gtk::PACK_SHRINK, 2); + pack_start (*histogramArea); + pack_end (*vbox, Gtk::PACK_SHRINK, 2); + + showRed->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); + showGreen->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); + showBlue->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); + showValue->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); + + show_all (); + + showRed->set_tooltip_text (M("HISTOGRAM_TOOLTIP_R")); + showGreen->set_tooltip_text (M("HISTOGRAM_TOOLTIP_G")); + showBlue->set_tooltip_text (M("HISTOGRAM_TOOLTIP_B")); + showValue->set_tooltip_text (M("HISTOGRAM_TOOLTIP_L")); + + rconn = signal_size_allocate().connect( sigc::mem_fun(*this, &HistogramPanel::resized) ); +} + +void HistogramPanel::resized (Gtk::Allocation& req) { + + rconn.block (true); + + if (req.get_width()/2>150) + set_size_request (req.get_width(), 150); + else + set_size_request (req.get_width(), req.get_width()/2); + rconn.block (false); + histogramArea->renderHistogram (); + histogramArea->queue_draw (); +} + +void HistogramPanel::rgbv_toggled () { + + histogramArea->updateOptions (showRed->get_active(), showGreen->get_active(), showBlue->get_active(), showValue->get_active()); + histogramArea->queue_draw (); +} + +HistogramArea::HistogramArea () : + needVal(true), needRed(true), needGreen(true), needBlue(true), oldwidth(-1), valid(false), showFull(true) { + + haih = new HistogramAreaIdleHelper; + haih->harea = this; + haih->destroyed = false; + haih->pending = 0; + + signal_style_changed().connect( sigc::mem_fun(*this, &HistogramArea::styleChanged) ); +} + +HistogramArea::~HistogramArea () { + + if (haih->pending) + haih->destroyed = true; + else + delete haih; +} + +void HistogramArea::updateOptions (bool r, bool g, bool b, bool v) { + + needRed = r; + needGreen = g; + needBlue = b; + needVal = v; + + renderHistogram (); +} + +int histupdate (void* data) { + + gdk_threads_enter (); + + HistogramAreaIdleHelper* haih = (HistogramAreaIdleHelper*)data; + + if (haih->destroyed) { + if (haih->pending == 1) + delete haih; + else + haih->pending--; + gdk_threads_leave (); + return 0; + } + + haih->harea->renderHistogram (); + haih->harea->queue_draw (); + + haih->pending--; + gdk_threads_leave (); + return 0; +} + +void HistogramArea::update (unsigned int* rh, unsigned int* gh, unsigned int* bh, unsigned int* lh) { + + if (rh!=NULL) { + memcpy (lhist, lh, 256*sizeof(unsigned int)); + memcpy (rhist, rh, 256*sizeof(unsigned int)); + memcpy (ghist, gh, 256*sizeof(unsigned int)); + memcpy (bhist, bh, 256*sizeof(unsigned int)); + valid = true; + } + else + valid = false; + + haih->pending++; + g_idle_add (histupdate, haih); +} + +void HistogramArea::renderHistogram () { + + if (!is_realized ()) + return; + + Glib::RefPtr window = get_window(); + int winx, winy, winw, winh, wind; + window->get_geometry(winx, winy, winw, winh, wind); + + backBuffer = Gdk::Pixmap::create (window, winw, winh, -1); + + Glib::RefPtr bgc = Gdk::GC::create(backBuffer); + + bgc->set_foreground (white); + backBuffer->draw_rectangle (bgc, true, 0, 0, winw, winh); + + if (valid) { + + // compute height of the full histogram (realheight) and + + int fullhistheight = 0; + for (int i=0; i<256; i++) { + if (needVal && lhist[i]>fullhistheight) + fullhistheight = lhist[i]; + if (needRed && rhist[i]>fullhistheight) + fullhistheight = rhist[i]; + if (needGreen && ghist[i]>fullhistheight) + fullhistheight = ghist[i]; + if (needBlue && bhist[i]>fullhistheight) + fullhistheight = bhist[i]; + } + + // compute two hights, one for the magnified view and one for the threshold + int realhistheight = fullhistheight; + + if (!showFull) { + int area1thres = 0; + int area2thres = 0; + int area = 0; + for (int i=0; ii) || (needRed && rhist[j]>i) || (needGreen && ghist[j]>i) || (needBlue && bhist[j]>i)) + area++; + if (area1thres==0 && (double)area / (256*(i+1)) < 0.3) + area1thres = i; + if (area2thres==0 && (double)area / (256*(i+1)) < 0.3) + area2thres = i; + if (area1thres && area2thres) + break; + } + if (area1thres>0 && area2thres>0 && area1thres cr = backBuffer->create_cairo_context(); + cr->set_antialias (Cairo::ANTIALIAS_SUBPIXEL); cr->set_line_width (1.0); double stepSize = (winw-1) / 256.0; - if (needVal) { - cr->move_to (0, winh-1); - cr->set_source_rgb (0.75, 0.75, 0.75); - for (int i=0; i<256; i++) { - double val = lhist[i] * (double)(winh-2) / realhistheight; - if (val>winh-1) - val = winh-1; - if (i>0) + if (needVal) { + cr->move_to (0, winh-1); + cr->set_source_rgb (0.75, 0.75, 0.75); + for (int i=0; i<256; i++) { + double val = lhist[i] * (double)(winh-2) / realhistheight; + if (val>winh-1) + val = winh-1; + if (i>0) cr->line_to (i*stepSize, winh-1-val); } cr->save (); - cr->line_to (winw-1, winh-1); cr->fill_preserve (); + cr->line_to (winw-1, winh-1); cr->fill_preserve (); cr->restore (); - cr->set_source_rgb (0.5, 0.5, 0.5); - cr->stroke (); + cr->set_source_rgb (0.5, 0.5, 0.5); + cr->stroke (); + } + if (needRed) { + cr->move_to (0, winh-1); + cr->set_source_rgb (1.0, 0.0, 0.0); + for (int i=0; i<256; i++) { + double val = rhist[i] * (double)(winh-2) / realhistheight; + if (val>winh-1) + val = winh-1; + if (i>0) + cr->line_to (i*stepSize, winh-1-val); + } + cr->stroke (); + } + if (needGreen) { cr->move_to (0, winh-1); + cr->set_source_rgb (0.0, 1.0, 0.0); + for (int i=0; i<256; i++) { + double val = ghist[i] * (double)(winh-2) / realhistheight; + if (val>winh-1) + val = winh-1; + if (i>0) + cr->line_to (i*stepSize, winh-1-val); + } + cr->stroke (); + } + if (needBlue) { + cr->move_to (0, winh-1); + cr->set_source_rgb (0.0, 0.0, 1.0); + for (int i=0; i<256; i++) { + int val = bhist[i] * (double)(winh-2) / realhistheight; + if (val>winh-1) + val = winh-1; + if (i>0) + cr->line_to (i*stepSize, winh-1-val); + } + cr->stroke (); } - if (needRed) { - cr->move_to (0, winh-1); - cr->set_source_rgb (1.0, 0.0, 0.0); - for (int i=0; i<256; i++) { - double val = rhist[i] * (double)(winh-2) / realhistheight; - if (val>winh-1) - val = winh-1; - if (i>0) - cr->line_to (i*stepSize, winh-1-val); - } - cr->stroke (); - } - if (needGreen) { cr->move_to (0, winh-1); - cr->set_source_rgb (0.0, 1.0, 0.0); - for (int i=0; i<256; i++) { - double val = ghist[i] * (double)(winh-2) / realhistheight; - if (val>winh-1) - val = winh-1; - if (i>0) - cr->line_to (i*stepSize, winh-1-val); - } - cr->stroke (); - } - if (needBlue) { - cr->move_to (0, winh-1); - cr->set_source_rgb (0.0, 0.0, 1.0); - for (int i=0; i<256; i++) { - int val = bhist[i] * (double)(winh-2) / realhistheight; - if (val>winh-1) - val = winh-1; - if (i>0) - cr->line_to (i*stepSize, winh-1-val); - } - cr->stroke (); - } } /* - - // scale histogram to width winw-1 - - int* vval = new int[winw-1]; - int* vred = new int[winw-1]; - int* vgreen = new int[winw-1]; - int* vblue = new int[winw-1]; - - memset (vval, 0, sizeof(int)*(winw-1)); - memset (vred, 0, sizeof(int)*(winw-1)); - memset (vgreen, 0, sizeof(int)*(winw-1)); - memset (vblue, 0, sizeof(int)*(winw-1)); - - int index = 0; - double scale = 256.0 / (winw-2); - for (int i=0; i<=winw-2; i++) { - int samples = 0; - while (index < 256 && (int)(index/scale) == i) { - vval[i] += lhist[index]; - vred[i] += rhist[index]; - vgreen[i] += ghist[index]; - vblue[i] += bhist[index]; - index++; - samples++; - } - if (samples>0) { - vval[i] /= samples; - vred[i] /= samples; - vgreen[i] /= samples; - vblue[i] /= samples; - } + + // scale histogram to width winw-1 + + int* vval = new int[winw-1]; + int* vred = new int[winw-1]; + int* vgreen = new int[winw-1]; + int* vblue = new int[winw-1]; + + memset (vval, 0, sizeof(int)*(winw-1)); + memset (vred, 0, sizeof(int)*(winw-1)); + memset (vgreen, 0, sizeof(int)*(winw-1)); + memset (vblue, 0, sizeof(int)*(winw-1)); + + int index = 0; + double scale = 256.0 / (winw-2); + for (int i=0; i<=winw-2; i++) { + int samples = 0; + while (index < 256 && (int)(index/scale) == i) { + vval[i] += lhist[index]; + vred[i] += rhist[index]; + vgreen[i] += ghist[index]; + vblue[i] += bhist[index]; + index++; + samples++; + } + if (samples>0) { + vval[i] /= samples; + vred[i] /= samples; + vgreen[i] /= samples; + vblue[i] /= samples; + } } - // compute height of the full histogram (realheight) and - - int fullhistheight = 0; - for (int i=0; i<=winw-2; i++) { - if (needVal && vval[i]>fullhistheight) - fullhistheight = vval[i]; - if (needRed && vred[i]>fullhistheight) - fullhistheight = vred[i]; - if (needGreen && vgreen[i]>fullhistheight) - fullhistheight = vgreen[i]; - if (needBlue && vblue[i]>fullhistheight) - fullhistheight = vblue[i]; - } - - // compute two hights, one for the magnified view and one for the threshold - - int realhistheight = fullhistheight; - - if (!showFull) { - int area1thres = 0; - int area2thres = 0; - int area = 0; - for (int i=0; ii) || (needRed && vred[j]>i) || (needGreen && vgreen[j]>i) || (needBlue && vblue[j]>i)) - area++; - if (area1thres==0 && (double)area / ((winw-1)*(i+1)) < 0.3) - area1thres = i; - if (area2thres==0 && (double)area / ((winw-1)*(i+1)) < 0.3) - area2thres = i; - if (area1thres && area2thres) - break; - } - if (area1thres>0 && area2thres>0 && area1thres cr = backBuffer->create_cairo_context(); - cr->set_antialias (Cairo::ANTIALIAS_SUBPIXEL); - cr->set_line_width (1.0); - if (needVal) { - cr->move_to (0, winh-1); - cr->set_source_rgb (0.75, 0.75, 0.75); - for (int i=0; i<=winw-2; i++) { - int val = (int)(vval[i] * (double)(winh-2) / realhistheight); - if (val>winh-1) - val = winh-1; - if (i>0) - cr->line_to (i+1, winh-1-val); - } - cr->fill_preserve (); - cr->set_source_rgb (0.5, 0.5, 0.5); - cr->stroke (); - } - if (needRed) { - cr->move_to (0, winh-1); - cr->set_source_rgb (1.0, 0.0, 0.0); - for (int i=0; i<=winw-2; i++) { - int val = (int)(vred[i] * (double)(winh-2) / realhistheight); - if (val>winh-1) - val = winh-1; - if (i>0) - cr->line_to (i+1, winh-1-val); - } - cr->stroke (); - } - if (needGreen) { - cr->move_to (0, winh-1); - cr->set_source_rgb (0.0, 1.0, 0.0); - for (int i=0; i<=winw-2; i++) { - int val = (int)(vgreen[i] * (double)(winh-2) / realhistheight); - if (val>winh-1) - val = winh-1; - if (i>0) - cr->line_to (i+1, winh-1-val); - } - cr->stroke (); - } - if (needBlue) { - cr->move_to (0, winh-1); - cr->set_source_rgb (0.0, 0.0, 1.0); - for (int i=0; i<=winw-2; i++) { - int val = (int)(vblue[i] * (double)(winh-2) / realhistheight); - if (val>winh-1) - val = winh-1; - if (i>0) - cr->line_to (i+1, winh-1-val); - } - cr->stroke (); - } - - delete [] vval; - delete [] vred; - delete [] vgreen; - delete [] vblue; - } + // compute height of the full histogram (realheight) and + + int fullhistheight = 0; + for (int i=0; i<=winw-2; i++) { + if (needVal && vval[i]>fullhistheight) + fullhistheight = vval[i]; + if (needRed && vred[i]>fullhistheight) + fullhistheight = vred[i]; + if (needGreen && vgreen[i]>fullhistheight) + fullhistheight = vgreen[i]; + if (needBlue && vblue[i]>fullhistheight) + fullhistheight = vblue[i]; + } + + // compute two hights, one for the magnified view and one for the threshold + + int realhistheight = fullhistheight; + + if (!showFull) { + int area1thres = 0; + int area2thres = 0; + int area = 0; + for (int i=0; ii) || (needRed && vred[j]>i) || (needGreen && vgreen[j]>i) || (needBlue && vblue[j]>i)) + area++; + if (area1thres==0 && (double)area / ((winw-1)*(i+1)) < 0.3) + area1thres = i; + if (area2thres==0 && (double)area / ((winw-1)*(i+1)) < 0.3) + area2thres = i; + if (area1thres && area2thres) + break; + } + if (area1thres>0 && area2thres>0 && area1thres cr = backBuffer->create_cairo_context(); + cr->set_antialias (Cairo::ANTIALIAS_SUBPIXEL); + cr->set_line_width (1.0); + if (needVal) { + cr->move_to (0, winh-1); + cr->set_source_rgb (0.75, 0.75, 0.75); + for (int i=0; i<=winw-2; i++) { + int val = (int)(vval[i] * (double)(winh-2) / realhistheight); + if (val>winh-1) + val = winh-1; + if (i>0) + cr->line_to (i+1, winh-1-val); + } + cr->fill_preserve (); + cr->set_source_rgb (0.5, 0.5, 0.5); + cr->stroke (); + } + if (needRed) { + cr->move_to (0, winh-1); + cr->set_source_rgb (1.0, 0.0, 0.0); + for (int i=0; i<=winw-2; i++) { + int val = (int)(vred[i] * (double)(winh-2) / realhistheight); + if (val>winh-1) + val = winh-1; + if (i>0) + cr->line_to (i+1, winh-1-val); + } + cr->stroke (); + } + if (needGreen) { + cr->move_to (0, winh-1); + cr->set_source_rgb (0.0, 1.0, 0.0); + for (int i=0; i<=winw-2; i++) { + int val = (int)(vgreen[i] * (double)(winh-2) / realhistheight); + if (val>winh-1) + val = winh-1; + if (i>0) + cr->line_to (i+1, winh-1-val); + } + cr->stroke (); + } + if (needBlue) { + cr->move_to (0, winh-1); + cr->set_source_rgb (0.0, 0.0, 1.0); + for (int i=0; i<=winw-2; i++) { + int val = (int)(vblue[i] * (double)(winh-2) / realhistheight); + if (val>winh-1) + val = winh-1; + if (i>0) + cr->line_to (i+1, winh-1-val); + } + cr->stroke (); + } + + delete [] vval; + delete [] vred; + delete [] vgreen; + delete [] vblue; + } */ - bgc->set_foreground (mgray); - backBuffer->draw_rectangle (bgc, false, 0, 0, winw-1, winh-1); - - bgc->set_line_attributes (1, Gdk::LINE_ON_OFF_DASH, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER); - - backBuffer->draw_line (bgc, winw/3, 0, winw/3, winh-1); - backBuffer->draw_line (bgc, 2*winw/3, 0, 2*winw/3, winh-1); - backBuffer->draw_line (bgc, 0, winh/3, winw-1, winh/3); - backBuffer->draw_line (bgc, 0, 2*winh/3, winw-1, 2*winh/3); - - bgc->set_line_attributes (1, Gdk::LINE_SOLID, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER); - - oldwidth = winw; - oldheight = winh; -} - -void HistogramArea::on_realize () { - - Gtk::DrawingArea::on_realize(); - Glib::RefPtr window = get_window(); - gc_ = Gdk::GC::create(window); - add_events(Gdk::EXPOSURE_MASK | Gdk::BUTTON_PRESS_MASK); - Glib::RefPtr colormap = get_default_colormap(); - - black = Gdk::Color ("black"); - red = Gdk::Color ("red"); - green = Gdk::Color ("green"); - blue = Gdk::Color ("blue"); - lgray = Gdk::Color ("gray75"); - mgray = Gdk::Color ("gray50"); - dgray = Gdk::Color ("gray25"); - colormap->alloc_color(black); - colormap->alloc_color(white); - colormap->alloc_color(red); - colormap->alloc_color(green); - colormap->alloc_color(blue); - colormap->alloc_color(lgray); - colormap->alloc_color(mgray); - colormap->alloc_color(dgray); - -} - -void HistogramArea::styleChanged (const Glib::RefPtr& style) { - - white = get_style()->get_base(Gtk::STATE_NORMAL); - queue_draw (); -} - -bool HistogramArea::on_expose_event(GdkEventExpose* event) { - - Glib::RefPtr window = get_window(); - - int winx, winy, winw, winh, wind; - window->get_geometry(winx, winy, winw, winh, wind); - - if (winw!=oldwidth && winh!=oldheight) - renderHistogram (); - window->draw_drawable (gc_, backBuffer, 0, 0, 0, 0, -1, -1); - - return true; -} - - -bool HistogramArea::on_button_press_event (GdkEventButton* event) { - - if (event->type==GDK_2BUTTON_PRESS && event->button==1) { - showFull = !showFull; - renderHistogram (); - queue_draw (); - } - return true; -} - - + bgc->set_foreground (mgray); + backBuffer->draw_rectangle (bgc, false, 0, 0, winw-1, winh-1); + + bgc->set_line_attributes (1, Gdk::LINE_ON_OFF_DASH, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER); + + backBuffer->draw_line (bgc, winw/3, 0, winw/3, winh-1); + backBuffer->draw_line (bgc, 2*winw/3, 0, 2*winw/3, winh-1); + backBuffer->draw_line (bgc, 0, winh/3, winw-1, winh/3); + backBuffer->draw_line (bgc, 0, 2*winh/3, winw-1, 2*winh/3); + + bgc->set_line_attributes (1, Gdk::LINE_SOLID, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER); + + oldwidth = winw; + oldheight = winh; +} + +void HistogramArea::on_realize () { + + Gtk::DrawingArea::on_realize(); + Glib::RefPtr window = get_window(); + gc_ = Gdk::GC::create(window); + add_events(Gdk::EXPOSURE_MASK | Gdk::BUTTON_PRESS_MASK); + Glib::RefPtr colormap = get_default_colormap(); + + black = Gdk::Color ("black"); + red = Gdk::Color ("red"); + green = Gdk::Color ("green"); + blue = Gdk::Color ("blue"); + lgray = Gdk::Color ("gray75"); + mgray = Gdk::Color ("gray50"); + dgray = Gdk::Color ("gray25"); + colormap->alloc_color(black); + colormap->alloc_color(white); + colormap->alloc_color(red); + colormap->alloc_color(green); + colormap->alloc_color(blue); + colormap->alloc_color(lgray); + colormap->alloc_color(mgray); + colormap->alloc_color(dgray); + +} + +void HistogramArea::styleChanged (const Glib::RefPtr& style) { + + white = get_style()->get_base(Gtk::STATE_NORMAL); + queue_draw (); +} + +bool HistogramArea::on_expose_event(GdkEventExpose* event) { + + Glib::RefPtr window = get_window(); + + int winx, winy, winw, winh, wind; + window->get_geometry(winx, winy, winw, winh, wind); + + if (winw!=oldwidth && winh!=oldheight) + renderHistogram (); + window->draw_drawable (gc_, backBuffer, 0, 0, 0, 0, -1, -1); + + return true; +} + + +bool HistogramArea::on_button_press_event (GdkEventButton* event) { + + if (event->type==GDK_2BUTTON_PRESS && event->button==1) { + showFull = !showFull; + renderHistogram (); + queue_draw (); + } + return true; +} + + diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index d50ed2838..f29ea3c5e 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -1,97 +1,97 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _HISTOGRAMPANEL_ -#define _HISTOGRAMPANEL_ - -#include -#include - -class HistogramArea; -struct HistogramAreaIdleHelper { - HistogramArea* harea; - bool destroyed; - int pending; -}; - -class HistogramArea : public Gtk::DrawingArea { - - protected: - - Glib::RefPtr gc_; - Glib::RefPtr backBuffer; - - Gdk::Color black; - Gdk::Color white; - Gdk::Color red; - Gdk::Color green; - Gdk::Color blue; - Gdk::Color lgray; - Gdk::Color mgray; - Gdk::Color dgray; - unsigned int lhist[256]; - unsigned int rhist[256]; - unsigned int ghist[256]; - unsigned int bhist[256]; - bool valid; - bool showFull; - int oldwidth, oldheight; - - bool needVal; - bool needRed; - bool needGreen; - bool needBlue; - - HistogramAreaIdleHelper* haih; - - public: - - HistogramArea(); - ~HistogramArea(); - - void renderHistogram (); - void update (unsigned int* rh, unsigned int* gh, unsigned int* bh, unsigned int* lh); - void updateOptions (bool r, bool g, bool b, bool v); - void on_realize(); - bool on_expose_event(GdkEventExpose* event); - bool on_button_press_event (GdkEventButton* event); - void styleChanged (const Glib::RefPtr& style); -}; - -class HistogramPanel : public Gtk::HBox { - - protected: - - HistogramArea* histogramArea; - Gtk::ToggleButton* showRed; - Gtk::ToggleButton* showGreen; - Gtk::ToggleButton* showBlue; - Gtk::ToggleButton* showValue; - - sigc::connection rconn; - - public: - - HistogramPanel (); - - void histogramChanged (unsigned int* rh, unsigned int* gh, unsigned int* bh, unsigned int* lh) { histogramArea->update (rh, gh, bh, lh); } - void rgbv_toggled (); - void resized (Gtk::Allocation& req); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _HISTOGRAMPANEL_ +#define _HISTOGRAMPANEL_ + +#include +#include + +class HistogramArea; +struct HistogramAreaIdleHelper { + HistogramArea* harea; + bool destroyed; + int pending; +}; + +class HistogramArea : public Gtk::DrawingArea { + + protected: + + Glib::RefPtr gc_; + Glib::RefPtr backBuffer; + + Gdk::Color black; + Gdk::Color white; + Gdk::Color red; + Gdk::Color green; + Gdk::Color blue; + Gdk::Color lgray; + Gdk::Color mgray; + Gdk::Color dgray; + unsigned int lhist[256]; + unsigned int rhist[256]; + unsigned int ghist[256]; + unsigned int bhist[256]; + bool valid; + bool showFull; + int oldwidth, oldheight; + + bool needVal; + bool needRed; + bool needGreen; + bool needBlue; + + HistogramAreaIdleHelper* haih; + + public: + + HistogramArea(); + ~HistogramArea(); + + void renderHistogram (); + void update (unsigned int* rh, unsigned int* gh, unsigned int* bh, unsigned int* lh); + void updateOptions (bool r, bool g, bool b, bool v); + void on_realize(); + bool on_expose_event(GdkEventExpose* event); + bool on_button_press_event (GdkEventButton* event); + void styleChanged (const Glib::RefPtr& style); +}; + +class HistogramPanel : public Gtk::HBox { + + protected: + + HistogramArea* histogramArea; + Gtk::ToggleButton* showRed; + Gtk::ToggleButton* showGreen; + Gtk::ToggleButton* showBlue; + Gtk::ToggleButton* showValue; + + sigc::connection rconn; + + public: + + HistogramPanel (); + + void histogramChanged (unsigned int* rh, unsigned int* gh, unsigned int* bh, unsigned int* lh) { histogramArea->update (rh, gh, bh, lh); } + void rgbv_toggled (); + void resized (Gtk::Allocation& req); +}; + +#endif diff --git a/rtgui/history.cc b/rtgui/history.cc index 46ea67b0b..1ae72c5b7 100644 --- a/rtgui/history.cc +++ b/rtgui/history.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include @@ -115,8 +115,8 @@ History::History (bool bookmarkSupport) : tpc (NULL), bmnum (1), blistener(NULL) hTreeView->set_grid_lines (Gtk::TREE_VIEW_GRID_LINES_BOTH); hTreeView->signal_size_allocate().connect( sigc::mem_fun(*this, &History::resized) ); - hTreeView->set_enable_search(false); - bTreeView->set_enable_search(false); + hTreeView->set_enable_search(false); + bTreeView->set_enable_search(false); show_all_children (); } diff --git a/rtgui/history.h b/rtgui/history.h index 58d0a76c9..134b30b0b 100644 --- a/rtgui/history.h +++ b/rtgui/history.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _HISTORY_ #define _HISTORY_ diff --git a/rtgui/hlrec.cc b/rtgui/hlrec.cc index 1c90d6533..0939cf3bd 100644 --- a/rtgui/hlrec.cc +++ b/rtgui/hlrec.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include diff --git a/rtgui/hlrec.h b/rtgui/hlrec.h index 86f490232..c77e47fab 100644 --- a/rtgui/hlrec.h +++ b/rtgui/hlrec.h @@ -1,48 +1,48 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _HLREC_H_ -#define _HLREC_H_ - -#include -#include - -class HLRecovery : public Gtk::VBox, public ToolPanel { - - protected: - Gtk::CheckButton* enabled; - Gtk::ComboBoxText* method; - sigc::connection methconn; - sigc::connection enaconn; - bool lastEnabled; - - public: - - HLRecovery (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setBatchMode (bool batchMode); - - void setRaw (bool raw); - - void enabledChanged (); - void methodChanged (); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _HLREC_H_ +#define _HLREC_H_ + +#include +#include + +class HLRecovery : public Gtk::VBox, public ToolPanel { + + protected: + Gtk::CheckButton* enabled; + Gtk::ComboBoxText* method; + sigc::connection methconn; + sigc::connection enaconn; + bool lastEnabled; + + public: + + HLRecovery (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setBatchMode (bool batchMode); + + void setRaw (bool raw); + + void enabledChanged (); + void methodChanged (); +}; + +#endif diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc index e51ca623e..765a7422d 100644 --- a/rtgui/icmpanel.cc +++ b/rtgui/icmpanel.cc @@ -1,197 +1,197 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include #include - -using namespace rtengine; -using namespace rtengine::procparams; - -extern Options options; - -ICMPanel::ICMPanel () : ToolPanel(), icmplistener(NULL), iunchanged(NULL) { - -// set_border_width (4); - - ipDialog = Gtk::manage (new Gtk::FileChooserButton (M("TP_ICM_INPUTDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN)); - opDialog = Gtk::manage (new Gtk::FileChooserButton (M("TP_ICM_INPUTDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN)); - - Gtk::Label* ilab = Gtk::manage (new Gtk::Label ()); - ilab->set_alignment (0.0, 0.5); - ilab->set_markup (Glib::ustring("") + M("TP_ICM_INPUTPROFILE") + ""); - pack_start (*ilab, Gtk::PACK_SHRINK, 4); - - iembedded = Gtk::manage (new Gtk::RadioButton (M("TP_ICM_INPUTEMBEDDED"))); - pack_start (*iembedded, Gtk::PACK_SHRINK, 4); - - icamera = Gtk::manage (new Gtk::RadioButton (M("TP_ICM_INPUTCAMERA"))); - pack_start (*icamera, Gtk::PACK_SHRINK, 4); - - ifromfile = Gtk::manage (new Gtk::RadioButton (M("TP_ICM_INPUTCUSTOM")+":")); - Gtk::HBox* ffbox = Gtk::manage (new Gtk::HBox ()); - ffbox->pack_start (*ifromfile, Gtk::PACK_SHRINK); - ffbox->pack_start (*ipDialog); - - pack_start (*ffbox, Gtk::PACK_SHRINK, 4); - - opts = icamera->get_group(); - iembedded->set_group (opts); - ifromfile->set_group (opts); - - igamma = Gtk::manage (new Gtk::CheckButton (M("TP_ICM_GAMMABEFOREINPUT"))); - igamma->set_sensitive (false); - pack_start (*igamma, Gtk::PACK_SHRINK, 4); - - saveRef = Gtk::manage (new Gtk::Button (M("TP_ICM_SAVEREFERENCE"))); - saveRef->set_image (*Gtk::manage (new Gtk::Image (Gtk::StockID("gtk-save"), Gtk::ICON_SIZE_BUTTON))); - pack_start (*saveRef, Gtk::PACK_SHRINK, 4); - - - Gtk::HSeparator* hsep1 = Gtk::manage (new Gtk::HSeparator ()); - pack_start (*hsep1, Gtk::PACK_SHRINK, 2); - - Gtk::Label* wlab = Gtk::manage (new Gtk::Label ()); - wlab->set_alignment (0.0, 0.5); - wlab->set_markup (Glib::ustring("") + M("TP_ICM_WORKINGPROFILE") + ""); - - pack_start (*wlab, Gtk::PACK_SHRINK, 4); - wnames = Gtk::manage (new Gtk::ComboBoxText ()); - pack_start (*wnames, Gtk::PACK_SHRINK, 4); - - Gtk::HSeparator* hsep2 = Gtk::manage (new Gtk::HSeparator ()); - pack_start (*hsep2, Gtk::PACK_SHRINK, 2); - - Gtk::Label* olab = Gtk::manage (new Gtk::Label ()); - olab->set_alignment (0.0, 0.5); - olab->set_markup (Glib::ustring("") + M("TP_ICM_OUTPUTPROFILE") + ""); - - pack_start (*olab, Gtk::PACK_SHRINK, 4); - onames = Gtk::manage (new Gtk::ComboBoxText ()); - pack_start (*onames, Gtk::PACK_SHRINK, 4); - - std::vector wpnames = rtengine::getWorkingProfiles (); - for (int i=0; iappend_text (wpnames[i]); - - onames->append_text (M("TP_ICM_NOICM")); - onames->set_active (0); - - std::vector opnames = rtengine::getOutputProfiles (); - for (int i=0; iappend_text (opnames[i]); - - wnames->set_active (0); - onames->set_active (0); - - Gtk::FileFilter filter_icc; - filter_icc.set_name(M("TP_ICM_FILEDLGFILTERICM")); - filter_icc.add_pattern("*.icc"); - filter_icc.add_pattern("*.icm"); - filter_icc.add_pattern("*.ICC"); - filter_icc.add_pattern("*.ICM"); - Gtk::FileFilter filter_any; - filter_any.set_name(M("TP_ICM_FILEDLGFILTERANY")); - filter_any.add_pattern("*"); - - ipDialog->add_filter (filter_icc); - ipDialog->add_filter (filter_any); - opDialog->add_filter (filter_icc); - opDialog->add_filter (filter_any); - - if (Glib::file_test (options.rtSettings.iccDirectory, Glib::FILE_TEST_IS_DIR)) { - ipDialog->set_current_folder (options.rtSettings.iccDirectory); - opDialog->set_current_folder (options.rtSettings.iccDirectory); - } - - oldip = ""; - - wnames->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::wpChanged) ); - onames->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::opChanged) ); - icamera->signal_toggled().connect( sigc::mem_fun(*this, &ICMPanel::ipChanged) ); - iembedded->signal_toggled().connect( sigc::mem_fun(*this, &ICMPanel::ipChanged) ); - ifromfile->signal_toggled().connect( sigc::mem_fun(*this, &ICMPanel::ipChanged) ); - ipc = ipDialog->signal_selection_changed().connect( sigc::mem_fun(*this, &ICMPanel::ipSelectionChanged) ); - saveRef->signal_pressed().connect( sigc::mem_fun(*this, &ICMPanel::saveReferencePressed) ); - - show_all (); -} - -void ICMPanel::read (const ProcParams* pp, const ParamsEdited* pedited) { - - disableListener (); - ipc.block (true); - if (pp->icm.input == "(embedded)" || ((pp->icm.input == "(camera)" || pp->icm.input=="") && icamera->get_state()==Gtk::STATE_INSENSITIVE)) { - iembedded->set_active (true); - igamma->set_sensitive (false); - } - else if ((pp->icm.input == "(camera)" || pp->icm.input=="") && icamera->get_state()!=Gtk::STATE_INSENSITIVE) { - icamera->set_active (true); - igamma->set_sensitive (false); - } - else { - ifromfile->set_active (true); - oldip = pp->icm.input.substr(5); - ipDialog->set_filename (pp->icm.input.substr(5)); - igamma->set_sensitive (true); - } - - wnames->set_active_text (pp->icm.working); - if (pp->icm.output=="No ICM: sRGB output") - onames->set_active_text (M("TP_ICM_NOICM")); - else - onames->set_active_text (pp->icm.output); - - if (onames->get_active_row_number()==-1) - onames->set_active_text (M("TP_ICM_NOICM")); - - igamma->set_active (pp->icm.gammaOnInput); +using namespace rtengine; +using namespace rtengine::procparams; + +extern Options options; + +ICMPanel::ICMPanel () : ToolPanel(), icmplistener(NULL), iunchanged(NULL) { + +// set_border_width (4); + + ipDialog = Gtk::manage (new Gtk::FileChooserButton (M("TP_ICM_INPUTDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN)); + opDialog = Gtk::manage (new Gtk::FileChooserButton (M("TP_ICM_INPUTDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN)); + + Gtk::Label* ilab = Gtk::manage (new Gtk::Label ()); + ilab->set_alignment (0.0, 0.5); + ilab->set_markup (Glib::ustring("") + M("TP_ICM_INPUTPROFILE") + ""); + pack_start (*ilab, Gtk::PACK_SHRINK, 4); + + iembedded = Gtk::manage (new Gtk::RadioButton (M("TP_ICM_INPUTEMBEDDED"))); + pack_start (*iembedded, Gtk::PACK_SHRINK, 4); + + icamera = Gtk::manage (new Gtk::RadioButton (M("TP_ICM_INPUTCAMERA"))); + pack_start (*icamera, Gtk::PACK_SHRINK, 4); + + ifromfile = Gtk::manage (new Gtk::RadioButton (M("TP_ICM_INPUTCUSTOM")+":")); + Gtk::HBox* ffbox = Gtk::manage (new Gtk::HBox ()); + ffbox->pack_start (*ifromfile, Gtk::PACK_SHRINK); + ffbox->pack_start (*ipDialog); + + pack_start (*ffbox, Gtk::PACK_SHRINK, 4); + + opts = icamera->get_group(); + iembedded->set_group (opts); + ifromfile->set_group (opts); + + igamma = Gtk::manage (new Gtk::CheckButton (M("TP_ICM_GAMMABEFOREINPUT"))); + igamma->set_sensitive (false); + pack_start (*igamma, Gtk::PACK_SHRINK, 4); + + saveRef = Gtk::manage (new Gtk::Button (M("TP_ICM_SAVEREFERENCE"))); + saveRef->set_image (*Gtk::manage (new Gtk::Image (Gtk::StockID("gtk-save"), Gtk::ICON_SIZE_BUTTON))); + pack_start (*saveRef, Gtk::PACK_SHRINK, 4); + + + Gtk::HSeparator* hsep1 = Gtk::manage (new Gtk::HSeparator ()); + pack_start (*hsep1, Gtk::PACK_SHRINK, 2); + + Gtk::Label* wlab = Gtk::manage (new Gtk::Label ()); + wlab->set_alignment (0.0, 0.5); + wlab->set_markup (Glib::ustring("") + M("TP_ICM_WORKINGPROFILE") + ""); + + pack_start (*wlab, Gtk::PACK_SHRINK, 4); + wnames = Gtk::manage (new Gtk::ComboBoxText ()); + pack_start (*wnames, Gtk::PACK_SHRINK, 4); + + Gtk::HSeparator* hsep2 = Gtk::manage (new Gtk::HSeparator ()); + pack_start (*hsep2, Gtk::PACK_SHRINK, 2); + + Gtk::Label* olab = Gtk::manage (new Gtk::Label ()); + olab->set_alignment (0.0, 0.5); + olab->set_markup (Glib::ustring("") + M("TP_ICM_OUTPUTPROFILE") + ""); + + pack_start (*olab, Gtk::PACK_SHRINK, 4); + onames = Gtk::manage (new Gtk::ComboBoxText ()); + pack_start (*onames, Gtk::PACK_SHRINK, 4); + + std::vector wpnames = rtengine::getWorkingProfiles (); + for (int i=0; iappend_text (wpnames[i]); + + onames->append_text (M("TP_ICM_NOICM")); + onames->set_active (0); + + std::vector opnames = rtengine::getOutputProfiles (); + for (int i=0; iappend_text (opnames[i]); + + wnames->set_active (0); + onames->set_active (0); + + Gtk::FileFilter filter_icc; + filter_icc.set_name(M("TP_ICM_FILEDLGFILTERICM")); + filter_icc.add_pattern("*.icc"); + filter_icc.add_pattern("*.icm"); + filter_icc.add_pattern("*.ICC"); + filter_icc.add_pattern("*.ICM"); + Gtk::FileFilter filter_any; + filter_any.set_name(M("TP_ICM_FILEDLGFILTERANY")); + filter_any.add_pattern("*"); + + ipDialog->add_filter (filter_icc); + ipDialog->add_filter (filter_any); + opDialog->add_filter (filter_icc); + opDialog->add_filter (filter_any); + + if (Glib::file_test (options.rtSettings.iccDirectory, Glib::FILE_TEST_IS_DIR)) { + ipDialog->set_current_folder (options.rtSettings.iccDirectory); + opDialog->set_current_folder (options.rtSettings.iccDirectory); + } + + oldip = ""; + + wnames->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::wpChanged) ); + onames->signal_changed().connect( sigc::mem_fun(*this, &ICMPanel::opChanged) ); + icamera->signal_toggled().connect( sigc::mem_fun(*this, &ICMPanel::ipChanged) ); + iembedded->signal_toggled().connect( sigc::mem_fun(*this, &ICMPanel::ipChanged) ); + ifromfile->signal_toggled().connect( sigc::mem_fun(*this, &ICMPanel::ipChanged) ); + ipc = ipDialog->signal_selection_changed().connect( sigc::mem_fun(*this, &ICMPanel::ipSelectionChanged) ); + saveRef->signal_pressed().connect( sigc::mem_fun(*this, &ICMPanel::saveReferencePressed) ); + + show_all (); +} + +void ICMPanel::read (const ProcParams* pp, const ParamsEdited* pedited) { + + disableListener (); + + ipc.block (true); + if (pp->icm.input == "(embedded)" || ((pp->icm.input == "(camera)" || pp->icm.input=="") && icamera->get_state()==Gtk::STATE_INSENSITIVE)) { + iembedded->set_active (true); + igamma->set_sensitive (false); + } + else if ((pp->icm.input == "(camera)" || pp->icm.input=="") && icamera->get_state()!=Gtk::STATE_INSENSITIVE) { + icamera->set_active (true); + igamma->set_sensitive (false); + } + else { + ifromfile->set_active (true); + oldip = pp->icm.input.substr(5); + ipDialog->set_filename (pp->icm.input.substr(5)); + igamma->set_sensitive (true); + } + + wnames->set_active_text (pp->icm.working); + if (pp->icm.output=="No ICM: sRGB output") + onames->set_active_text (M("TP_ICM_NOICM")); + else + onames->set_active_text (pp->icm.output); + + if (onames->get_active_row_number()==-1) + onames->set_active_text (M("TP_ICM_NOICM")); + + igamma->set_active (pp->icm.gammaOnInput); if (pedited) { iunchanged->set_active (!pedited->icm.input); - igamma->set_sensitive (false); + igamma->set_sensitive (false); if (!pedited->icm.working) wnames->set_active_text(M("GENERAL_UNCHANGED")); if (!pedited->icm.output) onames->set_active_text(M("GENERAL_UNCHANGED")); } - - ipc.block (false); - - enableListener (); -} - + + ipc.block (false); + + enableListener (); +} + void ICMPanel::write (ProcParams* pp, ParamsEdited* pedited) { - - if (iembedded->get_active ()) - pp->icm.input = "(embedded)"; - else if (icamera->get_active ()) - pp->icm.input = "(camera)"; - else - pp->icm.input = "file:"+ipDialog->get_filename (); - - pp->icm.working = wnames->get_active_text (); - - if (onames->get_active_text()==M("TP_ICM_NOICM")) - pp->icm.output = "No ICM: sRGB output"; - else - pp->icm.output = onames->get_active_text(); + + if (iembedded->get_active ()) + pp->icm.input = "(embedded)"; + else if (icamera->get_active ()) + pp->icm.input = "(camera)"; + else + pp->icm.input = "file:"+ipDialog->get_filename (); + + pp->icm.working = wnames->get_active_text (); + + if (onames->get_active_text()==M("TP_ICM_NOICM")) + pp->icm.output = "No ICM: sRGB output"; + else + pp->icm.output = onames->get_active_text(); pp->icm.gammaOnInput = igamma->get_active (); if (pedited) { @@ -199,92 +199,92 @@ void ICMPanel::write (ProcParams* pp, ParamsEdited* pedited) { pedited->icm.working = wnames->get_active_text()!=M("GENERAL_UNCHANGED"); pedited->icm.output = onames->get_active_text()!=M("GENERAL_UNCHANGED"); pedited->icm.gammaOnInput = !ifromfile->get_active (); - } -} - -void ICMPanel::wpChanged () { - - if (listener) - listener->panelChanged (EvWProfile, wnames->get_active_text ()); -} - -void ICMPanel::ipChanged () { - - std::string profname; - if (iembedded->get_active ()) { - profname = "(embedded)"; - igamma->set_sensitive (false); - } - else if (icamera->get_active ()) { - profname = "(camera)"; - igamma->set_sensitive (false); - } - else { - profname = ipDialog->get_filename (); - igamma->set_sensitive (true); - } - - if (listener && profname!=oldip) - listener->panelChanged (EvIProfile, profname); - - oldip = profname; -} - -void ICMPanel::opChanged () { - - if (listener) - listener->panelChanged (EvOProfile, onames->get_active_text()); -} - -void ICMPanel::setRaw (bool raw) { - - disableListener (); - - icamera->set_active (raw); - iembedded->set_active (!raw); - icamera->set_sensitive (raw); - iembedded->set_sensitive (!raw); - - enableListener (); -} - -void ICMPanel::ipSelectionChanged () { - - if (ipDialog->get_filename () == "") - return; - else - ipChanged (); - -} -void ICMPanel::saveReferencePressed () { - - if (!icmplistener) - return; - Gtk::FileChooserDialog dialog(M("TP_ICM_SAVEREFERENCEDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_SAVE); - - dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); - dialog.add_button(Gtk::StockID("gtk-save"), Gtk::RESPONSE_OK); - - Gtk::FileFilter filter_jpg; - filter_jpg.set_name(M("SAVEDLG_JPGFILTER")); - filter_jpg.add_pattern("*.jpg"); - dialog.add_filter(filter_jpg); - - dialog.set_do_overwrite_confirmation (true); - - if (dialog.run()==Gtk::RESPONSE_OK) - icmplistener->saveInputICCReference (dialog.get_filename()); - -} + } +} + +void ICMPanel::wpChanged () { + + if (listener) + listener->panelChanged (EvWProfile, wnames->get_active_text ()); +} + +void ICMPanel::ipChanged () { + + std::string profname; + if (iembedded->get_active ()) { + profname = "(embedded)"; + igamma->set_sensitive (false); + } + else if (icamera->get_active ()) { + profname = "(camera)"; + igamma->set_sensitive (false); + } + else { + profname = ipDialog->get_filename (); + igamma->set_sensitive (true); + } + + if (listener && profname!=oldip) + listener->panelChanged (EvIProfile, profname); + + oldip = profname; +} + +void ICMPanel::opChanged () { + + if (listener) + listener->panelChanged (EvOProfile, onames->get_active_text()); +} + +void ICMPanel::setRaw (bool raw) { + + disableListener (); + + icamera->set_active (raw); + iembedded->set_active (!raw); + icamera->set_sensitive (raw); + iembedded->set_sensitive (!raw); + + enableListener (); +} + +void ICMPanel::ipSelectionChanged () { + + if (ipDialog->get_filename () == "") + return; + else + ipChanged (); + +} +void ICMPanel::saveReferencePressed () { + + if (!icmplistener) + return; + Gtk::FileChooserDialog dialog(M("TP_ICM_SAVEREFERENCEDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_SAVE); + + dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); + dialog.add_button(Gtk::StockID("gtk-save"), Gtk::RESPONSE_OK); + + Gtk::FileFilter filter_jpg; + filter_jpg.set_name(M("SAVEDLG_JPGFILTER")); + filter_jpg.add_pattern("*.jpg"); + dialog.add_filter(filter_jpg); + + dialog.set_do_overwrite_confirmation (true); + + if (dialog.run()==Gtk::RESPONSE_OK) + icmplistener->saveInputICCReference (dialog.get_filename()); + +} void ICMPanel::setBatchMode (bool batchMode) { ToolPanel::setBatchMode (batchMode); iunchanged = Gtk::manage (new Gtk::RadioButton (M("GENERAL_UNCHANGED"))); - iunchanged->set_group (opts); + iunchanged->set_group (opts); pack_start (*iunchanged, Gtk::PACK_SHRINK, 4); reorder_child (*iunchanged, 5); removeIfThere (this, saveRef); - onames->append_text (M("GENERAL_UNCHANGED")); + onames->append_text (M("GENERAL_UNCHANGED")); wnames->append_text (M("GENERAL_UNCHANGED")); -} +} diff --git a/rtgui/icmpanel.h b/rtgui/icmpanel.h index 072ecfff3..38a91562a 100644 --- a/rtgui/icmpanel.h +++ b/rtgui/icmpanel.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _ICMPANEL_ #define _ICMPANEL_ @@ -51,9 +51,9 @@ class ICMPanel : public Gtk::VBox, public ToolPanel { public: ICMPanel (); - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setBatchMode (bool batchMode); + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setBatchMode (bool batchMode); void wpChanged (); void opChanged (); diff --git a/rtgui/ilabel.cc b/rtgui/ilabel.cc index c576498b9..1b734bfdb 100644 --- a/rtgui/ilabel.cc +++ b/rtgui/ilabel.cc @@ -1,45 +1,45 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include ILabel::ILabel (Glib::ustring lab) : label(lab) {} void ILabel::on_realize() { - Gtk::DrawingArea::on_realize(); + Gtk::DrawingArea::on_realize(); add_events(Gdk::EXPOSURE_MASK); - Glib::RefPtr fn = create_pango_layout(label); + Glib::RefPtr fn = create_pango_layout(label); fn->set_markup (label); - int labw, labh; - fn->get_pixel_size (labw, labh); + int labw, labh; + fn->get_pixel_size (labw, labh); set_size_request (2+labw,2+labh); - signal_style_changed().connect( sigc::mem_fun(*this, &ILabel::styleChanged) ); + signal_style_changed().connect( sigc::mem_fun(*this, &ILabel::styleChanged) ); } bool ILabel::on_expose_event (GdkEventExpose* event) { Glib::RefPtr style = get_style (); - Glib::RefPtr window = get_window(); - Glib::RefPtr gc_ = style->get_bg_gc(get_state()); - Cairo::RefPtr cr = window->create_cairo_context(); + Glib::RefPtr window = get_window(); + Glib::RefPtr gc_ = style->get_bg_gc(get_state()); + Cairo::RefPtr cr = window->create_cairo_context(); Gdk::Color c = style->get_fg (get_state()); cr->set_source_rgb (c.get_red_p(), c.get_green_p(), c.get_blue_p()); @@ -47,17 +47,17 @@ bool ILabel::on_expose_event (GdkEventExpose* event) { cr->fill (); Glib::RefPtr fn = create_pango_layout (label); - fn->set_markup (label); - window->draw_layout(gc_, 1, 1, fn); + fn->set_markup (label); + window->draw_layout(gc_, 1, 1, fn); return true; } void ILabel::styleChanged (const Glib::RefPtr& style) { - Glib::RefPtr fn = create_pango_layout(label); + Glib::RefPtr fn = create_pango_layout(label); fn->set_markup (label); - int labw, labh; - fn->get_pixel_size (labw, labh); + int labw, labh; + fn->get_pixel_size (labw, labh); set_size_request (2+labw,2+labh); } diff --git a/rtgui/ilabel.h b/rtgui/ilabel.h index 50a6fd942..48f0bf20f 100644 --- a/rtgui/ilabel.h +++ b/rtgui/ilabel.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _ILABEL_ #define _ILABEL_ @@ -29,7 +29,7 @@ class ILabel : public Gtk::DrawingArea { ILabel (Glib::ustring lab); bool on_expose_event(GdkEventExpose* event); void on_realize(); - void styleChanged (const Glib::RefPtr& style); + void styleChanged (const Glib::RefPtr& style); }; #endif diff --git a/rtgui/imagearea.cc b/rtgui/imagearea.cc index 572a2b701..6af40e42e 100644 --- a/rtgui/imagearea.cc +++ b/rtgui/imagearea.cc @@ -1,356 +1,356 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include -#include -#include -#include -#include - -ImageArea::ImageArea (ImageAreaPanel* p) : parent(p) { - - showInfo = false; - infotext = ""; - cropgl = NULL; - pmlistener = NULL; - focusGrabber = NULL; - mainCropWindow = NULL; - previewHandler = NULL; - lastClosedX = -1; - showClippedH = false; - showClippedS = false; - listener = NULL; - - zoomPanel = Gtk::manage (new ZoomPanel (this)); - indClippedPanel = Gtk::manage (new IndicateClippedPanel (this)); - - signal_style_changed().connect( sigc::mem_fun(*this, &ImageArea::styleChanged) ); - signal_size_allocate().connect( sigc::mem_fun(*this, &ImageArea::on_resized) ); - - dirty = false; -} - -void ImageArea::on_realize() -{ - Gtk::DrawingArea::on_realize(); - - add_events(Gdk::EXPOSURE_MASK | Gdk::POINTER_MOTION_MASK | Gdk::POINTER_MOTION_HINT_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::SCROLL_MASK); - - Cairo::FontOptions cfo; - cfo.set_antialias (Cairo::ANTIALIAS_SUBPIXEL); - get_pango_context ()->set_cairo_font_options (cfo); -} - -void ImageArea::on_resized (Gtk::Allocation& req) { +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include +#include +#include +#include +#include + +ImageArea::ImageArea (ImageAreaPanel* p) : parent(p) { + + showInfo = false; + infotext = ""; + cropgl = NULL; + pmlistener = NULL; + focusGrabber = NULL; + mainCropWindow = NULL; + previewHandler = NULL; + lastClosedX = -1; + showClippedH = false; + showClippedS = false; + listener = NULL; + + zoomPanel = Gtk::manage (new ZoomPanel (this)); + indClippedPanel = Gtk::manage (new IndicateClippedPanel (this)); + + signal_style_changed().connect( sigc::mem_fun(*this, &ImageArea::styleChanged) ); + signal_size_allocate().connect( sigc::mem_fun(*this, &ImageArea::on_resized) ); + + dirty = false; +} + +void ImageArea::on_realize() +{ + Gtk::DrawingArea::on_realize(); + + add_events(Gdk::EXPOSURE_MASK | Gdk::POINTER_MOTION_MASK | Gdk::POINTER_MOTION_HINT_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::SCROLL_MASK); + + Cairo::FontOptions cfo; + cfo.set_antialias (Cairo::ANTIALIAS_SUBPIXEL); + get_pango_context ()->set_cairo_font_options (cfo); +} + +void ImageArea::on_resized (Gtk::Allocation& req) { + + if (ipc && !mainCropWindow) { + mainCropWindow = new CropWindow (this, ipc); + mainCropWindow->setDecorated (false); + mainCropWindow->setFitZoomEnabled (true); + mainCropWindow->setPosition (0, 0); + mainCropWindow->setSize (get_width(), get_height()); + mainCropWindow->addCropWindowListener (this); + mainCropWindow->setCropGUIListener (cropgl); + mainCropWindow->setPointerMotionListener (pmlistener); + } + else if (ipc) { + mainCropWindow->setSize (get_width(), get_height()); + } +} + +void ImageArea::setImProcCoordinator (rtengine::StagedImageProcessor* ipc_) { + + ipc = ipc_; +} + +void ImageArea::setPreviewHandler (PreviewHandler* ph) { + + previewHandler = ph; +} - if (ipc && !mainCropWindow) { - mainCropWindow = new CropWindow (this, ipc); - mainCropWindow->setDecorated (false); - mainCropWindow->setFitZoomEnabled (true); - mainCropWindow->setPosition (0, 0); - mainCropWindow->setSize (get_width(), get_height()); - mainCropWindow->addCropWindowListener (this); - mainCropWindow->setCropGUIListener (cropgl); - mainCropWindow->setPointerMotionListener (pmlistener); - } - else if (ipc) { - mainCropWindow->setSize (get_width(), get_height()); - } -} - -void ImageArea::setImProcCoordinator (rtengine::StagedImageProcessor* ipc_) { - - ipc = ipc_; -} - -void ImageArea::setPreviewHandler (PreviewHandler* ph) { - - previewHandler = ph; -} - ImageArea::~ImageArea () { - for (std::list::iterator i=cropWins.begin(); i!=cropWins.end(); i++) - delete *i; - cropWins.clear (); + for (std::list::iterator i=cropWins.begin(); i!=cropWins.end(); i++) + delete *i; + cropWins.clear (); if (mainCropWindow) - delete mainCropWindow; -} - -void ImageArea::styleChanged (const Glib::RefPtr& style) { - - // TODO: notify all crop windows that the style has been changed - queue_draw (); -} - -void ImageArea::setInfoText (Glib::ustring text) { - - infotext = text; - - Glib::RefPtr context = get_pango_context () ; - Pango::FontDescription fontd = context->get_font_description (); - fontd.set_weight (Pango::WEIGHT_BOLD); - fontd.set_size (12*Pango::SCALE); - context->set_font_description (fontd); - ilayout = create_pango_layout(text); - int iw, ih; - ilayout->get_pixel_size (iw, ih); - ipixbuf = Gdk::Pixbuf::create (Gdk::COLORSPACE_RGB, true, 8, iw+8, ih+8); - ipixbuf->fill (128); -} - -void ImageArea::infoEnabled (bool e) { - - if (showInfo!=e) { - showInfo = e; - queue_draw (); - } -} - -CropWindow* ImageArea::getCropWindow (int x, int y) { - - CropWindow* cw = mainCropWindow; - for (std::list::iterator i=cropWins.begin(); i!=cropWins.end(); i++) - if ((*i)->isInside (x, y)) - return *i; - return cw; -} - -bool ImageArea::on_expose_event(GdkEventExpose* event) { - dirty = false; - + delete mainCropWindow; +} + +void ImageArea::styleChanged (const Glib::RefPtr& style) { + + // TODO: notify all crop windows that the style has been changed + queue_draw (); +} + +void ImageArea::setInfoText (Glib::ustring text) { + + infotext = text; + + Glib::RefPtr context = get_pango_context () ; + Pango::FontDescription fontd = context->get_font_description (); + fontd.set_weight (Pango::WEIGHT_BOLD); + fontd.set_size (12*Pango::SCALE); + context->set_font_description (fontd); + ilayout = create_pango_layout(text); + int iw, ih; + ilayout->get_pixel_size (iw, ih); + ipixbuf = Gdk::Pixbuf::create (Gdk::COLORSPACE_RGB, true, 8, iw+8, ih+8); + ipixbuf->fill (128); +} + +void ImageArea::infoEnabled (bool e) { + + if (showInfo!=e) { + showInfo = e; + queue_draw (); + } +} + +CropWindow* ImageArea::getCropWindow (int x, int y) { + + CropWindow* cw = mainCropWindow; + for (std::list::iterator i=cropWins.begin(); i!=cropWins.end(); i++) + if ((*i)->isInside (x, y)) + return *i; + return cw; +} + +bool ImageArea::on_expose_event(GdkEventExpose* event) { + dirty = false; + if (event->count) return true; - - Glib::RefPtr window = get_window(); - Cairo::RefPtr cr = get_window()->create_cairo_context(); - - if (mainCropWindow) - mainCropWindow->expose (cr); - - if (showInfo==true && infotext!="") { - int fnw, fnh; - ilayout->get_pixel_size (fnw, fnh); - window->draw_pixbuf (get_style()->get_base_gc (Gtk::STATE_NORMAL), ipixbuf, 0, 0, 4, 4, fnw+8, fnh+8, Gdk::RGB_DITHER_NONE, 0, 0); - cr->set_source_rgb (1.0, 1.0, 1.0); - cr->move_to (8, 8); - ilayout->add_to_cairo_context (cr); - cr->fill (); - } - - for (std::list::reverse_iterator i=cropWins.rbegin(); i!=cropWins.rend(); i++) - (*i)->expose (cr); - - return true; -} - - -bool ImageArea::on_motion_notify_event (GdkEventMotion* event) { - + + Glib::RefPtr window = get_window(); + Cairo::RefPtr cr = get_window()->create_cairo_context(); + + if (mainCropWindow) + mainCropWindow->expose (cr); + + if (showInfo==true && infotext!="") { + int fnw, fnh; + ilayout->get_pixel_size (fnw, fnh); + window->draw_pixbuf (get_style()->get_base_gc (Gtk::STATE_NORMAL), ipixbuf, 0, 0, 4, 4, fnw+8, fnh+8, Gdk::RGB_DITHER_NONE, 0, 0); + cr->set_source_rgb (1.0, 1.0, 1.0); + cr->move_to (8, 8); + ilayout->add_to_cairo_context (cr); + cr->fill (); + } + + for (std::list::reverse_iterator i=cropWins.rbegin(); i!=cropWins.rend(); i++) + (*i)->expose (cr); + + return true; +} + + +bool ImageArea::on_motion_notify_event (GdkEventMotion* event) { + if (focusGrabber) - focusGrabber->pointerMoved (event->x, event->y); + focusGrabber->pointerMoved (event->x, event->y); else { - CropWindow* cw = getCropWindow (event->x, event->y); - if (cw) - cw->pointerMoved (event->x, event->y); - } - return true; -} - -bool ImageArea::on_button_press_event (GdkEventButton* event) { - - if (focusGrabber) - focusGrabber->buttonPress (event->button, event->type, event->state, event->x, event->y); - else { - CropWindow* cw = getCropWindow (event->x, event->y); - if (cw) - cw->buttonPress (event->button, event->type, event->state, event->x, event->y); - } - return true; -} - -bool ImageArea::on_scroll_event (GdkEventScroll* event) { - - CropWindow* cw = getCropWindow (event->x, event->y); - if (cw) { - if (event->direction==GDK_SCROLL_UP) - cw->zoomIn (); - else - cw->zoomOut (); - return true; - } - return true; -} - -bool ImageArea::on_button_release_event (GdkEventButton* event) { - - if (focusGrabber) - focusGrabber->buttonRelease (event->button, event->type, event->state, event->x, event->y); - else { - CropWindow* cw = getCropWindow (event->x, event->y); - if (cw) { - cw->buttonRelease (event->button, event->type, event->state, event->x, event->y); - } - } - return true; -} - - -void ImageArea::grabFocus (CropWindow* cw) { - - focusGrabber = cw; - if (cw && cw!=mainCropWindow) - cropWindowSelected (cw); -} - -void ImageArea::unGrabFocus () { - + CropWindow* cw = getCropWindow (event->x, event->y); + if (cw) + cw->pointerMoved (event->x, event->y); + } + return true; +} + +bool ImageArea::on_button_press_event (GdkEventButton* event) { + + if (focusGrabber) + focusGrabber->buttonPress (event->button, event->type, event->state, event->x, event->y); + else { + CropWindow* cw = getCropWindow (event->x, event->y); + if (cw) + cw->buttonPress (event->button, event->type, event->state, event->x, event->y); + } + return true; +} + +bool ImageArea::on_scroll_event (GdkEventScroll* event) { + + CropWindow* cw = getCropWindow (event->x, event->y); + if (cw) { + if (event->direction==GDK_SCROLL_UP) + cw->zoomIn (); + else + cw->zoomOut (); + return true; + } + return true; +} + +bool ImageArea::on_button_release_event (GdkEventButton* event) { + + if (focusGrabber) + focusGrabber->buttonRelease (event->button, event->type, event->state, event->x, event->y); + else { + CropWindow* cw = getCropWindow (event->x, event->y); + if (cw) { + cw->buttonRelease (event->button, event->type, event->state, event->x, event->y); + } + } + return true; +} + + +void ImageArea::grabFocus (CropWindow* cw) { + + focusGrabber = cw; + if (cw && cw!=mainCropWindow) + cropWindowSelected (cw); +} + +void ImageArea::unGrabFocus () { + focusGrabber = NULL; -} - -void ImageArea::addCropWindow () { - - CropWindow* cw = new CropWindow (this, ipc); - cw->setCropGUIListener (cropgl); - cw->setPointerMotionListener (pmlistener); - cropWins.push_front (cw); - - if (lastClosedX<0) { - int K = 2; - int hBorder = get_width()/K/8; - int vBorder = get_height()/K/8; - int N = cropWins.size()-1; - int layer = N/K/K; - int row = K-1 - (N % (K*K)) / K; - int col = K-1 - (N % (K*K)) % K; - - cw->setSize (get_width()/K - hBorder, get_height()/K - vBorder); - cw->setPosition (col*get_width()/K + hBorder/2 + layer*30, row*get_height()/K + vBorder/2 + layer*30); - } - else { - cw->setSize (lastClosedX, lastClosedY); - cw->setPosition (lastClosedW, lastClosedH); - } - - mainCropWindow->setObservedCropWin (cropWins.front()); - queue_draw (); -} - - -void ImageArea::cropWindowSelected (CropWindow* cw) { - - std::list::iterator i = std::find (cropWins.begin(), cropWins.end(), cw); - if (i!=cropWins.end()) - cropWins.erase (i); - cropWins.push_front (cw); - mainCropWindow->setObservedCropWin (cropWins.front()); -} - -void ImageArea::cropWindowClosed (CropWindow* cw) { - - focusGrabber = NULL; - cw->getPosition (lastClosedX, lastClosedY); - cw->getSize (lastClosedW, lastClosedH); - std::list::iterator i = std::find (cropWins.begin(), cropWins.end(), cw); - if (i!=cropWins.end()) - cropWins.erase (i); - delete cw; - if (!cropWins.empty()) - mainCropWindow->setObservedCropWin (cropWins.front()); - else - mainCropWindow->setObservedCropWin (NULL); - queue_draw (); -} +} + +void ImageArea::addCropWindow () { + + CropWindow* cw = new CropWindow (this, ipc); + cw->setCropGUIListener (cropgl); + cw->setPointerMotionListener (pmlistener); + cropWins.push_front (cw); + + if (lastClosedX<0) { + int K = 2; + int hBorder = get_width()/K/8; + int vBorder = get_height()/K/8; + int N = cropWins.size()-1; + int layer = N/K/K; + int row = K-1 - (N % (K*K)) / K; + int col = K-1 - (N % (K*K)) % K; + + cw->setSize (get_width()/K - hBorder, get_height()/K - vBorder); + cw->setPosition (col*get_width()/K + hBorder/2 + layer*30, row*get_height()/K + vBorder/2 + layer*30); + } + else { + cw->setSize (lastClosedX, lastClosedY); + cw->setPosition (lastClosedW, lastClosedH); + } + + mainCropWindow->setObservedCropWin (cropWins.front()); + queue_draw (); +} + + +void ImageArea::cropWindowSelected (CropWindow* cw) { + + std::list::iterator i = std::find (cropWins.begin(), cropWins.end(), cw); + if (i!=cropWins.end()) + cropWins.erase (i); + cropWins.push_front (cw); + mainCropWindow->setObservedCropWin (cropWins.front()); +} + +void ImageArea::cropWindowClosed (CropWindow* cw) { + + focusGrabber = NULL; + cw->getPosition (lastClosedX, lastClosedY); + cw->getSize (lastClosedW, lastClosedH); + std::list::iterator i = std::find (cropWins.begin(), cropWins.end(), cw); + if (i!=cropWins.end()) + cropWins.erase (i); + delete cw; + if (!cropWins.empty()) + mainCropWindow->setObservedCropWin (cropWins.front()); + else + mainCropWindow->setObservedCropWin (NULL); + queue_draw (); +} void ImageArea::straightenReady (double rotDeg) { if (listener) listener->rotateSelectionReady (rotDeg); -} +} void ImageArea::spotWBSelected (int x, int y) { if (listener) - listener->spotWBselected (x, y); -} - -void ImageArea::redraw () { - - if (!dirty) { - dirty = true; - queue_draw (); - } -} - -void ImageArea::getScrollImageSize (int& w, int& h) { - - if (mainCropWindow && ipc) { - double z = mainCropWindow->getZoom (); - w = ipc->getFullWidth() * z; - h = ipc->getFullHeight() * z; - } - else - w = h = 0; -} - -void ImageArea::getScrollPosition (int& x, int& y) { - + listener->spotWBselected (x, y); +} + +void ImageArea::redraw () { + + if (!dirty) { + dirty = true; + queue_draw (); + } +} + +void ImageArea::getScrollImageSize (int& w, int& h) { + + if (mainCropWindow && ipc) { + double z = mainCropWindow->getZoom (); + w = ipc->getFullWidth() * z; + h = ipc->getFullHeight() * z; + } + else + w = h = 0; +} + +void ImageArea::getScrollPosition (int& x, int& y) { + if (mainCropWindow) { - int cropX, cropY; + int cropX, cropY; mainCropWindow->getCropPosition (cropX, cropY); x = cropX*mainCropWindow->getZoom (); y = cropY*mainCropWindow->getZoom (); - } - else - x = y = 0; -} - -void ImageArea::setScrollPosition (int x, int y) { - - if (mainCropWindow) { - mainCropWindow->delCropWindowListener (this); - mainCropWindow->setCropPosition (x/mainCropWindow->getZoom (), y/mainCropWindow->getZoom ()); - mainCropWindow->addCropWindowListener (this); - } -} - -void ImageArea::cropPositionChanged (CropWindow* cw) { - - updateScrollbars (); -} - -void ImageArea::cropWindowSizeChanged (CropWindow* cw) { - - updateScrollbars (); -} - -void ImageArea::cropZoomChanged (CropWindow* cw) { - + } + else + x = y = 0; +} + +void ImageArea::setScrollPosition (int x, int y) { + + if (mainCropWindow) { + mainCropWindow->delCropWindowListener (this); + mainCropWindow->setCropPosition (x/mainCropWindow->getZoom (), y/mainCropWindow->getZoom ()); + mainCropWindow->addCropWindowListener (this); + } +} + +void ImageArea::cropPositionChanged (CropWindow* cw) { + + updateScrollbars (); +} + +void ImageArea::cropWindowSizeChanged (CropWindow* cw) { + + updateScrollbars (); +} + +void ImageArea::cropZoomChanged (CropWindow* cw) { + if (cw==mainCropWindow) { - parent->zoomChanged (); + parent->zoomChanged (); updateScrollbars (); zoomPanel->refreshZoomLabel (); - } -} + } +} double ImageArea::getZoom () { @@ -366,53 +366,53 @@ void ImageArea::setZoom (double zoom) { mainCropWindow->setZoom (zoom); zoomPanel->refreshZoomLabel (); } - -void ImageArea::initialImageArrived (CropWindow* cw) { - - if (mainCropWindow) - mainCropWindow->zoomFit (); -} - -void ImageArea::updateScrollbars () { - parent->refreshScrollBars (); -} - -void ImageArea::setCropGUIListener (CropGUIListener* l) { - - cropgl = l; - for (std::list::iterator i=cropWins.begin(); i!=cropWins.end(); i++) - (*i)->setCropGUIListener (cropgl); - if (mainCropWindow) - mainCropWindow->setCropGUIListener (cropgl); -} - -void ImageArea::setPointerMotionListener (PointerMotionListener* pml) { - - pmlistener = pml; - for (std::list::iterator i=cropWins.begin(); i!=cropWins.end(); i++) - (*i)->setPointerMotionListener (pml); - if (mainCropWindow) - mainCropWindow->setPointerMotionListener (pml); -} - -ToolMode ImageArea::getToolMode () { - if (listener) +void ImageArea::initialImageArrived (CropWindow* cw) { + + if (mainCropWindow) + mainCropWindow->zoomFit (); +} + +void ImageArea::updateScrollbars () { + parent->refreshScrollBars (); +} + +void ImageArea::setCropGUIListener (CropGUIListener* l) { + + cropgl = l; + for (std::list::iterator i=cropWins.begin(); i!=cropWins.end(); i++) + (*i)->setCropGUIListener (cropgl); + if (mainCropWindow) + mainCropWindow->setCropGUIListener (cropgl); +} + +void ImageArea::setPointerMotionListener (PointerMotionListener* pml) { + + pmlistener = pml; + for (std::list::iterator i=cropWins.begin(); i!=cropWins.end(); i++) + (*i)->setPointerMotionListener (pml); + if (mainCropWindow) + mainCropWindow->setPointerMotionListener (pml); +} + +ToolMode ImageArea::getToolMode () { + + if (listener) return listener->getToolBar()->getTool (); else - return TMHand; -} - -void ImageArea::setToolHand () { - - if (listener) - listener->getToolBar()->setTool (TMHand); -} - -int ImageArea::getSpotWBRectSize () { - - if (listener) + return TMHand; +} + +void ImageArea::setToolHand () { + + if (listener) + listener->getToolBar()->setTool (TMHand); +} + +int ImageArea::getSpotWBRectSize () { + + if (listener) return listener->getSpotWBRectSize (); else - return 1; -} + return 1; +} diff --git a/rtgui/imagearea.h b/rtgui/imagearea.h index bb7163e40..9abe97d84 100644 --- a/rtgui/imagearea.h +++ b/rtgui/imagearea.h @@ -1,125 +1,125 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef __IMAGEAREA_H__ -#define __IMAGEAREA_H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class ImageAreaPanel; -class ImageArea : public Gtk::DrawingArea, public CropWindowListener { - - friend class ZoomPanel; - - protected: - - bool showInfo; - Glib::ustring infotext; - Glib::RefPtr ilayout; - Glib::RefPtr deglayout; - Glib::RefPtr ipixbuf; - bool showClippedH, showClippedS; - - ImageAreaPanel* parent; - CropWindow* mainCropWindow; - std::list cropWins; - PreviewHandler* previewHandler; - rtengine::StagedImageProcessor* ipc; - - int lastClosedX, lastClosedY, lastClosedW, lastClosedH; - - bool dirty; - CropWindow* focusGrabber; - CropGUIListener* cropgl; - PointerMotionListener* pmlistener; - ImageAreaToolListener* listener; - - CropWindow* getCropWindow (int x, int y); - - public: - - ZoomPanel* zoomPanel; - IndicateClippedPanel* indClippedPanel; - - ImageArea (ImageAreaPanel* p); - ~ImageArea (); - - void setImProcCoordinator (rtengine::StagedImageProcessor* ipc_); - - void getScrollImageSize (int& w, int& h); - void getScrollPosition (int& x, int& y); - void setScrollPosition (int x, int y); // called by the imageareapanel when the scrollbars have been changed - - // enabling and setting text of info area - void setInfoText (Glib::ustring text); - void infoEnabled (bool e); - - // widget base events - void on_realize (); - bool on_expose_event (GdkEventExpose* event); - bool on_motion_notify_event (GdkEventMotion* event); - bool on_button_press_event (GdkEventButton* event); - bool on_button_release_event (GdkEventButton* event); - bool on_scroll_event (GdkEventScroll* event); - void on_resized (Gtk::Allocation& req); - void styleChanged (const Glib::RefPtr& style); - void updateScrollbars (); - - void setCropGUIListener (CropGUIListener* l); - void setPointerMotionListener (PointerMotionListener* pml); - void setImageAreaToolListener (ImageAreaToolListener* l) { listener = l; } - void setPreviewHandler (PreviewHandler* ph); - PreviewHandler* getPreviewHandler () { return previewHandler; } - - void grabFocus (CropWindow* cw); - void unGrabFocus (); - void addCropWindow (); - void cropWindowSelected (CropWindow* cw); - void cropWindowClosed (CropWindow* cw); - ToolMode getToolMode (); +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef __IMAGEAREA_H__ +#define __IMAGEAREA_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class ImageAreaPanel; +class ImageArea : public Gtk::DrawingArea, public CropWindowListener { + + friend class ZoomPanel; + + protected: + + bool showInfo; + Glib::ustring infotext; + Glib::RefPtr ilayout; + Glib::RefPtr deglayout; + Glib::RefPtr ipixbuf; + bool showClippedH, showClippedS; + + ImageAreaPanel* parent; + CropWindow* mainCropWindow; + std::list cropWins; + PreviewHandler* previewHandler; + rtengine::StagedImageProcessor* ipc; + + int lastClosedX, lastClosedY, lastClosedW, lastClosedH; + + bool dirty; + CropWindow* focusGrabber; + CropGUIListener* cropgl; + PointerMotionListener* pmlistener; + ImageAreaToolListener* listener; + + CropWindow* getCropWindow (int x, int y); + + public: + + ZoomPanel* zoomPanel; + IndicateClippedPanel* indClippedPanel; + + ImageArea (ImageAreaPanel* p); + ~ImageArea (); + + void setImProcCoordinator (rtengine::StagedImageProcessor* ipc_); + + void getScrollImageSize (int& w, int& h); + void getScrollPosition (int& x, int& y); + void setScrollPosition (int x, int y); // called by the imageareapanel when the scrollbars have been changed + + // enabling and setting text of info area + void setInfoText (Glib::ustring text); + void infoEnabled (bool e); + + // widget base events + void on_realize (); + bool on_expose_event (GdkEventExpose* event); + bool on_motion_notify_event (GdkEventMotion* event); + bool on_button_press_event (GdkEventButton* event); + bool on_button_release_event (GdkEventButton* event); + bool on_scroll_event (GdkEventScroll* event); + void on_resized (Gtk::Allocation& req); + void styleChanged (const Glib::RefPtr& style); + void updateScrollbars (); + + void setCropGUIListener (CropGUIListener* l); + void setPointerMotionListener (PointerMotionListener* pml); + void setImageAreaToolListener (ImageAreaToolListener* l) { listener = l; } + void setPreviewHandler (PreviewHandler* ph); + PreviewHandler* getPreviewHandler () { return previewHandler; } + + void grabFocus (CropWindow* cw); + void unGrabFocus (); + void addCropWindow (); + void cropWindowSelected (CropWindow* cw); + void cropWindowClosed (CropWindow* cw); + ToolMode getToolMode (); void setToolHand (); - void straightenReady (double rotDeg); + void straightenReady (double rotDeg); void spotWBSelected (int x, int y); - int getSpotWBRectSize (); - void redraw (); + int getSpotWBRectSize (); + void redraw (); void zoomFit (); double getZoom (); void setZoom (double zoom); - - // cropwindowlistener interface - void cropPositionChanged (CropWindow* cw); - void cropWindowSizeChanged (CropWindow* cw); - void cropZoomChanged (CropWindow* cw); - void initialImageArrived (CropWindow* cw) ; - - CropWindow* getMainCropWindow () { return mainCropWindow; } -}; - - - -#endif + + // cropwindowlistener interface + void cropPositionChanged (CropWindow* cw); + void cropWindowSizeChanged (CropWindow* cw); + void cropZoomChanged (CropWindow* cw); + void initialImageArrived (CropWindow* cw) ; + + CropWindow* getMainCropWindow () { return mainCropWindow; } +}; + + + +#endif diff --git a/rtgui/imageareapanel.cc b/rtgui/imageareapanel.cc index ecafd0446..e03bd3e5c 100644 --- a/rtgui/imageareapanel.cc +++ b/rtgui/imageareapanel.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include ImageAreaPanel::ImageAreaPanel () : before(NULL), after(NULL) { @@ -61,7 +61,7 @@ ImageAreaPanel::ImageAreaPanel () : before(NULL), after(NULL) { ImageAreaPanel::~ImageAreaPanel () { - delete imageArea; + delete imageArea; } void ImageAreaPanel::configScrollBars () { diff --git a/rtgui/imageareapanel.h b/rtgui/imageareapanel.h index 50a1d4644..77a6e3129 100644 --- a/rtgui/imageareapanel.h +++ b/rtgui/imageareapanel.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _IMAGEAREAPANEL_ #define _IMAGEAREAPANEL_ diff --git a/rtgui/imageareatoollistener.h b/rtgui/imageareatoollistener.h index a1d1d7ac1..56230a020 100644 --- a/rtgui/imageareatoollistener.h +++ b/rtgui/imageareatoollistener.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _IMAGEAREATOOLLISTENER_ #define _IMAGEAREATOOLLISTENER_ diff --git a/rtgui/indclippedpanel.cc b/rtgui/indclippedpanel.cc index 61924c60c..517e4c9cf 100644 --- a/rtgui/indclippedpanel.cc +++ b/rtgui/indclippedpanel.cc @@ -1,51 +1,51 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include -#include - -IndicateClippedPanel::IndicateClippedPanel (ImageArea* ia) : imageArea(ia) { - - indclippedh = Gtk::manage (new Gtk::ToggleButton ()); - indclippedh->set_relief(Gtk::RELIEF_NONE); - indclippedh->add (*Gtk::manage (new Gtk::Image (argv0+"/images/warnhl.png"))); - indclippedh->set_tooltip_text (M("MAIN_TOOLTIP_INDCLIPPEDH")); - - indclippeds = Gtk::manage (new Gtk::ToggleButton ()); - indclippeds->set_relief(Gtk::RELIEF_NONE); - indclippeds->add (*Gtk::manage (new Gtk::Image (argv0+"/images/warnsh.png"))); - indclippeds->set_tooltip_text (M("MAIN_TOOLTIP_INDCLIPPEDS")); - - indclippedh->set_active (options.showClippedHighlights); - indclippeds->set_active (options.showClippedShadows); - - pack_start (*indclippedh, Gtk::PACK_SHRINK, 0); - pack_start (*indclippeds, Gtk::PACK_SHRINK, 0); - - indclippedh->signal_toggled().connect( sigc::mem_fun(*this, &IndicateClippedPanel::buttonToggled) ); - indclippeds->signal_toggled().connect( sigc::mem_fun(*this, &IndicateClippedPanel::buttonToggled) ); - - show_all (); -} - -void IndicateClippedPanel::buttonToggled () { - - imageArea->queue_draw (); -} +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include +#include + +IndicateClippedPanel::IndicateClippedPanel (ImageArea* ia) : imageArea(ia) { + + indclippedh = Gtk::manage (new Gtk::ToggleButton ()); + indclippedh->set_relief(Gtk::RELIEF_NONE); + indclippedh->add (*Gtk::manage (new Gtk::Image (argv0+"/images/warnhl.png"))); + indclippedh->set_tooltip_text (M("MAIN_TOOLTIP_INDCLIPPEDH")); + + indclippeds = Gtk::manage (new Gtk::ToggleButton ()); + indclippeds->set_relief(Gtk::RELIEF_NONE); + indclippeds->add (*Gtk::manage (new Gtk::Image (argv0+"/images/warnsh.png"))); + indclippeds->set_tooltip_text (M("MAIN_TOOLTIP_INDCLIPPEDS")); + + indclippedh->set_active (options.showClippedHighlights); + indclippeds->set_active (options.showClippedShadows); + + pack_start (*indclippedh, Gtk::PACK_SHRINK, 0); + pack_start (*indclippeds, Gtk::PACK_SHRINK, 0); + + indclippedh->signal_toggled().connect( sigc::mem_fun(*this, &IndicateClippedPanel::buttonToggled) ); + indclippeds->signal_toggled().connect( sigc::mem_fun(*this, &IndicateClippedPanel::buttonToggled) ); + + show_all (); +} + +void IndicateClippedPanel::buttonToggled () { + + imageArea->queue_draw (); +} diff --git a/rtgui/indclippedpanel.h b/rtgui/indclippedpanel.h index 8acaccdf9..f048ec944 100644 --- a/rtgui/indclippedpanel.h +++ b/rtgui/indclippedpanel.h @@ -1,41 +1,41 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _INDCLIPPEDPANEL_ -#define _INDCLIPPEDPANEL_ - -#include - -class ImageArea; -class IndicateClippedPanel : public Gtk::HBox { - - protected: - Gtk::ToggleButton* indclippedh; - Gtk::ToggleButton* indclippeds; - ImageArea* imageArea; - - public: - IndicateClippedPanel (ImageArea* ia); - - void buttonToggled (); - - bool showClippedShadows () { return indclippeds->get_active (); } - bool showClippedHighlights () { return indclippedh->get_active (); } -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _INDCLIPPEDPANEL_ +#define _INDCLIPPEDPANEL_ + +#include + +class ImageArea; +class IndicateClippedPanel : public Gtk::HBox { + + protected: + Gtk::ToggleButton* indclippedh; + Gtk::ToggleButton* indclippeds; + ImageArea* imageArea; + + public: + IndicateClippedPanel (ImageArea* ia); + + void buttonToggled (); + + bool showClippedShadows () { return indclippeds->get_active (); } + bool showClippedHighlights () { return indclippedh->get_active (); } +}; + +#endif diff --git a/rtgui/iptcpanel.cc b/rtgui/iptcpanel.cc index 9c3eb7996..6af6a6c24 100644 --- a/rtgui/iptcpanel.cc +++ b/rtgui/iptcpanel.cc @@ -1,600 +1,600 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include - -extern Glib::ustring argv0; - -using namespace rtengine; -using namespace rtengine::procparams; - -IPTCPanel::IPTCPanel () { - - set_border_width (2); - - Gtk::Table* iptc = new Gtk::Table (27, 2); - - int row = 0; - - Gtk::Label* capl = new Gtk::Label (M("IPTCPANEL_CAPTION")+":"); - captionText = Gtk::TextBuffer::create (); - captionView = new Gtk::TextView (captionText); - Gtk::ScrolledWindow* scrolledWindowc = new Gtk::ScrolledWindow(); - scrolledWindowc->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); - scrolledWindowc->add(*captionView); - capl->set_tooltip_text (M("IPTCPANEL_CAPTIONHINT")); - captionView->set_tooltip_text (M("IPTCPANEL_CAPTIONHINT")); - iptc->attach (*capl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*scrolledWindowc, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - row++; - - Gtk::Label* capwl = new Gtk::Label (M("IPTCPANEL_CAPTIONWRITER")+":"); - captionWriter = new Gtk::Entry (); - capwl->set_tooltip_text (M("IPTCPANEL_CAPTIONWRITERHINT")); - captionWriter->set_tooltip_text (M("IPTCPANEL_CAPTIONWRITERHINT")); - iptc->attach (*capwl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*captionWriter, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - row++; - - Gtk::Label* headl = new Gtk::Label (M("IPTCPANEL_HEADLINE")+":"); - headline = new Gtk::Entry (); - headl->set_tooltip_text (M("IPTCPANEL_HEADLINEHINT")); - headline->set_tooltip_text (M("IPTCPANEL_HEADLINEHINT")); - iptc->attach (*headl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*headline, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - row++; - - Gtk::Label* instl = new Gtk::Label (M("IPTCPANEL_INSTRUCTIONS")+":"); - instructions = new Gtk::Entry (); - instl->set_tooltip_text (M("IPTCPANEL_INSTRUCTIONSHINT")); - instructions->set_tooltip_text (M("IPTCPANEL_INSTRUCTIONSHINT")); - iptc->attach (*instl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*instructions, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - row++; - - Gtk::HSeparator* hsep1 = new Gtk::HSeparator (); - iptc->attach (*hsep1, 0, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - row++; - - Gtk::Label* keyl = new Gtk::Label (M("IPTCPANEL_KEYWORDS")+":"); - keywords = new Gtk::ListViewText (1, false, Gtk::SELECTION_MULTIPLE); - keywords->set_headers_visible (false); - Gtk::ScrolledWindow* scrolledWindowkw = new Gtk::ScrolledWindow(); - scrolledWindowkw->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); - scrolledWindowkw->add(*keywords); - keyword = new Gtk::ComboBoxEntryText (); - keyword->set_size_request (32, -1); - keyl->set_tooltip_text (M("IPTCPANEL_KEYWORDSHINT")); - keywords->set_tooltip_text (M("IPTCPANEL_KEYWORDSHINT")); - keyword->set_tooltip_text (M("IPTCPANEL_KEYWORDSHINT")); - addKW = new Gtk::Button (); - delKW = new Gtk::Button (); - Gtk::Image* addKWImg = new Gtk::Image (argv0+"/images/list-add12.png"); - Gtk::Image* delKWImg = new Gtk::Image (argv0+"/images/list-remove12r.png"); - addKW->add (*addKWImg); - delKW->add (*delKWImg); - Gtk::HBox* kwhb = new Gtk::HBox (); - kwhb->pack_start (*keyword); - kwhb->pack_start (*addKW, Gtk::PACK_SHRINK, 2); - kwhb->pack_start (*delKW, Gtk::PACK_SHRINK, 2); - iptc->attach (*keyl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*kwhb, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - row++; - iptc->attach (*scrolledWindowkw, 0, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - row++; - - Gtk::HSeparator* hsep2 = new Gtk::HSeparator (); - iptc->attach (*hsep2, 0, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - row++; - - Gtk::Label* catl = new Gtk::Label (M("IPTCPANEL_CATEGORY")+":"); - category = new Gtk::ComboBoxEntryText (); - category->set_size_request (32, -1); - catl->set_tooltip_text (M("IPTCPANEL_CATEGORYHINT")); - category->set_tooltip_text (M("IPTCPANEL_CATEGORYHINT")); - Gtk::Label* scl = new Gtk::Label (M("IPTCPANEL_SUPPCATEGORIES")+":"); - suppCategories = new Gtk::ListViewText (1, false, Gtk::SELECTION_MULTIPLE); - suppCategories->set_headers_visible (false); - Gtk::ScrolledWindow* scrolledWindowsc = new Gtk::ScrolledWindow(); - scrolledWindowsc->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); - scrolledWindowsc->add(*suppCategories); - suppCategory = new Gtk::ComboBoxEntryText (); - suppCategory->set_size_request (32, -1); - scl->set_tooltip_text (M("IPTCPANEL_SUPPCATEGORIESHINT")); - suppCategories->set_tooltip_text (M("IPTCPANEL_SUPPCATEGORIESHINT")); - suppCategory->set_tooltip_text (M("IPTCPANEL_SUPPCATEGORIESHINT")); - addSC = new Gtk::Button (); - delSC = new Gtk::Button (); - Gtk::Image* addSCImg = new Gtk::Image (argv0+"/images/list-add12.png"); - Gtk::Image* delSCImg = new Gtk::Image (argv0+"/images/list-remove12r.png"); - addSC->add (*addSCImg); - delSC->add (*delSCImg); - Gtk::HBox* schb = new Gtk::HBox (); - schb->pack_start (*suppCategory); - schb->pack_start (*addSC, Gtk::PACK_SHRINK, 2); - schb->pack_start (*delSC, Gtk::PACK_SHRINK, 2); - iptc->attach (*catl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*category, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - row++; - iptc->attach (*scl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*schb, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - row++; - iptc->attach (*scrolledWindowsc, 0, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - row++; - - Gtk::HSeparator* hsep3 = new Gtk::HSeparator (); - iptc->attach (*hsep3, 0, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - row++; - - Gtk::Label* authl = new Gtk::Label (M("IPTCPANEL_AUTHOR")+":"); - author = new Gtk::Entry (); - authl->set_tooltip_text (M("IPTCPANEL_CREDITHINT")); - author->set_tooltip_text (M("IPTCPANEL_CREDITHINT")); - iptc->attach (*authl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*author, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - row++; - - Gtk::Label* aupl = new Gtk::Label (M("IPTCPANEL_AUTHORSPOSITION")+":"); - authorPos = new Gtk::Entry (); - aupl->set_tooltip_text (M("IPTCPANEL_AUTHORSPOSITIONHINT")); - authorPos->set_tooltip_text (M("IPTCPANEL_AUTHORSPOSITIONHINT")); - iptc->attach (*aupl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*authorPos, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - row++; - - Gtk::Label* credl = new Gtk::Label (M("IPTCPANEL_CREDIT")+":"); - credit = new Gtk::Entry (); - credl->set_tooltip_text (M("IPTCPANEL_CREDITHINT")); - credit->set_tooltip_text (M("IPTCPANEL_CREDITHINT")); - iptc->attach (*credl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*credit, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - row++; - - Gtk::Label* sourl = new Gtk::Label (M("IPTCPANEL_SOURCE")+":"); - source = new Gtk::Entry (); - sourl->set_tooltip_text (M("IPTCPANEL_SOURCEHINT")); - source->set_tooltip_text (M("IPTCPANEL_SOURCEHINT")); - iptc->attach (*sourl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*source, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - row++; - - Gtk::Label* cprl = new Gtk::Label (M("IPTCPANEL_COPYRIGHT")+":"); - copyright = new Gtk::Entry (); - cprl->set_tooltip_text (M("IPTCPANEL_COPYRIGHTHINT")); - copyright->set_tooltip_text (M("IPTCPANEL_COPYRIGHTHINT")); - iptc->attach (*cprl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*copyright, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - row++; - - Gtk::HSeparator* hsep4 = new Gtk::HSeparator (); - iptc->attach (*hsep4, 0, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - row++; - - Gtk::Label* cityl = new Gtk::Label (M("IPTCPANEL_CITY")+":"); - city = new Gtk::Entry (); - cityl->set_tooltip_text (M("IPTCPANEL_CITYHINT")); - city->set_tooltip_text (M("IPTCPANEL_CITYHINT")); - iptc->attach (*cityl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*city, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - row++; - - Gtk::Label* provl = new Gtk::Label (M("IPTCPANEL_PROVINCE")+":"); - province = new Gtk::Entry (); - provl->set_tooltip_text (M("IPTCPANEL_PROVINCEHINT")); - province->set_tooltip_text (M("IPTCPANEL_PROVINCEHINT")); - iptc->attach (*provl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*province, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - row++; - - Gtk::Label* ctrl = new Gtk::Label (M("IPTCPANEL_COUNTRY")+":"); - country = new Gtk::Entry (); - ctrl->set_tooltip_text (M("IPTCPANEL_COUNTRYHINT")); - country->set_tooltip_text (M("IPTCPANEL_COUNTRYHINT")); - iptc->attach (*ctrl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*country, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - row++; - - Gtk::Label* titll = new Gtk::Label (M("IPTCPANEL_TITLE")+":"); - title = new Gtk::Entry (); - titll->set_tooltip_text (M("IPTCPANEL_TITLEHINT")); - title->set_tooltip_text (M("IPTCPANEL_TITLEHINT")); - iptc->attach (*titll, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*title, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - row++; - - Gtk::Label* dcl = new Gtk::Label (M("IPTCPANEL_DATECREATED")+":"); - dateCreated = new Gtk::Entry (); - dcl->set_tooltip_text (M("IPTCPANEL_DATECREATEDHINT")); - dateCreated->set_tooltip_text (M("IPTCPANEL_DATECREATEDHINT")); - iptc->attach (*dcl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*dateCreated, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - row++; - - Gtk::Label* trl = new Gtk::Label (M("IPTCPANEL_TRANSREFERENCE")+":"); - transReference = new Gtk::Entry (); - trl->set_tooltip_text (M("IPTCPANEL_TRANSREFERENCEHINT")); - transReference->set_tooltip_text (M("IPTCPANEL_TRANSREFERENCEHINT")); - iptc->attach (*trl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*transReference, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - - row++; - - Gtk::ScrolledWindow* scrolledWindow = new Gtk::ScrolledWindow(); - scrolledWindow->set_border_width(2); - scrolledWindow->set_shadow_type(Gtk::SHADOW_NONE); - scrolledWindow->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); - scrolledWindow->property_window_placement().set_value(Gtk::CORNER_TOP_LEFT); - scrolledWindow->add(*iptc); - - pack_start (*scrolledWindow); - - Gtk::HBox* bbox = new Gtk::HBox (); - - reset = new Gtk::Button (M("IPTCPANEL_RESET")); - reset->set_image (*(new Gtk::Image (Gtk::StockID ("gtk-undo"), Gtk::IconSize (2)))); - bbox->pack_start (*reset); - - file = new Gtk::Button (M("IPTCPANEL_EMBEDDED")); - file->set_image (*(new Gtk::Image (Gtk::StockID ("gtk-open"), Gtk::IconSize (2)))); - bbox->pack_start (*file); - - copy = new Gtk::Button (); - copy->set_image (*(new Gtk::Image (Gtk::StockID ("gtk-copy"), Gtk::IconSize (2)))); - bbox->pack_start (*copy, Gtk::PACK_SHRINK, 0); - - paste = new Gtk::Button (); - paste->set_image (*(new Gtk::Image (Gtk::StockID ("gtk-paste"), Gtk::IconSize (2)))); - bbox->pack_start (*paste, Gtk::PACK_SHRINK, 0); - - pack_end (*bbox, Gtk::PACK_SHRINK, 2); - - Gtk::Tooltips* toolTip = new Gtk::Tooltips (); - toolTip->set_tip (*reset, M("IPTCPANEL_RESETHINT")); - toolTip->set_tip (*file, M("IPTCPANEL_EMBEDDEDHINT")); - toolTip->set_tip (*copy, M("IPTCPANEL_COPYHINT")); - toolTip->set_tip (*paste, M("IPTCPANEL_PASTEHINT")); - - reset->signal_clicked().connect( sigc::mem_fun(*this, &IPTCPanel::resetClicked) ); - file->signal_clicked().connect( sigc::mem_fun(*this, &IPTCPanel::fileClicked) ); - copy->signal_clicked().connect( sigc::mem_fun(*this, &IPTCPanel::copyClicked) ); - paste->signal_clicked().connect( sigc::mem_fun(*this, &IPTCPanel::pasteClicked) ); - - - addKW->signal_clicked().connect( sigc::mem_fun(*this, &IPTCPanel::addKeyWord) ); - delKW->signal_clicked().connect( sigc::mem_fun(*this, &IPTCPanel::delKeyWord) ); - addSC->signal_clicked().connect( sigc::mem_fun(*this, &IPTCPanel::addSuppCategory) ); - delSC->signal_clicked().connect( sigc::mem_fun(*this, &IPTCPanel::delSuppCategory) ); - keyword->get_entry()->signal_activate().connect( sigc::mem_fun(*this, &IPTCPanel::addKeyWord) ); - suppCategory->get_entry()->signal_activate().connect( sigc::mem_fun(*this, &IPTCPanel::addSuppCategory) ); - - conns[0] = captionText->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); - conns[1] = captionWriter->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); - conns[2] = headline->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); - conns[3] = instructions->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); - conns[4] = category->get_entry()->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); - conns[5] = author->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); - conns[6] = authorPos->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); - conns[7] = credit->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); - conns[8] = source->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); - conns[9] = copyright->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); - conns[10] = city->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); - conns[11] = province->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); - conns[12] = country->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); - conns[13] = title->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); - conns[14] = dateCreated->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); - conns[15] = transReference->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); - - category->get_entry()->set_max_length (3); - keyword->get_entry()->set_max_length (64); - captionWriter->set_max_length (32); - instructions->set_max_length (256); - author->set_max_length (32); - authorPos->set_max_length (32); - credit->set_max_length (32); - source->set_max_length (32); - copyright->set_max_length (128); - city->set_max_length (32); - province->set_max_length (32); - country->set_max_length (64); - title->set_max_length (64); - dateCreated->set_max_length (8); - transReference->set_max_length (32); - - show_all (); -} - -void IPTCPanel::read (const ProcParams* pp, const ParamsEdited* pedited) { - - disableListener (); - if (pp->iptc.size()>0) - changeList = pp->iptc; - else - changeList = embeddedData; - applyChangeList (); - enableListener (); -} - -void IPTCPanel::write (ProcParams* pp, ParamsEdited* pedited) { - - pp->iptc = changeList; -} - -void IPTCPanel::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { - - defChangeList = defParams->iptc; -} - -void IPTCPanel::setImageData (const ImageMetaData* id) { - - if (id) - embeddedData = id->getIPTCData (); - else +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include + +extern Glib::ustring argv0; + +using namespace rtengine; +using namespace rtengine::procparams; + +IPTCPanel::IPTCPanel () { + + set_border_width (2); + + Gtk::Table* iptc = new Gtk::Table (27, 2); + + int row = 0; + + Gtk::Label* capl = new Gtk::Label (M("IPTCPANEL_CAPTION")+":"); + captionText = Gtk::TextBuffer::create (); + captionView = new Gtk::TextView (captionText); + Gtk::ScrolledWindow* scrolledWindowc = new Gtk::ScrolledWindow(); + scrolledWindowc->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); + scrolledWindowc->add(*captionView); + capl->set_tooltip_text (M("IPTCPANEL_CAPTIONHINT")); + captionView->set_tooltip_text (M("IPTCPANEL_CAPTIONHINT")); + iptc->attach (*capl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + iptc->attach (*scrolledWindowc, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + row++; + + Gtk::Label* capwl = new Gtk::Label (M("IPTCPANEL_CAPTIONWRITER")+":"); + captionWriter = new Gtk::Entry (); + capwl->set_tooltip_text (M("IPTCPANEL_CAPTIONWRITERHINT")); + captionWriter->set_tooltip_text (M("IPTCPANEL_CAPTIONWRITERHINT")); + iptc->attach (*capwl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + iptc->attach (*captionWriter, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + row++; + + Gtk::Label* headl = new Gtk::Label (M("IPTCPANEL_HEADLINE")+":"); + headline = new Gtk::Entry (); + headl->set_tooltip_text (M("IPTCPANEL_HEADLINEHINT")); + headline->set_tooltip_text (M("IPTCPANEL_HEADLINEHINT")); + iptc->attach (*headl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + iptc->attach (*headline, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + row++; + + Gtk::Label* instl = new Gtk::Label (M("IPTCPANEL_INSTRUCTIONS")+":"); + instructions = new Gtk::Entry (); + instl->set_tooltip_text (M("IPTCPANEL_INSTRUCTIONSHINT")); + instructions->set_tooltip_text (M("IPTCPANEL_INSTRUCTIONSHINT")); + iptc->attach (*instl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + iptc->attach (*instructions, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + row++; + + Gtk::HSeparator* hsep1 = new Gtk::HSeparator (); + iptc->attach (*hsep1, 0, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + row++; + + Gtk::Label* keyl = new Gtk::Label (M("IPTCPANEL_KEYWORDS")+":"); + keywords = new Gtk::ListViewText (1, false, Gtk::SELECTION_MULTIPLE); + keywords->set_headers_visible (false); + Gtk::ScrolledWindow* scrolledWindowkw = new Gtk::ScrolledWindow(); + scrolledWindowkw->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); + scrolledWindowkw->add(*keywords); + keyword = new Gtk::ComboBoxEntryText (); + keyword->set_size_request (32, -1); + keyl->set_tooltip_text (M("IPTCPANEL_KEYWORDSHINT")); + keywords->set_tooltip_text (M("IPTCPANEL_KEYWORDSHINT")); + keyword->set_tooltip_text (M("IPTCPANEL_KEYWORDSHINT")); + addKW = new Gtk::Button (); + delKW = new Gtk::Button (); + Gtk::Image* addKWImg = new Gtk::Image (argv0+"/images/list-add12.png"); + Gtk::Image* delKWImg = new Gtk::Image (argv0+"/images/list-remove12r.png"); + addKW->add (*addKWImg); + delKW->add (*delKWImg); + Gtk::HBox* kwhb = new Gtk::HBox (); + kwhb->pack_start (*keyword); + kwhb->pack_start (*addKW, Gtk::PACK_SHRINK, 2); + kwhb->pack_start (*delKW, Gtk::PACK_SHRINK, 2); + iptc->attach (*keyl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + iptc->attach (*kwhb, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + row++; + iptc->attach (*scrolledWindowkw, 0, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + row++; + + Gtk::HSeparator* hsep2 = new Gtk::HSeparator (); + iptc->attach (*hsep2, 0, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + row++; + + Gtk::Label* catl = new Gtk::Label (M("IPTCPANEL_CATEGORY")+":"); + category = new Gtk::ComboBoxEntryText (); + category->set_size_request (32, -1); + catl->set_tooltip_text (M("IPTCPANEL_CATEGORYHINT")); + category->set_tooltip_text (M("IPTCPANEL_CATEGORYHINT")); + Gtk::Label* scl = new Gtk::Label (M("IPTCPANEL_SUPPCATEGORIES")+":"); + suppCategories = new Gtk::ListViewText (1, false, Gtk::SELECTION_MULTIPLE); + suppCategories->set_headers_visible (false); + Gtk::ScrolledWindow* scrolledWindowsc = new Gtk::ScrolledWindow(); + scrolledWindowsc->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); + scrolledWindowsc->add(*suppCategories); + suppCategory = new Gtk::ComboBoxEntryText (); + suppCategory->set_size_request (32, -1); + scl->set_tooltip_text (M("IPTCPANEL_SUPPCATEGORIESHINT")); + suppCategories->set_tooltip_text (M("IPTCPANEL_SUPPCATEGORIESHINT")); + suppCategory->set_tooltip_text (M("IPTCPANEL_SUPPCATEGORIESHINT")); + addSC = new Gtk::Button (); + delSC = new Gtk::Button (); + Gtk::Image* addSCImg = new Gtk::Image (argv0+"/images/list-add12.png"); + Gtk::Image* delSCImg = new Gtk::Image (argv0+"/images/list-remove12r.png"); + addSC->add (*addSCImg); + delSC->add (*delSCImg); + Gtk::HBox* schb = new Gtk::HBox (); + schb->pack_start (*suppCategory); + schb->pack_start (*addSC, Gtk::PACK_SHRINK, 2); + schb->pack_start (*delSC, Gtk::PACK_SHRINK, 2); + iptc->attach (*catl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + iptc->attach (*category, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + row++; + iptc->attach (*scl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + iptc->attach (*schb, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + row++; + iptc->attach (*scrolledWindowsc, 0, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + row++; + + Gtk::HSeparator* hsep3 = new Gtk::HSeparator (); + iptc->attach (*hsep3, 0, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + row++; + + Gtk::Label* authl = new Gtk::Label (M("IPTCPANEL_AUTHOR")+":"); + author = new Gtk::Entry (); + authl->set_tooltip_text (M("IPTCPANEL_CREDITHINT")); + author->set_tooltip_text (M("IPTCPANEL_CREDITHINT")); + iptc->attach (*authl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + iptc->attach (*author, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + row++; + + Gtk::Label* aupl = new Gtk::Label (M("IPTCPANEL_AUTHORSPOSITION")+":"); + authorPos = new Gtk::Entry (); + aupl->set_tooltip_text (M("IPTCPANEL_AUTHORSPOSITIONHINT")); + authorPos->set_tooltip_text (M("IPTCPANEL_AUTHORSPOSITIONHINT")); + iptc->attach (*aupl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + iptc->attach (*authorPos, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + row++; + + Gtk::Label* credl = new Gtk::Label (M("IPTCPANEL_CREDIT")+":"); + credit = new Gtk::Entry (); + credl->set_tooltip_text (M("IPTCPANEL_CREDITHINT")); + credit->set_tooltip_text (M("IPTCPANEL_CREDITHINT")); + iptc->attach (*credl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + iptc->attach (*credit, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + row++; + + Gtk::Label* sourl = new Gtk::Label (M("IPTCPANEL_SOURCE")+":"); + source = new Gtk::Entry (); + sourl->set_tooltip_text (M("IPTCPANEL_SOURCEHINT")); + source->set_tooltip_text (M("IPTCPANEL_SOURCEHINT")); + iptc->attach (*sourl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + iptc->attach (*source, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + row++; + + Gtk::Label* cprl = new Gtk::Label (M("IPTCPANEL_COPYRIGHT")+":"); + copyright = new Gtk::Entry (); + cprl->set_tooltip_text (M("IPTCPANEL_COPYRIGHTHINT")); + copyright->set_tooltip_text (M("IPTCPANEL_COPYRIGHTHINT")); + iptc->attach (*cprl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + iptc->attach (*copyright, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + row++; + + Gtk::HSeparator* hsep4 = new Gtk::HSeparator (); + iptc->attach (*hsep4, 0, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + row++; + + Gtk::Label* cityl = new Gtk::Label (M("IPTCPANEL_CITY")+":"); + city = new Gtk::Entry (); + cityl->set_tooltip_text (M("IPTCPANEL_CITYHINT")); + city->set_tooltip_text (M("IPTCPANEL_CITYHINT")); + iptc->attach (*cityl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + iptc->attach (*city, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + row++; + + Gtk::Label* provl = new Gtk::Label (M("IPTCPANEL_PROVINCE")+":"); + province = new Gtk::Entry (); + provl->set_tooltip_text (M("IPTCPANEL_PROVINCEHINT")); + province->set_tooltip_text (M("IPTCPANEL_PROVINCEHINT")); + iptc->attach (*provl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + iptc->attach (*province, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + row++; + + Gtk::Label* ctrl = new Gtk::Label (M("IPTCPANEL_COUNTRY")+":"); + country = new Gtk::Entry (); + ctrl->set_tooltip_text (M("IPTCPANEL_COUNTRYHINT")); + country->set_tooltip_text (M("IPTCPANEL_COUNTRYHINT")); + iptc->attach (*ctrl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + iptc->attach (*country, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + row++; + + Gtk::Label* titll = new Gtk::Label (M("IPTCPANEL_TITLE")+":"); + title = new Gtk::Entry (); + titll->set_tooltip_text (M("IPTCPANEL_TITLEHINT")); + title->set_tooltip_text (M("IPTCPANEL_TITLEHINT")); + iptc->attach (*titll, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + iptc->attach (*title, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + row++; + + Gtk::Label* dcl = new Gtk::Label (M("IPTCPANEL_DATECREATED")+":"); + dateCreated = new Gtk::Entry (); + dcl->set_tooltip_text (M("IPTCPANEL_DATECREATEDHINT")); + dateCreated->set_tooltip_text (M("IPTCPANEL_DATECREATEDHINT")); + iptc->attach (*dcl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + iptc->attach (*dateCreated, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + row++; + + Gtk::Label* trl = new Gtk::Label (M("IPTCPANEL_TRANSREFERENCE")+":"); + transReference = new Gtk::Entry (); + trl->set_tooltip_text (M("IPTCPANEL_TRANSREFERENCEHINT")); + transReference->set_tooltip_text (M("IPTCPANEL_TRANSREFERENCEHINT")); + iptc->attach (*trl, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); + iptc->attach (*transReference, 1, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + row++; + + Gtk::ScrolledWindow* scrolledWindow = new Gtk::ScrolledWindow(); + scrolledWindow->set_border_width(2); + scrolledWindow->set_shadow_type(Gtk::SHADOW_NONE); + scrolledWindow->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); + scrolledWindow->property_window_placement().set_value(Gtk::CORNER_TOP_LEFT); + scrolledWindow->add(*iptc); + + pack_start (*scrolledWindow); + + Gtk::HBox* bbox = new Gtk::HBox (); + + reset = new Gtk::Button (M("IPTCPANEL_RESET")); + reset->set_image (*(new Gtk::Image (Gtk::StockID ("gtk-undo"), Gtk::IconSize (2)))); + bbox->pack_start (*reset); + + file = new Gtk::Button (M("IPTCPANEL_EMBEDDED")); + file->set_image (*(new Gtk::Image (Gtk::StockID ("gtk-open"), Gtk::IconSize (2)))); + bbox->pack_start (*file); + + copy = new Gtk::Button (); + copy->set_image (*(new Gtk::Image (Gtk::StockID ("gtk-copy"), Gtk::IconSize (2)))); + bbox->pack_start (*copy, Gtk::PACK_SHRINK, 0); + + paste = new Gtk::Button (); + paste->set_image (*(new Gtk::Image (Gtk::StockID ("gtk-paste"), Gtk::IconSize (2)))); + bbox->pack_start (*paste, Gtk::PACK_SHRINK, 0); + + pack_end (*bbox, Gtk::PACK_SHRINK, 2); + + Gtk::Tooltips* toolTip = new Gtk::Tooltips (); + toolTip->set_tip (*reset, M("IPTCPANEL_RESETHINT")); + toolTip->set_tip (*file, M("IPTCPANEL_EMBEDDEDHINT")); + toolTip->set_tip (*copy, M("IPTCPANEL_COPYHINT")); + toolTip->set_tip (*paste, M("IPTCPANEL_PASTEHINT")); + + reset->signal_clicked().connect( sigc::mem_fun(*this, &IPTCPanel::resetClicked) ); + file->signal_clicked().connect( sigc::mem_fun(*this, &IPTCPanel::fileClicked) ); + copy->signal_clicked().connect( sigc::mem_fun(*this, &IPTCPanel::copyClicked) ); + paste->signal_clicked().connect( sigc::mem_fun(*this, &IPTCPanel::pasteClicked) ); + + + addKW->signal_clicked().connect( sigc::mem_fun(*this, &IPTCPanel::addKeyWord) ); + delKW->signal_clicked().connect( sigc::mem_fun(*this, &IPTCPanel::delKeyWord) ); + addSC->signal_clicked().connect( sigc::mem_fun(*this, &IPTCPanel::addSuppCategory) ); + delSC->signal_clicked().connect( sigc::mem_fun(*this, &IPTCPanel::delSuppCategory) ); + keyword->get_entry()->signal_activate().connect( sigc::mem_fun(*this, &IPTCPanel::addKeyWord) ); + suppCategory->get_entry()->signal_activate().connect( sigc::mem_fun(*this, &IPTCPanel::addSuppCategory) ); + + conns[0] = captionText->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); + conns[1] = captionWriter->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); + conns[2] = headline->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); + conns[3] = instructions->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); + conns[4] = category->get_entry()->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); + conns[5] = author->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); + conns[6] = authorPos->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); + conns[7] = credit->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); + conns[8] = source->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); + conns[9] = copyright->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); + conns[10] = city->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); + conns[11] = province->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); + conns[12] = country->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); + conns[13] = title->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); + conns[14] = dateCreated->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); + conns[15] = transReference->signal_changed().connect( sigc::mem_fun(*this, &IPTCPanel::updateChangeList) ); + + category->get_entry()->set_max_length (3); + keyword->get_entry()->set_max_length (64); + captionWriter->set_max_length (32); + instructions->set_max_length (256); + author->set_max_length (32); + authorPos->set_max_length (32); + credit->set_max_length (32); + source->set_max_length (32); + copyright->set_max_length (128); + city->set_max_length (32); + province->set_max_length (32); + country->set_max_length (64); + title->set_max_length (64); + dateCreated->set_max_length (8); + transReference->set_max_length (32); + + show_all (); +} + +void IPTCPanel::read (const ProcParams* pp, const ParamsEdited* pedited) { + + disableListener (); + if (pp->iptc.size()>0) + changeList = pp->iptc; + else + changeList = embeddedData; + applyChangeList (); + enableListener (); +} + +void IPTCPanel::write (ProcParams* pp, ParamsEdited* pedited) { + + pp->iptc = changeList; +} + +void IPTCPanel::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { + + defChangeList = defParams->iptc; +} + +void IPTCPanel::setImageData (const ImageMetaData* id) { + + if (id) + embeddedData = id->getIPTCData (); + else embeddedData.clear (); - file->set_sensitive (embeddedData.size() > 0); -} - -void IPTCPanel::notifyListener () { - - if (listener) - listener->panelChanged (EvIPTC, M("HISTORY_CHANGED")); -} - -void IPTCPanel::addKeyWord () { - - keyword->get_entry()->select_region (0, keyword->get_entry()->get_text().size()); + file->set_sensitive (embeddedData.size() > 0); +} - for (int i=0; isize(); i++) +void IPTCPanel::notifyListener () { + + if (listener) + listener->panelChanged (EvIPTC, M("HISTORY_CHANGED")); +} + +void IPTCPanel::addKeyWord () { + + keyword->get_entry()->select_region (0, keyword->get_entry()->get_text().size()); + + for (int i=0; isize(); i++) if (keywords->get_text (i) == keyword->get_entry()->get_text()) return; - - keywords->append_text (keyword->get_entry()->get_text()); - keyword->prepend_text (keyword->get_entry()->get_text()); - std::vector items; - for (Gtk::TreeModel::iterator i = keyword->get_model()->children().begin(); i!=keyword->get_model()->children().end(); i++) { - Glib::ustring s; - i->get_value (0, s); - items.push_back (s); - } - keyword->clear_items (); - for (int i=0; i<10 && iappend_text (items[i]); - keywords->scroll_to_row (keywords->get_model()->get_path(--keywords->get_model()->children().end())); - - updateChangeList (); -} - -void IPTCPanel::delKeyWord () { - - std::vector selection = keywords->get_selected (); - if (selection.size()>0) { - std::vector keep; - for (int i=0; isize(); i++) - if (std::find (selection.begin(), selection.end(), i) == selection.end()) - keep.push_back (keywords->get_text (i)); - keywords->clear_items (); - for (int i=0; iappend_text (keep[i]); - } - - updateChangeList (); -} - -void IPTCPanel::addSuppCategory () { - - for (int i=0; isize(); i++) - if (suppCategories->get_text (i) == suppCategory->get_entry()->get_text()) - return; - - suppCategories->append_text (suppCategory->get_entry()->get_text()); - suppCategory->prepend_text (suppCategory->get_entry()->get_text()); - std::vector items; - for (Gtk::TreeModel::iterator i = suppCategory->get_model()->children().begin(); i!=suppCategory->get_model()->children().end(); i++) { - Glib::ustring s; - i->get_value (0, s); - items.push_back (s); - } - suppCategory->clear_items (); - for (int i=0; i<10 && iappend_text (items[i]); - suppCategories->scroll_to_row (suppCategories->get_model()->get_path(--suppCategories->get_model()->children().end())); - suppCategory->get_entry()->select_region (0, suppCategory->get_entry()->get_text().size()); - - updateChangeList (); -} - -void IPTCPanel::delSuppCategory () { - - std::vector selection = suppCategories->get_selected (); - if (selection.size()>0) { - std::vector keep; - for (int i=0; isize(); i++) - if (std::find (selection.begin(), selection.end(), i) == selection.end()) - keep.push_back (suppCategories->get_text (i)); - suppCategories->clear_items (); - for (int i=0; iappend_text (keep[i]); - } - - updateChangeList (); -} - -void IPTCPanel::updateChangeList () { - - changeList.clear (); - changeList.resize (18); - changeList[0].field = "Caption"; - changeList[0].values.push_back (captionText->get_text ()); - changeList[1].field = "CaptionWriter"; - changeList[1].values.push_back (captionWriter->get_text ()); - changeList[2].field = "Headline"; - changeList[2].values.push_back (headline->get_text ()); - changeList[3].field = "Instructions"; - changeList[3].values.push_back (instructions->get_text ()); - changeList[4].field = "Keywords"; - for (int i=0; isize(); i++) - changeList[4].values.push_back (keywords->get_text (i)); - changeList[5].field = "Category"; - changeList[5].values.push_back (category->get_entry()->get_text ()); - changeList[6].field = "SupplementalCategories"; - for (int i=0; isize(); i++) - changeList[6].values.push_back (suppCategories->get_text (i)); - changeList[7].field = "Author"; - changeList[7].values.push_back (author->get_text ()); - changeList[8].field = "AuthorsPosition"; - changeList[8].values.push_back (authorPos->get_text ()); - changeList[9].field = "Credit"; - changeList[9].values.push_back (credit->get_text ()); - changeList[10].field = "Source"; - changeList[10].values.push_back (source->get_text ()); - changeList[11].field = "Copyright"; - changeList[11].values.push_back (copyright->get_text ()); - changeList[12].field = "City"; - changeList[12].values.push_back (city->get_text ()); - changeList[13].field = "Province"; - changeList[13].values.push_back (province->get_text ()); - changeList[14].field = "Country"; - changeList[14].values.push_back (country->get_text ()); - changeList[15].field = "Title"; - changeList[15].values.push_back (title->get_text ()); - changeList[16].field = "DateCreated"; - changeList[16].values.push_back (dateCreated->get_text ()); - changeList[17].field = "TransReference"; - changeList[17].values.push_back (transReference->get_text ()); - - notifyListener (); -} - -void IPTCPanel::applyChangeList () { - - for (int i=0; i<16; i++) - conns[i].block (true); - - captionText->set_text (""); - captionWriter->set_text (""); - headline->set_text (""); - instructions->set_text (""); - keywords->clear_items (); - category->get_entry()->set_text (""); - suppCategories->clear_items (); - author->set_text (""); - authorPos->set_text (""); - credit->set_text (""); - source->set_text (""); - copyright->set_text (""); - city->set_text (""); - province->set_text (""); - country->set_text (""); - title->set_text (""); - dateCreated->set_text (""); - transReference->set_text (""); - keyword->get_entry()->set_text (""); - suppCategory->get_entry()->set_text (""); - - for (int i=0; i0) - captionText->set_text (changeList[i].values[0]); - else if (changeList[i].field == "CaptionWriter" && changeList[i].values.size()>0) - captionWriter->set_text (changeList[i].values[0]); - else if (changeList[i].field == "Headline" && changeList[i].values.size()>0) - headline->set_text (changeList[i].values[0]); - else if (changeList[i].field == "Instructions" && changeList[i].values.size()>0) - instructions->set_text (changeList[i].values[0]); - else if (changeList[i].field == "Keywords") - for (int j=0; jappend_text (changeList[i].values[j]); - else if (changeList[i].field == "Category" && changeList[i].values.size()>0) - category->get_entry()->set_text (changeList[i].values[0]); - else if (changeList[i].field == "SupplementalCategories") - for (int j=0; jappend_text (changeList[i].values[j]); - else if (changeList[i].field == "Author" && changeList[i].values.size()>0) - author->set_text (changeList[i].values[0]); - else if (changeList[i].field == "AuthorsPosition" && changeList[i].values.size()>0) - authorPos->set_text (changeList[i].values[0]); - else if (changeList[i].field == "Credit" && changeList[i].values.size()>0) - credit->set_text (changeList[i].values[0]); - else if (changeList[i].field == "Source" && changeList[i].values.size()>0) - source->set_text (changeList[i].values[0]); - else if (changeList[i].field == "Copyright" && changeList[i].values.size()>0) - copyright->set_text (changeList[i].values[0]); - else if (changeList[i].field == "City" && changeList[i].values.size()>0) - city->set_text (changeList[i].values[0]); - else if (changeList[i].field == "Province" && changeList[i].values.size()>0) - province->set_text (changeList[i].values[0]); - else if (changeList[i].field == "Country" && changeList[i].values.size()>0) - country->set_text (changeList[i].values[0]); - else if (changeList[i].field == "Title" && changeList[i].values.size()>0) - title->set_text (changeList[i].values[0]); - else if (changeList[i].field == "DateCreated" && changeList[i].values.size()>0) - dateCreated->set_text (changeList[i].values[0]); - else if (changeList[i].field == "TransReference" && changeList[i].values.size()>0) - transReference->set_text (changeList[i].values[0]); - - for (int i=0; i<16; i++) - conns[i].block (false); -} - -void IPTCPanel::resetClicked () { - - disableListener (); - changeList = defChangeList; - applyChangeList (); - enableListener (); - notifyListener (); -} - -void IPTCPanel::fileClicked () { - - disableListener (); - changeList = embeddedData; - applyChangeList (); - enableListener (); - notifyListener (); -} - -void IPTCPanel::copyClicked () { - - clipboard.setIPTC (changeList); -} - -void IPTCPanel::pasteClicked () { - - disableListener (); - changeList = clipboard.getIPTC (); - applyChangeList (); - enableListener (); - notifyListener (); -} + + keywords->append_text (keyword->get_entry()->get_text()); + keyword->prepend_text (keyword->get_entry()->get_text()); + std::vector items; + for (Gtk::TreeModel::iterator i = keyword->get_model()->children().begin(); i!=keyword->get_model()->children().end(); i++) { + Glib::ustring s; + i->get_value (0, s); + items.push_back (s); + } + keyword->clear_items (); + for (int i=0; i<10 && iappend_text (items[i]); + keywords->scroll_to_row (keywords->get_model()->get_path(--keywords->get_model()->children().end())); + + updateChangeList (); +} + +void IPTCPanel::delKeyWord () { + + std::vector selection = keywords->get_selected (); + if (selection.size()>0) { + std::vector keep; + for (int i=0; isize(); i++) + if (std::find (selection.begin(), selection.end(), i) == selection.end()) + keep.push_back (keywords->get_text (i)); + keywords->clear_items (); + for (int i=0; iappend_text (keep[i]); + } + + updateChangeList (); +} + +void IPTCPanel::addSuppCategory () { + + for (int i=0; isize(); i++) + if (suppCategories->get_text (i) == suppCategory->get_entry()->get_text()) + return; + + suppCategories->append_text (suppCategory->get_entry()->get_text()); + suppCategory->prepend_text (suppCategory->get_entry()->get_text()); + std::vector items; + for (Gtk::TreeModel::iterator i = suppCategory->get_model()->children().begin(); i!=suppCategory->get_model()->children().end(); i++) { + Glib::ustring s; + i->get_value (0, s); + items.push_back (s); + } + suppCategory->clear_items (); + for (int i=0; i<10 && iappend_text (items[i]); + suppCategories->scroll_to_row (suppCategories->get_model()->get_path(--suppCategories->get_model()->children().end())); + suppCategory->get_entry()->select_region (0, suppCategory->get_entry()->get_text().size()); + + updateChangeList (); +} + +void IPTCPanel::delSuppCategory () { + + std::vector selection = suppCategories->get_selected (); + if (selection.size()>0) { + std::vector keep; + for (int i=0; isize(); i++) + if (std::find (selection.begin(), selection.end(), i) == selection.end()) + keep.push_back (suppCategories->get_text (i)); + suppCategories->clear_items (); + for (int i=0; iappend_text (keep[i]); + } + + updateChangeList (); +} + +void IPTCPanel::updateChangeList () { + + changeList.clear (); + changeList.resize (18); + changeList[0].field = "Caption"; + changeList[0].values.push_back (captionText->get_text ()); + changeList[1].field = "CaptionWriter"; + changeList[1].values.push_back (captionWriter->get_text ()); + changeList[2].field = "Headline"; + changeList[2].values.push_back (headline->get_text ()); + changeList[3].field = "Instructions"; + changeList[3].values.push_back (instructions->get_text ()); + changeList[4].field = "Keywords"; + for (int i=0; isize(); i++) + changeList[4].values.push_back (keywords->get_text (i)); + changeList[5].field = "Category"; + changeList[5].values.push_back (category->get_entry()->get_text ()); + changeList[6].field = "SupplementalCategories"; + for (int i=0; isize(); i++) + changeList[6].values.push_back (suppCategories->get_text (i)); + changeList[7].field = "Author"; + changeList[7].values.push_back (author->get_text ()); + changeList[8].field = "AuthorsPosition"; + changeList[8].values.push_back (authorPos->get_text ()); + changeList[9].field = "Credit"; + changeList[9].values.push_back (credit->get_text ()); + changeList[10].field = "Source"; + changeList[10].values.push_back (source->get_text ()); + changeList[11].field = "Copyright"; + changeList[11].values.push_back (copyright->get_text ()); + changeList[12].field = "City"; + changeList[12].values.push_back (city->get_text ()); + changeList[13].field = "Province"; + changeList[13].values.push_back (province->get_text ()); + changeList[14].field = "Country"; + changeList[14].values.push_back (country->get_text ()); + changeList[15].field = "Title"; + changeList[15].values.push_back (title->get_text ()); + changeList[16].field = "DateCreated"; + changeList[16].values.push_back (dateCreated->get_text ()); + changeList[17].field = "TransReference"; + changeList[17].values.push_back (transReference->get_text ()); + + notifyListener (); +} + +void IPTCPanel::applyChangeList () { + + for (int i=0; i<16; i++) + conns[i].block (true); + + captionText->set_text (""); + captionWriter->set_text (""); + headline->set_text (""); + instructions->set_text (""); + keywords->clear_items (); + category->get_entry()->set_text (""); + suppCategories->clear_items (); + author->set_text (""); + authorPos->set_text (""); + credit->set_text (""); + source->set_text (""); + copyright->set_text (""); + city->set_text (""); + province->set_text (""); + country->set_text (""); + title->set_text (""); + dateCreated->set_text (""); + transReference->set_text (""); + keyword->get_entry()->set_text (""); + suppCategory->get_entry()->set_text (""); + + for (int i=0; i0) + captionText->set_text (changeList[i].values[0]); + else if (changeList[i].field == "CaptionWriter" && changeList[i].values.size()>0) + captionWriter->set_text (changeList[i].values[0]); + else if (changeList[i].field == "Headline" && changeList[i].values.size()>0) + headline->set_text (changeList[i].values[0]); + else if (changeList[i].field == "Instructions" && changeList[i].values.size()>0) + instructions->set_text (changeList[i].values[0]); + else if (changeList[i].field == "Keywords") + for (int j=0; jappend_text (changeList[i].values[j]); + else if (changeList[i].field == "Category" && changeList[i].values.size()>0) + category->get_entry()->set_text (changeList[i].values[0]); + else if (changeList[i].field == "SupplementalCategories") + for (int j=0; jappend_text (changeList[i].values[j]); + else if (changeList[i].field == "Author" && changeList[i].values.size()>0) + author->set_text (changeList[i].values[0]); + else if (changeList[i].field == "AuthorsPosition" && changeList[i].values.size()>0) + authorPos->set_text (changeList[i].values[0]); + else if (changeList[i].field == "Credit" && changeList[i].values.size()>0) + credit->set_text (changeList[i].values[0]); + else if (changeList[i].field == "Source" && changeList[i].values.size()>0) + source->set_text (changeList[i].values[0]); + else if (changeList[i].field == "Copyright" && changeList[i].values.size()>0) + copyright->set_text (changeList[i].values[0]); + else if (changeList[i].field == "City" && changeList[i].values.size()>0) + city->set_text (changeList[i].values[0]); + else if (changeList[i].field == "Province" && changeList[i].values.size()>0) + province->set_text (changeList[i].values[0]); + else if (changeList[i].field == "Country" && changeList[i].values.size()>0) + country->set_text (changeList[i].values[0]); + else if (changeList[i].field == "Title" && changeList[i].values.size()>0) + title->set_text (changeList[i].values[0]); + else if (changeList[i].field == "DateCreated" && changeList[i].values.size()>0) + dateCreated->set_text (changeList[i].values[0]); + else if (changeList[i].field == "TransReference" && changeList[i].values.size()>0) + transReference->set_text (changeList[i].values[0]); + + for (int i=0; i<16; i++) + conns[i].block (false); +} + +void IPTCPanel::resetClicked () { + + disableListener (); + changeList = defChangeList; + applyChangeList (); + enableListener (); + notifyListener (); +} + +void IPTCPanel::fileClicked () { + + disableListener (); + changeList = embeddedData; + applyChangeList (); + enableListener (); + notifyListener (); +} + +void IPTCPanel::copyClicked () { + + clipboard.setIPTC (changeList); +} + +void IPTCPanel::pasteClicked () { + + disableListener (); + changeList = clipboard.getIPTC (); + applyChangeList (); + enableListener (); + notifyListener (); +} diff --git a/rtgui/iptcpanel.h b/rtgui/iptcpanel.h index 4b5baec6c..1a3e0e675 100644 --- a/rtgui/iptcpanel.h +++ b/rtgui/iptcpanel.h @@ -1,91 +1,91 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _IPTCPANEL_ -#define _IPTCPANEL_ - -#include -#include - -class IPTCPanel : public Gtk::VBox, public ToolPanel { - - private: - std::vector changeList; - std::vector defChangeList; - std::vector embeddedData; - - Gtk::TextView* captionView; - Glib::RefPtr captionText; - Gtk::Entry* captionWriter; - Gtk::Entry* headline; - Gtk::Entry* instructions; - Gtk::ComboBoxEntryText* keyword; - Gtk::ListViewText* keywords; - Gtk::Button* addKW; - Gtk::Button* delKW; - Gtk::ComboBoxEntryText* category; - Gtk::ComboBoxEntryText* suppCategory; - Gtk::ListViewText* suppCategories; - Gtk::Button* addSC; - Gtk::Button* delSC; - - Gtk::Entry* author; - Gtk::Entry* authorPos; - Gtk::Entry* credit; - Gtk::Entry* source; - Gtk::Entry* copyright; - Gtk::Entry* city; - Gtk::Entry* province; - Gtk::Entry* country; - Gtk::Entry* title; - Gtk::Entry* dateCreated; - Gtk::Entry* transReference; - - Gtk::Button* reset; - Gtk::Button* file; - Gtk::Button* copy; - Gtk::Button* paste; - - sigc::connection conns[16]; - - void applyChangeList (); - void updateChangeList (); - - public: - IPTCPanel (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); - - void setImageData (const rtengine::ImageMetaData* id); - - void notifyListener (); - - void addKeyWord (); - void delKeyWord (); - void addSuppCategory (); - void delSuppCategory (); - - void resetClicked (); - void fileClicked (); - void copyClicked (); - void pasteClicked (); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _IPTCPANEL_ +#define _IPTCPANEL_ + +#include +#include + +class IPTCPanel : public Gtk::VBox, public ToolPanel { + + private: + std::vector changeList; + std::vector defChangeList; + std::vector embeddedData; + + Gtk::TextView* captionView; + Glib::RefPtr captionText; + Gtk::Entry* captionWriter; + Gtk::Entry* headline; + Gtk::Entry* instructions; + Gtk::ComboBoxEntryText* keyword; + Gtk::ListViewText* keywords; + Gtk::Button* addKW; + Gtk::Button* delKW; + Gtk::ComboBoxEntryText* category; + Gtk::ComboBoxEntryText* suppCategory; + Gtk::ListViewText* suppCategories; + Gtk::Button* addSC; + Gtk::Button* delSC; + + Gtk::Entry* author; + Gtk::Entry* authorPos; + Gtk::Entry* credit; + Gtk::Entry* source; + Gtk::Entry* copyright; + Gtk::Entry* city; + Gtk::Entry* province; + Gtk::Entry* country; + Gtk::Entry* title; + Gtk::Entry* dateCreated; + Gtk::Entry* transReference; + + Gtk::Button* reset; + Gtk::Button* file; + Gtk::Button* copy; + Gtk::Button* paste; + + sigc::connection conns[16]; + + void applyChangeList (); + void updateChangeList (); + + public: + IPTCPanel (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); + + void setImageData (const rtengine::ImageMetaData* id); + + void notifyListener (); + + void addKeyWord (); + void delKeyWord (); + void addSuppCategory (); + void delSuppCategory (); + + void resetClicked (); + void fileClicked (); + void copyClicked (); + void pasteClicked (); +}; + +#endif diff --git a/rtgui/lcurve.cc b/rtgui/lcurve.cc index b40f37e8e..1291d7ed5 100644 --- a/rtgui/lcurve.cc +++ b/rtgui/lcurve.cc @@ -1,144 +1,144 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include - -using namespace rtengine; -using namespace rtengine::procparams; - -LCurve::LCurve () : ToolPanel(), brAdd(false), contrAdd(false) { - - Gtk::HBox* abox = Gtk::manage (new Gtk::HBox ()); - abox->set_border_width (2); - - brightness = Gtk::manage (new Adjuster (M("TP_LUMACURVE_BRIGHTNESS"), -100, 100, 0.01, 0)); - contrast = Gtk::manage (new Adjuster (M("TP_LUMACURVE_CONTRAST"), -100, 100, 1, 0)); - - pack_start (*brightness); - brightness->show (); - - pack_start (*contrast); - contrast->show (); - - Gtk::HSeparator *hsep3 = Gtk::manage (new Gtk::HSeparator()); - hsep3->show (); - pack_start (*hsep3); - - shape = Gtk::manage (new CurveEditor ()); - shape->show (); - shape->setCurveListener (this); - - pack_start (*shape, Gtk::PACK_SHRINK, 4); - - brightness->setAdjusterListener (this); - contrast->setAdjusterListener (this); -} - -void LCurve::read (const ProcParams* pp, const ParamsEdited* pedited) { - - disableListener (); - - if (pedited) { - brightness->setEditedState (pedited->lumaCurve.brightness ? Edited : UnEdited); - contrast->setEditedState (pedited->lumaCurve.contrast ? Edited : UnEdited); - shape->setUnChanged (!pedited->lumaCurve.curve); - } - - brightness->setValue (pp->lumaCurve.brightness); - contrast->setValue (pp->lumaCurve.contrast); - shape->setCurve (pp->lumaCurve.curve); - - enableListener (); -} - -void LCurve::write (ProcParams* pp, ParamsEdited* pedited) { - - pp->lumaCurve.brightness = brightness->getValue (); - pp->lumaCurve.contrast = (int)contrast->getValue (); - pp->lumaCurve.curve = shape->getCurve (); - - if (pedited) { - pedited->lumaCurve.brightness = brightness->getEditedState (); - pedited->lumaCurve.contrast = contrast->getEditedState (); - pedited->lumaCurve.curve = !shape->isUnChanged (); - } -} - -void LCurve::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { - - brightness->setDefault (defParams->lumaCurve.brightness); - contrast->setDefault (defParams->lumaCurve.contrast); - - if (pedited) { - brightness->setDefaultEditedState (pedited->lumaCurve.brightness ? Edited : UnEdited); - contrast->setDefaultEditedState (pedited->lumaCurve.contrast ? Edited : UnEdited); - } - else { - brightness->setDefaultEditedState (Irrelevant); - contrast->setDefaultEditedState (Irrelevant); - } -} - -void LCurve::curveChanged () { - - if (listener) - listener->panelChanged (EvLCurve, M("HISTORY_CUSTOMCURVE")); -} - -void LCurve::adjusterChanged (Adjuster* a, double newval) { - - if (!listener) - return; - - Glib::ustring costr; - if (a==brightness) +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include + +using namespace rtengine; +using namespace rtengine::procparams; + +LCurve::LCurve () : ToolPanel(), brAdd(false), contrAdd(false) { + + Gtk::HBox* abox = Gtk::manage (new Gtk::HBox ()); + abox->set_border_width (2); + + brightness = Gtk::manage (new Adjuster (M("TP_LUMACURVE_BRIGHTNESS"), -100, 100, 0.01, 0)); + contrast = Gtk::manage (new Adjuster (M("TP_LUMACURVE_CONTRAST"), -100, 100, 1, 0)); + + pack_start (*brightness); + brightness->show (); + + pack_start (*contrast); + contrast->show (); + + Gtk::HSeparator *hsep3 = Gtk::manage (new Gtk::HSeparator()); + hsep3->show (); + pack_start (*hsep3); + + shape = Gtk::manage (new CurveEditor ()); + shape->show (); + shape->setCurveListener (this); + + pack_start (*shape, Gtk::PACK_SHRINK, 4); + + brightness->setAdjusterListener (this); + contrast->setAdjusterListener (this); +} + +void LCurve::read (const ProcParams* pp, const ParamsEdited* pedited) { + + disableListener (); + + if (pedited) { + brightness->setEditedState (pedited->lumaCurve.brightness ? Edited : UnEdited); + contrast->setEditedState (pedited->lumaCurve.contrast ? Edited : UnEdited); + shape->setUnChanged (!pedited->lumaCurve.curve); + } + + brightness->setValue (pp->lumaCurve.brightness); + contrast->setValue (pp->lumaCurve.contrast); + shape->setCurve (pp->lumaCurve.curve); + + enableListener (); +} + +void LCurve::write (ProcParams* pp, ParamsEdited* pedited) { + + pp->lumaCurve.brightness = brightness->getValue (); + pp->lumaCurve.contrast = (int)contrast->getValue (); + pp->lumaCurve.curve = shape->getCurve (); + + if (pedited) { + pedited->lumaCurve.brightness = brightness->getEditedState (); + pedited->lumaCurve.contrast = contrast->getEditedState (); + pedited->lumaCurve.curve = !shape->isUnChanged (); + } +} + +void LCurve::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { + + brightness->setDefault (defParams->lumaCurve.brightness); + contrast->setDefault (defParams->lumaCurve.contrast); + + if (pedited) { + brightness->setDefaultEditedState (pedited->lumaCurve.brightness ? Edited : UnEdited); + contrast->setDefaultEditedState (pedited->lumaCurve.contrast ? Edited : UnEdited); + } + else { + brightness->setDefaultEditedState (Irrelevant); + contrast->setDefaultEditedState (Irrelevant); + } +} + +void LCurve::curveChanged () { + + if (listener) + listener->panelChanged (EvLCurve, M("HISTORY_CUSTOMCURVE")); +} + +void LCurve::adjusterChanged (Adjuster* a, double newval) { + + if (!listener) + return; + + Glib::ustring costr; + if (a==brightness) costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), a->getValue()); - else + else costr = Glib::ustring::format ((int)a->getValue()); - if (a==brightness) - listener->panelChanged (EvLBrightness, costr); - else if (a==contrast) - listener->panelChanged (EvLContrast, costr); -} - -void LCurve::setBatchMode (bool batchMode) { - - ToolPanel::setBatchMode (batchMode); - brightness->showEditedCB (); - contrast->showEditedCB (); - - shape->setBatchMode (batchMode); -} - -void LCurve::setAdjusterBehavior (bool bradd, bool contradd) { - - if (!brAdd && bradd || brAdd && !bradd) - brightness->setLimits (-100, 100, 1, 0); - if (!contrAdd && contradd || contrAdd && !contradd) - contrast->setLimits (-100, 100, 1, 0); - - brAdd = bradd; - contrAdd = contradd; -} - -void LCurve::updateCurveBackgroundHistogram (unsigned* hist) { - - shape->updateBackgroundHistogram (hist); -} + if (a==brightness) + listener->panelChanged (EvLBrightness, costr); + else if (a==contrast) + listener->panelChanged (EvLContrast, costr); +} + +void LCurve::setBatchMode (bool batchMode) { + + ToolPanel::setBatchMode (batchMode); + brightness->showEditedCB (); + contrast->showEditedCB (); + + shape->setBatchMode (batchMode); +} + +void LCurve::setAdjusterBehavior (bool bradd, bool contradd) { + + if (!brAdd && bradd || brAdd && !bradd) + brightness->setLimits (-100, 100, 1, 0); + if (!contrAdd && contradd || contrAdd && !contradd) + contrast->setLimits (-100, 100, 1, 0); + + brAdd = bradd; + contrAdd = contradd; +} + +void LCurve::updateCurveBackgroundHistogram (unsigned* hist) { + + shape->updateBackgroundHistogram (hist); +} diff --git a/rtgui/lcurve.h b/rtgui/lcurve.h index b8d1bd4c2..b8174b49c 100644 --- a/rtgui/lcurve.h +++ b/rtgui/lcurve.h @@ -1,51 +1,51 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _LCURVE_H_ -#define _LCURVE_H_ - -#include -#include -#include -#include -#include - -class LCurve : public Gtk::VBox, public AdjusterListener, public ToolPanel, public CurveListener { - - protected: - Adjuster* brightness; - Adjuster* contrast; +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _LCURVE_H_ +#define _LCURVE_H_ + +#include +#include +#include +#include +#include + +class LCurve : public Gtk::VBox, public AdjusterListener, public ToolPanel, public CurveListener { + + protected: + Adjuster* brightness; + Adjuster* contrast; CurveEditor* shape; - bool brAdd, contrAdd; - - public: - - LCurve (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); - void setBatchMode (bool batchMode); - void setAdjusterBehavior (bool bradd, bool contradd); - - void curveChanged (); + bool brAdd, contrAdd; + + public: + + LCurve (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); + void setBatchMode (bool batchMode); + void setAdjusterBehavior (bool bradd, bool contradd); + + void curveChanged (); void adjusterChanged (Adjuster* a, double newval); - void updateCurveBackgroundHistogram (unsigned* hist); -}; - -#endif + void updateCurveBackgroundHistogram (unsigned* hist); +}; + +#endif diff --git a/rtgui/lumadenoise.cc b/rtgui/lumadenoise.cc index e80d1595c..29d0b7aea 100644 --- a/rtgui/lumadenoise.cc +++ b/rtgui/lumadenoise.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include @@ -101,7 +101,7 @@ void LumaDenoise::adjusterChanged (Adjuster* a, double newval) { if (listener && enabled->get_active()) { - if (a==radius) + if (a==radius) listener->panelChanged (EvLDNRadius, Glib::ustring::format (std::setw(2), std::fixed, std::setprecision(1), a->getValue())); else if (a==edge) listener->panelChanged (EvLDNEdgeTolerance, Glib::ustring::format ((int)a->getValue())); diff --git a/rtgui/lumadenoise.h b/rtgui/lumadenoise.h index 3f8e84170..bb3b74233 100644 --- a/rtgui/lumadenoise.h +++ b/rtgui/lumadenoise.h @@ -1,51 +1,51 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _LUMADENOISE_H_ -#define _LUMADENOISE_H_ - -#include -#include -#include - -class LumaDenoise : public Gtk::VBox, public AdjusterListener, public ToolPanel { - - protected: - Adjuster* radius; - Adjuster* edge; - Gtk::CheckButton* enabled; - bool lastEnabled; - sigc::connection enaConn; - bool edgetolAdd; - - public: - - LumaDenoise (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); - void setBatchMode (bool batchMode); - - void adjusterChanged (Adjuster* a, double newval); - void enabledChanged (); - - void setAdjusterBehavior (bool bedgetoladd); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _LUMADENOISE_H_ +#define _LUMADENOISE_H_ + +#include +#include +#include + +class LumaDenoise : public Gtk::VBox, public AdjusterListener, public ToolPanel { + + protected: + Adjuster* radius; + Adjuster* edge; + Gtk::CheckButton* enabled; + bool lastEnabled; + sigc::connection enaConn; + bool edgetolAdd; + + public: + + LumaDenoise (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); + void setBatchMode (bool batchMode); + + void adjusterChanged (Adjuster* a, double newval); + void enabledChanged (); + + void setAdjusterBehavior (bool bedgetoladd); +}; + +#endif diff --git a/rtgui/lwbutton.cc b/rtgui/lwbutton.cc index e5ec6a68d..f93fb620c 100644 --- a/rtgui/lwbutton.cc +++ b/rtgui/lwbutton.cc @@ -1,186 +1,186 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include - -LWButton::LWButton (Cairo::RefPtr i, int aCode, void* aData, Alignment ha, Alignment va, Glib::ustring tooltip) - : icon(i), actionCode(aCode), actionData(aData), halign(ha), valign(va), state(Normal), toolTip(tooltip), listener(NULL) { - - if (i) { - w = i->get_width () + 2; - h = i->get_height () + 2; - } - else - w = h = 2; -} - -void LWButton::getSize (int& minw, int& minh) { - - minw = w; - minh = h; -} - -void LWButton::setPosition (int x, int y) { - - xpos = x; - ypos = y; -} - -void LWButton::getPosition (int& x, int& y) { - - x = xpos; - y = ypos; -} - -void LWButton::setIcon (Cairo::RefPtr i) { - - icon = i; - if (i) { - w = i->get_width () + 2; - h = i->get_height () + 2; - } - else - w = h = 2; -} - -Cairo::RefPtr LWButton::getIcon () { - - return icon; -} - -void LWButton::setColors (const Gdk::Color& bg, const Gdk::Color& fg) { - - bgr = bg.get_red_p (); - bgg = bg.get_green_p (); - bgb = bg.get_blue_p (); - fgr = fg.get_red_p (); - fgg = fg.get_green_p (); - fgb = fg.get_blue_p (); -} - -bool LWButton::inside (int x, int y) { - - return x>xpos && xypos && yredrawNeeded (this); - return true; - } - return in; -} - -bool LWButton::pressNotify (int x, int y) { - - bool in = inside (x, y); - State nstate = state; - if (in && (state==Normal || state==Over || state==Pressed_Out)) - nstate = Pressed_In; - else if (!in && state==Pressed_In) - nstate = Normal; - - if (state!=nstate) { - state = nstate; - if (listener) - listener->redrawNeeded (this); - return true; - } - return in; -} - -bool LWButton::releaseNotify (int x, int y) { - - bool in = inside (x, y); - State nstate = state; - bool action = false; - if (in && (state==Pressed_In || state==Pressed_Out)) { - nstate = Over; - action = true; - } - else - nstate = Normal; - - bool ret = action; - if (state!=nstate) { - state = nstate; - if (listener) - listener->redrawNeeded (this); - ret = true; - } - - if (action && listener) - listener->buttonPressed (this, actionCode, actionData); - return ret; -} - -void LWButton::redraw (Cairo::RefPtr context) { - - context->set_line_width (1.0); - context->set_antialias (Cairo::ANTIALIAS_SUBPIXEL); - context->rectangle (xpos+0.5, ypos+0.5, w-1.0, h-1.0); - if (state==Pressed_In) - context->set_source_rgb (fgr, fgg, fgb); - else - context->set_source_rgba (bgr, bgg, bgb, 0); - context->fill_preserve (); - if (state==Over) - context->set_source_rgb (fgr, fgg, fgb); - else - context->set_source_rgba (bgr, bgg, bgb, 0); - context->stroke (); - int dilat = 1; - if (state==Pressed_In) - dilat++; +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include - if (icon) { - context->set_source (icon, xpos+dilat, ypos+dilat); - context->paint (); - } -} - -void LWButton::getAlignment (Alignment& ha, Alignment& va) { - - ha = halign; - va = valign; +LWButton::LWButton (Cairo::RefPtr i, int aCode, void* aData, Alignment ha, Alignment va, Glib::ustring tooltip) + : icon(i), actionCode(aCode), actionData(aData), halign(ha), valign(va), state(Normal), toolTip(tooltip), listener(NULL) { + + if (i) { + w = i->get_width () + 2; + h = i->get_height () + 2; + } + else + w = h = 2; } - + +void LWButton::getSize (int& minw, int& minh) { + + minw = w; + minh = h; +} + +void LWButton::setPosition (int x, int y) { + + xpos = x; + ypos = y; +} + +void LWButton::getPosition (int& x, int& y) { + + x = xpos; + y = ypos; +} + +void LWButton::setIcon (Cairo::RefPtr i) { + + icon = i; + if (i) { + w = i->get_width () + 2; + h = i->get_height () + 2; + } + else + w = h = 2; +} + +Cairo::RefPtr LWButton::getIcon () { + + return icon; +} + +void LWButton::setColors (const Gdk::Color& bg, const Gdk::Color& fg) { + + bgr = bg.get_red_p (); + bgg = bg.get_green_p (); + bgb = bg.get_blue_p (); + fgr = fg.get_red_p (); + fgg = fg.get_green_p (); + fgb = fg.get_blue_p (); +} + +bool LWButton::inside (int x, int y) { + + return x>xpos && xypos && yredrawNeeded (this); + return true; + } + return in; +} + +bool LWButton::pressNotify (int x, int y) { + + bool in = inside (x, y); + State nstate = state; + if (in && (state==Normal || state==Over || state==Pressed_Out)) + nstate = Pressed_In; + else if (!in && state==Pressed_In) + nstate = Normal; + + if (state!=nstate) { + state = nstate; + if (listener) + listener->redrawNeeded (this); + return true; + } + return in; +} + +bool LWButton::releaseNotify (int x, int y) { + + bool in = inside (x, y); + State nstate = state; + bool action = false; + if (in && (state==Pressed_In || state==Pressed_Out)) { + nstate = Over; + action = true; + } + else + nstate = Normal; + + bool ret = action; + if (state!=nstate) { + state = nstate; + if (listener) + listener->redrawNeeded (this); + ret = true; + } + + if (action && listener) + listener->buttonPressed (this, actionCode, actionData); + return ret; +} + +void LWButton::redraw (Cairo::RefPtr context) { + + context->set_line_width (1.0); + context->set_antialias (Cairo::ANTIALIAS_SUBPIXEL); + context->rectangle (xpos+0.5, ypos+0.5, w-1.0, h-1.0); + if (state==Pressed_In) + context->set_source_rgb (fgr, fgg, fgb); + else + context->set_source_rgba (bgr, bgg, bgb, 0); + context->fill_preserve (); + if (state==Over) + context->set_source_rgb (fgr, fgg, fgb); + else + context->set_source_rgba (bgr, bgg, bgb, 0); + context->stroke (); + int dilat = 1; + if (state==Pressed_In) + dilat++; + + if (icon) { + context->set_source (icon, xpos+dilat, ypos+dilat); + context->paint (); + } +} + +void LWButton::getAlignment (Alignment& ha, Alignment& va) { + + ha = halign; + va = valign; +} + Glib::ustring LWButton::getToolTip (int x, int y) { if (inside (x, y)) return toolTip; else return ""; -} +} void LWButton::setToolTip (const Glib::ustring& tooltip) { diff --git a/rtgui/lwbutton.h b/rtgui/lwbutton.h index 0d3e7a61f..23ff322a6 100644 --- a/rtgui/lwbutton.h +++ b/rtgui/lwbutton.h @@ -1,74 +1,74 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _LWBUTTON_ -#define _LWBUTTON_ - -#include - -class LWButton; -class LWButtonListener { - - public: - virtual void buttonPressed (LWButton* button, int actionCode, void* actionData) {} - virtual void redrawNeeded (LWButton* button) {} -}; - -class LWButton { - - public: - enum Alignment {Left, Right, Top, Bottom, Center}; - enum State { Normal, Over, Pressed_In, Pressed_Out}; - - private: - int xpos, ypos, w, h; - Alignment halign, valign; - Cairo::RefPtr icon; - double bgr, bgg, bgb; - double fgr, fgg, fgb; - State state; - LWButtonListener* listener; - int actionCode; - void* actionData; - Glib::ustring toolTip; - - public: - LWButton (Cairo::RefPtr i, int aCode, void* aData, Alignment ha=Left, Alignment va=Center, Glib::ustring tooltip=""); - - void getSize (int& minw, int& minh); - void getAlignment (Alignment& ha, Alignment& va); - void setPosition (int x, int y); - void getPosition (int& x, int& y); - bool inside (int x, int y); - void setIcon (Cairo::RefPtr i); - Cairo::RefPtr getIcon (); - void setColors (const Gdk::Color& bg, const Gdk::Color& fg); - void setToolTip (const Glib::ustring& tooltip); - - bool motionNotify (int x, int y); - bool pressNotify (int x, int y); - bool releaseNotify (int x, int y); +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _LWBUTTON_ +#define _LWBUTTON_ - Glib::ustring getToolTip (int x, int y); - - void setButtonListener (LWButtonListener* bl) { listener = bl; } - - void redraw (Cairo::RefPtr context); -}; - -#endif +#include + +class LWButton; +class LWButtonListener { + + public: + virtual void buttonPressed (LWButton* button, int actionCode, void* actionData) {} + virtual void redrawNeeded (LWButton* button) {} +}; + +class LWButton { + + public: + enum Alignment {Left, Right, Top, Bottom, Center}; + enum State { Normal, Over, Pressed_In, Pressed_Out}; + + private: + int xpos, ypos, w, h; + Alignment halign, valign; + Cairo::RefPtr icon; + double bgr, bgg, bgb; + double fgr, fgg, fgb; + State state; + LWButtonListener* listener; + int actionCode; + void* actionData; + Glib::ustring toolTip; + + public: + LWButton (Cairo::RefPtr i, int aCode, void* aData, Alignment ha=Left, Alignment va=Center, Glib::ustring tooltip=""); + + void getSize (int& minw, int& minh); + void getAlignment (Alignment& ha, Alignment& va); + void setPosition (int x, int y); + void getPosition (int& x, int& y); + bool inside (int x, int y); + void setIcon (Cairo::RefPtr i); + Cairo::RefPtr getIcon (); + void setColors (const Gdk::Color& bg, const Gdk::Color& fg); + void setToolTip (const Glib::ustring& tooltip); + + bool motionNotify (int x, int y); + bool pressNotify (int x, int y); + bool releaseNotify (int x, int y); + + Glib::ustring getToolTip (int x, int y); + + void setButtonListener (LWButtonListener* bl) { listener = bl; } + + void redraw (Cairo::RefPtr context); +}; + +#endif diff --git a/rtgui/lwbuttonset.cc b/rtgui/lwbuttonset.cc index 1de440231..4e3a89eb5 100644 --- a/rtgui/lwbuttonset.cc +++ b/rtgui/lwbuttonset.cc @@ -1,169 +1,169 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include - -LWButtonSet::LWButtonSet () : aw(0), ah(0) { -} - -LWButtonSet::~LWButtonSet () { - - for (int i=0; igetSize (bw, bh); - w+= bw; - if (bh>h) - h = bh; - } -} - -void LWButtonSet::arrangeButtons (int x, int y, int w, int h) { - - int mw, mh; - getMinimalDimensions (mw, mh); - - if (w<0) - w = mw; - if (h<0) - h = mh; - - int begx = x; - int endx = x+w-1; - for (int i=0; igetSize (bw, bh); - buttons[i]->getAlignment (halign, valign); - if (halign == LWButton::Left) { - bx = begx; - begx += bw; - } - else if (halign == LWButton::Right) { - bx = endx-bw; - endx -= bw; - } - if (valign == LWButton::Top) - by = y; - else if (valign == LWButton::Bottom) - by = y+h-bh-1; - else if (valign == LWButton::Center) - by = y+(h-bh)/2; - buttons[i]->setPosition (bx, by); - } - aw = w; - ah = h; - ax = x; - ay = y; -} - -void LWButtonSet::move (int nx, int ny) { - - for (int i=0; igetPosition (x, y); - buttons[i]->setPosition (x+nx-ax, y+ny-ay); - } - - ax = nx; - ay = ny; -} - -void LWButtonSet::redraw (Cairo::RefPtr context) { - - for (int i=0; iredraw (context); -} - -bool LWButtonSet::motionNotify (int x, int y) { - - bool res = false; - for (int i=0; imotionNotify (x, y); - res = res || handled; - } - - return res; -} - -bool LWButtonSet::pressNotify (int x, int y) { - - bool res = false; - for (int i=0; ipressNotify (x, y); - res = res || handled; - } - return res; -} - -bool LWButtonSet::releaseNotify (int x, int y) { - - bool res = false; - for (int i=0; ireleaseNotify (x, y); - res = res || handled; - } - return res; -} - -bool LWButtonSet::inside (int x, int y) { - - for (int i=0; iinside (x, y)) - return true; - return false; -} - -void LWButtonSet::setButtonListener (LWButtonListener* bl) { - - for (int i=0; isetButtonListener (bl); -} - -void LWButtonSet::getAllocatedDimensions (int& w, int& h) { - - w = aw; - h = ah; -} - -void LWButtonSet::setColors (const Gdk::Color& bg, const Gdk::Color& fg) { - - for (int i=0; isetColors (bg, fg); -} +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include -Glib::ustring LWButtonSet::getToolTip (int x, int y) { - - for (int i=0; igetSize (bw, bh); + w+= bw; + if (bh>h) + h = bh; + } +} + +void LWButtonSet::arrangeButtons (int x, int y, int w, int h) { + + int mw, mh; + getMinimalDimensions (mw, mh); + + if (w<0) + w = mw; + if (h<0) + h = mh; + + int begx = x; + int endx = x+w-1; + for (int i=0; igetSize (bw, bh); + buttons[i]->getAlignment (halign, valign); + if (halign == LWButton::Left) { + bx = begx; + begx += bw; + } + else if (halign == LWButton::Right) { + bx = endx-bw; + endx -= bw; + } + if (valign == LWButton::Top) + by = y; + else if (valign == LWButton::Bottom) + by = y+h-bh-1; + else if (valign == LWButton::Center) + by = y+(h-bh)/2; + buttons[i]->setPosition (bx, by); + } + aw = w; + ah = h; + ax = x; + ay = y; +} + +void LWButtonSet::move (int nx, int ny) { + + for (int i=0; igetPosition (x, y); + buttons[i]->setPosition (x+nx-ax, y+ny-ay); + } + + ax = nx; + ay = ny; +} + +void LWButtonSet::redraw (Cairo::RefPtr context) { + + for (int i=0; iredraw (context); +} + +bool LWButtonSet::motionNotify (int x, int y) { + + bool res = false; + for (int i=0; imotionNotify (x, y); + res = res || handled; + } + + return res; +} + +bool LWButtonSet::pressNotify (int x, int y) { + + bool res = false; + for (int i=0; ipressNotify (x, y); + res = res || handled; + } + return res; +} + +bool LWButtonSet::releaseNotify (int x, int y) { + + bool res = false; + for (int i=0; ireleaseNotify (x, y); + res = res || handled; + } + return res; +} + +bool LWButtonSet::inside (int x, int y) { + + for (int i=0; iinside (x, y)) + return true; + return false; +} + +void LWButtonSet::setButtonListener (LWButtonListener* bl) { + + for (int i=0; isetButtonListener (bl); +} + +void LWButtonSet::getAllocatedDimensions (int& w, int& h) { + + w = aw; + h = ah; +} + +void LWButtonSet::setColors (const Gdk::Color& bg, const Gdk::Color& fg) { + + for (int i=0; isetColors (bg, fg); +} + +Glib::ustring LWButtonSet::getToolTip (int x, int y) { + + for (int i=0; igetToolTip (x, y); if (ttip!="") return ttip; } - return ""; -} + return ""; +} diff --git a/rtgui/lwbuttonset.h b/rtgui/lwbuttonset.h index b8ea55fad..0b17b10c3 100644 --- a/rtgui/lwbuttonset.h +++ b/rtgui/lwbuttonset.h @@ -1,53 +1,53 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _LWBUTTONSET_ -#define _LWBUTTONSET_ - -#include -#include -#include - -class LWButtonSet { - - protected: - std::vector buttons; - int aw, ah, ax, ay; - public: - LWButtonSet (); - ~LWButtonSet (); - - void add (LWButton* b); - - void getMinimalDimensions (int& w, int& h); - void getAllocatedDimensions (int& w, int& h); - void arrangeButtons (int x, int y, int w, int h); - void setColors (const Gdk::Color& bg, const Gdk::Color& fg); - bool motionNotify (int x, int y); - bool pressNotify (int x, int y); - bool releaseNotify (int x, int y); - void move (int nx, int ny); - bool inside (int x, int y); +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _LWBUTTONSET_ +#define _LWBUTTONSET_ - Glib::ustring getToolTip (int x, int y); - - void setButtonListener (LWButtonListener* bl); - void redraw (Cairo::RefPtr context); -}; - -#endif +#include +#include +#include + +class LWButtonSet { + + protected: + std::vector buttons; + int aw, ah, ax, ay; + public: + LWButtonSet (); + ~LWButtonSet (); + + void add (LWButton* b); + + void getMinimalDimensions (int& w, int& h); + void getAllocatedDimensions (int& w, int& h); + void arrangeButtons (int x, int y, int w, int h); + void setColors (const Gdk::Color& bg, const Gdk::Color& fg); + bool motionNotify (int x, int y); + bool pressNotify (int x, int y); + bool releaseNotify (int x, int y); + void move (int nx, int ny); + bool inside (int x, int y); + + Glib::ustring getToolTip (int x, int y); + + void setButtonListener (LWButtonListener* bl); + void redraw (Cairo::RefPtr context); +}; + +#endif diff --git a/rtgui/main.cc b/rtgui/main.cc index c5543d5cd..1c9fb21e1 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -1,113 +1,113 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -// generated 2004/6/3 19:15:32 CEST by gabor@darkstar.(none) -// using glademm V2.5.0 -// -// newer (non customized) versions of this file go to raw.cc_new - -// This file is for your program, I won't touch it again! - -//#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef WIN32 -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +// generated 2004/6/3 19:15:32 CEST by gabor@darkstar.(none) +// using glademm V2.5.0 +// +// newer (non customized) versions of this file go to raw.cc_new + +// This file is for your program, I won't touch it again! + +//#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef WIN32 +#include +#include #endif -#include +#include + +extern Options options; + +//#ifdef WIN32 +//#include // included for WinMain +//#endif + +// stores path to data files +Glib::ustring argv0; +Glib::ustring argv1; + +int main(int argc, char **argv) +{ + + std::string argv0_, argv1_; + +#ifdef WIN32 + char exname[512]; + GetModuleFileName (NULL, exname, 512); + argv0_ = exname; + // get the path where the rawtherapee is stored + int i; + for (i=argv0_.size()-1; (argv0_[i]!='/' && argv0_[i]!='\\') && i>0; i--); + if (argv0_[i]=='/' || argv0_[i]=='\\') + argv0_ = argv0_.substr(0,i); +#else + // get the path to data (defined in config.h which is generated by cmake) + argv0_ = DATA_SEARCH_PATH; + // check if path exists, otherwise revert back to behavior similar to windows + try { + Glib::Dir dir(DATA_SEARCH_PATH); + } catch (Glib::FileError) { + argv0_ = argv[0]; + int i; + for (i=argv0_.size()-1; (argv0_[i]!='/' && argv0_[i]!='\\') && i>0; i--); + if (argv0_[i]=='/' || argv0_[i]=='\\') + argv0_ = argv0_.substr(0,i); + } +#endif + + + if (argc>1) + argv1_ = argv[1]; + else + argv1_ = ""; + + argv0 = safe_locale_to_utf8 (argv0_); + argv1 = safe_locale_to_utf8 (argv1_); + + Glib::thread_init(); + gdk_threads_init(); + Gio::init (); + + Options::load (); + +// Gtk::RC::add_default_file (argv0+"/themes/"+options.theme); + std::vector rcfiles; + rcfiles.push_back (argv0+"/themes/"+options.theme); + Gtk::RC::set_default_files (rcfiles); + + Gtk::Main m(&argc, &argv); +// MainWindow *MainWindow = new class MainWindow(); + RTWindow *rtWindow = new class RTWindow(); + gdk_threads_enter (); + m.run(*rtWindow); + gdk_threads_leave (); + delete rtWindow; + return 0; +} + + + -extern Options options; - -//#ifdef WIN32 -//#include // included for WinMain -//#endif - -// stores path to data files -Glib::ustring argv0; -Glib::ustring argv1; - -int main(int argc, char **argv) -{ - - std::string argv0_, argv1_; - -#ifdef WIN32 - char exname[512]; - GetModuleFileName (NULL, exname, 512); - argv0_ = exname; - // get the path where the rawtherapee is stored - int i; - for (i=argv0_.size()-1; (argv0_[i]!='/' && argv0_[i]!='\\') && i>0; i--); - if (argv0_[i]=='/' || argv0_[i]=='\\') - argv0_ = argv0_.substr(0,i); -#else - // get the path to data (defined in config.h which is generated by cmake) - argv0_ = DATA_SEARCH_PATH; - // check if path exists, otherwise revert back to behavior similar to windows - try { - Glib::Dir dir(DATA_SEARCH_PATH); - } catch (Glib::FileError) { - argv0_ = argv[0]; - int i; - for (i=argv0_.size()-1; (argv0_[i]!='/' && argv0_[i]!='\\') && i>0; i--); - if (argv0_[i]=='/' || argv0_[i]=='\\') - argv0_ = argv0_.substr(0,i); - } -#endif - - - if (argc>1) - argv1_ = argv[1]; - else - argv1_ = ""; - - argv0 = safe_locale_to_utf8 (argv0_); - argv1 = safe_locale_to_utf8 (argv1_); - - Glib::thread_init(); - gdk_threads_init(); - Gio::init (); - - Options::load (); - -// Gtk::RC::add_default_file (argv0+"/themes/"+options.theme); - std::vector rcfiles; - rcfiles.push_back (argv0+"/themes/"+options.theme); - Gtk::RC::set_default_files (rcfiles); - - Gtk::Main m(&argc, &argv); -// MainWindow *MainWindow = new class MainWindow(); - RTWindow *rtWindow = new class RTWindow(); - gdk_threads_enter (); - m.run(*rtWindow); - gdk_threads_leave (); - delete rtWindow; - return 0; -} - - - - diff --git a/rtgui/mountselectionlistener.h b/rtgui/mountselectionlistener.h index c1986414d..169d57108 100644 --- a/rtgui/mountselectionlistener.h +++ b/rtgui/mountselectionlistener.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _MOUNTSELECTIONLISTENER_ #define _MOUNTSELECTIONLISTENER_ diff --git a/rtgui/multilangmgr.cc b/rtgui/multilangmgr.cc index 592f6e40d..bbdf17ead 100644 --- a/rtgui/multilangmgr.cc +++ b/rtgui/multilangmgr.cc @@ -1,55 +1,55 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include #include #include -#include - -MultiLangMgr langMgr; - -Glib::ustring M (std::string key) { return langMgr.getStr (key); } - -bool MultiLangMgr::load (Glib::ustring fname, MultiLangMgr* fb) { - - fallBack = fb; - - FILE *f = g_fopen (fname.c_str(), "rt"); +#include - if (f==NULL) - return false; - - transTable.clear (); - - char* buffer = new char[2048]; - - while (buffer = fgets (buffer, 2048, f)) { - // find separator - int seppos = 0; - while (buffer[seppos]!=0 && buffer[seppos]!=';') - seppos++; - // no separator found - if (buffer[seppos]==0) - continue; - // cut the last \n and \r characters - int endpos = strlen(buffer)-1; - while (buffer[endpos]=='\n' || buffer[endpos]=='\r') - endpos--; +MultiLangMgr langMgr; + +Glib::ustring M (std::string key) { return langMgr.getStr (key); } + +bool MultiLangMgr::load (Glib::ustring fname, MultiLangMgr* fb) { + + fallBack = fb; + + FILE *f = g_fopen (fname.c_str(), "rt"); + + if (f==NULL) + return false; + + transTable.clear (); + + char* buffer = new char[2048]; + + while (buffer = fgets (buffer, 2048, f)) { + // find separator + int seppos = 0; + while (buffer[seppos]!=0 && buffer[seppos]!=';') + seppos++; + // no separator found + if (buffer[seppos]==0) + continue; + // cut the last \n and \r characters + int endpos = strlen(buffer)-1; + while (buffer[endpos]=='\n' || buffer[endpos]=='\r') + endpos--; buffer[endpos+1] = 0; // replace "\n" to '\n' int j = 0; @@ -61,38 +61,38 @@ bool MultiLangMgr::load (Glib::ustring fname, MultiLangMgr* fb) { else buffer[j++] = buffer[i]; buffer[j] = 0; - // cut to two parts - buffer[seppos] = 0; - transTable[buffer] = buffer + seppos + 1; - } - - fclose (f); - delete [] buffer; - return true; -} - -bool MultiLangMgr::save (Glib::ustring fname) { - - FILE *f = g_fopen (fname.c_str(), "wt"); - - if (f==NULL) - return false; - - std::map::iterator r; - for (r=transTable.begin (); r!=transTable.end(); r++) - fprintf (f, "%s;%s\n", r->first.c_str(), safe_locale_from_utf8(r->second).c_str()); - - fclose (f); - return true; -} - -Glib::ustring MultiLangMgr::getStr (std::string key) { - - std::map::iterator r = transTable.find (key); - if (r!=transTable.end()) - return r->second; - else if (fallBack) - return fallBack->getStr (key); - else - return ""; + // cut to two parts + buffer[seppos] = 0; + transTable[buffer] = buffer + seppos + 1; + } + + fclose (f); + delete [] buffer; + return true; +} + +bool MultiLangMgr::save (Glib::ustring fname) { + + FILE *f = g_fopen (fname.c_str(), "wt"); + + if (f==NULL) + return false; + + std::map::iterator r; + for (r=transTable.begin (); r!=transTable.end(); r++) + fprintf (f, "%s;%s\n", r->first.c_str(), safe_locale_from_utf8(r->second).c_str()); + + fclose (f); + return true; +} + +Glib::ustring MultiLangMgr::getStr (std::string key) { + + std::map::iterator r = transTable.find (key); + if (r!=transTable.end()) + return r->second; + else if (fallBack) + return fallBack->getStr (key); + else + return ""; } diff --git a/rtgui/multilangmgr.h b/rtgui/multilangmgr.h index e22d7fa96..239684a63 100644 --- a/rtgui/multilangmgr.h +++ b/rtgui/multilangmgr.h @@ -1,45 +1,45 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _MULTILANGMGR_ -#define _MULTILANGMGR_ - -#include -#include -#include - -class MultiLangMgr { - - std::map transTable; - MultiLangMgr* fallBack; - - public: - MultiLangMgr () : fallBack (NULL) {} - MultiLangMgr (Glib::ustring fname) : fallBack (NULL) { load (fname); } - - bool load (Glib::ustring fname, MultiLangMgr* fb = NULL); - bool save (Glib::ustring fname); - - Glib::ustring getStr (std::string key); -}; - -extern MultiLangMgr langMgr; - -Glib::ustring M (std::string key); - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _MULTILANGMGR_ +#define _MULTILANGMGR_ + +#include +#include +#include + +class MultiLangMgr { + + std::map transTable; + MultiLangMgr* fallBack; + + public: + MultiLangMgr () : fallBack (NULL) {} + MultiLangMgr (Glib::ustring fname) : fallBack (NULL) { load (fname); } + + bool load (Glib::ustring fname, MultiLangMgr* fb = NULL); + bool save (Glib::ustring fname); + + Glib::ustring getStr (std::string key); +}; + +extern MultiLangMgr langMgr; + +Glib::ustring M (std::string key); + +#endif diff --git a/rtgui/mycurve.cc b/rtgui/mycurve.cc index 9460be070..eb1c78642 100644 --- a/rtgui/mycurve.cc +++ b/rtgui/mycurve.cc @@ -1,24 +1,24 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include -#include -#include +#include +#include #define RADIUS 3 /* radius of the control points */ #define MIN_DISTANCE 8 /* min distance between control points */ diff --git a/rtgui/mycurve.h b/rtgui/mycurve.h index 168c70ec3..f9af30825 100644 --- a/rtgui/mycurve.h +++ b/rtgui/mycurve.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _MYCURVE_ #define _MYCURVE_ diff --git a/rtgui/navigator.cc b/rtgui/navigator.cc index cf4306985..6e59e703f 100644 --- a/rtgui/navigator.cc +++ b/rtgui/navigator.cc @@ -1,115 +1,115 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include - -Navigator::Navigator () { - - set_label (M("MAIN_MSG_NAVIGATOR")); - Gtk::VBox* mbox = Gtk::manage (new Gtk::VBox ()); - previewWindow = Gtk::manage (new PreviewWindow ()); - mbox->pack_start (*previewWindow, Gtk::PACK_SHRINK, 2); - position = Gtk::manage (new Gtk::Label ()); - mbox->pack_start (*position, Gtk::PACK_SHRINK, 2); - - R = Gtk::manage (new Gtk::Label ()); - G = Gtk::manage (new Gtk::Label ()); - B = Gtk::manage (new Gtk::Label ()); - H = Gtk::manage (new Gtk::Label ()); - S = Gtk::manage (new Gtk::Label ()); - V = Gtk::manage (new Gtk::Label ()); - - Gtk::Table* table = new Gtk::Table (3, 2); - table->attach (*R, 0, 1, 0, 1, Gtk::EXPAND, Gtk::SHRINK, 0, 0); - table->attach (*G, 0, 1, 1, 2, Gtk::EXPAND, Gtk::SHRINK, 0, 0); - table->attach (*B, 0, 1, 2, 3, Gtk::EXPAND, Gtk::SHRINK, 0, 0); - table->attach (*H, 1, 2, 0, 1, Gtk::EXPAND, Gtk::SHRINK, 0, 0); - table->attach (*S, 1, 2, 1, 2, Gtk::EXPAND, Gtk::SHRINK, 0, 0); - table->attach (*V, 1, 2, 2, 3, Gtk::EXPAND, Gtk::SHRINK, 0, 0); - - mbox->pack_start (*table, Gtk::PACK_SHRINK, 2); - - add (*mbox); - - setInvalid (); - show_all (); -} - -void Navigator::setInvalid () { - - position->set_text ("x = n/a, y = n/a"); - R->set_text (M("NAVIGATOR_R_NA")); - G->set_text (M("NAVIGATOR_G_NA")); - B->set_text (M("NAVIGATOR_B_NA")); - H->set_text (M("NAVIGATOR_H_NA")); - S->set_text (M("NAVIGATOR_S_NA")); - V->set_text (M("NAVIGATOR_V_NA")); -} - -void Navigator::pointerMoved (bool validPos, int x, int y, int r, int g, int b) { - - if (!validPos) - setInvalid (); - else { - position->set_text (Glib::ustring::compose ("x = %1, y = %2", x, y)); - R->set_text (Glib::ustring::compose (M("NAVIGATOR_R_VALUE"), r)); - G->set_text (Glib::ustring::compose (M("NAVIGATOR_G_VALUE"), g)); - B->set_text (Glib::ustring::compose (M("NAVIGATOR_B_VALUE"), b)); - int h, s, v; - rgb2hsv (r, g, b, h, s, v); - H->set_text (Glib::ustring::compose (M("NAVIGATOR_H_VALUE"), h)); - S->set_text (Glib::ustring::compose (M("NAVIGATOR_S_VALUE"), s)); - V->set_text (Glib::ustring::compose (M("NAVIGATOR_V_VALUE"), v)); - } -} - -void Navigator::rgb2hsv (int r, int g, int b, int &h, int &s, int &v) { - - volatile double var_R = r / 255.0; - volatile double var_G = g / 255.0; - volatile double var_B = b / 255.0; - - volatile double var_Min = MIN(MIN(var_R,var_G),var_B); - volatile double var_Max = MAX(MAX(var_R,var_G),var_B); - double del_Max = var_Max - var_Min; - double V = (var_Max + var_Min) / 2; - double H, S; - if (fabs(del_Max)<0.0000001) { - H = 0; - S = 0; - } - else { - if (V < 0.5) S = del_Max / (var_Max + var_Min); - else S = del_Max / (2 - var_Max - var_Min); - - double del_R = ( ( ( var_Max - var_R ) / 6.0 ) + ( del_Max / 2.0 ) ) / del_Max; - double del_G = ( ( ( var_Max - var_G ) / 6.0 ) + ( del_Max / 2.0 ) ) / del_Max; - double del_B = ( ( ( var_Max - var_B ) / 6.0 ) + ( del_Max / 2.0 ) ) / del_Max; - if ( var_R == var_Max ) H = del_B - del_G; - else if ( var_G == var_Max ) H = (1.0 / 3.0) + del_R - del_B; - else if ( var_B == var_Max ) H = (2.0 / 3.0) + del_G - del_R; - - if ( H < 0 ) H += 1; - if ( H > 1 ) H -= 1; - } - - h = (int)(H*255.0); - s = (int)(S*255.0); - v = (int)(V*255.0); -} +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include + +Navigator::Navigator () { + + set_label (M("MAIN_MSG_NAVIGATOR")); + Gtk::VBox* mbox = Gtk::manage (new Gtk::VBox ()); + previewWindow = Gtk::manage (new PreviewWindow ()); + mbox->pack_start (*previewWindow, Gtk::PACK_SHRINK, 2); + position = Gtk::manage (new Gtk::Label ()); + mbox->pack_start (*position, Gtk::PACK_SHRINK, 2); + + R = Gtk::manage (new Gtk::Label ()); + G = Gtk::manage (new Gtk::Label ()); + B = Gtk::manage (new Gtk::Label ()); + H = Gtk::manage (new Gtk::Label ()); + S = Gtk::manage (new Gtk::Label ()); + V = Gtk::manage (new Gtk::Label ()); + + Gtk::Table* table = new Gtk::Table (3, 2); + table->attach (*R, 0, 1, 0, 1, Gtk::EXPAND, Gtk::SHRINK, 0, 0); + table->attach (*G, 0, 1, 1, 2, Gtk::EXPAND, Gtk::SHRINK, 0, 0); + table->attach (*B, 0, 1, 2, 3, Gtk::EXPAND, Gtk::SHRINK, 0, 0); + table->attach (*H, 1, 2, 0, 1, Gtk::EXPAND, Gtk::SHRINK, 0, 0); + table->attach (*S, 1, 2, 1, 2, Gtk::EXPAND, Gtk::SHRINK, 0, 0); + table->attach (*V, 1, 2, 2, 3, Gtk::EXPAND, Gtk::SHRINK, 0, 0); + + mbox->pack_start (*table, Gtk::PACK_SHRINK, 2); + + add (*mbox); + + setInvalid (); + show_all (); +} + +void Navigator::setInvalid () { + + position->set_text ("x = n/a, y = n/a"); + R->set_text (M("NAVIGATOR_R_NA")); + G->set_text (M("NAVIGATOR_G_NA")); + B->set_text (M("NAVIGATOR_B_NA")); + H->set_text (M("NAVIGATOR_H_NA")); + S->set_text (M("NAVIGATOR_S_NA")); + V->set_text (M("NAVIGATOR_V_NA")); +} + +void Navigator::pointerMoved (bool validPos, int x, int y, int r, int g, int b) { + + if (!validPos) + setInvalid (); + else { + position->set_text (Glib::ustring::compose ("x = %1, y = %2", x, y)); + R->set_text (Glib::ustring::compose (M("NAVIGATOR_R_VALUE"), r)); + G->set_text (Glib::ustring::compose (M("NAVIGATOR_G_VALUE"), g)); + B->set_text (Glib::ustring::compose (M("NAVIGATOR_B_VALUE"), b)); + int h, s, v; + rgb2hsv (r, g, b, h, s, v); + H->set_text (Glib::ustring::compose (M("NAVIGATOR_H_VALUE"), h)); + S->set_text (Glib::ustring::compose (M("NAVIGATOR_S_VALUE"), s)); + V->set_text (Glib::ustring::compose (M("NAVIGATOR_V_VALUE"), v)); + } +} + +void Navigator::rgb2hsv (int r, int g, int b, int &h, int &s, int &v) { + + volatile double var_R = r / 255.0; + volatile double var_G = g / 255.0; + volatile double var_B = b / 255.0; + + volatile double var_Min = MIN(MIN(var_R,var_G),var_B); + volatile double var_Max = MAX(MAX(var_R,var_G),var_B); + double del_Max = var_Max - var_Min; + double V = (var_Max + var_Min) / 2; + double H, S; + if (fabs(del_Max)<0.0000001) { + H = 0; + S = 0; + } + else { + if (V < 0.5) S = del_Max / (var_Max + var_Min); + else S = del_Max / (2 - var_Max - var_Min); + + double del_R = ( ( ( var_Max - var_R ) / 6.0 ) + ( del_Max / 2.0 ) ) / del_Max; + double del_G = ( ( ( var_Max - var_G ) / 6.0 ) + ( del_Max / 2.0 ) ) / del_Max; + double del_B = ( ( ( var_Max - var_B ) / 6.0 ) + ( del_Max / 2.0 ) ) / del_Max; + if ( var_R == var_Max ) H = del_B - del_G; + else if ( var_G == var_Max ) H = (1.0 / 3.0) + del_R - del_B; + else if ( var_B == var_Max ) H = (2.0 / 3.0) + del_G - del_R; + + if ( H < 0 ) H += 1; + if ( H > 1 ) H -= 1; + } + + h = (int)(H*255.0); + s = (int)(S*255.0); + v = (int)(V*255.0); +} diff --git a/rtgui/navigator.h b/rtgui/navigator.h index 4e67770bc..27220ada2 100644 --- a/rtgui/navigator.h +++ b/rtgui/navigator.h @@ -1,45 +1,45 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _NAVIGATOR_ -#define _NAVIGATOR_ - -#include -#include -#include - -class Navigator : public Gtk::Frame, public PointerMotionListener { - - protected: - Gtk::Label* position; - Gtk::Label *R, *G, *B; - Gtk::Label *H, *S, *V; - - void rgb2hsv (int r, int g, int b, int &h, int &s, int &v); - void setInvalid (); - public: - PreviewWindow* previewWindow; - - Navigator (); - - // pointermotionlistener interface - void pointerMoved (bool validPos, int x, int y, int r, int g, int b); - -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _NAVIGATOR_ +#define _NAVIGATOR_ + +#include +#include +#include + +class Navigator : public Gtk::Frame, public PointerMotionListener { + + protected: + Gtk::Label* position; + Gtk::Label *R, *G, *B; + Gtk::Label *H, *S, *V; + + void rgb2hsv (int r, int g, int b, int &h, int &s, int &v); + void setInvalid (); + public: + PreviewWindow* previewWindow; + + Navigator (); + + // pointermotionlistener interface + void pointerMoved (bool validPos, int x, int y, int r, int g, int b); + +}; + +#endif diff --git a/rtgui/options.cc b/rtgui/options.cc index 001d5369a..86105534d 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -1,441 +1,441 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include -#include -#include -#include -#include -#include - -Options options; -Glib::ustring versionString = "v3.0 alpha 1"; - -Options::Options () { - - setDefaults (); -} - -const char *DefaultLanguage = "English (US)"; - -void Options::setDefaults () { - - windowWidth = 1000; - windowHeight = 600; - firstRun = true; - savesParamsAtExit = true; - saveFormat.format = "jpg"; - saveFormat.jpegQuality = 100; - saveFormat.pngCompression = 6; - saveFormat.pngBits = 8; - saveFormat.tiffBits = 8; - saveFormat.tiffUncompressed = true; - saveFormat.saveParams = false; - savePathTemplate = "\%p1/converted/\%f"; - savePathFolder = ""; - saveUsePathTemplate = true; - defProfRaw = "default"; - defProfImg = "neutral"; - dateFormat = "%y-%m-%d"; - startupDir = 1; - startupPath = ""; - profilePath = "profiles"; - dirBrowserWidth = 200; - dirBrowserHeight = 150; - toolPanelWidth = 250; - browserToolPanelWidth = 250; - historyPanelWidth = 150; - lastScale = 4; - lastCropSize = 1; - fbOnlyRaw = false; - fbShowDateTime = true; - fbShowBasicExif = true; - fbShowHidden = false; - fbArrangement = 0; - multiUser = false; - version = 290; - thumbSize = 80; - showHistory = true; - showFilePanelState = 0; - showInfo = false; - cropDPI = 300; - showClippedHighlights = false; - showClippedShadows = false; - highlightThreshold = 254; - shadowThreshold = 0; - bgcolor = 0; - blinkClipped = true; - language = DefaultLanguage; - lastSaveAsPath = ""; - theme = ""; - maxThumbnailHeight = 400; - maxCacheEntries = 10000; - thumbnailFormat = FT_Custom16; - thumbInterp = 1; - saveParamsFile = false; - saveParamsCache = true; - paramsLoadLocation = PLL_Cache; - procQueueEnabled = true; - gimpDir = "C:\\Program Files\\GIMP-2.0"; - psDir = "C:\\Program Files\\Adobe\\Adobe Photoshop CS3"; - customEditorProg = "start"; - editorToSendTo = 1; - liveThumbnails = true; - tpOpen.clear (); - crvOpen.clear (); - parseExtensions.clear (); - parseExtensionsEnabled.clear (); - renameUseTemplates = false; - renameTemplates.clear (); - thumbnailZoomRatios.clear (); - thumbnailZoomRatios.push_back (0.2); - thumbnailZoomRatios.push_back (0.3); - thumbnailZoomRatios.push_back (0.45); - thumbnailZoomRatios.push_back (0.6); - thumbnailZoomRatios.push_back (0.8); - thumbnailZoomRatios.push_back (1.0); - overlayedFileNames = true; +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include +#include +#include +#include +#include +#include + +Options options; +Glib::ustring versionString = "v3.0 alpha 1"; + +Options::Options () { + + setDefaults (); +} + +const char *DefaultLanguage = "English (US)"; + +void Options::setDefaults () { + + windowWidth = 1000; + windowHeight = 600; + firstRun = true; + savesParamsAtExit = true; + saveFormat.format = "jpg"; + saveFormat.jpegQuality = 100; + saveFormat.pngCompression = 6; + saveFormat.pngBits = 8; + saveFormat.tiffBits = 8; + saveFormat.tiffUncompressed = true; + saveFormat.saveParams = false; + savePathTemplate = "\%p1/converted/\%f"; + savePathFolder = ""; + saveUsePathTemplate = true; + defProfRaw = "default"; + defProfImg = "neutral"; + dateFormat = "%y-%m-%d"; + startupDir = 1; + startupPath = ""; + profilePath = "profiles"; + dirBrowserWidth = 200; + dirBrowserHeight = 150; + toolPanelWidth = 250; + browserToolPanelWidth = 250; + historyPanelWidth = 150; + lastScale = 4; + lastCropSize = 1; + fbOnlyRaw = false; + fbShowDateTime = true; + fbShowBasicExif = true; + fbShowHidden = false; + fbArrangement = 0; + multiUser = false; + version = 290; + thumbSize = 80; + showHistory = true; + showFilePanelState = 0; + showInfo = false; + cropDPI = 300; + showClippedHighlights = false; + showClippedShadows = false; + highlightThreshold = 254; + shadowThreshold = 0; + bgcolor = 0; + blinkClipped = true; + language = DefaultLanguage; + lastSaveAsPath = ""; + theme = ""; + maxThumbnailHeight = 400; + maxCacheEntries = 10000; + thumbnailFormat = FT_Custom16; + thumbInterp = 1; + saveParamsFile = false; + saveParamsCache = true; + paramsLoadLocation = PLL_Cache; + procQueueEnabled = true; + gimpDir = "C:\\Program Files\\GIMP-2.0"; + psDir = "C:\\Program Files\\Adobe\\Adobe Photoshop CS3"; + customEditorProg = "start"; + editorToSendTo = 1; + liveThumbnails = true; + tpOpen.clear (); + crvOpen.clear (); + parseExtensions.clear (); + parseExtensionsEnabled.clear (); + renameUseTemplates = false; + renameTemplates.clear (); + thumbnailZoomRatios.clear (); + thumbnailZoomRatios.push_back (0.2); + thumbnailZoomRatios.push_back (0.3); + thumbnailZoomRatios.push_back (0.45); + thumbnailZoomRatios.push_back (0.6); + thumbnailZoomRatios.push_back (0.8); + thumbnailZoomRatios.push_back (1.0); + overlayedFileNames = true; showFileNames = true; - - int babehav[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0}; - baBehav = std::vector (babehav, babehav+ADDSET_PARAM_NUM); - - rtSettings.dualThreadEnabled = true; - rtSettings.demosaicMethod = "eahd"; - rtSettings.colorCorrectionSteps = 2; - rtSettings.dcb_iterations = 2; - rtSettings.dcb_enhance = true; - rtSettings.iccDirectory = "/usr/share/color/icc"; - rtSettings.colorimetricIntent = 1; - rtSettings.monitorProfile = ""; - rtSettings.verbose = false; -} - -Options* Options::copyFrom (Options* other) { - - *this = *other; - return this; -} - -int Options::readFromFile (Glib::ustring fname) { - - rtengine::SafeKeyFile keyFile; - - try { - if (!keyFile.load_from_file (fname)) - return 1; - } - catch (Glib::FileError) { - return 1; - } - - setDefaults (); - -if (keyFile.has_group ("General")) { - Glib::ustring stup; - if (keyFile.has_key ("General", "StartupDirectory") && keyFile.get_string ("General", "StartupDirectory") == "home") - startupDir = STARTUPDIR_HOME; - else if (keyFile.has_key ("General", "StartupDirectory") && keyFile.get_string ("General", "StartupDirectory") == "current") - startupDir = STARTUPDIR_CURRENT; - else if (keyFile.has_key ("General", "StartupDirectory") && keyFile.get_string ("General", "StartupDirectory") == "last") - startupDir = STARTUPDIR_LAST; - else - startupDir = STARTUPDIR_CUSTOM; - - if (keyFile.has_key ("General", "StartupPath")) startupPath = keyFile.get_string ("General", "StartupPath"); - if (keyFile.has_key ("General", "DateFormat")) dateFormat = keyFile.get_string ("General", "DateFormat"); - if (keyFile.has_key ("General", "AdjusterDelay")) Adjuster::delay = keyFile.get_integer ("General", "AdjusterDelay"); - if (keyFile.has_key ("General", "StoreLastProfile")) savesParamsAtExit = keyFile.get_boolean ("General", "StoreLastProfile"); - if (keyFile.has_key ("General", "DualProcSupport")) rtSettings.dualThreadEnabled = keyFile.get_boolean ("General", "DualProcSupport"); - if (keyFile.has_key ("General", "MultiUser")) multiUser = keyFile.get_boolean ("General", "MultiUser"); -// if (keyFile.has_key ("General", "Version")) version = keyFile.get_integer ("General", "Version"); - if (keyFile.has_key ("General", "Language")) language = keyFile.get_string ("General", "Language"); - if (keyFile.has_key ("General", "Theme")) theme = keyFile.get_string ("General", "Theme"); - if (keyFile.has_key ("General", "FirstRun")) firstRun = keyFile.get_boolean ("General", "FirstRun"); -} - -if (keyFile.has_group ("External Editor")) { - if (keyFile.has_key ("External Editor", "EditorKind")) editorToSendTo = keyFile.get_integer ("External Editor", "EditorKind"); - if (keyFile.has_key ("External Editor", "GimpDir")) gimpDir = keyFile.get_string ("External Editor", "GimpDir"); - if (keyFile.has_key ("External Editor", "PhotoshopDir")) psDir = keyFile.get_string ("External Editor", "PhotoshopDir"); - if (keyFile.has_key ("External Editor", "CustomEditor")) customEditorProg = keyFile.get_string ("External Editor", "CustomEditor"); -} - -if (keyFile.has_group ("Output")) { - if (keyFile.has_key ("Output", "Format")) saveFormat.format = keyFile.get_string ("Output", "Format"); - if (keyFile.has_key ("Output", "JpegQuality")) saveFormat.jpegQuality = keyFile.get_integer ("Output", "JpegQuality"); - if (keyFile.has_key ("Output", "PngCompression")) saveFormat.pngCompression = keyFile.get_integer ("Output", "PngCompression"); - if (keyFile.has_key ("Output", "PngBps")) saveFormat.pngBits = keyFile.get_integer ("Output", "PngBps"); - if (keyFile.has_key ("Output", "TiffBps")) saveFormat.tiffBits = keyFile.get_integer ("Output", "TiffBps"); - if (keyFile.has_key ("Output", "SaveProcParams")) saveFormat.saveParams = keyFile.get_boolean ("Output", "SaveProcParams"); - if (keyFile.has_key ("Output", "Path")) savePathTemplate = keyFile.get_string ("Output", "Path"); - if (keyFile.has_key ("Output", "PathTemplate")) savePathTemplate = keyFile.get_string ("Output", "PathTemplate"); - if (keyFile.has_key ("Output", "PathFolder")) savePathFolder = keyFile.get_string ("Output", "PathFolder"); - if (keyFile.has_key ("Output", "UsePathTemplate")) saveUsePathTemplate = keyFile.get_boolean("Output", "UsePathTemplate"); - if (keyFile.has_key ("Output", "LastSaveAsPath")) lastSaveAsPath = keyFile.get_string ("Output", "LastSaveAsPath"); -} - -if (keyFile.has_group ("Profiles")) { - if (keyFile.has_key ("Profiles", "Directory")) profilePath = keyFile.get_string ("Profiles", "Directory"); - if (keyFile.has_key ("Profiles", "RawDefault")) defProfRaw = keyFile.get_string ("Profiles", "RawDefault"); - if (keyFile.has_key ("Profiles", "ImgDefault")) defProfImg = keyFile.get_string ("Profiles", "ImgDefault"); - if (keyFile.has_key ("Profiles", "SaveParamsWithFile")) saveParamsFile = keyFile.get_boolean ("Profiles", "SaveParamsWithFile"); - if (keyFile.has_key ("Profiles", "SaveParamsToCache")) saveParamsCache = keyFile.get_boolean ("Profiles", "SaveParamsToCache"); - if (keyFile.has_key ("Profiles", "LoadParamsFromLocation")) paramsLoadLocation = (PPLoadLocation)keyFile.get_integer ("Profiles", "LoadParamsFromLocation"); -} - -if (keyFile.has_group ("File Browser")) { - if (keyFile.has_key ("File Browser", "ThumbnailSize")) thumbSize = keyFile.get_integer ("File Browser", "ThumbnailSize"); - if (keyFile.has_key ("File Browser", "BrowseOnlyRaw")) fbOnlyRaw = keyFile.get_boolean ("File Browser", "BrowseOnlyRaw"); - if (keyFile.has_key ("File Browser", "BrowserShowsDate")) fbShowDateTime = keyFile.get_boolean ("File Browser", "BrowserShowsDate"); - if (keyFile.has_key ("File Browser", "BrowserShowsExif")) fbShowBasicExif = keyFile.get_boolean ("File Browser", "BrowserShowsExif"); - if (keyFile.has_key ("File Browser", "BrowserShowsHidden")) fbShowHidden = keyFile.get_boolean ("File Browser", "BrowserShowsHidden"); - if (keyFile.has_key ("File Browser", "MaxPreviewHeight")) maxThumbnailHeight = keyFile.get_integer ("File Browser", "MaxPreviewHeight"); - if (keyFile.has_key ("File Browser", "MaxCacheEntries")) maxCacheEntries = keyFile.get_integer ("File Browser", "MaxCacheEntries"); - if (keyFile.has_key ("File Browser", "ThumbnailFormat")) thumbnailFormat = (ThFileType)keyFile.get_integer ("File Browser", "ThumbnailFormat"); - if (keyFile.has_key ("File Browser", "ParseExtensions")) parseExtensions = keyFile.get_string_list ("File Browser", "ParseExtensions"); - if (keyFile.has_key ("File Browser", "ParseExtensionsEnabled")) parseExtensionsEnabled = keyFile.get_integer_list ("File Browser", "ParseExtensionsEnabled"); - if (keyFile.has_key ("File Browser", "ThumbnailArrangement")) fbArrangement = keyFile.get_integer ("File Browser", "ThumbnailArrangement"); - if (keyFile.has_key ("File Browser", "ThumbnailInterpolation")) thumbInterp = keyFile.get_integer ("File Browser", "ThumbnailInterpolation"); - if (keyFile.has_key ("File Browser", "LiveThumbnails")) liveThumbnails = keyFile.get_boolean ("File Browser", "LiveThumbnails"); - if (keyFile.has_key ("File Browser", "FavoriteDirs")) favoriteDirs = keyFile.get_string_list ("File Browser", "FavoriteDirs"); - if (keyFile.has_key ("File Browser", "RenameTemplates")) renameTemplates = keyFile.get_string_list ("File Browser", "RenameTemplates"); - if (keyFile.has_key ("File Browser", "RenameUseTemplates")) renameUseTemplates = keyFile.get_boolean ("File Browser", "RenameUseTemplates"); - if (keyFile.has_key ("File Browser", "ThumbnailZoomRatios"))thumbnailZoomRatios= keyFile.get_double_list ("File Browser", "ThumbnailZoomRatios"); - if (keyFile.has_key ("File Browser", "OverlayedFileNames")) overlayedFileNames = keyFile.get_boolean ("File Browser", "OverlayedFileNames"); - if (keyFile.has_key ("File Browser", "ShowFileNames")) showFileNames = keyFile.get_boolean ("File Browser", "ShowFileNames"); -} - -if (keyFile.has_group ("Clipping Indication")) { - if (keyFile.has_key ("Clipping Indication", "HighlightThreshold")) highlightThreshold= keyFile.get_integer ("Clipping Indication", "HighlightThreshold"); - if (keyFile.has_key ("Clipping Indication", "ShadowThreshold")) shadowThreshold = keyFile.get_integer ("Clipping Indication", "ShadowThreshold"); - if (keyFile.has_key ("Clipping Indication", "BlinkClipped")) blinkClipped = keyFile.get_boolean ("Clipping Indication", "BlinkClipped"); -} - -if (keyFile.has_group ("GUI")) { - if (keyFile.has_key ("GUI", "WindowWidth")) windowWidth = keyFile.get_integer ("GUI", "WindowWidth"); - if (keyFile.has_key ("GUI", "WindowHeight")) windowHeight = keyFile.get_integer ("GUI", "WindowHeight"); - if (keyFile.has_key ("GUI", "DirBrowserWidth")) dirBrowserWidth = keyFile.get_integer ("GUI", "DirBrowserWidth"); - if (keyFile.has_key ("GUI", "DirBrowserHeight")) dirBrowserHeight = keyFile.get_integer ("GUI", "DirBrowserHeight"); - if (keyFile.has_key ("GUI", "ToolPanelWidth")) toolPanelWidth = keyFile.get_integer ("GUI", "ToolPanelWidth"); - if (keyFile.has_key ("GUI", "BrowserToolPanelWidth"))browserToolPanelWidth = keyFile.get_integer ("GUI", "BrowserToolPanelWidth"); - if (keyFile.has_key ("GUI", "HistoryPanelWidth")) historyPanelWidth = keyFile.get_integer ("GUI", "HistoryPanelWidth"); - if (keyFile.has_key ("GUI", "LastPreviewScale")) lastScale = keyFile.get_integer ("GUI", "LastPreviewScale"); - if (keyFile.has_key ("GUI", "LastCropSize")) lastCropSize = keyFile.get_integer ("GUI", "LastCropSize"); - if (keyFile.has_key ("GUI", "ShowHistory")) showHistory = keyFile.get_boolean ("GUI", "ShowHistory"); - if (keyFile.has_key ("GUI", "ShowFilePanelState")) showFilePanelState= keyFile.get_integer ("GUI", "ShowFilePanelState"); - if (keyFile.has_key ("GUI", "ShowInfo")) showInfo = keyFile.get_boolean ("GUI", "ShowInfo"); - if (keyFile.has_key ("GUI", "ShowClippedHighlights"))showClippedHighlights = keyFile.get_boolean ("GUI", "ShowClippedHighlights"); - if (keyFile.has_key ("GUI", "ShowClippedShadows")) showClippedShadows= keyFile.get_boolean ("GUI", "ShowClippedShadows"); - if (keyFile.has_key ("GUI", "FrameColor")) bgcolor = keyFile.get_integer ("GUI", "FrameColor"); - if (keyFile.has_key ("GUI", "ProcessingQueueEnbled"))procQueueEnabled = keyFile.get_boolean ("GUI", "ProcessingQueueEnbled"); - if (keyFile.has_key ("GUI", "ToolPanelsExpanded")) tpOpen = keyFile.get_integer_list ("GUI", "ToolPanelsExpanded"); - if (keyFile.has_key ("GUI", "CurvePanelsExpanded")) crvOpen = keyFile.get_integer_list ("GUI", "CurvePanelsExpanded"); -} - -if (keyFile.has_group ("Algorithms")) { - if (keyFile.has_key ("Algorithms", "DemosaicMethod")) rtSettings.demosaicMethod = keyFile.get_string ("Algorithms", "DemosaicMethod"); - if (keyFile.has_key ("Algorithms", "ColorCorrection")) rtSettings.colorCorrectionSteps = keyFile.get_integer ("Algorithms", "ColorCorrection"); - if(keyFile.has_key("Algorithms", "DCBIterations")) rtSettings.dcb_iterations = keyFile.get_integer("Algorithms", "DCBIterations"); - if(keyFile.has_key("Algorithms", "DCBEnhance")) rtSettings.dcb_enhance = keyFile.get_boolean("Algorithms", "DCBEnhance"); -} - -if (keyFile.has_group ("Crop Settings")) { - if (keyFile.has_key ("Crop Settings", "DPI")) cropDPI = keyFile.get_integer ("Crop Settings", "DPI"); -} - -if (keyFile.has_group ("Color Management")) { - if (keyFile.has_key ("Color Management", "ICCDirectory")) rtSettings.iccDirectory = keyFile.get_string ("Color Management", "ICCDirectory"); - if (keyFile.has_key ("Color Management", "MonitorProfile")) rtSettings.monitorProfile = keyFile.get_string ("Color Management", "MonitorProfile"); - if (keyFile.has_key ("Color Management", "Intent")) rtSettings.colorimetricIntent = keyFile.get_integer("Color Management", "Intent"); -} - -if (keyFile.has_group ("Batch Processing")) { - if (keyFile.has_key ("Batch Processing", "AdjusterBehavior")) baBehav = keyFile.get_integer_list ("Batch Processing", "AdjusterBehavior"); -} - - return 0; -} - -int Options::saveToFile (Glib::ustring fname) { - - rtengine::SafeKeyFile keyFile; - - keyFile.set_boolean ("General", "StoreLastProfile", savesParamsAtExit); - if (startupDir==STARTUPDIR_HOME) - keyFile.set_string ("General", "StartupDirectory", "home"); - else if (startupDir==STARTUPDIR_CURRENT) - keyFile.set_string ("General", "StartupDirectory", "current"); - else if (startupDir==STARTUPDIR_CUSTOM) - keyFile.set_string ("General", "StartupDirectory", "custom"); - else if (startupDir==STARTUPDIR_LAST) - keyFile.set_string ("General", "StartupDirectory", "last"); - keyFile.set_string ("General", "StartupPath", startupPath); - keyFile.set_string ("General", "DateFormat", dateFormat); - keyFile.set_integer ("General", "AdjusterDelay", Adjuster::delay); - keyFile.set_boolean ("General", "DualProcSupport", rtSettings.dualThreadEnabled); - keyFile.set_boolean ("General", "MultiUser", multiUser); - keyFile.set_string ("General", "Language", language); - keyFile.set_string ("General", "Theme", theme); - keyFile.set_integer ("General", "Version", 290); - keyFile.set_boolean ("General", "FirstRun", firstRun); - - keyFile.set_integer ("External Editor", "EditorKind", editorToSendTo); - keyFile.set_string ("External Editor", "GimpDir", gimpDir); - keyFile.set_string ("External Editor", "PhotoshopDir", psDir); - keyFile.set_string ("External Editor", "CustomEditor", customEditorProg); - - - keyFile.set_boolean ("File Browser", "BrowseOnlyRaw", fbOnlyRaw); - keyFile.set_boolean ("File Browser", "BrowserShowsDate", fbShowDateTime); - keyFile.set_boolean ("File Browser", "BrowserShowsExif", fbShowBasicExif); - keyFile.set_boolean ("File Browser", "BrowserShowsHidden", fbShowHidden); - keyFile.set_integer ("File Browser", "ThumbnailSize", thumbSize); - keyFile.set_integer ("File Browser", "MaxPreviewHeight", maxThumbnailHeight); - keyFile.set_integer ("File Browser", "MaxCacheEntries", maxCacheEntries); - keyFile.set_integer ("File Browser", "ThumbnailFormat", (int)thumbnailFormat); - Glib::ArrayHandle pext = parseExtensions; - keyFile.set_string_list ("File Browser", "ParseExtensions", pext); - Glib::ArrayHandle pextena = parseExtensionsEnabled; - keyFile.set_integer_list ("File Browser", "ParseExtensionsEnabled", pextena); - keyFile.set_integer ("File Browser", "ThumbnailArrangement", fbArrangement); - keyFile.set_integer ("File Browser", "ThumbnailInterpolation", thumbInterp); - keyFile.set_boolean ("File Browser", "LiveThumbnails", liveThumbnails); - Glib::ArrayHandle pfav = favoriteDirs; - keyFile.set_string_list ("File Browser", "FavoriteDirs", pfav); - Glib::ArrayHandle pren = renameTemplates; - keyFile.set_string_list ("File Browser", "RenameTemplates", pren); - keyFile.set_boolean ("File Browser", "RenameUseTemplates", renameUseTemplates); - Glib::ArrayHandle ptzoom = thumbnailZoomRatios; - keyFile.set_double_list ("File Browser", "ThumbnailZoomRatios", ptzoom); - keyFile.set_boolean ("File Browser", "OverlayedFileNames", overlayedFileNames); - keyFile.set_boolean ("File Browser", "ShowFileNames", showFileNames ); - - keyFile.set_integer ("Clipping Indication", "HighlightThreshold", highlightThreshold); - keyFile.set_integer ("Clipping Indication", "ShadowThreshold", shadowThreshold); - keyFile.set_boolean ("Clipping Indication", "BlinkClipped", blinkClipped); - - keyFile.set_string ("Output", "Format", saveFormat.format); - keyFile.set_integer ("Output", "JpegQuality", saveFormat.jpegQuality); - keyFile.set_integer ("Output", "PngCompression", saveFormat.pngCompression); - keyFile.set_integer ("Output", "PngBps", saveFormat.pngBits); - keyFile.set_integer ("Output", "TiffBps", saveFormat.tiffBits); - keyFile.set_boolean ("Output", "SaveProcParams", saveFormat.saveParams); - keyFile.set_string ("Output", "PathTemplate", savePathTemplate); - keyFile.set_string ("Output", "PathFolder", savePathFolder); - keyFile.set_boolean("Output", "UsePathTemplate", saveUsePathTemplate); - keyFile.set_string ("Output", "LastSaveAsPath", lastSaveAsPath); - - keyFile.set_string ("Profiles", "Directory", profilePath); - keyFile.set_string ("Profiles", "RawDefault", defProfRaw); - keyFile.set_string ("Profiles", "ImgDefault", defProfImg); - keyFile.set_boolean ("Profiles", "SaveParamsWithFile", saveParamsFile); - keyFile.set_boolean ("Profiles", "SaveParamsToCache", saveParamsCache); - keyFile.set_integer ("Profiles", "LoadParamsFromLocation", paramsLoadLocation); - - keyFile.set_integer ("GUI", "WindowWidth", windowWidth); - keyFile.set_integer ("GUI", "WindowHeight", windowHeight); - keyFile.set_integer ("GUI", "DirBrowserWidth", dirBrowserWidth); - keyFile.set_integer ("GUI", "DirBrowserHeight", dirBrowserHeight); - keyFile.set_integer ("GUI", "ToolPanelWidth", toolPanelWidth); - keyFile.set_integer ("GUI", "BrowserToolPanelWidth", browserToolPanelWidth); - keyFile.set_integer ("GUI", "HistoryPanelWidth", historyPanelWidth); - keyFile.set_integer ("GUI", "LastPreviewScale", lastScale); - keyFile.set_integer ("GUI", "LastCropSize", lastCropSize); - keyFile.set_boolean ("GUI", "ShowHistory", showHistory); - keyFile.set_integer ("GUI", "ShowFilePanelState", showFilePanelState); - keyFile.set_boolean ("GUI", "ShowInfo", showInfo); - keyFile.set_boolean ("GUI", "ShowClippedHighlights", showClippedHighlights); - keyFile.set_boolean ("GUI", "ShowClippedShadows", showClippedShadows); - keyFile.set_integer ("GUI", "FrameColor", bgcolor); - keyFile.set_boolean ("GUI", "ProcessingQueueEnbled", procQueueEnabled); - Glib::ArrayHandle tpopen = tpOpen; - keyFile.set_integer_list ("GUI", "ToolPanelsExpanded", tpopen); - Glib::ArrayHandle crvopen = crvOpen; - keyFile.set_integer_list ("GUI", "CurvePanelsExpanded", crvopen); - - keyFile.set_string ("Algorithms", "DemosaicMethod", rtSettings.demosaicMethod); - keyFile.set_integer ("Algorithms", "ColorCorrection", rtSettings.colorCorrectionSteps); - keyFile.set_integer ("Algorithms", "DCBIterations", rtSettings.dcb_iterations); - keyFile.set_boolean ("Algorithms", "DCBEnhance", rtSettings.dcb_enhance); - - keyFile.set_integer ("Crop Settings", "DPI", cropDPI); - - keyFile.set_string ("Color Management", "ICCDirectory", rtSettings.iccDirectory); - keyFile.set_string ("Color Management", "MonitorProfile", rtSettings.monitorProfile); - keyFile.set_integer ("Color Management", "Intent", rtSettings.colorimetricIntent); - - Glib::ArrayHandle bab = baBehav; - keyFile.set_integer_list ("Batch Processing", "AdjusterBehavior", bab); - - - FILE *f = g_fopen (fname.c_str(), "wt"); - if (f==NULL) - return 1; - else { - fprintf (f, "%s", keyFile.to_data().c_str()); - fclose (f); - return 0; - } -} - -Glib::ustring Options::rtdir; -Glib::ustring Options::cacheBaseDir; - -void Options::load () { - - rtdir = Glib::ustring(g_get_user_config_dir ())+"/RawTherapeeAlpha"; - options.readFromFile (argv0+"/options"); - cacheBaseDir = argv0 + "/cache"; - if (options.multiUser) { - int r = options.readFromFile (rtdir + "/options"); - if (r && !g_mkdir_with_parents (rtdir.c_str(), 511)) { - Glib::ustring profdir = rtdir + "/profiles"; - g_mkdir_with_parents (profdir.c_str(), 511); - options.saveToFile (rtdir + "/options"); - } - cacheBaseDir = rtdir + "/cache"; - } - - Glib::ustring fname = argv0+"/languages/"; - fname += (options.language.empty())? DefaultLanguage : options.language; - - if (!langMgr.load (fname, new MultiLangMgr (argv0+"/languages/"+DefaultLanguage))) - langMgr.load (argv0+"/languages/"+DefaultLanguage); - - rtengine::init (&options.rtSettings); -} - -void Options::save () { - - if (options.multiUser==false) { - options.saveToFile (argv0+"/options"); - } - else { - options.saveToFile (rtdir + "/options"); - } -} - -bool Options::is_extention_enabled (Glib::ustring ext) { - for (int j=0; j=parseExtensionsEnabled.size() || parseExtensionsEnabled[j]; - return false; -} + + int babehav[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0}; + baBehav = std::vector (babehav, babehav+ADDSET_PARAM_NUM); + + rtSettings.dualThreadEnabled = true; + rtSettings.demosaicMethod = "eahd"; + rtSettings.colorCorrectionSteps = 2; + rtSettings.dcb_iterations = 2; + rtSettings.dcb_enhance = true; + rtSettings.iccDirectory = "/usr/share/color/icc"; + rtSettings.colorimetricIntent = 1; + rtSettings.monitorProfile = ""; + rtSettings.verbose = false; +} + +Options* Options::copyFrom (Options* other) { + + *this = *other; + return this; +} + +int Options::readFromFile (Glib::ustring fname) { + + rtengine::SafeKeyFile keyFile; + + try { + if (!keyFile.load_from_file (fname)) + return 1; + } + catch (Glib::FileError) { + return 1; + } + + setDefaults (); + +if (keyFile.has_group ("General")) { + Glib::ustring stup; + if (keyFile.has_key ("General", "StartupDirectory") && keyFile.get_string ("General", "StartupDirectory") == "home") + startupDir = STARTUPDIR_HOME; + else if (keyFile.has_key ("General", "StartupDirectory") && keyFile.get_string ("General", "StartupDirectory") == "current") + startupDir = STARTUPDIR_CURRENT; + else if (keyFile.has_key ("General", "StartupDirectory") && keyFile.get_string ("General", "StartupDirectory") == "last") + startupDir = STARTUPDIR_LAST; + else + startupDir = STARTUPDIR_CUSTOM; + + if (keyFile.has_key ("General", "StartupPath")) startupPath = keyFile.get_string ("General", "StartupPath"); + if (keyFile.has_key ("General", "DateFormat")) dateFormat = keyFile.get_string ("General", "DateFormat"); + if (keyFile.has_key ("General", "AdjusterDelay")) Adjuster::delay = keyFile.get_integer ("General", "AdjusterDelay"); + if (keyFile.has_key ("General", "StoreLastProfile")) savesParamsAtExit = keyFile.get_boolean ("General", "StoreLastProfile"); + if (keyFile.has_key ("General", "DualProcSupport")) rtSettings.dualThreadEnabled = keyFile.get_boolean ("General", "DualProcSupport"); + if (keyFile.has_key ("General", "MultiUser")) multiUser = keyFile.get_boolean ("General", "MultiUser"); +// if (keyFile.has_key ("General", "Version")) version = keyFile.get_integer ("General", "Version"); + if (keyFile.has_key ("General", "Language")) language = keyFile.get_string ("General", "Language"); + if (keyFile.has_key ("General", "Theme")) theme = keyFile.get_string ("General", "Theme"); + if (keyFile.has_key ("General", "FirstRun")) firstRun = keyFile.get_boolean ("General", "FirstRun"); +} + +if (keyFile.has_group ("External Editor")) { + if (keyFile.has_key ("External Editor", "EditorKind")) editorToSendTo = keyFile.get_integer ("External Editor", "EditorKind"); + if (keyFile.has_key ("External Editor", "GimpDir")) gimpDir = keyFile.get_string ("External Editor", "GimpDir"); + if (keyFile.has_key ("External Editor", "PhotoshopDir")) psDir = keyFile.get_string ("External Editor", "PhotoshopDir"); + if (keyFile.has_key ("External Editor", "CustomEditor")) customEditorProg = keyFile.get_string ("External Editor", "CustomEditor"); +} + +if (keyFile.has_group ("Output")) { + if (keyFile.has_key ("Output", "Format")) saveFormat.format = keyFile.get_string ("Output", "Format"); + if (keyFile.has_key ("Output", "JpegQuality")) saveFormat.jpegQuality = keyFile.get_integer ("Output", "JpegQuality"); + if (keyFile.has_key ("Output", "PngCompression")) saveFormat.pngCompression = keyFile.get_integer ("Output", "PngCompression"); + if (keyFile.has_key ("Output", "PngBps")) saveFormat.pngBits = keyFile.get_integer ("Output", "PngBps"); + if (keyFile.has_key ("Output", "TiffBps")) saveFormat.tiffBits = keyFile.get_integer ("Output", "TiffBps"); + if (keyFile.has_key ("Output", "SaveProcParams")) saveFormat.saveParams = keyFile.get_boolean ("Output", "SaveProcParams"); + if (keyFile.has_key ("Output", "Path")) savePathTemplate = keyFile.get_string ("Output", "Path"); + if (keyFile.has_key ("Output", "PathTemplate")) savePathTemplate = keyFile.get_string ("Output", "PathTemplate"); + if (keyFile.has_key ("Output", "PathFolder")) savePathFolder = keyFile.get_string ("Output", "PathFolder"); + if (keyFile.has_key ("Output", "UsePathTemplate")) saveUsePathTemplate = keyFile.get_boolean("Output", "UsePathTemplate"); + if (keyFile.has_key ("Output", "LastSaveAsPath")) lastSaveAsPath = keyFile.get_string ("Output", "LastSaveAsPath"); +} + +if (keyFile.has_group ("Profiles")) { + if (keyFile.has_key ("Profiles", "Directory")) profilePath = keyFile.get_string ("Profiles", "Directory"); + if (keyFile.has_key ("Profiles", "RawDefault")) defProfRaw = keyFile.get_string ("Profiles", "RawDefault"); + if (keyFile.has_key ("Profiles", "ImgDefault")) defProfImg = keyFile.get_string ("Profiles", "ImgDefault"); + if (keyFile.has_key ("Profiles", "SaveParamsWithFile")) saveParamsFile = keyFile.get_boolean ("Profiles", "SaveParamsWithFile"); + if (keyFile.has_key ("Profiles", "SaveParamsToCache")) saveParamsCache = keyFile.get_boolean ("Profiles", "SaveParamsToCache"); + if (keyFile.has_key ("Profiles", "LoadParamsFromLocation")) paramsLoadLocation = (PPLoadLocation)keyFile.get_integer ("Profiles", "LoadParamsFromLocation"); +} + +if (keyFile.has_group ("File Browser")) { + if (keyFile.has_key ("File Browser", "ThumbnailSize")) thumbSize = keyFile.get_integer ("File Browser", "ThumbnailSize"); + if (keyFile.has_key ("File Browser", "BrowseOnlyRaw")) fbOnlyRaw = keyFile.get_boolean ("File Browser", "BrowseOnlyRaw"); + if (keyFile.has_key ("File Browser", "BrowserShowsDate")) fbShowDateTime = keyFile.get_boolean ("File Browser", "BrowserShowsDate"); + if (keyFile.has_key ("File Browser", "BrowserShowsExif")) fbShowBasicExif = keyFile.get_boolean ("File Browser", "BrowserShowsExif"); + if (keyFile.has_key ("File Browser", "BrowserShowsHidden")) fbShowHidden = keyFile.get_boolean ("File Browser", "BrowserShowsHidden"); + if (keyFile.has_key ("File Browser", "MaxPreviewHeight")) maxThumbnailHeight = keyFile.get_integer ("File Browser", "MaxPreviewHeight"); + if (keyFile.has_key ("File Browser", "MaxCacheEntries")) maxCacheEntries = keyFile.get_integer ("File Browser", "MaxCacheEntries"); + if (keyFile.has_key ("File Browser", "ThumbnailFormat")) thumbnailFormat = (ThFileType)keyFile.get_integer ("File Browser", "ThumbnailFormat"); + if (keyFile.has_key ("File Browser", "ParseExtensions")) parseExtensions = keyFile.get_string_list ("File Browser", "ParseExtensions"); + if (keyFile.has_key ("File Browser", "ParseExtensionsEnabled")) parseExtensionsEnabled = keyFile.get_integer_list ("File Browser", "ParseExtensionsEnabled"); + if (keyFile.has_key ("File Browser", "ThumbnailArrangement")) fbArrangement = keyFile.get_integer ("File Browser", "ThumbnailArrangement"); + if (keyFile.has_key ("File Browser", "ThumbnailInterpolation")) thumbInterp = keyFile.get_integer ("File Browser", "ThumbnailInterpolation"); + if (keyFile.has_key ("File Browser", "LiveThumbnails")) liveThumbnails = keyFile.get_boolean ("File Browser", "LiveThumbnails"); + if (keyFile.has_key ("File Browser", "FavoriteDirs")) favoriteDirs = keyFile.get_string_list ("File Browser", "FavoriteDirs"); + if (keyFile.has_key ("File Browser", "RenameTemplates")) renameTemplates = keyFile.get_string_list ("File Browser", "RenameTemplates"); + if (keyFile.has_key ("File Browser", "RenameUseTemplates")) renameUseTemplates = keyFile.get_boolean ("File Browser", "RenameUseTemplates"); + if (keyFile.has_key ("File Browser", "ThumbnailZoomRatios"))thumbnailZoomRatios= keyFile.get_double_list ("File Browser", "ThumbnailZoomRatios"); + if (keyFile.has_key ("File Browser", "OverlayedFileNames")) overlayedFileNames = keyFile.get_boolean ("File Browser", "OverlayedFileNames"); + if (keyFile.has_key ("File Browser", "ShowFileNames")) showFileNames = keyFile.get_boolean ("File Browser", "ShowFileNames"); +} + +if (keyFile.has_group ("Clipping Indication")) { + if (keyFile.has_key ("Clipping Indication", "HighlightThreshold")) highlightThreshold= keyFile.get_integer ("Clipping Indication", "HighlightThreshold"); + if (keyFile.has_key ("Clipping Indication", "ShadowThreshold")) shadowThreshold = keyFile.get_integer ("Clipping Indication", "ShadowThreshold"); + if (keyFile.has_key ("Clipping Indication", "BlinkClipped")) blinkClipped = keyFile.get_boolean ("Clipping Indication", "BlinkClipped"); +} + +if (keyFile.has_group ("GUI")) { + if (keyFile.has_key ("GUI", "WindowWidth")) windowWidth = keyFile.get_integer ("GUI", "WindowWidth"); + if (keyFile.has_key ("GUI", "WindowHeight")) windowHeight = keyFile.get_integer ("GUI", "WindowHeight"); + if (keyFile.has_key ("GUI", "DirBrowserWidth")) dirBrowserWidth = keyFile.get_integer ("GUI", "DirBrowserWidth"); + if (keyFile.has_key ("GUI", "DirBrowserHeight")) dirBrowserHeight = keyFile.get_integer ("GUI", "DirBrowserHeight"); + if (keyFile.has_key ("GUI", "ToolPanelWidth")) toolPanelWidth = keyFile.get_integer ("GUI", "ToolPanelWidth"); + if (keyFile.has_key ("GUI", "BrowserToolPanelWidth"))browserToolPanelWidth = keyFile.get_integer ("GUI", "BrowserToolPanelWidth"); + if (keyFile.has_key ("GUI", "HistoryPanelWidth")) historyPanelWidth = keyFile.get_integer ("GUI", "HistoryPanelWidth"); + if (keyFile.has_key ("GUI", "LastPreviewScale")) lastScale = keyFile.get_integer ("GUI", "LastPreviewScale"); + if (keyFile.has_key ("GUI", "LastCropSize")) lastCropSize = keyFile.get_integer ("GUI", "LastCropSize"); + if (keyFile.has_key ("GUI", "ShowHistory")) showHistory = keyFile.get_boolean ("GUI", "ShowHistory"); + if (keyFile.has_key ("GUI", "ShowFilePanelState")) showFilePanelState= keyFile.get_integer ("GUI", "ShowFilePanelState"); + if (keyFile.has_key ("GUI", "ShowInfo")) showInfo = keyFile.get_boolean ("GUI", "ShowInfo"); + if (keyFile.has_key ("GUI", "ShowClippedHighlights"))showClippedHighlights = keyFile.get_boolean ("GUI", "ShowClippedHighlights"); + if (keyFile.has_key ("GUI", "ShowClippedShadows")) showClippedShadows= keyFile.get_boolean ("GUI", "ShowClippedShadows"); + if (keyFile.has_key ("GUI", "FrameColor")) bgcolor = keyFile.get_integer ("GUI", "FrameColor"); + if (keyFile.has_key ("GUI", "ProcessingQueueEnbled"))procQueueEnabled = keyFile.get_boolean ("GUI", "ProcessingQueueEnbled"); + if (keyFile.has_key ("GUI", "ToolPanelsExpanded")) tpOpen = keyFile.get_integer_list ("GUI", "ToolPanelsExpanded"); + if (keyFile.has_key ("GUI", "CurvePanelsExpanded")) crvOpen = keyFile.get_integer_list ("GUI", "CurvePanelsExpanded"); +} + +if (keyFile.has_group ("Algorithms")) { + if (keyFile.has_key ("Algorithms", "DemosaicMethod")) rtSettings.demosaicMethod = keyFile.get_string ("Algorithms", "DemosaicMethod"); + if (keyFile.has_key ("Algorithms", "ColorCorrection")) rtSettings.colorCorrectionSteps = keyFile.get_integer ("Algorithms", "ColorCorrection"); + if(keyFile.has_key("Algorithms", "DCBIterations")) rtSettings.dcb_iterations = keyFile.get_integer("Algorithms", "DCBIterations"); + if(keyFile.has_key("Algorithms", "DCBEnhance")) rtSettings.dcb_enhance = keyFile.get_boolean("Algorithms", "DCBEnhance"); +} + +if (keyFile.has_group ("Crop Settings")) { + if (keyFile.has_key ("Crop Settings", "DPI")) cropDPI = keyFile.get_integer ("Crop Settings", "DPI"); +} + +if (keyFile.has_group ("Color Management")) { + if (keyFile.has_key ("Color Management", "ICCDirectory")) rtSettings.iccDirectory = keyFile.get_string ("Color Management", "ICCDirectory"); + if (keyFile.has_key ("Color Management", "MonitorProfile")) rtSettings.monitorProfile = keyFile.get_string ("Color Management", "MonitorProfile"); + if (keyFile.has_key ("Color Management", "Intent")) rtSettings.colorimetricIntent = keyFile.get_integer("Color Management", "Intent"); +} + +if (keyFile.has_group ("Batch Processing")) { + if (keyFile.has_key ("Batch Processing", "AdjusterBehavior")) baBehav = keyFile.get_integer_list ("Batch Processing", "AdjusterBehavior"); +} + + return 0; +} + +int Options::saveToFile (Glib::ustring fname) { + + rtengine::SafeKeyFile keyFile; + + keyFile.set_boolean ("General", "StoreLastProfile", savesParamsAtExit); + if (startupDir==STARTUPDIR_HOME) + keyFile.set_string ("General", "StartupDirectory", "home"); + else if (startupDir==STARTUPDIR_CURRENT) + keyFile.set_string ("General", "StartupDirectory", "current"); + else if (startupDir==STARTUPDIR_CUSTOM) + keyFile.set_string ("General", "StartupDirectory", "custom"); + else if (startupDir==STARTUPDIR_LAST) + keyFile.set_string ("General", "StartupDirectory", "last"); + keyFile.set_string ("General", "StartupPath", startupPath); + keyFile.set_string ("General", "DateFormat", dateFormat); + keyFile.set_integer ("General", "AdjusterDelay", Adjuster::delay); + keyFile.set_boolean ("General", "DualProcSupport", rtSettings.dualThreadEnabled); + keyFile.set_boolean ("General", "MultiUser", multiUser); + keyFile.set_string ("General", "Language", language); + keyFile.set_string ("General", "Theme", theme); + keyFile.set_integer ("General", "Version", 290); + keyFile.set_boolean ("General", "FirstRun", firstRun); + + keyFile.set_integer ("External Editor", "EditorKind", editorToSendTo); + keyFile.set_string ("External Editor", "GimpDir", gimpDir); + keyFile.set_string ("External Editor", "PhotoshopDir", psDir); + keyFile.set_string ("External Editor", "CustomEditor", customEditorProg); + + + keyFile.set_boolean ("File Browser", "BrowseOnlyRaw", fbOnlyRaw); + keyFile.set_boolean ("File Browser", "BrowserShowsDate", fbShowDateTime); + keyFile.set_boolean ("File Browser", "BrowserShowsExif", fbShowBasicExif); + keyFile.set_boolean ("File Browser", "BrowserShowsHidden", fbShowHidden); + keyFile.set_integer ("File Browser", "ThumbnailSize", thumbSize); + keyFile.set_integer ("File Browser", "MaxPreviewHeight", maxThumbnailHeight); + keyFile.set_integer ("File Browser", "MaxCacheEntries", maxCacheEntries); + keyFile.set_integer ("File Browser", "ThumbnailFormat", (int)thumbnailFormat); + Glib::ArrayHandle pext = parseExtensions; + keyFile.set_string_list ("File Browser", "ParseExtensions", pext); + Glib::ArrayHandle pextena = parseExtensionsEnabled; + keyFile.set_integer_list ("File Browser", "ParseExtensionsEnabled", pextena); + keyFile.set_integer ("File Browser", "ThumbnailArrangement", fbArrangement); + keyFile.set_integer ("File Browser", "ThumbnailInterpolation", thumbInterp); + keyFile.set_boolean ("File Browser", "LiveThumbnails", liveThumbnails); + Glib::ArrayHandle pfav = favoriteDirs; + keyFile.set_string_list ("File Browser", "FavoriteDirs", pfav); + Glib::ArrayHandle pren = renameTemplates; + keyFile.set_string_list ("File Browser", "RenameTemplates", pren); + keyFile.set_boolean ("File Browser", "RenameUseTemplates", renameUseTemplates); + Glib::ArrayHandle ptzoom = thumbnailZoomRatios; + keyFile.set_double_list ("File Browser", "ThumbnailZoomRatios", ptzoom); + keyFile.set_boolean ("File Browser", "OverlayedFileNames", overlayedFileNames); + keyFile.set_boolean ("File Browser", "ShowFileNames", showFileNames ); + + keyFile.set_integer ("Clipping Indication", "HighlightThreshold", highlightThreshold); + keyFile.set_integer ("Clipping Indication", "ShadowThreshold", shadowThreshold); + keyFile.set_boolean ("Clipping Indication", "BlinkClipped", blinkClipped); + + keyFile.set_string ("Output", "Format", saveFormat.format); + keyFile.set_integer ("Output", "JpegQuality", saveFormat.jpegQuality); + keyFile.set_integer ("Output", "PngCompression", saveFormat.pngCompression); + keyFile.set_integer ("Output", "PngBps", saveFormat.pngBits); + keyFile.set_integer ("Output", "TiffBps", saveFormat.tiffBits); + keyFile.set_boolean ("Output", "SaveProcParams", saveFormat.saveParams); + keyFile.set_string ("Output", "PathTemplate", savePathTemplate); + keyFile.set_string ("Output", "PathFolder", savePathFolder); + keyFile.set_boolean("Output", "UsePathTemplate", saveUsePathTemplate); + keyFile.set_string ("Output", "LastSaveAsPath", lastSaveAsPath); + + keyFile.set_string ("Profiles", "Directory", profilePath); + keyFile.set_string ("Profiles", "RawDefault", defProfRaw); + keyFile.set_string ("Profiles", "ImgDefault", defProfImg); + keyFile.set_boolean ("Profiles", "SaveParamsWithFile", saveParamsFile); + keyFile.set_boolean ("Profiles", "SaveParamsToCache", saveParamsCache); + keyFile.set_integer ("Profiles", "LoadParamsFromLocation", paramsLoadLocation); + + keyFile.set_integer ("GUI", "WindowWidth", windowWidth); + keyFile.set_integer ("GUI", "WindowHeight", windowHeight); + keyFile.set_integer ("GUI", "DirBrowserWidth", dirBrowserWidth); + keyFile.set_integer ("GUI", "DirBrowserHeight", dirBrowserHeight); + keyFile.set_integer ("GUI", "ToolPanelWidth", toolPanelWidth); + keyFile.set_integer ("GUI", "BrowserToolPanelWidth", browserToolPanelWidth); + keyFile.set_integer ("GUI", "HistoryPanelWidth", historyPanelWidth); + keyFile.set_integer ("GUI", "LastPreviewScale", lastScale); + keyFile.set_integer ("GUI", "LastCropSize", lastCropSize); + keyFile.set_boolean ("GUI", "ShowHistory", showHistory); + keyFile.set_integer ("GUI", "ShowFilePanelState", showFilePanelState); + keyFile.set_boolean ("GUI", "ShowInfo", showInfo); + keyFile.set_boolean ("GUI", "ShowClippedHighlights", showClippedHighlights); + keyFile.set_boolean ("GUI", "ShowClippedShadows", showClippedShadows); + keyFile.set_integer ("GUI", "FrameColor", bgcolor); + keyFile.set_boolean ("GUI", "ProcessingQueueEnbled", procQueueEnabled); + Glib::ArrayHandle tpopen = tpOpen; + keyFile.set_integer_list ("GUI", "ToolPanelsExpanded", tpopen); + Glib::ArrayHandle crvopen = crvOpen; + keyFile.set_integer_list ("GUI", "CurvePanelsExpanded", crvopen); + + keyFile.set_string ("Algorithms", "DemosaicMethod", rtSettings.demosaicMethod); + keyFile.set_integer ("Algorithms", "ColorCorrection", rtSettings.colorCorrectionSteps); + keyFile.set_integer ("Algorithms", "DCBIterations", rtSettings.dcb_iterations); + keyFile.set_boolean ("Algorithms", "DCBEnhance", rtSettings.dcb_enhance); + + keyFile.set_integer ("Crop Settings", "DPI", cropDPI); + + keyFile.set_string ("Color Management", "ICCDirectory", rtSettings.iccDirectory); + keyFile.set_string ("Color Management", "MonitorProfile", rtSettings.monitorProfile); + keyFile.set_integer ("Color Management", "Intent", rtSettings.colorimetricIntent); + + Glib::ArrayHandle bab = baBehav; + keyFile.set_integer_list ("Batch Processing", "AdjusterBehavior", bab); + + + FILE *f = g_fopen (fname.c_str(), "wt"); + if (f==NULL) + return 1; + else { + fprintf (f, "%s", keyFile.to_data().c_str()); + fclose (f); + return 0; + } +} + +Glib::ustring Options::rtdir; +Glib::ustring Options::cacheBaseDir; + +void Options::load () { + + rtdir = Glib::ustring(g_get_user_config_dir ())+"/RawTherapeeAlpha"; + options.readFromFile (argv0+"/options"); + cacheBaseDir = argv0 + "/cache"; + if (options.multiUser) { + int r = options.readFromFile (rtdir + "/options"); + if (r && !g_mkdir_with_parents (rtdir.c_str(), 511)) { + Glib::ustring profdir = rtdir + "/profiles"; + g_mkdir_with_parents (profdir.c_str(), 511); + options.saveToFile (rtdir + "/options"); + } + cacheBaseDir = rtdir + "/cache"; + } + + Glib::ustring fname = argv0+"/languages/"; + fname += (options.language.empty())? DefaultLanguage : options.language; + + if (!langMgr.load (fname, new MultiLangMgr (argv0+"/languages/"+DefaultLanguage))) + langMgr.load (argv0+"/languages/"+DefaultLanguage); + + rtengine::init (&options.rtSettings); +} + +void Options::save () { + + if (options.multiUser==false) { + options.saveToFile (argv0+"/options"); + } + else { + options.saveToFile (rtdir + "/options"); + } +} + +bool Options::is_extention_enabled (Glib::ustring ext) { + for (int j=0; j=parseExtensionsEnabled.size() || parseExtensionsEnabled[j]; + return false; +} diff --git a/rtgui/options.h b/rtgui/options.h index 27c236b85..6b738877b 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -1,142 +1,142 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _OPTIONS_ -#define _OPTIONS_ - -#include -#include - -#define STARTUPDIR_CURRENT 0 -#define STARTUPDIR_HOME 1 -#define STARTUPDIR_CUSTOM 2 -#define STARTUPDIR_LAST 3 - -class SaveFormat { - - public: - Glib::ustring format; - int pngBits; - int pngCompression; - int jpegQuality; - int tiffBits; - bool tiffUncompressed; - bool saveParams; -}; - -enum ThFileType {FT_Invalid=-1, FT_None=0, FT_Raw=1, FT_Jpeg=2, FT_Tiff=3, FT_Png=4, FT_Custom=5, FT_Tiff16=6, FT_Png16=7, FT_Custom16=8}; -enum PPLoadLocation {PLL_Cache=0, PLL_Input=1}; - -class Options { - - private: - int getString (const char* src, char* dst); - void error (int line); - - public: - bool firstRun; - bool savesParamsAtExit; - SaveFormat saveFormat; - Glib::ustring savePathTemplate; - Glib::ustring savePathFolder; - bool saveUsePathTemplate; - Glib::ustring defProfRaw; - Glib::ustring defProfImg; - Glib::ustring dateFormat; - int startupDir; - Glib::ustring startupPath; - Glib::ustring profilePath; - Glib::ustring lastSaveAsPath; - int toolPanelWidth; - int browserToolPanelWidth; - int historyPanelWidth; +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _OPTIONS_ +#define _OPTIONS_ + +#include +#include + +#define STARTUPDIR_CURRENT 0 +#define STARTUPDIR_HOME 1 +#define STARTUPDIR_CUSTOM 2 +#define STARTUPDIR_LAST 3 + +class SaveFormat { + + public: + Glib::ustring format; + int pngBits; + int pngCompression; + int jpegQuality; + int tiffBits; + bool tiffUncompressed; + bool saveParams; +}; + +enum ThFileType {FT_Invalid=-1, FT_None=0, FT_Raw=1, FT_Jpeg=2, FT_Tiff=3, FT_Png=4, FT_Custom=5, FT_Tiff16=6, FT_Png16=7, FT_Custom16=8}; +enum PPLoadLocation {PLL_Cache=0, PLL_Input=1}; + +class Options { + + private: + int getString (const char* src, char* dst); + void error (int line); + + public: + bool firstRun; + bool savesParamsAtExit; + SaveFormat saveFormat; + Glib::ustring savePathTemplate; + Glib::ustring savePathFolder; + bool saveUsePathTemplate; + Glib::ustring defProfRaw; + Glib::ustring defProfImg; + Glib::ustring dateFormat; + int startupDir; + Glib::ustring startupPath; + Glib::ustring profilePath; + Glib::ustring lastSaveAsPath; + int toolPanelWidth; + int browserToolPanelWidth; + int historyPanelWidth; int windowWidth; int windowHeight; - int dirBrowserWidth; - int dirBrowserHeight; - int lastScale; - int lastCropSize; - bool fbOnlyRaw; - bool fbShowDateTime; - bool fbShowBasicExif; - bool fbShowHidden; - int fbArrangement; - bool multiUser; - static Glib::ustring rtdir; - int version; - int thumbSize; - bool showHistory; - int showFilePanelState; // 0: normal, 1: maximized, 2: normal, 3: hidden - bool showInfo; - int cropDPI; - bool showClippedHighlights; - bool showClippedShadows; - int highlightThreshold; - int shadowThreshold; - bool blinkClipped; - int bgcolor; - Glib::ustring language; - Glib::ustring theme; - static Glib::ustring cacheBaseDir; - bool saveParamsFile; - bool saveParamsCache; - PPLoadLocation paramsLoadLocation; - bool procQueueEnabled; - Glib::ustring gimpDir; - Glib::ustring psDir; - Glib::ustring customEditorProg; - int editorToSendTo; - int maxThumbnailHeight; - int maxCacheEntries; - ThFileType thumbnailFormat; - int thumbInterp; // 0: nearest, 1: bilinear - bool liveThumbnails; - std::vector parseExtensions; - std::vector parseExtensionsEnabled; - std::vector tpOpen; + int dirBrowserWidth; + int dirBrowserHeight; + int lastScale; + int lastCropSize; + bool fbOnlyRaw; + bool fbShowDateTime; + bool fbShowBasicExif; + bool fbShowHidden; + int fbArrangement; + bool multiUser; + static Glib::ustring rtdir; + int version; + int thumbSize; + bool showHistory; + int showFilePanelState; // 0: normal, 1: maximized, 2: normal, 3: hidden + bool showInfo; + int cropDPI; + bool showClippedHighlights; + bool showClippedShadows; + int highlightThreshold; + int shadowThreshold; + bool blinkClipped; + int bgcolor; + Glib::ustring language; + Glib::ustring theme; + static Glib::ustring cacheBaseDir; + bool saveParamsFile; + bool saveParamsCache; + PPLoadLocation paramsLoadLocation; + bool procQueueEnabled; + Glib::ustring gimpDir; + Glib::ustring psDir; + Glib::ustring customEditorProg; + int editorToSendTo; + int maxThumbnailHeight; + int maxCacheEntries; + ThFileType thumbnailFormat; + int thumbInterp; // 0: nearest, 1: bilinear + bool liveThumbnails; + std::vector parseExtensions; + std::vector parseExtensionsEnabled; + std::vector tpOpen; std::vector crvOpen; - std::vector baBehav; + std::vector baBehav; rtengine::Settings rtSettings; - std::vector favoriteDirs; + std::vector favoriteDirs; std::vector renameTemplates; bool renameUseTemplates; - std::vector thumbnailZoomRatios; - bool overlayedFileNames; - bool showFileNames; - - - Options (); - - Options* copyFrom (Options* other); - void setDefaults (); - int readFromFile (Glib::ustring fname); - int saveToFile (Glib::ustring fname); - static void load (); - static void save (); - - bool is_extention_enabled(Glib::ustring ext); -}; - -extern Options options; + std::vector thumbnailZoomRatios; + bool overlayedFileNames; + bool showFileNames; + + + Options (); + + Options* copyFrom (Options* other); + void setDefaults (); + int readFromFile (Glib::ustring fname); + int saveToFile (Glib::ustring fname); + static void load (); + static void save (); + + bool is_extention_enabled(Glib::ustring ext); +}; + +extern Options options; extern Glib::ustring argv0; extern Glib::ustring argv1; extern Glib::ustring versionString; -#endif +#endif diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index d8175bd01..aea204ab6 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index f1640dea5..3b48e2f63 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _PARAMEDITED_H_ #define _PARAMEDITED_H_ diff --git a/rtgui/partialpastedlg.cc b/rtgui/partialpastedlg.cc index 21641b614..63af45fd9 100644 --- a/rtgui/partialpastedlg.cc +++ b/rtgui/partialpastedlg.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include @@ -130,39 +130,39 @@ PartialPasteDlg::PartialPasteDlg () { get_vbox()->pack_start (*hbmain); - basicConn = basic->signal_toggled().connect (sigc::mem_fun(*this, &PartialPasteDlg::basicToggled)); - luminanceConn = luminance->signal_toggled().connect (sigc::mem_fun(*this, &PartialPasteDlg::luminanceToggled)); - colorConn = color->signal_toggled().connect (sigc::mem_fun(*this, &PartialPasteDlg::colorToggled)); - lensConn = lens->signal_toggled().connect (sigc::mem_fun(*this, &PartialPasteDlg::lensToggled)); - compositionConn = composition->signal_toggled().connect (sigc::mem_fun(*this, &PartialPasteDlg::compositionToggled)); - metaicmConn = metaicm->signal_toggled().connect (sigc::mem_fun(*this, &PartialPasteDlg::metaicmToggled)); + basicConn = basic->signal_toggled().connect (sigc::mem_fun(*this, &PartialPasteDlg::basicToggled)); + luminanceConn = luminance->signal_toggled().connect (sigc::mem_fun(*this, &PartialPasteDlg::luminanceToggled)); + colorConn = color->signal_toggled().connect (sigc::mem_fun(*this, &PartialPasteDlg::colorToggled)); + lensConn = lens->signal_toggled().connect (sigc::mem_fun(*this, &PartialPasteDlg::lensToggled)); + compositionConn = composition->signal_toggled().connect (sigc::mem_fun(*this, &PartialPasteDlg::compositionToggled)); + metaicmConn = metaicm->signal_toggled().connect (sigc::mem_fun(*this, &PartialPasteDlg::metaicmToggled)); - wbConn = wb->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true)); - exposureConn = exposure->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true)); - hlrecConn = hlrec->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true)); + wbConn = wb->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true)); + exposureConn = exposure->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true)); + hlrecConn = hlrec->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true)); - sharpenConn = sharpen->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); - lumadenConn = lumaden->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); - lumacurveConn = lumacurve->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); - shConn = sh->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); + sharpenConn = sharpen->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); + lumadenConn = lumaden->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); + lumacurveConn = lumacurve->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); + shConn = sh->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); - colormixerConn = colormixer->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); - colorshiftConn = colorshift->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); - colorboostConn = colorboost->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); - colordenConn = colorden->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); + colormixerConn = colormixer->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); + colorshiftConn = colorshift->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); + colorboostConn = colorboost->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); + colordenConn = colorden->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); - distortionConn = distortion->signal_toggled().connect (sigc::bind (sigc::mem_fun(*lens, &Gtk::CheckButton::set_inconsistent), true)); - cacorrConn = cacorr->signal_toggled().connect (sigc::bind (sigc::mem_fun(*lens, &Gtk::CheckButton::set_inconsistent), true)); - vignettingConn = vignetting->signal_toggled().connect (sigc::bind (sigc::mem_fun(*lens, &Gtk::CheckButton::set_inconsistent), true)); + distortionConn = distortion->signal_toggled().connect (sigc::bind (sigc::mem_fun(*lens, &Gtk::CheckButton::set_inconsistent), true)); + cacorrConn = cacorr->signal_toggled().connect (sigc::bind (sigc::mem_fun(*lens, &Gtk::CheckButton::set_inconsistent), true)); + vignettingConn = vignetting->signal_toggled().connect (sigc::bind (sigc::mem_fun(*lens, &Gtk::CheckButton::set_inconsistent), true)); - coarserotConn = coarserot->signal_toggled().connect (sigc::bind (sigc::mem_fun(*composition, &Gtk::CheckButton::set_inconsistent), true)); - finerotConn = finerot->signal_toggled().connect (sigc::bind (sigc::mem_fun(*composition, &Gtk::CheckButton::set_inconsistent), true)); - cropConn = crop->signal_toggled().connect (sigc::bind (sigc::mem_fun(*composition, &Gtk::CheckButton::set_inconsistent), true)); - resizeConn = resize->signal_toggled().connect (sigc::bind (sigc::mem_fun(*composition, &Gtk::CheckButton::set_inconsistent), true)); + coarserotConn = coarserot->signal_toggled().connect (sigc::bind (sigc::mem_fun(*composition, &Gtk::CheckButton::set_inconsistent), true)); + finerotConn = finerot->signal_toggled().connect (sigc::bind (sigc::mem_fun(*composition, &Gtk::CheckButton::set_inconsistent), true)); + cropConn = crop->signal_toggled().connect (sigc::bind (sigc::mem_fun(*composition, &Gtk::CheckButton::set_inconsistent), true)); + resizeConn = resize->signal_toggled().connect (sigc::bind (sigc::mem_fun(*composition, &Gtk::CheckButton::set_inconsistent), true)); - exifchConn = exifch->signal_toggled().connect (sigc::bind (sigc::mem_fun(*metaicm, &Gtk::CheckButton::set_inconsistent), true)); - iptcConn = iptc->signal_toggled().connect (sigc::bind (sigc::mem_fun(*metaicm, &Gtk::CheckButton::set_inconsistent), true)); - icmConn = icm->signal_toggled().connect (sigc::bind (sigc::mem_fun(*metaicm, &Gtk::CheckButton::set_inconsistent), true)); + exifchConn = exifch->signal_toggled().connect (sigc::bind (sigc::mem_fun(*metaicm, &Gtk::CheckButton::set_inconsistent), true)); + iptcConn = iptc->signal_toggled().connect (sigc::bind (sigc::mem_fun(*metaicm, &Gtk::CheckButton::set_inconsistent), true)); + icmConn = icm->signal_toggled().connect (sigc::bind (sigc::mem_fun(*metaicm, &Gtk::CheckButton::set_inconsistent), true)); add_button (Gtk::StockID("gtk-ok"), 1); add_button (Gtk::StockID("gtk-cancel"), 0); diff --git a/rtgui/partialpastedlg.h b/rtgui/partialpastedlg.h index 6a42a5033..03ff1b90c 100644 --- a/rtgui/partialpastedlg.h +++ b/rtgui/partialpastedlg.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _PARTIALPASTEDLG_ #define _PARTIALPASTEDLG_ diff --git a/rtgui/placesbrowser.cc b/rtgui/placesbrowser.cc index 11a9e68f7..b09025cbe 100644 --- a/rtgui/placesbrowser.cc +++ b/rtgui/placesbrowser.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include > @@ -50,8 +50,8 @@ PlacesBrowser::PlacesBrowser () : listener (NULL) { Gtk::CellRendererText *labelCR = Gtk::manage (new Gtk::CellRendererText()); iviewcol->pack_start (*iconCR, false); iviewcol->pack_start (*labelCR, true); - iviewcol->add_attribute (*iconCR, "gicon", 0); - iviewcol->add_attribute (*labelCR, "text", placesColumns.label); + iviewcol->add_attribute (*iconCR, "gicon", 0); + iviewcol->add_attribute (*labelCR, "text", placesColumns.label); treeView->append_column (*iviewcol); treeView->set_row_separator_func (sigc::mem_fun(*this, &PlacesBrowser::rowSeparatorFunc)); diff --git a/rtgui/placesbrowser.h b/rtgui/placesbrowser.h index eac18f162..ee015a863 100644 --- a/rtgui/placesbrowser.h +++ b/rtgui/placesbrowser.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _PLACESBROWSER_ #define _PLACESBROWSER_ @@ -29,7 +29,7 @@ class PlacesBrowser : public Gtk::VBox, public DirSelectionListener { class PlacesColumns : public Gtk::TreeModel::ColumnRecord { public: - Gtk::TreeModelColumn > icon; + Gtk::TreeModelColumn > icon; Gtk::TreeModelColumn label; Gtk::TreeModelColumn root; Gtk::TreeModelColumn type; diff --git a/rtgui/pointermotionlistener.h b/rtgui/pointermotionlistener.h index 0d9230c31..ff2ed0b19 100644 --- a/rtgui/pointermotionlistener.h +++ b/rtgui/pointermotionlistener.h @@ -1,28 +1,28 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _POINTERMOTIONLISTENER_ -#define _POINTERMOTIONLISTENER_ - -class PointerMotionListener { - - public: - virtual void pointerMoved (bool validPos, int x, int y, int r, int g, int b) {} -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _POINTERMOTIONLISTENER_ +#define _POINTERMOTIONLISTENER_ + +class PointerMotionListener { + + public: + virtual void pointerMoved (bool validPos, int x, int y, int r, int g, int b) {} +}; + +#endif diff --git a/rtgui/pparamschangelistener.h b/rtgui/pparamschangelistener.h index 5a34890f2..47cb8a085 100644 --- a/rtgui/pparamschangelistener.h +++ b/rtgui/pparamschangelistener.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _PPARAMSCHANGELISTENER_ #define _PPARAMSCHANGELISTENER_ @@ -28,7 +28,7 @@ class PParamsChangeListener { public: virtual void procParamsChanged (rtengine::procparams::ProcParams* params, rtengine::ProcEvent ev, Glib::ustring descr, ParamsEdited* paramsEdited=NULL) {} virtual void clearParamChanges () {} -}; +}; #endif diff --git a/rtgui/previewhandler.cc b/rtgui/previewhandler.cc index 421ebac9c..a93337625 100644 --- a/rtgui/previewhandler.cc +++ b/rtgui/previewhandler.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include diff --git a/rtgui/previewhandler.h b/rtgui/previewhandler.h index 677ad5d3f..e3a604cbd 100644 --- a/rtgui/previewhandler.h +++ b/rtgui/previewhandler.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _PREVIEWHANDLER_ #define _PREVIEWHANDLER_ diff --git a/rtgui/previewwindow.cc b/rtgui/previewwindow.cc index 9c3d647dd..139957298 100644 --- a/rtgui/previewwindow.cc +++ b/rtgui/previewwindow.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include diff --git a/rtgui/previewwindow.h b/rtgui/previewwindow.h index c3fcdb8d0..63140a31b 100644 --- a/rtgui/previewwindow.h +++ b/rtgui/previewwindow.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _PREVIEWWINDOW_ #define _PREVIEWWINDOW_ diff --git a/rtgui/procparamchangers.h b/rtgui/procparamchangers.h index 6de1c5e21..759babefc 100644 --- a/rtgui/procparamchangers.h +++ b/rtgui/procparamchangers.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #define UNKNOWN -1 #define FILEBROWSER 1 #define EDITOR 2 diff --git a/rtgui/procthread.h b/rtgui/procthread.h index f992899b4..c025bd028 100644 --- a/rtgui/procthread.h +++ b/rtgui/procthread.h @@ -1,78 +1,78 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _PROCTHREAD_ -#define _PROCTHREAD_ - -#include - -template -class ProcessingThread { - - protected: - bool tostop; - bool stopped; - std::list jqueue; +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _PROCTHREAD_ +#define _PROCTHREAD_ + +#include + +template +class ProcessingThread { + + protected: + bool tostop; + bool stopped; + std::list jqueue; Glib::Thread* thread; - bool fifo; - - public: - ProcessingThread () : tostop(false), stopped(true), fifo(true) {} - void init () { tostop = false; stopped = true; } - void add (T de) { jqueue.push_back (de); } - void removejobs () { while (!jqueue.empty()) jqueue.pop_front (); } - void stop () { if (stopped) { tostop = true; return; } gdk_threads_leave(); tostop = true; Glib::Thread::self()->yield(); if (!stopped) thread->join (); gdk_threads_enter();} - - virtual void start () {} - virtual void process (T& e) {} - virtual void processCustomOrder () {} - virtual void end () {} - - void process () { - if (stopped) - #undef THREAD_PRIORITY_NORMAL - thread = Glib::Thread::create(sigc::mem_fun(*this, &ProcessingThread::process_), (unsigned long int)0, true, true, Glib::THREAD_PRIORITY_NORMAL); - } - void process_ () { - stopped = false; - tostop = false; - - start (); // jqueue.sort (); - - - while (!tostop && !jqueue.empty ()) { + bool fifo; + + public: + ProcessingThread () : tostop(false), stopped(true), fifo(true) {} + void init () { tostop = false; stopped = true; } + void add (T de) { jqueue.push_back (de); } + void removejobs () { while (!jqueue.empty()) jqueue.pop_front (); } + void stop () { if (stopped) { tostop = true; return; } gdk_threads_leave(); tostop = true; Glib::Thread::self()->yield(); if (!stopped) thread->join (); gdk_threads_enter();} + + virtual void start () {} + virtual void process (T& e) {} + virtual void processCustomOrder () {} + virtual void end () {} + + void process () { + if (stopped) + #undef THREAD_PRIORITY_NORMAL + thread = Glib::Thread::create(sigc::mem_fun(*this, &ProcessingThread::process_), (unsigned long int)0, true, true, Glib::THREAD_PRIORITY_NORMAL); + } + void process_ () { + stopped = false; + tostop = false; + + start (); // jqueue.sort (); + + + while (!tostop && !jqueue.empty ()) { if (fifo) { - T current = jqueue.front (); - jqueue.pop_front (); - process (current); + T current = jqueue.front (); + jqueue.pop_front (); + process (current); } else processCustomOrder (); } - stopped = true; - end (); - } - - bool runs () { return !stopped; } - + stopped = true; + end (); + } + + bool runs () { return !stopped; } + void terminate () { stop (); removejobs (); } - int numOfJobs () { return jqueue.size(); } -}; - -#endif + int numOfJobs () { return jqueue.size(); } +}; + +#endif diff --git a/rtgui/profilechangelistener.h b/rtgui/profilechangelistener.h index a57ad4d88..48f19ea9b 100644 --- a/rtgui/profilechangelistener.h +++ b/rtgui/profilechangelistener.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _PROFILECHANGELISTENER_ #define _PROFILECHANGELISTENER_ diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index 5849f885d..6c7e10d58 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -1,385 +1,385 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include +#include #include - -using namespace rtengine; -using namespace rtengine::procparams; - -extern Glib::ustring argv0; - -ProfilePanel::ProfilePanel () { - - tpc = NULL; - - profiles = Gtk::manage (new Gtk::ComboBoxText ()); - Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox ()); - hbox->show (); -// pack_start (*profiles, Gtk::PACK_SHRINK, 4); - - pack_start (*hbox, Gtk::PACK_SHRINK, 4); - - save = Gtk::manage (new Gtk::Button ()); - save->add (*Gtk::manage (new Gtk::Image (Gtk::StockID("gtk-save"), Gtk::ICON_SIZE_BUTTON))); - load = Gtk::manage (new Gtk::Button ()); - load->add (*Gtk::manage (new Gtk::Image (Gtk::StockID("gtk-open"), Gtk::ICON_SIZE_BUTTON))); - copy = Gtk::manage (new Gtk::Button ()); - copy->add (*Gtk::manage (new Gtk::Image (Gtk::StockID("gtk-copy"), Gtk::ICON_SIZE_BUTTON))); - paste = Gtk::manage (new Gtk::Button ()); - paste->add (*Gtk::manage (new Gtk::Image (Gtk::StockID("gtk-paste"), Gtk::ICON_SIZE_BUTTON))); - - hbox->pack_start (*profiles); - hbox->pack_start (*load, Gtk::PACK_SHRINK, 1); - hbox->pack_start (*save, Gtk::PACK_SHRINK, 1); - hbox->pack_start (*copy, Gtk::PACK_SHRINK, 1); - hbox->pack_start (*paste, Gtk::PACK_SHRINK, 1); - - load->signal_clicked().connect( sigc::mem_fun(*this, &ProfilePanel::load_clicked) ); - save->signal_clicked().connect( sigc::mem_fun(*this, &ProfilePanel::save_clicked) ); - copy->signal_clicked().connect( sigc::mem_fun(*this, &ProfilePanel::copy_clicked) ); - paste->signal_clicked().connect( sigc::mem_fun(*this, &ProfilePanel::paste_clicked) ); - - custom = NULL; - lastphoto = NULL; - lastsaved = NULL; - dontupdate = false; - - refreshProfileList (); - - profiles->set_active (0); - old = profiles->get_active_text(); - changeconn = profiles->signal_changed().connect( sigc::mem_fun(*this, &ProfilePanel::selection_changed) ); - - save->set_tooltip_text (M("PROFILEPANEL_TOOLTIPSAVE")); - load->set_tooltip_text (M("PROFILEPANEL_TOOLTIPLOAD")); - copy->set_tooltip_text (M("PROFILEPANEL_TOOLTIPCOPY")); - paste->set_tooltip_text (M("PROFILEPANEL_TOOLTIPPASTE")); - - show_all_children (); + +using namespace rtengine; +using namespace rtengine::procparams; + +extern Glib::ustring argv0; + +ProfilePanel::ProfilePanel () { + + tpc = NULL; + + profiles = Gtk::manage (new Gtk::ComboBoxText ()); + Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox ()); + hbox->show (); +// pack_start (*profiles, Gtk::PACK_SHRINK, 4); + + pack_start (*hbox, Gtk::PACK_SHRINK, 4); + + save = Gtk::manage (new Gtk::Button ()); + save->add (*Gtk::manage (new Gtk::Image (Gtk::StockID("gtk-save"), Gtk::ICON_SIZE_BUTTON))); + load = Gtk::manage (new Gtk::Button ()); + load->add (*Gtk::manage (new Gtk::Image (Gtk::StockID("gtk-open"), Gtk::ICON_SIZE_BUTTON))); + copy = Gtk::manage (new Gtk::Button ()); + copy->add (*Gtk::manage (new Gtk::Image (Gtk::StockID("gtk-copy"), Gtk::ICON_SIZE_BUTTON))); + paste = Gtk::manage (new Gtk::Button ()); + paste->add (*Gtk::manage (new Gtk::Image (Gtk::StockID("gtk-paste"), Gtk::ICON_SIZE_BUTTON))); + + hbox->pack_start (*profiles); + hbox->pack_start (*load, Gtk::PACK_SHRINK, 1); + hbox->pack_start (*save, Gtk::PACK_SHRINK, 1); + hbox->pack_start (*copy, Gtk::PACK_SHRINK, 1); + hbox->pack_start (*paste, Gtk::PACK_SHRINK, 1); + + load->signal_clicked().connect( sigc::mem_fun(*this, &ProfilePanel::load_clicked) ); + save->signal_clicked().connect( sigc::mem_fun(*this, &ProfilePanel::save_clicked) ); + copy->signal_clicked().connect( sigc::mem_fun(*this, &ProfilePanel::copy_clicked) ); + paste->signal_clicked().connect( sigc::mem_fun(*this, &ProfilePanel::paste_clicked) ); + + custom = NULL; + lastphoto = NULL; + lastsaved = NULL; + dontupdate = false; + + refreshProfileList (); + + profiles->set_active (0); + old = profiles->get_active_text(); + changeconn = profiles->signal_changed().connect( sigc::mem_fun(*this, &ProfilePanel::selection_changed) ); + + save->set_tooltip_text (M("PROFILEPANEL_TOOLTIPSAVE")); + load->set_tooltip_text (M("PROFILEPANEL_TOOLTIPLOAD")); + copy->set_tooltip_text (M("PROFILEPANEL_TOOLTIPCOPY")); + paste->set_tooltip_text (M("PROFILEPANEL_TOOLTIPPASTE")); + + show_all_children (); } ProfilePanel::~ProfilePanel () { - delete custom; - delete lastsaved; - delete lastphoto; -} - -void ProfilePanel::refreshProfileList () { - - Glib::ustring oldsel = profiles->get_active_text (); - changeconn.block (true); - - // clear items - profiles->clear_items (); - pparams.clear (); - - // re-parse profile directories (deletes old ones) - profileStore.parseProfiles (); - pparams = profileStore.getProfileNames (); - for (int i=0; iappend_text (pparams[i]); - - if (custom) - profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); - if (lastsaved) - profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PLASTSAVED") + ")"); - if (lastphoto) - profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PLASTPHOTO") + ")"); - - profiles->set_active_text (oldsel); - changeconn.block (false); -} - -void ProfilePanel::save_clicked () { - - Gtk::FileChooserDialog dialog(M("PROFILEPANEL_SAVEDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_SAVE); - if (options.multiUser) - dialog.set_current_folder (Options::rtdir + "/" + options.profilePath); - else - dialog.set_current_folder (argv0 + "/" + options.profilePath); - - //Add response buttons the the dialog: - dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); - dialog.add_button(Gtk::StockID("gtk-save"), Gtk::RESPONSE_OK); - - //Add filters, so that only certain file types can be selected: - - Gtk::FileFilter filter_pp; - filter_pp.set_name(M("PROFILEPANEL_FILEDLGFILTERPP")); - filter_pp.add_pattern("*.pp2"); - dialog.add_filter(filter_pp); - - Gtk::FileFilter filter_any; - filter_any.set_name(M("PROFILEPANEL_FILEDLGFILTERANY")); - filter_any.add_pattern("*"); - dialog.add_filter(filter_any); - -// dialog.set_do_overwrite_confirmation (true); - - savedialog = &dialog; - - int result = dialog.run(); - - if (result==Gtk::RESPONSE_OK) { - - std::string fname = dialog.get_filename(); - - bool hasext = true; - int dotpos = fname.find_last_of ('.'); - if (dotpos==Glib::ustring::npos) - hasext = false; - int dirpos1 = fname.find_last_of ('/'); - if (dirpos1!=Glib::ustring::npos && dirpos1>dotpos) - hasext = false; - int dirpos2 = fname.find_last_of ('\\'); - if (dirpos2!=Glib::ustring::npos && dirpos2>dotpos) - hasext = false; - - if (!hasext) - fname = fname + ".pp2"; - - if (Glib::file_test (fname, Glib::FILE_TEST_EXISTS)) { - Glib::ustring msg_ = Glib::ustring("") + fname + ": " + M("MAIN_MSG_ALREADYEXISTS") + "\n" + M("MAIN_MSG_QOVERWRITE") + ""; - Gtk::MessageDialog msgd (msg_, true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_YES_NO, true); - int response = msgd.run (); - if (response==Gtk::RESPONSE_NO) - return; - } - - ProcParams* toSave = NULL; - if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")") - toSave = custom; - else if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PLASTSAVED") + ")") - toSave = lastsaved; - else if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PLASTPHOTO") + ")") - toSave = lastphoto; - else - toSave = profileStore.getProfile (profiles->get_active_text()); - - if (toSave) { - toSave->save (fname); - refreshProfileList (); - } - } -} - -void ProfilePanel::copy_clicked () { - - ProcParams* toSave = NULL; - if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")") - toSave = custom; - else if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PLASTSAVED") + ")") - toSave = lastsaved; - else if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PLASTPHOTO") + ")") - toSave = lastphoto; - else - toSave = profileStore.getProfile (profiles->get_active_text()); - - if (toSave) - clipboard.setProcParams (*toSave); -} - -void ProfilePanel::load_clicked () { - - Gtk::FileChooserDialog dialog(M("PROFILEPANEL_LOADDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN); - if (options.multiUser) - dialog.set_current_folder (Options::rtdir + "/" + options.profilePath); - else - dialog.set_current_folder (argv0 + "/" + options.profilePath); - - //Add response buttons the the dialog: - dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); - dialog.add_button(Gtk::StockID("gtk-open"), Gtk::RESPONSE_OK); - - //Add filters, so that only certain file types can be selected: - - Gtk::FileFilter filter_pp; - filter_pp.set_name(M("PROFILEPANEL_FILEDLGFILTERPP")); - filter_pp.add_pattern("*.pp2"); - dialog.add_filter(filter_pp); - - Gtk::FileFilter filter_any; - filter_any.set_name(M("PROFILEPANEL_FILEDLGFILTERANY")); - filter_any.add_pattern("*"); - dialog.add_filter(filter_any); - - int result = dialog.run(); - - if (result==Gtk::RESPONSE_OK) { - if (!custom) { - custom = new ProcParams (); - profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); - } - custom->load (dialog.get_filename()); - profiles->set_active_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); - old = profiles->get_active_text(); - changeTo (custom, M("PROFILEPANEL_PFILE")); - } -} - -void ProfilePanel::paste_clicked () { - - if (!clipboard.hasProcParams()) - return; - - if (!custom) { - custom = new ProcParams (); - profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); - } - *custom = clipboard.getProcParams (); - profiles->set_active_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); - old = profiles->get_active_text(); - changeTo (custom, M("HISTORY_FROMCLIPBOARD")); -} - -void ProfilePanel::changeTo (ProcParams* newpp, Glib::ustring profname) { - - if (!newpp) - return; - - // Keep transformation parameters while changing the profile - -/* int cropx = working->crop_x; - int cropy = working->crop_y; - int cropw = working->crop_w; - int croph = working->crop_h; - bool crope = working->crop_enabled; - int rotcor = working->rotate_coarse; - double rotfine = working->rotate_fine; - double lenscorr = working->lens_distortion; - bool hflip = working->horizontal_flip; - bool vflip = working->vertical_flip; - - working->copy (newpp); - - working->crop_x = cropx; - working->crop_y = cropy; - working->crop_w = cropw; - working->crop_h = croph; - working->crop_enabled = crope; - working->rotate_coarse = rotcor; - working->rotate_fine = rotfine; - working->lens_distortion = lenscorr; - working->horizontal_flip = hflip; - working->vertical_flip = vflip; -*/ - if (tpc) - tpc->profileChange (newpp, EvProfileChanged, profname); -} - -void ProfilePanel::selection_changed () { - - if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")") { - if (!dontupdate) - changeTo (custom, Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); - } - else if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PLASTSAVED") + ")") - changeTo (lastsaved, Glib::ustring("(") + M("PROFILEPANEL_PLASTSAVED") + ")"); - else if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PLASTPHOTO") + ")") - changeTo (lastphoto, Glib::ustring("(") + M("PROFILEPANEL_PLASTPHOTO") + ")"); - else { - ProcParams* s = profileStore.getProfile (profiles->get_active_text()); - if (s) - changeTo (s, profiles->get_active_text()); - } - old = profiles->get_active_text (); - dontupdate = false; -} - + delete custom; + delete lastsaved; + delete lastphoto; +} + +void ProfilePanel::refreshProfileList () { + + Glib::ustring oldsel = profiles->get_active_text (); + changeconn.block (true); + + // clear items + profiles->clear_items (); + pparams.clear (); + + // re-parse profile directories (deletes old ones) + profileStore.parseProfiles (); + pparams = profileStore.getProfileNames (); + for (int i=0; iappend_text (pparams[i]); + + if (custom) + profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); + if (lastsaved) + profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PLASTSAVED") + ")"); + if (lastphoto) + profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PLASTPHOTO") + ")"); + + profiles->set_active_text (oldsel); + changeconn.block (false); +} + +void ProfilePanel::save_clicked () { + + Gtk::FileChooserDialog dialog(M("PROFILEPANEL_SAVEDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_SAVE); + if (options.multiUser) + dialog.set_current_folder (Options::rtdir + "/" + options.profilePath); + else + dialog.set_current_folder (argv0 + "/" + options.profilePath); + + //Add response buttons the the dialog: + dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); + dialog.add_button(Gtk::StockID("gtk-save"), Gtk::RESPONSE_OK); + + //Add filters, so that only certain file types can be selected: + + Gtk::FileFilter filter_pp; + filter_pp.set_name(M("PROFILEPANEL_FILEDLGFILTERPP")); + filter_pp.add_pattern("*.pp2"); + dialog.add_filter(filter_pp); + + Gtk::FileFilter filter_any; + filter_any.set_name(M("PROFILEPANEL_FILEDLGFILTERANY")); + filter_any.add_pattern("*"); + dialog.add_filter(filter_any); + +// dialog.set_do_overwrite_confirmation (true); + + savedialog = &dialog; + + int result = dialog.run(); + + if (result==Gtk::RESPONSE_OK) { + + std::string fname = dialog.get_filename(); + + bool hasext = true; + int dotpos = fname.find_last_of ('.'); + if (dotpos==Glib::ustring::npos) + hasext = false; + int dirpos1 = fname.find_last_of ('/'); + if (dirpos1!=Glib::ustring::npos && dirpos1>dotpos) + hasext = false; + int dirpos2 = fname.find_last_of ('\\'); + if (dirpos2!=Glib::ustring::npos && dirpos2>dotpos) + hasext = false; + + if (!hasext) + fname = fname + ".pp2"; + + if (Glib::file_test (fname, Glib::FILE_TEST_EXISTS)) { + Glib::ustring msg_ = Glib::ustring("") + fname + ": " + M("MAIN_MSG_ALREADYEXISTS") + "\n" + M("MAIN_MSG_QOVERWRITE") + ""; + Gtk::MessageDialog msgd (msg_, true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_YES_NO, true); + int response = msgd.run (); + if (response==Gtk::RESPONSE_NO) + return; + } + + ProcParams* toSave = NULL; + if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")") + toSave = custom; + else if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PLASTSAVED") + ")") + toSave = lastsaved; + else if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PLASTPHOTO") + ")") + toSave = lastphoto; + else + toSave = profileStore.getProfile (profiles->get_active_text()); + + if (toSave) { + toSave->save (fname); + refreshProfileList (); + } + } +} + +void ProfilePanel::copy_clicked () { + + ProcParams* toSave = NULL; + if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")") + toSave = custom; + else if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PLASTSAVED") + ")") + toSave = lastsaved; + else if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PLASTPHOTO") + ")") + toSave = lastphoto; + else + toSave = profileStore.getProfile (profiles->get_active_text()); + + if (toSave) + clipboard.setProcParams (*toSave); +} + +void ProfilePanel::load_clicked () { + + Gtk::FileChooserDialog dialog(M("PROFILEPANEL_LOADDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN); + if (options.multiUser) + dialog.set_current_folder (Options::rtdir + "/" + options.profilePath); + else + dialog.set_current_folder (argv0 + "/" + options.profilePath); + + //Add response buttons the the dialog: + dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); + dialog.add_button(Gtk::StockID("gtk-open"), Gtk::RESPONSE_OK); + + //Add filters, so that only certain file types can be selected: + + Gtk::FileFilter filter_pp; + filter_pp.set_name(M("PROFILEPANEL_FILEDLGFILTERPP")); + filter_pp.add_pattern("*.pp2"); + dialog.add_filter(filter_pp); + + Gtk::FileFilter filter_any; + filter_any.set_name(M("PROFILEPANEL_FILEDLGFILTERANY")); + filter_any.add_pattern("*"); + dialog.add_filter(filter_any); + + int result = dialog.run(); + + if (result==Gtk::RESPONSE_OK) { + if (!custom) { + custom = new ProcParams (); + profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); + } + custom->load (dialog.get_filename()); + profiles->set_active_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); + old = profiles->get_active_text(); + changeTo (custom, M("PROFILEPANEL_PFILE")); + } +} + +void ProfilePanel::paste_clicked () { + + if (!clipboard.hasProcParams()) + return; + + if (!custom) { + custom = new ProcParams (); + profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); + } + *custom = clipboard.getProcParams (); + profiles->set_active_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); + old = profiles->get_active_text(); + changeTo (custom, M("HISTORY_FROMCLIPBOARD")); +} + +void ProfilePanel::changeTo (ProcParams* newpp, Glib::ustring profname) { + + if (!newpp) + return; + + // Keep transformation parameters while changing the profile + +/* int cropx = working->crop_x; + int cropy = working->crop_y; + int cropw = working->crop_w; + int croph = working->crop_h; + bool crope = working->crop_enabled; + int rotcor = working->rotate_coarse; + double rotfine = working->rotate_fine; + double lenscorr = working->lens_distortion; + bool hflip = working->horizontal_flip; + bool vflip = working->vertical_flip; + + working->copy (newpp); + + working->crop_x = cropx; + working->crop_y = cropy; + working->crop_w = cropw; + working->crop_h = croph; + working->crop_enabled = crope; + working->rotate_coarse = rotcor; + working->rotate_fine = rotfine; + working->lens_distortion = lenscorr; + working->horizontal_flip = hflip; + working->vertical_flip = vflip; +*/ + if (tpc) + tpc->profileChange (newpp, EvProfileChanged, profname); +} + +void ProfilePanel::selection_changed () { + + if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")") { + if (!dontupdate) + changeTo (custom, Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); + } + else if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PLASTSAVED") + ")") + changeTo (lastsaved, Glib::ustring("(") + M("PROFILEPANEL_PLASTSAVED") + ")"); + else if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PLASTPHOTO") + ")") + changeTo (lastphoto, Glib::ustring("(") + M("PROFILEPANEL_PLASTPHOTO") + ")"); + else { + ProcParams* s = profileStore.getProfile (profiles->get_active_text()); + if (s) + changeTo (s, profiles->get_active_text()); + } + old = profiles->get_active_text (); + dontupdate = false; +} + void ProfilePanel::procParamsChanged (rtengine::procparams::ProcParams* p, rtengine::ProcEvent ev, Glib::ustring descr, ParamsEdited* paramsEdited) { // to prevent recursion filter out the events caused by the profilepanel if (ev==EvProfileChanged || ev==EvPhotoLoaded) - return; - - if (profiles->get_active_text() != Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")") { - dontupdate = true; - if (!custom) { - custom = new ProcParams (); - profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); - } - *custom = *p; - profiles->set_active_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); - old = profiles->get_active_text(); - } - else - *custom = *p; -} - -void ProfilePanel::initProfile (const Glib::ustring& profname, ProcParams* lastSaved, ProcParams* lastPhoto) { - - changeconn.block (true); - - profiles->clear_items (); - pparams.clear (); - - pparams = profileStore.getProfileNames (); - for (int i=0; iappend_text (pparams[i]); - - delete custom; - custom = NULL; - delete lastsaved; - lastsaved = lastSaved; - delete lastphoto; - lastphoto = lastPhoto; - - Glib::ustring defline = profname; - ProcParams* defprofile = profileStore.getProfile (profname); - - if (lastphoto) - profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PLASTPHOTO") + ")"); - - if (lastsaved) { - defline = Glib::ustring("(") + M("PROFILEPANEL_PLASTSAVED") + ")"; - defprofile = lastsaved; - profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PLASTSAVED") + ")"); - } - - if (tpc) { - if (lastsaved) - tpc->setDefaults (lastsaved); - else - tpc->setDefaults (profileStore.getProfile (profname)); - } - if (defprofile) { - old = defline; - profiles->set_active_text (defline); - changeconn.block (false); - if (tpc) - tpc->profileChange (defprofile, EvPhotoLoaded, defline); - } - else { - // select first valid profile - old = ""; - profiles->set_active (0); - ProcParams* s = profileStore.getProfile (profiles->get_active_text()); - if (!s) - s = new ProcParams (); - changeconn.block (false); - if (tpc) - tpc->profileChange (s, EvPhotoLoaded, profiles->get_active_text()); - } -} - - + return; + + if (profiles->get_active_text() != Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")") { + dontupdate = true; + if (!custom) { + custom = new ProcParams (); + profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); + } + *custom = *p; + profiles->set_active_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); + old = profiles->get_active_text(); + } + else + *custom = *p; +} + +void ProfilePanel::initProfile (const Glib::ustring& profname, ProcParams* lastSaved, ProcParams* lastPhoto) { + + changeconn.block (true); + + profiles->clear_items (); + pparams.clear (); + + pparams = profileStore.getProfileNames (); + for (int i=0; iappend_text (pparams[i]); + + delete custom; + custom = NULL; + delete lastsaved; + lastsaved = lastSaved; + delete lastphoto; + lastphoto = lastPhoto; + + Glib::ustring defline = profname; + ProcParams* defprofile = profileStore.getProfile (profname); + + if (lastphoto) + profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PLASTPHOTO") + ")"); + + if (lastsaved) { + defline = Glib::ustring("(") + M("PROFILEPANEL_PLASTSAVED") + ")"; + defprofile = lastsaved; + profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PLASTSAVED") + ")"); + } + + if (tpc) { + if (lastsaved) + tpc->setDefaults (lastsaved); + else + tpc->setDefaults (profileStore.getProfile (profname)); + } + if (defprofile) { + old = defline; + profiles->set_active_text (defline); + changeconn.block (false); + if (tpc) + tpc->profileChange (defprofile, EvPhotoLoaded, defline); + } + else { + // select first valid profile + old = ""; + profiles->set_active (0); + ProcParams* s = profileStore.getProfile (profiles->get_active_text()); + if (!s) + s = new ProcParams (); + changeconn.block (false); + if (tpc) + tpc->profileChange (s, EvPhotoLoaded, profiles->get_active_text()); + } +} + + diff --git a/rtgui/profilepanel.h b/rtgui/profilepanel.h index 2009aad8b..2d8139a3e 100644 --- a/rtgui/profilepanel.h +++ b/rtgui/profilepanel.h @@ -1,70 +1,70 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _PROFILEPANEL_ -#define _PROFILEPANEL_ - -#include -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _PROFILEPANEL_ +#define _PROFILEPANEL_ + +#include +#include +#include #include #include - -class ProfilePanel : public Gtk::VBox, public PParamsChangeListener { - - protected: - - Gtk::Button* save; - Gtk::Button* load; - Gtk::Button* copy; - Gtk::Button* paste; - Gtk::ComboBoxText* profiles; - std::vector pparams; - rtengine::procparams::ProcParams* custom; - rtengine::procparams::ProcParams* lastsaved; - rtengine::procparams::ProcParams* lastphoto; - Glib::ustring old; - ProfileChangeListener* tpc; - bool dontupdate; - sigc::connection changeconn; - Gtk::FileChooserDialog* savedialog; - - void changeTo (rtengine::procparams::ProcParams* newpp, Glib::ustring profname); - void refreshProfileList (); - - public: - + +class ProfilePanel : public Gtk::VBox, public PParamsChangeListener { + + protected: + + Gtk::Button* save; + Gtk::Button* load; + Gtk::Button* copy; + Gtk::Button* paste; + Gtk::ComboBoxText* profiles; + std::vector pparams; + rtengine::procparams::ProcParams* custom; + rtengine::procparams::ProcParams* lastsaved; + rtengine::procparams::ProcParams* lastphoto; + Glib::ustring old; + ProfileChangeListener* tpc; + bool dontupdate; + sigc::connection changeconn; + Gtk::FileChooserDialog* savedialog; + + void changeTo (rtengine::procparams::ProcParams* newpp, Glib::ustring profname); + void refreshProfileList (); + + public: + ProfilePanel (); virtual ~ProfilePanel (); - void setProfileChangeListener (ProfileChangeListener* ppl) { tpc = ppl; } - - void initProfile (const Glib::ustring& profname, rtengine::procparams::ProcParams* lastSaved, rtengine::procparams::ProcParams* lastPhoto); + void setProfileChangeListener (ProfileChangeListener* ppl) { tpc = ppl; } + + void initProfile (const Glib::ustring& profname, rtengine::procparams::ProcParams* lastSaved, rtengine::procparams::ProcParams* lastPhoto); // PParamsChangeListener interface - void procParamsChanged (rtengine::procparams::ProcParams* params, rtengine::ProcEvent ev, Glib::ustring descr, ParamsEdited* paramsEdited=NULL); + void procParamsChanged (rtengine::procparams::ProcParams* params, rtengine::ProcEvent ev, Glib::ustring descr, ParamsEdited* paramsEdited=NULL); - // gui callbacks - void save_clicked (); - void load_clicked (); - void copy_clicked (); - void paste_clicked (); - void selection_changed (); -}; - -#endif + // gui callbacks + void save_clicked (); + void load_clicked (); + void copy_clicked (); + void paste_clicked (); + void selection_changed (); +}; + +#endif diff --git a/rtgui/profilestore.h b/rtgui/profilestore.h index d54b90498..cf8136455 100644 --- a/rtgui/profilestore.h +++ b/rtgui/profilestore.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _PROFILESTORE_ #define _PROFILESTORE_ diff --git a/rtgui/progressdialog.cc b/rtgui/progressdialog.cc index cc9df4c6b..871e00bcb 100644 --- a/rtgui/progressdialog.cc +++ b/rtgui/progressdialog.cc @@ -1,56 +1,56 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include - -template -ProgressDialog::ProgressDialog (const sigc::slot0& slot) { - +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include + +template +ProgressDialog::ProgressDialog (const sigc::slot0& slot) { + set_deletable (false); - operation.connect (slot); -} - -template -void ProgressDialog::start () { - - T ret = operation.emit (); -} - -template -void ProgressDialog::finish () { - - gtk_threads_enter (); - hide (); - gtk_threads_leave (); -} - -template -void ProgressDialog::setProgress (double p) { -} - -template -void ProgressDialog::setProgressStr (Glib::ustring str) { -} - -template -void ProgressDialog::setProgressState (int state) { -} - -template -void ProgressDialog::error (Glib::ustring descr) { -} + operation.connect (slot); +} + +template +void ProgressDialog::start () { + + T ret = operation.emit (); +} + +template +void ProgressDialog::finish () { + + gtk_threads_enter (); + hide (); + gtk_threads_leave (); +} + +template +void ProgressDialog::setProgress (double p) { +} + +template +void ProgressDialog::setProgressStr (Glib::ustring str) { +} + +template +void ProgressDialog::setProgressState (int state) { +} + +template +void ProgressDialog::error (Glib::ustring descr) { +} diff --git a/rtgui/progressdialog.h b/rtgui/progressdialog.h index 48076194d..07c85466c 100644 --- a/rtgui/progressdialog.h +++ b/rtgui/progressdialog.h @@ -1,128 +1,128 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _PROGRESSDIALOG_ -#define _PROGRESSDIALOG_ - -#include -#include -#include - -#undef THREAD_PRIORITY_NORMAL - -class PLDBridge : public rtengine::ProgressListener { - - Gtk::Dialog* dialog; - Gtk::Label* label; - Gtk::ProgressBar* progBar; - - public: - PLDBridge (Gtk::Dialog* d, Gtk::Label* l, Gtk::ProgressBar* pb) - : dialog(d), label(l), progBar(pb) {} - - // progresslistener interface - void setProgress (double p) { - gdk_threads_enter (); - progBar->set_fraction (p); - gdk_threads_leave (); - } - void setProgressStr (Glib::ustring str) { - gdk_threads_enter (); - Glib::ustring progrstr; - if (str=="Decoding...") - progrstr = M("PROGRESSBAR_DECODING"); - else if (str=="Ready.") - progrstr = M("PROGRESSBAR_READY"); - else if (str=="Demosaicing...") - progrstr = M("PROGRESSBAR_DEMOSAICING"); - else if (str=="Loading...") - progrstr = M("PROGRESSBAR_LOADING"); - else if (str=="Loading PNG file...") - progrstr = M("PROGRESSBAR_LOADPNG"); - else if (str=="Loading JPEG file...") - progrstr = M("PROGRESSBAR_LOADJPEG"); - else if (str=="Loading TIFF file...") - progrstr = M("PROGRESSBAR_LOADTIFF"); - else if (str=="Saving PNG file...") - progrstr = M("PROGRESSBAR_SAVEPNG"); - else if (str=="Saving JPEG file...") - progrstr = M("PROGRESSBAR_SAVEJPEG"); - else if (str=="Saving TIFF file...") - progrstr = M("PROGRESSBAR_SAVETIFF"); - else if (str=="Processing...") - progrstr = M("PROGRESSBAR_PROCESSING"); - else - progrstr = str; - - label->set_text (progrstr); - gdk_threads_leave (); - } - void setProgressState (int state) {} - void error (Glib::ustring descr) {} -}; - -template -class ProgressDialog : public Gtk::Dialog { - - sigc::signal0 operation; - T* retval; - Gtk::Label prLabel; - Gtk::ProgressBar prProgBar; - - PLDBridge* pldBridge; - - - void workingThread () { +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _PROGRESSDIALOG_ +#define _PROGRESSDIALOG_ + +#include +#include +#include + +#undef THREAD_PRIORITY_NORMAL + +class PLDBridge : public rtengine::ProgressListener { + + Gtk::Dialog* dialog; + Gtk::Label* label; + Gtk::ProgressBar* progBar; + + public: + PLDBridge (Gtk::Dialog* d, Gtk::Label* l, Gtk::ProgressBar* pb) + : dialog(d), label(l), progBar(pb) {} + + // progresslistener interface + void setProgress (double p) { + gdk_threads_enter (); + progBar->set_fraction (p); + gdk_threads_leave (); + } + void setProgressStr (Glib::ustring str) { + gdk_threads_enter (); + Glib::ustring progrstr; + if (str=="Decoding...") + progrstr = M("PROGRESSBAR_DECODING"); + else if (str=="Ready.") + progrstr = M("PROGRESSBAR_READY"); + else if (str=="Demosaicing...") + progrstr = M("PROGRESSBAR_DEMOSAICING"); + else if (str=="Loading...") + progrstr = M("PROGRESSBAR_LOADING"); + else if (str=="Loading PNG file...") + progrstr = M("PROGRESSBAR_LOADPNG"); + else if (str=="Loading JPEG file...") + progrstr = M("PROGRESSBAR_LOADJPEG"); + else if (str=="Loading TIFF file...") + progrstr = M("PROGRESSBAR_LOADTIFF"); + else if (str=="Saving PNG file...") + progrstr = M("PROGRESSBAR_SAVEPNG"); + else if (str=="Saving JPEG file...") + progrstr = M("PROGRESSBAR_SAVEJPEG"); + else if (str=="Saving TIFF file...") + progrstr = M("PROGRESSBAR_SAVETIFF"); + else if (str=="Processing...") + progrstr = M("PROGRESSBAR_PROCESSING"); + else + progrstr = str; + + label->set_text (progrstr); + gdk_threads_leave (); + } + void setProgressState (int state) {} + void error (Glib::ustring descr) {} +}; + +template +class ProgressDialog : public Gtk::Dialog { + + sigc::signal0 operation; + T* retval; + Gtk::Label prLabel; + Gtk::ProgressBar prProgBar; + + PLDBridge* pldBridge; + + + void workingThread () { *retval = operation.emit (); - gdk_threads_enter (); - response (1); - gdk_threads_leave (); - } - - public: - + gdk_threads_enter (); + response (1); + gdk_threads_leave (); + } + + public: + ProgressDialog (Glib::ustring label) : Gtk::Dialog (label, true) { - pldBridge = new PLDBridge (this, &prLabel, &prProgBar); - get_vbox()->pack_start (prLabel, Gtk::PACK_SHRINK, 4); - get_vbox()->pack_start (prProgBar, Gtk::PACK_SHRINK, 4); + pldBridge = new PLDBridge (this, &prLabel, &prProgBar); + get_vbox()->pack_start (prLabel, Gtk::PACK_SHRINK, 4); + get_vbox()->pack_start (prProgBar, Gtk::PACK_SHRINK, 4); set_size_request (300, -1); show_all_children (); - } - - ~ProgressDialog () { - delete pldBridge; - } - - rtengine::ProgressListener* getProgressListener () { return pldBridge; } - - void setFunc (const sigc::slot0& slot, T* rv) { - retval = rv; - operation.connect (slot); - } - - void start () { - Glib::Thread *thread = Glib::Thread::create(sigc::mem_fun(*this, &ProgressDialog::workingThread), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); - int x = run (); - if (x<0) { - gdk_threads_leave (); - thread->join (); - gdk_threads_enter (); - } } -}; -#endif + + ~ProgressDialog () { + delete pldBridge; + } + + rtengine::ProgressListener* getProgressListener () { return pldBridge; } + + void setFunc (const sigc::slot0& slot, T* rv) { + retval = rv; + operation.connect (slot); + } + + void start () { + Glib::Thread *thread = Glib::Thread::create(sigc::mem_fun(*this, &ProgressDialog::workingThread), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); + int x = run (); + if (x<0) { + gdk_threads_leave (); + thread->join (); + gdk_threads_enter (); + } + } +}; +#endif diff --git a/rtgui/quickzoomlistener.h b/rtgui/quickzoomlistener.h index 958e05302..4cbaad8fc 100644 --- a/rtgui/quickzoomlistener.h +++ b/rtgui/quickzoomlistener.h @@ -1,34 +1,34 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _QZLISTENER_ -#define _QZLISTENER_ - -class QuickZoomListener { - - public: - - virtual void increaseZoom () {} - virtual void decreaseZoom () {} - virtual void quickZoom () {} - virtual void increaseCropZoom () {} - virtual void decreaseCropZoom () {} - virtual void quickCropZoom () {} -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _QZLISTENER_ +#define _QZLISTENER_ + +class QuickZoomListener { + + public: + + virtual void increaseZoom () {} + virtual void decreaseZoom () {} + virtual void quickZoom () {} + virtual void increaseCropZoom () {} + virtual void decreaseCropZoom () {} + virtual void quickCropZoom () {} +}; + +#endif diff --git a/rtgui/recentbrowser.cc b/rtgui/recentbrowser.cc index 0cb7e3d1a..2054f7f4a 100644 --- a/rtgui/recentbrowser.cc +++ b/rtgui/recentbrowser.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include diff --git a/rtgui/recentbrowser.h b/rtgui/recentbrowser.h index 0a267df63..3c2908dc3 100644 --- a/rtgui/recentbrowser.h +++ b/rtgui/recentbrowser.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _RECENTBROWSER_ #define _RECENTBROWSER_ diff --git a/rtgui/recentselectionlistener.h b/rtgui/recentselectionlistener.h index c1e865bd1..f1765cb7c 100644 --- a/rtgui/recentselectionlistener.h +++ b/rtgui/recentselectionlistener.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _RECENTSELECTIONLISTENER_ #define _RECENTSELECTIONLISTENER_ diff --git a/rtgui/renamedlg.cc b/rtgui/renamedlg.cc index 29c25f982..d17ce145b 100644 --- a/rtgui/renamedlg.cc +++ b/rtgui/renamedlg.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include @@ -24,15 +24,15 @@ RenameDialog::RenameDialog (Gtk::Window* parent) : Gtk::Dialog (M("FILEBROWSER_RENAMEDLGLABEL"), *parent, true, true), imageData(NULL), p(parent) { Gtk::Table* names = Gtk::manage (new Gtk::Table (2, 2)); - Gtk::Label* onlab = Gtk::manage (new Gtk::Label (M("FILEBROWSER_CURRENT_NAME"))); - Gtk::Label* nnlab = Gtk::manage (new Gtk::Label (M("FILEBROWSER_NEW_NAME"))); - oldName = Gtk::manage (new Gtk::Label ("alma")); - newName = Gtk::manage (new Gtk::Entry ()); + Gtk::Label* onlab = Gtk::manage (new Gtk::Label (M("FILEBROWSER_CURRENT_NAME"))); + Gtk::Label* nnlab = Gtk::manage (new Gtk::Label (M("FILEBROWSER_NEW_NAME"))); + oldName = Gtk::manage (new Gtk::Label ("alma")); + newName = Gtk::manage (new Gtk::Entry ()); names->attach (*onlab, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - names->attach (*oldName, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + names->attach (*oldName, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); names->attach (*nnlab, 0, 1, 1, 2, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - names->attach (*newName, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + names->attach (*newName, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); get_vbox()->pack_start (*names, Gtk::PACK_SHRINK, 4); @@ -52,8 +52,8 @@ RenameDialog::RenameDialog (Gtk::Window* parent) add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); all = add_button ("All", RESPONSE_ALL); - newName->set_activates_default (true); - set_default_response (Gtk::RESPONSE_OK); + newName->set_activates_default (true); + set_default_response (Gtk::RESPONSE_OK); fillTemplateList (); @@ -73,7 +73,7 @@ void RenameDialog::initName (const Glib::ustring& iname, const CacheImageData* c newName->set_text (iname); if (useTmpl->get_active () && isTemplSelected ()) newName->set_text (applyTemplate (iname, cid, getActiveTemplate())); - newName->select_region (0, newName->get_text().size()); + newName->select_region (0, newName->get_text().size()); } Glib::ustring RenameDialog::getNewName () { @@ -113,7 +113,7 @@ void RenameDialog::useTemplToggled () { } else all->set_sensitive (false); - newName->select_region (0, newName->get_text().size()); + newName->select_region (0, newName->get_text().size()); } bool RenameDialog::isTemplSelected () { @@ -157,8 +157,8 @@ RenameTemplateEditor::RenameTemplateEditor (Gtk::Window* parent) templ = Gtk::manage (new Gtk::Entry ()); Gtk::Button* add = Gtk::manage (new Gtk::Button ()); Gtk::Button* del = Gtk::manage (new Gtk::Button ()); - add->add (*Gtk::manage (new Gtk::Image (argv0+"/images/list-add12.png"))); - del->add (*Gtk::manage (new Gtk::Image (argv0+"/images/list-remove12r.png"))); + add->add (*Gtk::manage (new Gtk::Image (argv0+"/images/list-add12.png"))); + del->add (*Gtk::manage (new Gtk::Image (argv0+"/images/list-remove12r.png"))); hb->pack_start (*templ); hb->pack_start (*add, Gtk::PACK_SHRINK, 2); hb->pack_start (*del, Gtk::PACK_SHRINK, 2); diff --git a/rtgui/renamedlg.h b/rtgui/renamedlg.h index e1cef34d9..ab9b23029 100644 --- a/rtgui/renamedlg.h +++ b/rtgui/renamedlg.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _RENAMEDLG_ #define _RENAMEDLG_ diff --git a/rtgui/resize.h b/rtgui/resize.h index 5f9a3f2b6..18ebb467e 100644 --- a/rtgui/resize.h +++ b/rtgui/resize.h @@ -1,60 +1,60 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _RESIZE_H_ -#define _RESIZE_H_ - -#include -#include -#include - -class Resize : public Gtk::VBox, public AdjusterListener, public ToolPanel, public rtengine::SizeListener { - - protected: - Gtk::CheckButton* enabled; - Adjuster* scale; - Gtk::VBox* sizeBox; - Gtk::ComboBoxText* method; - Gtk::ComboBoxText* spec; - Gtk::SpinButton* w; - Gtk::SpinButton* h; - int maxw, maxh; - sigc::connection wconn, hconn, enaConn; - bool wDirty, hDirty, lastEnabled; - - public: - - Resize (); - ~Resize (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); - void setBatchMode (bool batchMode); - - void adjusterChanged (Adjuster* a, double newval); - void entryWChanged (); - void entryHChanged (); - void methodChanged (); - void specChanged (); - void sizeChanged (int w, int h, int ow, int oh); - void setDimensions (int w, int h, int ow, int oh); - void enabledToggled (); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _RESIZE_H_ +#define _RESIZE_H_ + +#include +#include +#include + +class Resize : public Gtk::VBox, public AdjusterListener, public ToolPanel, public rtengine::SizeListener { + + protected: + Gtk::CheckButton* enabled; + Adjuster* scale; + Gtk::VBox* sizeBox; + Gtk::ComboBoxText* method; + Gtk::ComboBoxText* spec; + Gtk::SpinButton* w; + Gtk::SpinButton* h; + int maxw, maxh; + sigc::connection wconn, hconn, enaConn; + bool wDirty, hDirty, lastEnabled; + + public: + + Resize (); + ~Resize (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); + void setBatchMode (bool batchMode); + + void adjusterChanged (Adjuster* a, double newval); + void entryWChanged (); + void entryHChanged (); + void methodChanged (); + void specChanged (); + void sizeChanged (int w, int h, int ow, int oh); + void setDimensions (int w, int h, int ow, int oh); + void enabledToggled (); +}; + +#endif diff --git a/rtgui/rotate.cc b/rtgui/rotate.cc index f0411f7e2..1cdd2861f 100644 --- a/rtgui/rotate.cc +++ b/rtgui/rotate.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include diff --git a/rtgui/rotate.h b/rtgui/rotate.h index 17019fcb2..a4b215d17 100644 --- a/rtgui/rotate.h +++ b/rtgui/rotate.h @@ -1,64 +1,64 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _ROTATE_H_ -#define _ROTATE_H_ - -#include -#include -#include - -class RotateListener { - - public: - virtual void straightenRequested () {} - virtual void autoCropRequested () {} -}; - -class Rotate : public Gtk::VBox, public AdjusterListener, public ToolPanel { - - protected: - Adjuster* degree; - Gtk::Button* selectStraight; - Gtk::Button* autoCrop; - RotateListener* rlistener; - Gtk::CheckButton* fill; - bool degAdd; - bool lastFill; - sigc::connection fillConn; - - public: - - Rotate (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); - void setBatchMode (bool batchMode); - - void straighten (double deg); - - void adjusterChanged (Adjuster* a, double newval); - void setAdjusterBehavior (bool brotadd); - void selectStraightPressed (); - void fillPressed (); - void autoCropPressed (); - void setRotateListener (RotateListener* l) { rlistener = l; } -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _ROTATE_H_ +#define _ROTATE_H_ + +#include +#include +#include + +class RotateListener { + + public: + virtual void straightenRequested () {} + virtual void autoCropRequested () {} +}; + +class Rotate : public Gtk::VBox, public AdjusterListener, public ToolPanel { + + protected: + Adjuster* degree; + Gtk::Button* selectStraight; + Gtk::Button* autoCrop; + RotateListener* rlistener; + Gtk::CheckButton* fill; + bool degAdd; + bool lastFill; + sigc::connection fillConn; + + public: + + Rotate (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); + void setBatchMode (bool batchMode); + + void straighten (double deg); + + void adjusterChanged (Adjuster* a, double newval); + void setAdjusterBehavior (bool brotadd); + void selectStraightPressed (); + void fillPressed (); + void autoCropPressed (); + void setRotateListener (RotateListener* l) { rlistener = l; } +}; + +#endif diff --git a/rtgui/rtwindow.h b/rtgui/rtwindow.h index e69ee3ff8..6af9deb98 100644 --- a/rtgui/rtwindow.h +++ b/rtgui/rtwindow.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _RTWINDOW_ #define _RTWINDOW_ diff --git a/rtgui/safegtk.cc b/rtgui/safegtk.cc index 867a7119d..26f586a8a 100644 --- a/rtgui/safegtk.cc +++ b/rtgui/safegtk.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include @@ -24,12 +24,12 @@ Glib::RefPtr safe_create_from_file(const std::string& filename) { Glib::RefPtr res; #ifdef GLIBMM_EXCEPTIONS_ENABLED - try { + try { res = Gdk::Pixbuf::create_from_file (filename); - } - catch (Glib::Exception& ex) { - printf ("%s\n", ex.what().c_str()); - } + } + catch (Glib::Exception& ex) { + printf ("%s\n", ex.what().c_str()); + } #else std::auto_ptr error; res = Gdk::Pixbuf::create_from_file (filename, error); @@ -49,23 +49,23 @@ Glib::RefPtr safe_query_file_info (Glib::RefPtr &file) #else std::auto_ptr error; info = file->query_info("*", Gio::FILE_QUERY_INFO_NONE, error); -#endif +#endif return info; } #ifdef GLIBMM_EXCEPTIONS_ENABLED # define SAFE_ENUMERATOR_CODE_START \ - do{try { if ((dirList = dir->enumerate_children ())) \ + do{try { if ((dirList = dir->enumerate_children ())) \ for (Glib::RefPtr info = dirList->next_file(); info; info = dirList->next_file()) { - + # define SAFE_ENUMERATOR_CODE_END \ - }} catch (Glib::Exception& ex) { printf ("%s\n", ex.what().c_str()); }}while(0) + }} catch (Glib::Exception& ex) { printf ("%s\n", ex.what().c_str()); }}while(0) #else # define SAFE_ENUMERATOR_CODE_START \ do{std::auto_ptr error; Glib::RefPtr cancellable; \ - if ((dirList = dir->enumerate_children (cancellable, "*", Gio::FILE_QUERY_INFO_NONE, error))) \ + if ((dirList = dir->enumerate_children (cancellable, "*", Gio::FILE_QUERY_INFO_NONE, error))) \ for (Glib::RefPtr info = dirList->next_file(cancellable, error); !error.get() && info; info = dirList->next_file(cancellable, error)) { - + # define SAFE_ENUMERATOR_CODE_END } if (error.get()) printf ("%s\n", error->what().c_str());}while (0) #endif @@ -84,7 +84,7 @@ void safe_build_file_list (Glib::RefPtr &dir, std::vector dirList; if (dir) { SAFE_ENUMERATOR_CODE_START - names.push_back (Glib::build_filename (directory, info->get_name())); + names.push_back (Glib::build_filename (directory, info->get_name())); SAFE_ENUMERATOR_CODE_END; } } @@ -96,8 +96,8 @@ void safe_build_subdir_list (Glib::RefPtr &dir, std::vectorget_file_type() == Gio::FILE_TYPE_DIRECTORY && (!info->is_hidden() || add_hidden)) - subDirs.push_back (info->get_name()); + if (info->get_file_type() == Gio::FILE_TYPE_DIRECTORY && (!info->is_hidden() || add_hidden)) + subDirs.push_back (info->get_name()); SAFE_ENUMERATOR_CODE_END; } } @@ -107,13 +107,13 @@ bool safe_spawn_command_line_async (const Glib::ustring& cmd_utf8) std::string cmd; bool success = false; #ifdef GLIBMM_EXCEPTIONS_ENABLED - try { + try { cmd = Glib::filename_from_utf8(cmd_utf8); printf ("command line: |%s|\n", cmd.c_str()); Glib::spawn_command_line_async (cmd); success = true; - } catch (Glib::Exception& ex) { - printf ("%s\n", ex.what().c_str()); + } catch (Glib::Exception& ex) { + printf ("%s\n", ex.what().c_str()); } #else std::auto_ptr error; @@ -127,7 +127,7 @@ bool safe_spawn_command_line_async (const Glib::ustring& cmd_utf8) else success = true; #endif - return success; + return success; } std::string safe_locale_from_utf8 (const Glib::ustring& utf8_str) diff --git a/rtgui/safegtk.h b/rtgui/safegtk.h index 02809f308..d4b2c7deb 100644 --- a/rtgui/safegtk.h +++ b/rtgui/safegtk.h @@ -7,15 +7,15 @@ Glib::RefPtr safe_create_from_file(const std::string& filename); -class FileMTimeInfo { - - public: - Glib::ustring fname; - Glib::TimeVal mtime; - - FileMTimeInfo (Glib::ustring name, Glib::TimeVal mtime) : fname(name), mtime(mtime) {} - bool operator<(const FileMTimeInfo& other) const { return mtime safe_query_file_info (Glib::RefPtr &file); void safe_build_file_list (Glib::RefPtr &dir, std::vector &flist); @@ -26,7 +26,7 @@ bool safe_spawn_command_line_async (const Glib::ustring& cmd_utf8); Glib::ustring safe_locale_to_utf8 (const std::string& src); // from rtengine std::string safe_locale_from_utf8 (const Glib::ustring& utf8_str); - - + + #endif diff --git a/rtgui/saveasdlg.cc b/rtgui/saveasdlg.cc index 088eef363..021a54207 100644 --- a/rtgui/saveasdlg.cc +++ b/rtgui/saveasdlg.cc @@ -1,141 +1,141 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include "saveasdlg.h" -#include - -extern Options options; -SaveAsDialog::SaveAsDialog (Glib::ustring initialDir) { +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include "saveasdlg.h" +#include - Gtk::VBox* vbox = get_vbox (); - - fchooser = new Gtk::FileChooserWidget (Gtk::FILE_CHOOSER_ACTION_SAVE); - fchooser->set_current_folder (initialDir); - - filter_jpg.set_name(M("SAVEDLG_JPGFILTER")); - filter_jpg.add_pattern("*.jpg"); - - filter_tif.set_name(M("SAVEDLG_JPGFILTER")); - filter_tif.add_pattern("*.tif"); - - filter_png.set_name(M("SAVEDLG_JPGFILTER")); - filter_png.add_pattern("*.png"); - - vbox->pack_start (*fchooser); - - Gtk::HSeparator* hsep1 = new Gtk::HSeparator (); - vbox->pack_start (*hsep1, Gtk::PACK_SHRINK, 2); - -// Output Options -// ~~~~~~~~~~~~~~ - formatOpts = new SaveFormatPanel (); - formatOpts->init (options.saveFormat); - formatOpts->setListener (this); - - vbox->pack_start (*formatOpts, Gtk::PACK_SHRINK, 4); - - Gtk::HSeparator* hsep2 = new Gtk::HSeparator (); - vbox->pack_start (*hsep2, Gtk::PACK_SHRINK, 2); - -// queue/immediate -// ~~~~~~~~~~~~~ - immediately = new Gtk::RadioButton (M("SAVEDLG_SAVEIMMEDIATELY")); - putToQueueHead = new Gtk::RadioButton (M("SAVEDLG_PUTTOQUEUEHEAD")); - putToQueueTail = new Gtk::RadioButton (M("SAVEDLG_PUTTOQUEUETAIL")); - vbox->pack_start (*immediately, Gtk::PACK_SHRINK, 4); - vbox->pack_start (*putToQueueHead, Gtk::PACK_SHRINK, 4); - vbox->pack_start (*putToQueueTail, Gtk::PACK_SHRINK, 4); - immediately->set_active (true); - Gtk::RadioButton::Group g = immediately->get_group(); - putToQueueHead->set_group (g); - putToQueueTail->set_group (g); - -// buttons -// ~~~~~~ - Gtk::Button* ok = new Gtk::Button (M("GENERAL_OK")); - Gtk::Button* cancel = new Gtk::Button (M("GENERAL_CANCEL")); - - ok->set_image (*(new Gtk::Image (Gtk::StockID("gtk-ok"), Gtk::ICON_SIZE_BUTTON))); - cancel->set_image (*(new Gtk::Image (Gtk::StockID("gtk-cancel"), Gtk::ICON_SIZE_BUTTON))); - - ok->signal_clicked().connect( sigc::mem_fun(*this, &SaveAsDialog::okPressed) ); - cancel->signal_clicked().connect( sigc::mem_fun(*this, &SaveAsDialog::cancelPressed) ); - - get_action_area()->pack_end (*ok, Gtk::PACK_SHRINK, 4); - get_action_area()->pack_end (*cancel, Gtk::PACK_SHRINK, 4); - - set_border_width (4); - show_all_children (); -} - -bool SaveAsDialog::getImmediately () { - - return immediately->get_active (); -} +extern Options options; +SaveAsDialog::SaveAsDialog (Glib::ustring initialDir) { -bool SaveAsDialog::getToHeadOfQueue () { - - return putToQueueHead->get_active (); -} - -bool SaveAsDialog::getToTailOfQueue () { - - return putToQueueTail->get_active (); -} + Gtk::VBox* vbox = get_vbox (); -Glib::ustring SaveAsDialog::getFileName () { - - return fname; -} - -Glib::ustring SaveAsDialog::getDirectory () { - - return fchooser->get_current_folder (); -} - -SaveFormat SaveAsDialog::getFormat () { - - return formatOpts->getFormat (); -} - -void SaveAsDialog::okPressed () { - - fname = fchooser->get_filename(); - hide (); -} - -void SaveAsDialog::cancelPressed () { - - fname = ""; - hide (); -} - -void SaveAsDialog::formatChanged (Glib::ustring f) { - - if (f=="jpg") - fchooser->set_filter (filter_jpg); - else if (f=="png") - fchooser->set_filter (filter_png); - else if (f=="tif") - fchooser->set_filter (filter_tif); -} - -void SaveAsDialog::setInitialFileName (Glib::ustring fname) { - - fchooser->set_current_name(fname); -} + fchooser = new Gtk::FileChooserWidget (Gtk::FILE_CHOOSER_ACTION_SAVE); + fchooser->set_current_folder (initialDir); + + filter_jpg.set_name(M("SAVEDLG_JPGFILTER")); + filter_jpg.add_pattern("*.jpg"); + + filter_tif.set_name(M("SAVEDLG_JPGFILTER")); + filter_tif.add_pattern("*.tif"); + + filter_png.set_name(M("SAVEDLG_JPGFILTER")); + filter_png.add_pattern("*.png"); + + vbox->pack_start (*fchooser); + + Gtk::HSeparator* hsep1 = new Gtk::HSeparator (); + vbox->pack_start (*hsep1, Gtk::PACK_SHRINK, 2); + +// Output Options +// ~~~~~~~~~~~~~~ + formatOpts = new SaveFormatPanel (); + formatOpts->init (options.saveFormat); + formatOpts->setListener (this); + + vbox->pack_start (*formatOpts, Gtk::PACK_SHRINK, 4); + + Gtk::HSeparator* hsep2 = new Gtk::HSeparator (); + vbox->pack_start (*hsep2, Gtk::PACK_SHRINK, 2); + +// queue/immediate +// ~~~~~~~~~~~~~ + immediately = new Gtk::RadioButton (M("SAVEDLG_SAVEIMMEDIATELY")); + putToQueueHead = new Gtk::RadioButton (M("SAVEDLG_PUTTOQUEUEHEAD")); + putToQueueTail = new Gtk::RadioButton (M("SAVEDLG_PUTTOQUEUETAIL")); + vbox->pack_start (*immediately, Gtk::PACK_SHRINK, 4); + vbox->pack_start (*putToQueueHead, Gtk::PACK_SHRINK, 4); + vbox->pack_start (*putToQueueTail, Gtk::PACK_SHRINK, 4); + immediately->set_active (true); + Gtk::RadioButton::Group g = immediately->get_group(); + putToQueueHead->set_group (g); + putToQueueTail->set_group (g); + +// buttons +// ~~~~~~ + Gtk::Button* ok = new Gtk::Button (M("GENERAL_OK")); + Gtk::Button* cancel = new Gtk::Button (M("GENERAL_CANCEL")); + + ok->set_image (*(new Gtk::Image (Gtk::StockID("gtk-ok"), Gtk::ICON_SIZE_BUTTON))); + cancel->set_image (*(new Gtk::Image (Gtk::StockID("gtk-cancel"), Gtk::ICON_SIZE_BUTTON))); + + ok->signal_clicked().connect( sigc::mem_fun(*this, &SaveAsDialog::okPressed) ); + cancel->signal_clicked().connect( sigc::mem_fun(*this, &SaveAsDialog::cancelPressed) ); + + get_action_area()->pack_end (*ok, Gtk::PACK_SHRINK, 4); + get_action_area()->pack_end (*cancel, Gtk::PACK_SHRINK, 4); + + set_border_width (4); + show_all_children (); +} + +bool SaveAsDialog::getImmediately () { + + return immediately->get_active (); +} + +bool SaveAsDialog::getToHeadOfQueue () { + + return putToQueueHead->get_active (); +} + +bool SaveAsDialog::getToTailOfQueue () { + + return putToQueueTail->get_active (); +} + +Glib::ustring SaveAsDialog::getFileName () { + + return fname; +} + +Glib::ustring SaveAsDialog::getDirectory () { + + return fchooser->get_current_folder (); +} + +SaveFormat SaveAsDialog::getFormat () { + + return formatOpts->getFormat (); +} + +void SaveAsDialog::okPressed () { + + fname = fchooser->get_filename(); + hide (); +} + +void SaveAsDialog::cancelPressed () { + + fname = ""; + hide (); +} + +void SaveAsDialog::formatChanged (Glib::ustring f) { + + if (f=="jpg") + fchooser->set_filter (filter_jpg); + else if (f=="png") + fchooser->set_filter (filter_png); + else if (f=="tif") + fchooser->set_filter (filter_tif); +} + +void SaveAsDialog::setInitialFileName (Glib::ustring fname) { + + fchooser->set_current_name(fname); +} diff --git a/rtgui/saveasdlg.h b/rtgui/saveasdlg.h index f038bc62a..7df8d8392 100644 --- a/rtgui/saveasdlg.h +++ b/rtgui/saveasdlg.h @@ -1,58 +1,58 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _SAVEASDLG_ -#define _SAVEASDLG_ - -#include -#include -#include -#include - -class SaveAsDialog : public Gtk::Dialog, public FormatChangeListener { - - protected: - Gtk::FileChooserWidget* fchooser; - SaveFormatPanel* formatOpts; - Glib::ustring fname; - Gtk::FileFilter filter_jpg; - Gtk::FileFilter filter_tif; - Gtk::FileFilter filter_png; - Gtk::RadioButton* immediately; - Gtk::RadioButton* putToQueueHead; - Gtk::RadioButton* putToQueueTail; - - public: - SaveAsDialog (Glib::ustring initialDir); - - Glib::ustring getFileName (); - Glib::ustring getDirectory (); - SaveFormat getFormat (); +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _SAVEASDLG_ +#define _SAVEASDLG_ + +#include +#include +#include +#include + +class SaveAsDialog : public Gtk::Dialog, public FormatChangeListener { + + protected: + Gtk::FileChooserWidget* fchooser; + SaveFormatPanel* formatOpts; + Glib::ustring fname; + Gtk::FileFilter filter_jpg; + Gtk::FileFilter filter_tif; + Gtk::FileFilter filter_png; + Gtk::RadioButton* immediately; + Gtk::RadioButton* putToQueueHead; + Gtk::RadioButton* putToQueueTail; + + public: + SaveAsDialog (Glib::ustring initialDir); + + Glib::ustring getFileName (); + Glib::ustring getDirectory (); + SaveFormat getFormat (); bool getImmediately (); bool getToHeadOfQueue (); - bool getToTailOfQueue (); - - void setInitialFileName (Glib::ustring iname); - - void okPressed (); - void cancelPressed (); - void formatChanged (Glib::ustring f); -}; - - -#endif + bool getToTailOfQueue (); + + void setInitialFileName (Glib::ustring iname); + + void okPressed (); + void cancelPressed (); + void formatChanged (Glib::ustring f); +}; + + +#endif diff --git a/rtgui/saveformatpanel.cc b/rtgui/saveformatpanel.cc index 3c2b0d699..6e820191b 100644 --- a/rtgui/saveformatpanel.cc +++ b/rtgui/saveformatpanel.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include @@ -23,35 +23,35 @@ SaveFormatPanel::SaveFormatPanel () : listener (NULL) { jpegqual = new Adjuster (M("SAVEDLG_JPEGQUAL"), 0, 100, 1, 100); - jpegqual->setAdjusterListener (this); - jpegqual->show (); - pngcompr = new Adjuster (M("SAVEDLG_PNGCOMPR"), 0, 6, 1, 6); + jpegqual->setAdjusterListener (this); + jpegqual->show (); + pngcompr = new Adjuster (M("SAVEDLG_PNGCOMPR"), 0, 6, 1, 6); pngcompr->setAdjusterListener (this); - pngcompr->show (); + pngcompr->show (); - Gtk::HBox* hb1 = Gtk::manage (new Gtk::HBox ()); - Gtk::Label* flab = Gtk::manage (new Gtk::Label (M("SAVEDLG_FILEFORMAT")+":")); - hb1->pack_start (*flab, Gtk::PACK_SHRINK,4); - format = Gtk::manage (new Gtk::ComboBoxText ()); - format->append_text ("JPEG (8 bit)"); - format->append_text ("TIFF (8 bit)"); - format->append_text ("TIFF (16 bit)"); - format->append_text ("PNG (8 bit)"); - format->append_text ("PNG (16 bit)"); - format->set_active (0); - oformat = 0; - format->signal_changed().connect( sigc::mem_fun(*this, &SaveFormatPanel::formatChanged) ); - hb1->pack_start (*format); - pack_start (*hb1, Gtk::PACK_SHRINK, 4); + Gtk::HBox* hb1 = Gtk::manage (new Gtk::HBox ()); + Gtk::Label* flab = Gtk::manage (new Gtk::Label (M("SAVEDLG_FILEFORMAT")+":")); + hb1->pack_start (*flab, Gtk::PACK_SHRINK,4); + format = Gtk::manage (new Gtk::ComboBoxText ()); + format->append_text ("JPEG (8 bit)"); + format->append_text ("TIFF (8 bit)"); + format->append_text ("TIFF (16 bit)"); + format->append_text ("PNG (8 bit)"); + format->append_text ("PNG (16 bit)"); + format->set_active (0); + oformat = 0; + format->signal_changed().connect( sigc::mem_fun(*this, &SaveFormatPanel::formatChanged) ); + hb1->pack_start (*format); + pack_start (*hb1, Gtk::PACK_SHRINK, 4); formatopts = Gtk::manage (new Gtk::VBox ()); formatopts->pack_start (*jpegqual, Gtk::PACK_SHRINK, 4); pack_start (*formatopts, Gtk::PACK_SHRINK, 4); - savespp = Gtk::manage (new Gtk::CheckButton (M("SAVEDLG_SAVESPP"))); - pack_start (*savespp, Gtk::PACK_SHRINK, 4); + savespp = Gtk::manage (new Gtk::CheckButton (M("SAVEDLG_SAVESPP"))); + pack_start (*savespp, Gtk::PACK_SHRINK, 4); - show_all (); + show_all (); set_border_width (4); fstr[0] = "jpg"; @@ -60,7 +60,7 @@ SaveFormatPanel::SaveFormatPanel () : listener (NULL) { fstr[3] = "png"; fstr[4] = "png"; } - + void SaveFormatPanel::init (SaveFormat &sf) { FormatChangeListener* tmp = listener; @@ -105,9 +105,9 @@ SaveFormat SaveFormatPanel::getFormat () { void SaveFormatPanel::formatChanged () { - if (oformat==0) - removeIfThere (formatopts, jpegqual); - else if (oformat==3 || oformat==4) + if (oformat==0) + removeIfThere (formatopts, jpegqual); + else if (oformat==3 || oformat==4) removeIfThere (formatopts, pngcompr); int act = format->get_active_row_number(); @@ -115,17 +115,17 @@ void SaveFormatPanel::formatChanged () { return; Glib::ustring fr = fstr[act]; - if (fr=="jpg") - formatopts->pack_start (*jpegqual, Gtk::PACK_SHRINK,4); - else if (fr=="png") - formatopts->pack_start (*pngcompr, Gtk::PACK_SHRINK,4); - + if (fr=="jpg") + formatopts->pack_start (*jpegqual, Gtk::PACK_SHRINK,4); + else if (fr=="png") + formatopts->pack_start (*pngcompr, Gtk::PACK_SHRINK,4); + oformat = act; if (listener) - listener->formatChanged (fr); + listener->formatChanged (fr); } - + void SaveFormatPanel::adjusterChanged (Adjuster* a, double newval) { formatChanged (); diff --git a/rtgui/saveformatpanel.h b/rtgui/saveformatpanel.h index 2add74c45..ec5e302ff 100644 --- a/rtgui/saveformatpanel.h +++ b/rtgui/saveformatpanel.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef __SAVEFORMATPANEL_H__ #define __SAVEFORMATPANEL_H__ @@ -33,26 +33,26 @@ class FormatChangeListener { class SaveFormatPanel : public Gtk::VBox, public AdjusterListener { protected: - Adjuster* jpegqual; - Adjuster* pngcompr; - Gtk::ComboBoxText* format; - Gtk::VBox* formatopts; + Adjuster* jpegqual; + Adjuster* pngcompr; + Gtk::ComboBoxText* format; + Gtk::VBox* formatopts; int oformat; FormatChangeListener* listener; Glib::ustring fstr[5]; Gtk::CheckButton* savespp; - + public: - SaveFormatPanel (); + SaveFormatPanel (); void setListener (FormatChangeListener* l) { listener = l; } void init (SaveFormat& sf); SaveFormat getFormat (); void formatChanged (); - void adjusterChanged (Adjuster* a, double newval); + void adjusterChanged (Adjuster* a, double newval); }; #endif diff --git a/rtgui/shadowshighlights.cc b/rtgui/shadowshighlights.cc index 224d94a65..a70497485 100644 --- a/rtgui/shadowshighlights.cc +++ b/rtgui/shadowshighlights.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include using namespace rtengine; diff --git a/rtgui/shadowshighlights.h b/rtgui/shadowshighlights.h index c65ebea05..e74d64c20 100644 --- a/rtgui/shadowshighlights.h +++ b/rtgui/shadowshighlights.h @@ -1,57 +1,57 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _SHADOWSHIGHLIGHTS_H_ -#define _SHADOWSHIGHLIGHTS_H_ - -#include -#include -#include - -class ShadowsHighlights : public Gtk::VBox, public AdjusterListener, public ToolPanel { - - protected: - Adjuster* highlights; - Adjuster* h_tonalwidth; - Adjuster* shadows; - Adjuster* s_tonalwidth; - Adjuster* lcontrast; - Adjuster* radius; - Gtk::CheckButton* enabled; - Gtk::CheckButton* hq; - bool hAdd, sAdd, lcAdd; - bool lastEnabled, lastHQ; - sigc::connection enaConn, hqConn; - - public: - - ShadowsHighlights (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); - void setBatchMode (bool batchMode); - - void adjusterChanged (Adjuster* a, double newval); - void enabledChanged (); - void hqChanged (); - - void setAdjusterBehavior (bool hadd, bool sadd, bool lcadd); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _SHADOWSHIGHLIGHTS_H_ +#define _SHADOWSHIGHLIGHTS_H_ + +#include +#include +#include + +class ShadowsHighlights : public Gtk::VBox, public AdjusterListener, public ToolPanel { + + protected: + Adjuster* highlights; + Adjuster* h_tonalwidth; + Adjuster* shadows; + Adjuster* s_tonalwidth; + Adjuster* lcontrast; + Adjuster* radius; + Gtk::CheckButton* enabled; + Gtk::CheckButton* hq; + bool hAdd, sAdd, lcAdd; + bool lastEnabled, lastHQ; + sigc::connection enaConn, hqConn; + + public: + + ShadowsHighlights (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); + void setBatchMode (bool batchMode); + + void adjusterChanged (Adjuster* a, double newval); + void enabledChanged (); + void hqChanged (); + + void setAdjusterBehavior (bool hadd, bool sadd, bool lcadd); +}; + +#endif diff --git a/rtgui/sharpening.cc b/rtgui/sharpening.cc index 249747b5b..1ff514313 100644 --- a/rtgui/sharpening.cc +++ b/rtgui/sharpening.cc @@ -1,142 +1,142 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include -#include - -using namespace rtengine; -using namespace rtengine::procparams; - -Sharpening::Sharpening () : ToolPanel () { - - enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); - enabled->set_active (true); - pack_start(*enabled); - enabled->show (); - Gtk::HSeparator *hsep6aa = Gtk::manage (new Gtk::HSeparator()); - pack_start(*hsep6aa, Gtk::PACK_SHRINK, 2); - hsep6aa->show (); - - Gtk::HBox* hb = Gtk::manage (new Gtk::HBox ()); - hb->set_border_width (4); - hb->show (); - Gtk::Label* ml = Gtk::manage (new Gtk::Label (M("TP_SHARPENING_METHOD")+":")); - ml->show (); - method = Gtk::manage (new Gtk::ComboBoxText ()); - method->append_text (M("TP_SHARPENING_USM")); - method->append_text (M("TP_SHARPENING_RLD")); - method->show (); - hb->pack_start(*ml, Gtk::PACK_SHRINK, 4); - hb->pack_start(*method); - pack_start (*hb); - - rld = new Gtk::VBox (); - dradius = Gtk::manage (new Adjuster (M("TP_SHARPENING_EDRADIUS"), 0.5, 2.5, 0.01, 0.75)); - damount = Gtk::manage (new Adjuster (M("TP_SHARPENING_RLD_AMOUNT"), 0.0, 100, 1, 75)); - ddamping = Gtk::manage (new Adjuster (M("TP_SHARPENING_RLD_DAMPING"), 0, 100, 1, 20)); - diter = Gtk::manage (new Adjuster (M("TP_SHARPENING_RLD_ITERATIONS"), 5, 100, 1, 30)); - rld->pack_start (*dradius); - rld->pack_start (*damount); - rld->pack_start (*ddamping); - rld->pack_start (*diter); - dradius->show (); - damount->show (); - ddamping->show (); - diter->show (); - rld->show (); - - usm = new Gtk::VBox (); - usm->show (); - - - Gtk::HSeparator *hsep6a = Gtk::manage (new Gtk::HSeparator()); - amount = Gtk::manage (new Adjuster (M("TP_SHARPENING_AMOUNT"), 1, 1000, 1, 150)); - radius = Gtk::manage (new Adjuster (M("TP_SHARPENING_RADIUS"), 0.3, 3, 0.01, 0.8)); - threshold = Gtk::manage (new Adjuster (M("TP_SHARPENING_THRESHOLD"), 0, 16384, 1024, 1)); - pack_start(*hsep6a, Gtk::PACK_SHRINK, 2); - - pack_start (*usm); - - usm->pack_start(*radius); - usm->pack_start(*amount); - usm->pack_start(*threshold); - hsep6a->show (); - radius->show (); - amount->show (); - threshold->show (); - - Gtk::HSeparator *hsep6 = Gtk::manage (new Gtk::HSeparator()); - edgesonly = Gtk::manage (new Gtk::CheckButton (M("TP_SHARPENING_ONLYEDGES"))); - edgesonly->set_active (false); - edgebox = new Gtk::VBox (); - eradius = Gtk::manage (new Adjuster (M("TP_SHARPENING_EDRADIUS"), 0.5, 2.5, 0.1, 1.9)); - etolerance = Gtk::manage (new Adjuster (M("TP_SHARPENING_EDTOLERANCE"), 10, 10000, 100, 1000)); - usm->pack_start(*hsep6, Gtk::PACK_SHRINK, 2); - usm->pack_start(*edgesonly); - edgebox->pack_start(*eradius); - edgebox->pack_start(*etolerance); - edgebox->show (); - edgebin = Gtk::manage (new Gtk::VBox ()); - usm->pack_start (*edgebin); - edgebin->show (); - hsep6->show(); - edgesonly->show(); - eradius->show(); - etolerance->show(); - - Gtk::HSeparator *hsep6b = Gtk::manage (new Gtk::HSeparator()); - halocontrol = Gtk::manage (new Gtk::CheckButton (M("TP_SHARPENING_HALOCONTROL"))); - halocontrol->set_active (false); - hcbox = new Gtk::VBox (); - hcamount = Gtk::manage (new Adjuster (M("TP_SHARPENING_HCAMOUNT"), 1, 100, 1, 75)); - usm->pack_start(*hsep6b, Gtk::PACK_SHRINK, 2); - usm->pack_start(*halocontrol); - hcbox->pack_start(*hcamount); - hcbox->show (); - hcbin = Gtk::manage (new Gtk::VBox ()); - usm->pack_start (*hcbin); - hcbin->show (); - hsep6b->show (); - halocontrol->show (); - hcamount->show (); - - dradius->setAdjusterListener (this); - damount->setAdjusterListener (this); - ddamping->setAdjusterListener (this); - diter->setAdjusterListener (this); - radius->setAdjusterListener (this); - amount->setAdjusterListener (this); - threshold->setAdjusterListener (this); - eradius->setAdjusterListener (this); - etolerance->setAdjusterListener (this); - hcamount->setAdjusterListener (this); +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include +#include + +using namespace rtengine; +using namespace rtengine::procparams; + +Sharpening::Sharpening () : ToolPanel () { + + enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); + enabled->set_active (true); + pack_start(*enabled); + enabled->show (); + Gtk::HSeparator *hsep6aa = Gtk::manage (new Gtk::HSeparator()); + pack_start(*hsep6aa, Gtk::PACK_SHRINK, 2); + hsep6aa->show (); + + Gtk::HBox* hb = Gtk::manage (new Gtk::HBox ()); + hb->set_border_width (4); + hb->show (); + Gtk::Label* ml = Gtk::manage (new Gtk::Label (M("TP_SHARPENING_METHOD")+":")); + ml->show (); + method = Gtk::manage (new Gtk::ComboBoxText ()); + method->append_text (M("TP_SHARPENING_USM")); + method->append_text (M("TP_SHARPENING_RLD")); + method->show (); + hb->pack_start(*ml, Gtk::PACK_SHRINK, 4); + hb->pack_start(*method); + pack_start (*hb); + + rld = new Gtk::VBox (); + dradius = Gtk::manage (new Adjuster (M("TP_SHARPENING_EDRADIUS"), 0.5, 2.5, 0.01, 0.75)); + damount = Gtk::manage (new Adjuster (M("TP_SHARPENING_RLD_AMOUNT"), 0.0, 100, 1, 75)); + ddamping = Gtk::manage (new Adjuster (M("TP_SHARPENING_RLD_DAMPING"), 0, 100, 1, 20)); + diter = Gtk::manage (new Adjuster (M("TP_SHARPENING_RLD_ITERATIONS"), 5, 100, 1, 30)); + rld->pack_start (*dradius); + rld->pack_start (*damount); + rld->pack_start (*ddamping); + rld->pack_start (*diter); + dradius->show (); + damount->show (); + ddamping->show (); + diter->show (); + rld->show (); + + usm = new Gtk::VBox (); + usm->show (); + + + Gtk::HSeparator *hsep6a = Gtk::manage (new Gtk::HSeparator()); + amount = Gtk::manage (new Adjuster (M("TP_SHARPENING_AMOUNT"), 1, 1000, 1, 150)); + radius = Gtk::manage (new Adjuster (M("TP_SHARPENING_RADIUS"), 0.3, 3, 0.01, 0.8)); + threshold = Gtk::manage (new Adjuster (M("TP_SHARPENING_THRESHOLD"), 0, 16384, 1024, 1)); + pack_start(*hsep6a, Gtk::PACK_SHRINK, 2); + + pack_start (*usm); + + usm->pack_start(*radius); + usm->pack_start(*amount); + usm->pack_start(*threshold); + hsep6a->show (); + radius->show (); + amount->show (); + threshold->show (); + + Gtk::HSeparator *hsep6 = Gtk::manage (new Gtk::HSeparator()); + edgesonly = Gtk::manage (new Gtk::CheckButton (M("TP_SHARPENING_ONLYEDGES"))); + edgesonly->set_active (false); + edgebox = new Gtk::VBox (); + eradius = Gtk::manage (new Adjuster (M("TP_SHARPENING_EDRADIUS"), 0.5, 2.5, 0.1, 1.9)); + etolerance = Gtk::manage (new Adjuster (M("TP_SHARPENING_EDTOLERANCE"), 10, 10000, 100, 1000)); + usm->pack_start(*hsep6, Gtk::PACK_SHRINK, 2); + usm->pack_start(*edgesonly); + edgebox->pack_start(*eradius); + edgebox->pack_start(*etolerance); + edgebox->show (); + edgebin = Gtk::manage (new Gtk::VBox ()); + usm->pack_start (*edgebin); + edgebin->show (); + hsep6->show(); + edgesonly->show(); + eradius->show(); + etolerance->show(); + + Gtk::HSeparator *hsep6b = Gtk::manage (new Gtk::HSeparator()); + halocontrol = Gtk::manage (new Gtk::CheckButton (M("TP_SHARPENING_HALOCONTROL"))); + halocontrol->set_active (false); + hcbox = new Gtk::VBox (); + hcamount = Gtk::manage (new Adjuster (M("TP_SHARPENING_HCAMOUNT"), 1, 100, 1, 75)); + usm->pack_start(*hsep6b, Gtk::PACK_SHRINK, 2); + usm->pack_start(*halocontrol); + hcbox->pack_start(*hcamount); + hcbox->show (); + hcbin = Gtk::manage (new Gtk::VBox ()); + usm->pack_start (*hcbin); + hcbin->show (); + hsep6b->show (); + halocontrol->show (); + hcamount->show (); + + dradius->setAdjusterListener (this); + damount->setAdjusterListener (this); + ddamping->setAdjusterListener (this); + diter->setAdjusterListener (this); + radius->setAdjusterListener (this); + amount->setAdjusterListener (this); + threshold->setAdjusterListener (this); + eradius->setAdjusterListener (this); + etolerance->setAdjusterListener (this); + hcamount->setAdjusterListener (this); edgebox->reference (); hcbox->reference (); usm->reference (); rld->reference (); - - enaConn = enabled->signal_toggled().connect( sigc::mem_fun(*this, &Sharpening::enabled_toggled) ); - eonlyConn = edgesonly->signal_toggled().connect( sigc::mem_fun(*this, &Sharpening::edgesonly_toggled) ); - hcConn = halocontrol->signal_toggled().connect( sigc::mem_fun(*this, &Sharpening::halocontrol_toggled) ); - method->signal_changed().connect( sigc::mem_fun(*this, &Sharpening::method_changed) ); + + enaConn = enabled->signal_toggled().connect( sigc::mem_fun(*this, &Sharpening::enabled_toggled) ); + eonlyConn = edgesonly->signal_toggled().connect( sigc::mem_fun(*this, &Sharpening::edgesonly_toggled) ); + hcConn = halocontrol->signal_toggled().connect( sigc::mem_fun(*this, &Sharpening::halocontrol_toggled) ); + method->signal_changed().connect( sigc::mem_fun(*this, &Sharpening::method_changed) ); } Sharpening::~Sharpening () { @@ -145,317 +145,317 @@ Sharpening::~Sharpening () { delete rld; delete edgebox; delete hcbox; -} - - -void Sharpening::read (const ProcParams* pp, const ParamsEdited* pedited) { - - disableListener (); - - if (pedited) { - amount->setEditedState (pedited->sharpening.amount ? Edited : UnEdited); - radius->setEditedState (pedited->sharpening.radius ? Edited : UnEdited); - threshold->setEditedState (pedited->sharpening.threshold ? Edited : UnEdited); - eradius->setEditedState (pedited->sharpening.edges_radius ? Edited : UnEdited); - etolerance->setEditedState (pedited->sharpening.edges_tolerance ? Edited : UnEdited); - hcamount->setEditedState (pedited->sharpening.halocontrol_amount ? Edited : UnEdited); - damount->setEditedState (pedited->sharpening.deconvamount ? Edited : UnEdited); - dradius->setEditedState (pedited->sharpening.deconvradius ? Edited : UnEdited); - diter->setEditedState (pedited->sharpening.deconviter ? Edited : UnEdited); - ddamping->setEditedState (pedited->sharpening.deconvdamping ? Edited : UnEdited); - - enabled->set_inconsistent (!pedited->sharpening.enabled); - halocontrol->set_inconsistent (!pedited->sharpening.halocontrol); - edgesonly->set_inconsistent (!pedited->sharpening.edgesonly); - } - - enaConn.block (true); - enabled->set_active (pp->sharpening.enabled); - enaConn.block (false); - lastEnabled = pp->sharpening.enabled; - - eonlyConn.block (true); - edgesonly->set_active (pp->sharpening.edgesonly); - eonlyConn.block (false); - lastEdgesOnly = pp->sharpening.edgesonly; - - hcConn.block (true); - halocontrol->set_active (pp->sharpening.halocontrol); - hcConn.block (false); - lastHaloControl = pp->sharpening.halocontrol; - - amount->setValue (pp->sharpening.amount); - radius->setValue (pp->sharpening.radius); - threshold->setValue (pp->sharpening.threshold); - eradius->setValue (pp->sharpening.edges_radius); - etolerance->setValue (pp->sharpening.edges_tolerance); - hcamount->setValue (pp->sharpening.halocontrol_amount); - - dradius->setValue (pp->sharpening.deconvradius); - damount->setValue (pp->sharpening.deconvamount); - diter->setValue (pp->sharpening.deconviter); - ddamping->setValue (pp->sharpening.deconvdamping); - - if (!batchMode) { - removeIfThere (edgebin, edgebox, false); - if (edgesonly->get_active ()) - edgebin->pack_start (*edgebox); - - removeIfThere (hcbin, hcbox, false); - if (halocontrol->get_active ()) - hcbin->pack_start (*hcbox); - - } - if (pedited && !pedited->sharpening.method) - method->set_active (2); - else if (pp->sharpening.method=="usm") - method->set_active (0); - else if (pp->sharpening.method=="rld") - method->set_active (1); - - enableListener (); -} - -void Sharpening::write (ProcParams* pp, ParamsEdited* pedited) { - - pp->sharpening.amount = (int)amount->getValue(); - pp->sharpening.enabled = enabled->get_active (); - pp->sharpening.radius = radius->getValue (); - pp->sharpening.threshold = (int)threshold->getValue (); - pp->sharpening.edgesonly = edgesonly->get_active (); - pp->sharpening.edges_radius = eradius->getValue (); - pp->sharpening.edges_tolerance = (int)etolerance->getValue (); - pp->sharpening.halocontrol = halocontrol->get_active (); - pp->sharpening.halocontrol_amount = (int)hcamount->getValue (); - pp->sharpening.deconvradius = dradius->getValue (); - pp->sharpening.deconviter = (int)diter->getValue (); - pp->sharpening.deconvamount = (int)damount->getValue (); - pp->sharpening.deconvdamping = (int)ddamping->getValue (); - - if (method->get_active_row_number()==0) - pp->sharpening.method = "usm"; - else if (method->get_active_row_number()==1) - pp->sharpening.method = "rld"; - - if (pedited) { - pedited->sharpening.amount = amount->getEditedState (); - pedited->sharpening.radius = radius->getEditedState (); - pedited->sharpening.threshold = threshold->getEditedState (); - pedited->sharpening.edges_radius = eradius->getEditedState (); - pedited->sharpening.edges_tolerance = etolerance->getEditedState (); - pedited->sharpening.halocontrol_amount = hcamount->getEditedState (); - pedited->sharpening.deconvamount = damount->getEditedState (); - pedited->sharpening.deconvradius = dradius->getEditedState (); - pedited->sharpening.deconviter = diter->getEditedState (); - pedited->sharpening.deconvdamping = ddamping->getEditedState (); - pedited->sharpening.method = method->get_active_row_number()!=2; - pedited->sharpening.halocontrol = !halocontrol->get_inconsistent(); - pedited->sharpening.edgesonly = !edgesonly->get_inconsistent(); - pedited->sharpening.enabled = !enabled->get_inconsistent(); - } -} - -void Sharpening::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { - - amount->setDefault (defParams->sharpening.amount); - radius->setDefault (defParams->sharpening.radius); - threshold->setDefault (defParams->sharpening.threshold); - eradius->setDefault (defParams->sharpening.edges_radius); - etolerance->setDefault (defParams->sharpening.edges_tolerance); - hcamount->setDefault (defParams->sharpening.halocontrol_amount); - damount->setDefault (defParams->sharpening.deconvamount); - dradius->setDefault (defParams->sharpening.deconvradius); - diter->setDefault (defParams->sharpening.deconviter); - ddamping->setDefault (defParams->sharpening.deconvdamping); - - if (pedited) { - amount->setDefaultEditedState (pedited->sharpening.amount ? Edited : UnEdited); - radius->setDefaultEditedState (pedited->sharpening.radius ? Edited : UnEdited); - threshold->setDefaultEditedState (pedited->sharpening.threshold ? Edited : UnEdited); - eradius->setDefaultEditedState (pedited->sharpening.edges_radius ? Edited : UnEdited); - etolerance->setDefaultEditedState (pedited->sharpening.edges_tolerance ? Edited : UnEdited); - hcamount->setDefaultEditedState (pedited->sharpening.halocontrol_amount ? Edited : UnEdited); - damount->setDefaultEditedState (pedited->sharpening.deconvamount ? Edited : UnEdited); - dradius->setDefaultEditedState (pedited->sharpening.deconvradius ? Edited : UnEdited); - diter->setDefaultEditedState (pedited->sharpening.deconviter ? Edited : UnEdited); - ddamping->setDefaultEditedState (pedited->sharpening.deconvdamping ? Edited : UnEdited); - } - else { - amount->setDefaultEditedState (Irrelevant); - radius->setDefaultEditedState (Irrelevant); - threshold->setDefaultEditedState (Irrelevant); - eradius->setDefaultEditedState (Irrelevant); - etolerance->setDefaultEditedState (Irrelevant); - hcamount->setDefaultEditedState (Irrelevant); - damount->setDefaultEditedState (Irrelevant); - dradius->setDefaultEditedState (Irrelevant); - diter->setDefaultEditedState (Irrelevant); - ddamping->setDefaultEditedState (Irrelevant); - } -} - -void Sharpening::adjusterChanged (Adjuster* a, double newval) { - - if (listener && enabled->get_active()) { +} - Glib::ustring costr; - if (a==radius || a==dradius) + +void Sharpening::read (const ProcParams* pp, const ParamsEdited* pedited) { + + disableListener (); + + if (pedited) { + amount->setEditedState (pedited->sharpening.amount ? Edited : UnEdited); + radius->setEditedState (pedited->sharpening.radius ? Edited : UnEdited); + threshold->setEditedState (pedited->sharpening.threshold ? Edited : UnEdited); + eradius->setEditedState (pedited->sharpening.edges_radius ? Edited : UnEdited); + etolerance->setEditedState (pedited->sharpening.edges_tolerance ? Edited : UnEdited); + hcamount->setEditedState (pedited->sharpening.halocontrol_amount ? Edited : UnEdited); + damount->setEditedState (pedited->sharpening.deconvamount ? Edited : UnEdited); + dradius->setEditedState (pedited->sharpening.deconvradius ? Edited : UnEdited); + diter->setEditedState (pedited->sharpening.deconviter ? Edited : UnEdited); + ddamping->setEditedState (pedited->sharpening.deconvdamping ? Edited : UnEdited); + + enabled->set_inconsistent (!pedited->sharpening.enabled); + halocontrol->set_inconsistent (!pedited->sharpening.halocontrol); + edgesonly->set_inconsistent (!pedited->sharpening.edgesonly); + } + + enaConn.block (true); + enabled->set_active (pp->sharpening.enabled); + enaConn.block (false); + lastEnabled = pp->sharpening.enabled; + + eonlyConn.block (true); + edgesonly->set_active (pp->sharpening.edgesonly); + eonlyConn.block (false); + lastEdgesOnly = pp->sharpening.edgesonly; + + hcConn.block (true); + halocontrol->set_active (pp->sharpening.halocontrol); + hcConn.block (false); + lastHaloControl = pp->sharpening.halocontrol; + + amount->setValue (pp->sharpening.amount); + radius->setValue (pp->sharpening.radius); + threshold->setValue (pp->sharpening.threshold); + eradius->setValue (pp->sharpening.edges_radius); + etolerance->setValue (pp->sharpening.edges_tolerance); + hcamount->setValue (pp->sharpening.halocontrol_amount); + + dradius->setValue (pp->sharpening.deconvradius); + damount->setValue (pp->sharpening.deconvamount); + diter->setValue (pp->sharpening.deconviter); + ddamping->setValue (pp->sharpening.deconvdamping); + + if (!batchMode) { + removeIfThere (edgebin, edgebox, false); + if (edgesonly->get_active ()) + edgebin->pack_start (*edgebox); + + removeIfThere (hcbin, hcbox, false); + if (halocontrol->get_active ()) + hcbin->pack_start (*hcbox); + + } + if (pedited && !pedited->sharpening.method) + method->set_active (2); + else if (pp->sharpening.method=="usm") + method->set_active (0); + else if (pp->sharpening.method=="rld") + method->set_active (1); + + enableListener (); +} + +void Sharpening::write (ProcParams* pp, ParamsEdited* pedited) { + + pp->sharpening.amount = (int)amount->getValue(); + pp->sharpening.enabled = enabled->get_active (); + pp->sharpening.radius = radius->getValue (); + pp->sharpening.threshold = (int)threshold->getValue (); + pp->sharpening.edgesonly = edgesonly->get_active (); + pp->sharpening.edges_radius = eradius->getValue (); + pp->sharpening.edges_tolerance = (int)etolerance->getValue (); + pp->sharpening.halocontrol = halocontrol->get_active (); + pp->sharpening.halocontrol_amount = (int)hcamount->getValue (); + pp->sharpening.deconvradius = dradius->getValue (); + pp->sharpening.deconviter = (int)diter->getValue (); + pp->sharpening.deconvamount = (int)damount->getValue (); + pp->sharpening.deconvdamping = (int)ddamping->getValue (); + + if (method->get_active_row_number()==0) + pp->sharpening.method = "usm"; + else if (method->get_active_row_number()==1) + pp->sharpening.method = "rld"; + + if (pedited) { + pedited->sharpening.amount = amount->getEditedState (); + pedited->sharpening.radius = radius->getEditedState (); + pedited->sharpening.threshold = threshold->getEditedState (); + pedited->sharpening.edges_radius = eradius->getEditedState (); + pedited->sharpening.edges_tolerance = etolerance->getEditedState (); + pedited->sharpening.halocontrol_amount = hcamount->getEditedState (); + pedited->sharpening.deconvamount = damount->getEditedState (); + pedited->sharpening.deconvradius = dradius->getEditedState (); + pedited->sharpening.deconviter = diter->getEditedState (); + pedited->sharpening.deconvdamping = ddamping->getEditedState (); + pedited->sharpening.method = method->get_active_row_number()!=2; + pedited->sharpening.halocontrol = !halocontrol->get_inconsistent(); + pedited->sharpening.edgesonly = !edgesonly->get_inconsistent(); + pedited->sharpening.enabled = !enabled->get_inconsistent(); + } +} + +void Sharpening::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { + + amount->setDefault (defParams->sharpening.amount); + radius->setDefault (defParams->sharpening.radius); + threshold->setDefault (defParams->sharpening.threshold); + eradius->setDefault (defParams->sharpening.edges_radius); + etolerance->setDefault (defParams->sharpening.edges_tolerance); + hcamount->setDefault (defParams->sharpening.halocontrol_amount); + damount->setDefault (defParams->sharpening.deconvamount); + dradius->setDefault (defParams->sharpening.deconvradius); + diter->setDefault (defParams->sharpening.deconviter); + ddamping->setDefault (defParams->sharpening.deconvdamping); + + if (pedited) { + amount->setDefaultEditedState (pedited->sharpening.amount ? Edited : UnEdited); + radius->setDefaultEditedState (pedited->sharpening.radius ? Edited : UnEdited); + threshold->setDefaultEditedState (pedited->sharpening.threshold ? Edited : UnEdited); + eradius->setDefaultEditedState (pedited->sharpening.edges_radius ? Edited : UnEdited); + etolerance->setDefaultEditedState (pedited->sharpening.edges_tolerance ? Edited : UnEdited); + hcamount->setDefaultEditedState (pedited->sharpening.halocontrol_amount ? Edited : UnEdited); + damount->setDefaultEditedState (pedited->sharpening.deconvamount ? Edited : UnEdited); + dradius->setDefaultEditedState (pedited->sharpening.deconvradius ? Edited : UnEdited); + diter->setDefaultEditedState (pedited->sharpening.deconviter ? Edited : UnEdited); + ddamping->setDefaultEditedState (pedited->sharpening.deconvdamping ? Edited : UnEdited); + } + else { + amount->setDefaultEditedState (Irrelevant); + radius->setDefaultEditedState (Irrelevant); + threshold->setDefaultEditedState (Irrelevant); + eradius->setDefaultEditedState (Irrelevant); + etolerance->setDefaultEditedState (Irrelevant); + hcamount->setDefaultEditedState (Irrelevant); + damount->setDefaultEditedState (Irrelevant); + dradius->setDefaultEditedState (Irrelevant); + diter->setDefaultEditedState (Irrelevant); + ddamping->setDefaultEditedState (Irrelevant); + } +} + +void Sharpening::adjusterChanged (Adjuster* a, double newval) { + + if (listener && enabled->get_active()) { + + Glib::ustring costr; + if (a==radius || a==dradius) costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), a->getValue()); - else if (a==eradius) + else if (a==eradius) costr = Glib::ustring::format (std::setw(2), std::fixed, std::setprecision(1), a->getValue()); - else + else costr = Glib::ustring::format ((int)a->getValue()); - - if (a==amount) - listener->panelChanged (EvShrAmount, costr); - else if (a==radius) - listener->panelChanged (EvShrRadius, costr); - else if (a==threshold) - listener->panelChanged (EvShrThresh, costr); - else if (a==eradius) - listener->panelChanged (EvShrEdgeRadius, costr); - else if (a==etolerance) - listener->panelChanged (EvShrEdgeTolerance, costr); - else if (a==hcamount) - listener->panelChanged (EvShrHaloAmount, costr); - else if (a==dradius) - listener->panelChanged (EvShrDRadius, costr); - else if (a==damount) - listener->panelChanged (EvShrDAmount, costr); - else if (a==ddamping) - listener->panelChanged (EvShrDDamping, costr); - else if (a==diter) - listener->panelChanged (EvShrDIterations, costr); - } -} - -void Sharpening::enabled_toggled () { - - if (batchMode) { - if (enabled->get_inconsistent()) { - enabled->set_inconsistent (false); - enaConn.block (true); - enabled->set_active (false); - enaConn.block (false); - } - else if (lastEnabled) - enabled->set_inconsistent (true); - - lastEnabled = enabled->get_active (); - } - - if (listener) { - if (enabled->get_active ()) - listener->panelChanged (EvShrEnabled, M("GENERAL_ENABLED")); - else - listener->panelChanged (EvShrEnabled, M("GENERAL_DISABLED")); - } -} - -void Sharpening::edgesonly_toggled () { - - if (batchMode) { - if (edgesonly->get_inconsistent()) { - edgesonly->set_inconsistent (false); - eonlyConn.block (true); - edgesonly->set_active (false); - eonlyConn.block (false); - } - else if (lastEdgesOnly) - edgesonly->set_inconsistent (true); - - lastEdgesOnly = edgesonly->get_active (); - } - - if (!batchMode) { - removeIfThere (edgebin, edgebox, false); - if (edgesonly->get_active ()) - edgebin->pack_start (*edgebox); - } - - if (listener && enabled->get_active()) { - if (edgesonly->get_active ()) - listener->panelChanged (EvShrEdgeOnly, M("GENERAL_ENABLED")); - else - listener->panelChanged (EvShrEdgeOnly, M("GENERAL_DISABLED")); - } -} - -void Sharpening::halocontrol_toggled () { - - if (batchMode) { - if (halocontrol->get_inconsistent()) { - halocontrol->set_inconsistent (false); - hcConn.block (true); - halocontrol->set_active (false); - hcConn.block (false); - } - else if (lastHaloControl) - halocontrol->set_inconsistent (true); - - lastHaloControl = halocontrol->get_active (); - } - - if (!batchMode) { - removeIfThere (hcbin, hcbox, false); - if (halocontrol->get_active ()) - hcbin->pack_start (*hcbox); - } - - if (listener && enabled->get_active()) { - if (halocontrol->get_active ()) - listener->panelChanged (EvShrHaloControl, M("GENERAL_ENABLED")); - else - listener->panelChanged (EvShrHaloControl, M("GENERAL_DISABLED")); - } -} - -void Sharpening::method_changed () { - - removeIfThere (this, usm, false); - removeIfThere (this, rld, false); - - if (method->get_active_row_number()==0) - pack_start (*usm); - else if (method->get_active_row_number()==1) - pack_start (*rld); - - if (listener && enabled->get_active ()) - listener->panelChanged (EvShrMethod, method->get_active_text ()); - -} - -void Sharpening::setBatchMode (bool batchMode) { - - ToolPanel::setBatchMode (batchMode); - - removeIfThere (hcbin, hcbox, false); - hcbin->pack_start (*hcbox); - removeIfThere (edgebin, edgebox, false); - edgebin->pack_start (*edgebox); - - radius->showEditedCB (); - amount->showEditedCB (); - threshold->showEditedCB (); - eradius->showEditedCB (); - etolerance->showEditedCB (); - hcamount->showEditedCB (); - dradius->showEditedCB (); - damount->showEditedCB (); - ddamping->showEditedCB (); - diter->showEditedCB (); - method->append_text (M("GENERAL_UNCHANGED")); -} - -void Sharpening::setAdjusterBehavior (bool bamountadd) { - - if (!amountAdd && bamountadd) { - amount->setLimits (-100, 100, 1, 0); - damount->setLimits (-100, 100, 1, 0); - } - else if (amountAdd && !bamountadd) { - amount->setLimits (1, 1000, 1, 150); - damount->setLimits (0, 100, 1, 75); - } - amountAdd = bamountadd; -} + + if (a==amount) + listener->panelChanged (EvShrAmount, costr); + else if (a==radius) + listener->panelChanged (EvShrRadius, costr); + else if (a==threshold) + listener->panelChanged (EvShrThresh, costr); + else if (a==eradius) + listener->panelChanged (EvShrEdgeRadius, costr); + else if (a==etolerance) + listener->panelChanged (EvShrEdgeTolerance, costr); + else if (a==hcamount) + listener->panelChanged (EvShrHaloAmount, costr); + else if (a==dradius) + listener->panelChanged (EvShrDRadius, costr); + else if (a==damount) + listener->panelChanged (EvShrDAmount, costr); + else if (a==ddamping) + listener->panelChanged (EvShrDDamping, costr); + else if (a==diter) + listener->panelChanged (EvShrDIterations, costr); + } +} + +void Sharpening::enabled_toggled () { + + if (batchMode) { + if (enabled->get_inconsistent()) { + enabled->set_inconsistent (false); + enaConn.block (true); + enabled->set_active (false); + enaConn.block (false); + } + else if (lastEnabled) + enabled->set_inconsistent (true); + + lastEnabled = enabled->get_active (); + } + + if (listener) { + if (enabled->get_active ()) + listener->panelChanged (EvShrEnabled, M("GENERAL_ENABLED")); + else + listener->panelChanged (EvShrEnabled, M("GENERAL_DISABLED")); + } +} + +void Sharpening::edgesonly_toggled () { + + if (batchMode) { + if (edgesonly->get_inconsistent()) { + edgesonly->set_inconsistent (false); + eonlyConn.block (true); + edgesonly->set_active (false); + eonlyConn.block (false); + } + else if (lastEdgesOnly) + edgesonly->set_inconsistent (true); + + lastEdgesOnly = edgesonly->get_active (); + } + + if (!batchMode) { + removeIfThere (edgebin, edgebox, false); + if (edgesonly->get_active ()) + edgebin->pack_start (*edgebox); + } + + if (listener && enabled->get_active()) { + if (edgesonly->get_active ()) + listener->panelChanged (EvShrEdgeOnly, M("GENERAL_ENABLED")); + else + listener->panelChanged (EvShrEdgeOnly, M("GENERAL_DISABLED")); + } +} + +void Sharpening::halocontrol_toggled () { + + if (batchMode) { + if (halocontrol->get_inconsistent()) { + halocontrol->set_inconsistent (false); + hcConn.block (true); + halocontrol->set_active (false); + hcConn.block (false); + } + else if (lastHaloControl) + halocontrol->set_inconsistent (true); + + lastHaloControl = halocontrol->get_active (); + } + + if (!batchMode) { + removeIfThere (hcbin, hcbox, false); + if (halocontrol->get_active ()) + hcbin->pack_start (*hcbox); + } + + if (listener && enabled->get_active()) { + if (halocontrol->get_active ()) + listener->panelChanged (EvShrHaloControl, M("GENERAL_ENABLED")); + else + listener->panelChanged (EvShrHaloControl, M("GENERAL_DISABLED")); + } +} + +void Sharpening::method_changed () { + + removeIfThere (this, usm, false); + removeIfThere (this, rld, false); + + if (method->get_active_row_number()==0) + pack_start (*usm); + else if (method->get_active_row_number()==1) + pack_start (*rld); + + if (listener && enabled->get_active ()) + listener->panelChanged (EvShrMethod, method->get_active_text ()); + +} + +void Sharpening::setBatchMode (bool batchMode) { + + ToolPanel::setBatchMode (batchMode); + + removeIfThere (hcbin, hcbox, false); + hcbin->pack_start (*hcbox); + removeIfThere (edgebin, edgebox, false); + edgebin->pack_start (*edgebox); + + radius->showEditedCB (); + amount->showEditedCB (); + threshold->showEditedCB (); + eradius->showEditedCB (); + etolerance->showEditedCB (); + hcamount->showEditedCB (); + dradius->showEditedCB (); + damount->showEditedCB (); + ddamping->showEditedCB (); + diter->showEditedCB (); + method->append_text (M("GENERAL_UNCHANGED")); +} + +void Sharpening::setAdjusterBehavior (bool bamountadd) { + + if (!amountAdd && bamountadd) { + amount->setLimits (-100, 100, 1, 0); + damount->setLimits (-100, 100, 1, 0); + } + else if (amountAdd && !bamountadd) { + amount->setLimits (1, 1000, 1, 150); + damount->setLimits (0, 100, 1, 75); + } + amountAdd = bamountadd; +} diff --git a/rtgui/sharpening.h b/rtgui/sharpening.h index cb3ad2a43..e96edcd41 100644 --- a/rtgui/sharpening.h +++ b/rtgui/sharpening.h @@ -1,79 +1,79 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _SHARPENING_H_ -#define _SHARPENING_H_ - -#include -#include -#include - -class Sharpening : public Gtk::VBox, public AdjusterListener, public ToolPanel { - - protected: - Gtk::ComboBoxText* method; - Adjuster* dradius; - Adjuster* damount; - Adjuster* ddamping; - Adjuster* diter; - Gtk::VBox* usm; - Gtk::VBox* rld; - - Adjuster* radius; - Adjuster* amount; - Adjuster* threshold; - Adjuster* eradius; - Adjuster* etolerance; - Adjuster* hcamount; - Gtk::VBox* edgebin; - Gtk::VBox* hcbin; - Gtk::VBox* edgebox; - Gtk::VBox* hcbox; - Gtk::CheckButton* enabled; - bool lastEnabled; - sigc::connection enaConn; - Gtk::CheckButton* edgesonly; - bool lastEdgesOnly; - sigc::connection eonlyConn; - Gtk::CheckButton* halocontrol; - bool lastHaloControl; - sigc::connection hcConn; - bool amountAdd; - - - - public: - - Sharpening (); - virtual ~Sharpening (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); - void setBatchMode (bool batchMode); - - void adjusterChanged (Adjuster* a, double newval); - void enabled_toggled (); - void edgesonly_toggled (); - void halocontrol_toggled (); - void method_changed (); - - void setAdjusterBehavior (bool bamountadd); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _SHARPENING_H_ +#define _SHARPENING_H_ + +#include +#include +#include + +class Sharpening : public Gtk::VBox, public AdjusterListener, public ToolPanel { + + protected: + Gtk::ComboBoxText* method; + Adjuster* dradius; + Adjuster* damount; + Adjuster* ddamping; + Adjuster* diter; + Gtk::VBox* usm; + Gtk::VBox* rld; + + Adjuster* radius; + Adjuster* amount; + Adjuster* threshold; + Adjuster* eradius; + Adjuster* etolerance; + Adjuster* hcamount; + Gtk::VBox* edgebin; + Gtk::VBox* hcbin; + Gtk::VBox* edgebox; + Gtk::VBox* hcbox; + Gtk::CheckButton* enabled; + bool lastEnabled; + sigc::connection enaConn; + Gtk::CheckButton* edgesonly; + bool lastEdgesOnly; + sigc::connection eonlyConn; + Gtk::CheckButton* halocontrol; + bool lastHaloControl; + sigc::connection hcConn; + bool amountAdd; + + + + public: + + Sharpening (); + virtual ~Sharpening (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); + void setBatchMode (bool batchMode); + + void adjusterChanged (Adjuster* a, double newval); + void enabled_toggled (); + void edgesonly_toggled (); + void halocontrol_toggled (); + void method_changed (); + + void setAdjusterBehavior (bool bamountadd); +}; + +#endif diff --git a/rtgui/splash.h b/rtgui/splash.h index b8c1b38af..2afa2c9a5 100644 --- a/rtgui/splash.h +++ b/rtgui/splash.h @@ -1,50 +1,50 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef __SPLASH__ -#define __SPLASH__ - -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef __SPLASH__ +#define __SPLASH__ + +#include class SplashImage : public Gtk::DrawingArea { private: Glib::RefPtr gc_; Glib::RefPtr pixbuf; - Glib::RefPtr version; + Glib::RefPtr version; public: SplashImage (); - void on_realize (); - bool on_expose_event (GdkEventExpose* event); + void on_realize (); + bool on_expose_event (GdkEventExpose* event); }; - -//class Splash : public Gtk::Window { -class Splash : public Gtk::Dialog { + +//class Splash : public Gtk::Window { +class Splash : public Gtk::Dialog { private: - SplashImage* splashImage; - - public: - Splash (int maxtime); - + SplashImage* splashImage; + + public: + Splash (int maxtime); + bool on_timer (); - virtual bool on_button_release_event (GdkEventButton* event); -}; - -#endif + virtual bool on_button_release_event (GdkEventButton* event); +}; + +#endif diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index 0dd697641..faf54ac29 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -1,238 +1,238 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include +#include #include -ThumbBrowserBase::ThumbBrowserBase () - : previewHeight(options.thumbSize), lastClicked(NULL) { - - inW = -1; inH = -1; - - Gtk::HBox* hb1 = new Gtk::HBox (); - Gtk::HBox* hb2 = new Gtk::HBox (); - Gtk::Frame* frame = new Gtk::Frame (); - frame->add (internal); - frame->set_shadow_type (Gtk::SHADOW_IN ); - hb1->pack_start (*frame); - hb1->pack_end (vscroll, Gtk::PACK_SHRINK, 0); - - pack_start (*hb1); - - Gtk::HBox* tmp = new Gtk::HBox (); - hb2->pack_start (hscroll); - Gtk::Requisition vcr = vscroll.size_request (); - tmp->set_size_request (vcr.width, vcr.width); - hb2->pack_end (*tmp, Gtk::PACK_SHRINK, 0); - - pack_start (*hb2,Gtk::PACK_SHRINK, 0); - - internal.setParent (this); - - show_all (); - - hscroll.set_update_policy (Gtk::UPDATE_CONTINUOUS); - vscroll.set_update_policy (Gtk::UPDATE_CONTINUOUS); - - vscroll.signal_value_changed().connect( sigc::mem_fun(*this, &ThumbBrowserBase::scrollChanged) ); - hscroll.signal_value_changed().connect( sigc::mem_fun(*this, &ThumbBrowserBase::scrollChanged) ); - - internal.signal_size_allocate().connect( sigc::mem_fun(*this, &ThumbBrowserBase::internalAreaResized) ); - signal_style_changed().connect( sigc::mem_fun(*this, &ThumbBrowserBase::styleChanged) ); -} - -void ThumbBrowserBase::scrollChanged () { - - for (int i=0; isetOffset ((int)(hscroll.get_value()), (int)(vscroll.get_value())); - - internal.setPosition ((int)(hscroll.get_value()), (int)(vscroll.get_value())); - - if (!internal.isDirty()) { - internal.setDirty (); - internal.queue_draw (); -// gdk_window_process_updates (get_window()->gobj(), true); - } -} +ThumbBrowserBase::ThumbBrowserBase () + : previewHeight(options.thumbSize), lastClicked(NULL) { + + inW = -1; inH = -1; + + Gtk::HBox* hb1 = new Gtk::HBox (); + Gtk::HBox* hb2 = new Gtk::HBox (); + Gtk::Frame* frame = new Gtk::Frame (); + frame->add (internal); + frame->set_shadow_type (Gtk::SHADOW_IN ); + hb1->pack_start (*frame); + hb1->pack_end (vscroll, Gtk::PACK_SHRINK, 0); + + pack_start (*hb1); + + Gtk::HBox* tmp = new Gtk::HBox (); + hb2->pack_start (hscroll); + Gtk::Requisition vcr = vscroll.size_request (); + tmp->set_size_request (vcr.width, vcr.width); + hb2->pack_end (*tmp, Gtk::PACK_SHRINK, 0); + + pack_start (*hb2,Gtk::PACK_SHRINK, 0); + + internal.setParent (this); + + show_all (); + + hscroll.set_update_policy (Gtk::UPDATE_CONTINUOUS); + vscroll.set_update_policy (Gtk::UPDATE_CONTINUOUS); + + vscroll.signal_value_changed().connect( sigc::mem_fun(*this, &ThumbBrowserBase::scrollChanged) ); + hscroll.signal_value_changed().connect( sigc::mem_fun(*this, &ThumbBrowserBase::scrollChanged) ); + + internal.signal_size_allocate().connect( sigc::mem_fun(*this, &ThumbBrowserBase::internalAreaResized) ); + signal_style_changed().connect( sigc::mem_fun(*this, &ThumbBrowserBase::styleChanged) ); +} + +void ThumbBrowserBase::scrollChanged () { + + for (int i=0; isetOffset ((int)(hscroll.get_value()), (int)(vscroll.get_value())); + + internal.setPosition ((int)(hscroll.get_value()), (int)(vscroll.get_value())); + + if (!internal.isDirty()) { + internal.setDirty (); + internal.queue_draw (); +// gdk_window_process_updates (get_window()->gobj(), true); + } +} + +void ThumbBrowserBase::scroll (int direction) { -void ThumbBrowserBase::scroll (int direction) { - if (arrangement==TB_Vertical) vscroll.set_value (vscroll.get_value() + (direction==GDK_SCROLL_DOWN ? +1 : -1) * vscroll.get_adjustment()->get_step_increment()); else hscroll.set_value (hscroll.get_value() + (direction==GDK_SCROLL_DOWN ? +1 : -1) * hscroll.get_adjustment()->get_step_increment()); } - -void ThumbBrowserBase::resizeThumbnailArea (int w, int h) { - - inW = w; + +void ThumbBrowserBase::resizeThumbnailArea (int w, int h) { + + inW = w; inH = h; - if (hscroll.get_value() + internal.get_width() > inW) - hscroll.set_value (inW - internal.get_width()); - if (vscroll.get_value() + internal.get_height() > inH) + if (hscroll.get_value() + internal.get_width() > inW) + hscroll.set_value (inW - internal.get_width()); + if (vscroll.get_value() + internal.get_height() > inH) vscroll.set_value (inH - internal.get_height()); configScrollBars (); -} - -void ThumbBrowserBase::internalAreaResized (Gtk::Allocation& req) { - - if (inW>0 && inH>0) { - configScrollBars (); - redraw (); - } -} - -void ThumbBrowserBase::configScrollBars () { - - if (inW>0 && inH>0) { - - int iw = internal.get_width (); - int ih = internal.get_height (); - - hscroll.get_adjustment()->set_upper (inW); - vscroll.get_adjustment()->set_upper (inH); - hscroll.get_adjustment()->set_lower (0); - vscroll.get_adjustment()->set_lower (0); - hscroll.get_adjustment()->set_step_increment (32); - vscroll.get_adjustment()->set_step_increment (32); - hscroll.get_adjustment()->set_page_increment (iw); - vscroll.get_adjustment()->set_page_increment (ih); - hscroll.get_adjustment()->set_page_size (iw); - vscroll.get_adjustment()->set_page_size (ih); - } -} - -void ThumbBrowserBase::arrangeFiles () { +} - int N = fd.size (); - // apply filter - for (int i=0; ifiltered = !checkFilter (fd[i]); - - int rowHeight = 0; - // compute size of the items - for (int i=0; ifiltered && fd[i]->getMinimalHeight() > rowHeight) - rowHeight = fd[i]->getMinimalHeight (); - - if (arrangement==TB_Horizontal) { - - int numOfRows = 1; - if (rowHeight>0) { - numOfRows = (internal.get_height()+rowHeight/2)/rowHeight; - if (numOfRows<1) - numOfRows = 1; - } - - int ct = 0; - int currx = 0; int curry = 0; - while (ctgetMinimalWidth() > maxw) - maxw = fd[ct+i]->getMinimalWidth (); - - // arrange items in the column - curry = 0; - for (int i=0; ctfiltered) - fd[ct++]->drawable = false; - if (ctsetPosition (currx, curry, maxw, rowHeight); - fd[ct]->drawable = true; - curry += rowHeight; - } - } - currx += maxw; - } - resizeThumbnailArea (currx, numOfRows*rowHeight); - } - else { - int availWidth = internal.get_width(); - // initial number of columns - int numOfCols = 0; - int currColNum = 0; - int colsWidth = 0; - for (int i=0; ifiltered && colsWidth + fd[i]->getMinimalWidth() <= availWidth) { - colsWidth += fd[numOfCols]->getMinimalWidth (); - numOfCols++; - } - if (numOfCols<1) - numOfCols = 1; - std::vector colWidths; - for (; numOfCols>0; numOfCols--) { - // compute column widths - colWidths.resize (numOfCols); - for (int i=0; ifiltered && fd[i]->getMinimalWidth() > colWidths[j%numOfCols]) - colWidths[j%numOfCols] = fd[i]->getMinimalWidth (); - if (!fd[i]->filtered) - j++; - } - // if not wider than the space available, arrange it and we are ready - colsWidth = 0; - for (int i=0; ifiltered) - fd[ct++]->drawable = false; - if (ctsetPosition (currx, curry, colWidths[i%numOfCols], rowHeight); - fd[ct]->drawable = true; - currx += colWidths[i%numOfCols]; - } - } - if (currx>0) // there were thumbnails placed in the row - curry += rowHeight; - } - resizeThumbnailArea (colsWidth, curry); - } -} - - -void ThumbBrowserBase::Internal::on_realize() -{ - Cairo::FontOptions cfo; - cfo.set_antialias (Cairo::ANTIALIAS_SUBPIXEL); - get_pango_context()->set_cairo_font_options (cfo); - - Gtk::DrawingArea::on_realize(); - Glib::RefPtr window = get_window(); - set_flags (Gtk::CAN_FOCUS); - add_events(Gdk::EXPOSURE_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::POINTER_MOTION_MASK | Gdk::SCROLL_MASK | Gdk::KEY_PRESS_MASK); +void ThumbBrowserBase::internalAreaResized (Gtk::Allocation& req) { + + if (inW>0 && inH>0) { + configScrollBars (); + redraw (); + } +} + +void ThumbBrowserBase::configScrollBars () { + + if (inW>0 && inH>0) { + + int iw = internal.get_width (); + int ih = internal.get_height (); + + hscroll.get_adjustment()->set_upper (inW); + vscroll.get_adjustment()->set_upper (inH); + hscroll.get_adjustment()->set_lower (0); + vscroll.get_adjustment()->set_lower (0); + hscroll.get_adjustment()->set_step_increment (32); + vscroll.get_adjustment()->set_step_increment (32); + hscroll.get_adjustment()->set_page_increment (iw); + vscroll.get_adjustment()->set_page_increment (ih); + hscroll.get_adjustment()->set_page_size (iw); + vscroll.get_adjustment()->set_page_size (ih); + } +} + +void ThumbBrowserBase::arrangeFiles () { + + int N = fd.size (); + // apply filter + for (int i=0; ifiltered = !checkFilter (fd[i]); + + int rowHeight = 0; + // compute size of the items + for (int i=0; ifiltered && fd[i]->getMinimalHeight() > rowHeight) + rowHeight = fd[i]->getMinimalHeight (); + + if (arrangement==TB_Horizontal) { + + int numOfRows = 1; + if (rowHeight>0) { + numOfRows = (internal.get_height()+rowHeight/2)/rowHeight; + if (numOfRows<1) + numOfRows = 1; + } + + int ct = 0; + int currx = 0; int curry = 0; + while (ctgetMinimalWidth() > maxw) + maxw = fd[ct+i]->getMinimalWidth (); + + // arrange items in the column + curry = 0; + for (int i=0; ctfiltered) + fd[ct++]->drawable = false; + if (ctsetPosition (currx, curry, maxw, rowHeight); + fd[ct]->drawable = true; + curry += rowHeight; + } + } + currx += maxw; + } + resizeThumbnailArea (currx, numOfRows*rowHeight); + } + else { + int availWidth = internal.get_width(); + // initial number of columns + int numOfCols = 0; + int currColNum = 0; + int colsWidth = 0; + for (int i=0; ifiltered && colsWidth + fd[i]->getMinimalWidth() <= availWidth) { + colsWidth += fd[numOfCols]->getMinimalWidth (); + numOfCols++; + } + if (numOfCols<1) + numOfCols = 1; + std::vector colWidths; + for (; numOfCols>0; numOfCols--) { + // compute column widths + colWidths.resize (numOfCols); + for (int i=0; ifiltered && fd[i]->getMinimalWidth() > colWidths[j%numOfCols]) + colWidths[j%numOfCols] = fd[i]->getMinimalWidth (); + if (!fd[i]->filtered) + j++; + } + // if not wider than the space available, arrange it and we are ready + colsWidth = 0; + for (int i=0; ifiltered) + fd[ct++]->drawable = false; + if (ctsetPosition (currx, curry, colWidths[i%numOfCols], rowHeight); + fd[ct]->drawable = true; + currx += colWidths[i%numOfCols]; + } + } + if (currx>0) // there were thumbnails placed in the row + curry += rowHeight; + } + resizeThumbnailArea (colsWidth, curry); + } +} + + +void ThumbBrowserBase::Internal::on_realize() +{ + Cairo::FontOptions cfo; + cfo.set_antialias (Cairo::ANTIALIAS_SUBPIXEL); + get_pango_context()->set_cairo_font_options (cfo); + + Gtk::DrawingArea::on_realize(); + Glib::RefPtr window = get_window(); + set_flags (Gtk::CAN_FOCUS); + add_events(Gdk::EXPOSURE_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::POINTER_MOTION_MASK | Gdk::SCROLL_MASK | Gdk::KEY_PRESS_MASK); gc_ = Gdk::GC::create(window); set_has_tooltip (true); signal_query_tooltip().connect( sigc::mem_fun(*this, &ThumbBrowserBase::Internal::on_query_tooltip) ); @@ -241,8 +241,8 @@ void ThumbBrowserBase::Internal::on_realize() bool ThumbBrowserBase::Internal::on_query_tooltip (int x, int y, bool keyboard_tooltip, const Glib::RefPtr& tooltip) { Glib::ustring ttip = ""; - for (int i=0; ifd.size(); i++) - if (parent->fd[i]->drawable && parent->fd[i]->inside (x, y)) { + for (int i=0; ifd.size(); i++) + if (parent->fd[i]->drawable && parent->fd[i]->inside (x, y)) { ttip = parent->fd[i]->getToolTip (x, y); break; } @@ -251,265 +251,265 @@ bool ThumbBrowserBase::Internal::on_query_tooltip (int x, int y, bool keyboard_t return true; } else - return false; -} - -void ThumbBrowserBase::styleChanged (const Glib::RefPtr& style) { - - refreshThumbImages (); -} - -ThumbBrowserBase::Internal::Internal () : parent(NULL), ofsX(0), ofsY(0), dirty(true) { -} - -void ThumbBrowserBase::Internal::setParent (ThumbBrowserBase* p) { - - parent = p; -} - -void ThumbBrowserBase::Internal::setPosition (int x, int y) { - - ofsX = x; - ofsY = y; + return false; +} + +void ThumbBrowserBase::styleChanged (const Glib::RefPtr& style) { + + refreshThumbImages (); +} + +ThumbBrowserBase::Internal::Internal () : parent(NULL), ofsX(0), ofsY(0), dirty(true) { +} + +void ThumbBrowserBase::Internal::setParent (ThumbBrowserBase* p) { + + parent = p; +} + +void ThumbBrowserBase::Internal::setPosition (int x, int y) { + + ofsX = x; + ofsY = y; } bool ThumbBrowserBase::Internal::on_key_press_event (GdkEventKey* event) { return parent->keyPressed (event); -} - -bool ThumbBrowserBase::Internal::on_button_press_event (GdkEventButton* event) { +} + +bool ThumbBrowserBase::Internal::on_button_press_event (GdkEventButton* event) { grab_focus (); - - parent->eventTime = event->time; - parent->buttonPressed ((int)event->x, (int)event->y, event->button, event->type, event->state, 0, 0, get_width(), get_height()); - Glib::RefPtr window = get_window(); - - GdkRectangle rect; - rect.x = 0; - rect.y = 0; - window->get_size (rect.width, rect.height); - - gdk_window_invalidate_rect (window->gobj(), &rect, true); + parent->eventTime = event->time; + + parent->buttonPressed ((int)event->x, (int)event->y, event->button, event->type, event->state, 0, 0, get_width(), get_height()); + Glib::RefPtr window = get_window(); + + GdkRectangle rect; + rect.x = 0; + rect.y = 0; + window->get_size (rect.width, rect.height); + + gdk_window_invalidate_rect (window->gobj(), &rect, true); gdk_window_process_updates (window->gobj(), true); - return true; -} - -void ThumbBrowserBase::buttonPressed (int x, int y, int button, GdkEventType type, int state, int clx, int cly, int clw, int clh) { - - ThumbBrowserEntryBase* fileDescr = NULL; - bool handled = false; - for (int i=0; idrawable) { - if (fd[i]->inside (x, y) && fd[i]->insideWindow (clx, cly, clw, clh)) - fileDescr = fd[i]; - bool b = fd[i]->pressNotify (button, type, state, x, y); - handled = handled || b; - } - - if (handled || (fileDescr && fileDescr->processing)) - return; - - if (selected.size()==1 && type==GDK_2BUTTON_PRESS && button==1) - doubleClicked (selected[0]); - else if (button==1 && type==GDK_BUTTON_PRESS) { - if (fileDescr && state & GDK_SHIFT_MASK) { - if (selected.size()==0) { - selected.push_back (fileDescr); - fileDescr->selected = true; + return true; +} + +void ThumbBrowserBase::buttonPressed (int x, int y, int button, GdkEventType type, int state, int clx, int cly, int clw, int clh) { + + ThumbBrowserEntryBase* fileDescr = NULL; + bool handled = false; + for (int i=0; idrawable) { + if (fd[i]->inside (x, y) && fd[i]->insideWindow (clx, cly, clw, clh)) + fileDescr = fd[i]; + bool b = fd[i]->pressNotify (button, type, state, x, y); + handled = handled || b; + } + + if (handled || (fileDescr && fileDescr->processing)) + return; + + if (selected.size()==1 && type==GDK_2BUTTON_PRESS && button==1) + doubleClicked (selected[0]); + else if (button==1 && type==GDK_BUTTON_PRESS) { + if (fileDescr && state & GDK_SHIFT_MASK) { + if (selected.size()==0) { + selected.push_back (fileDescr); + fileDescr->selected = true; lastClicked = fileDescr; - selectionChanged (); - } - else { - // find the start and the end of the selection interval - int startx = fd.size()-1; - if (lastClicked) { - for (; startx>=0; startx--) - if (fd[startx]==lastClicked) - break; - } - else { - for (; startx>=0; startx--) - if (fd[startx]==selected[0]) - break; - } - int endx = 0; - for (; endxselected = false; - selected.clear (); - // select thumbnails in the interval - for (int i=startx; i<=endx; i++) { - if (!fd[i]->filtered) { - fd[i]->selected = true; - selected.push_back (fd[i]); - } + selectionChanged (); + } + else { + // find the start and the end of the selection interval + int startx = fd.size()-1; + if (lastClicked) { + for (; startx>=0; startx--) + if (fd[startx]==lastClicked) + break; } - selectionChanged (); - } - } - else if (fileDescr && state & GDK_CONTROL_MASK) { - std::vector::iterator i = std::find (selected.begin(), selected.end(), fileDescr); - if (i!=selected.end()) { - (*i)->selected = false; - selected.erase (i); - } - else { - selected.push_back (fileDescr); - fileDescr->selected = true; - } + else { + for (; startx>=0; startx--) + if (fd[startx]==selected[0]) + break; + } + int endx = 0; + for (; endxselected = false; + selected.clear (); + // select thumbnails in the interval + for (int i=startx; i<=endx; i++) { + if (!fd[i]->filtered) { + fd[i]->selected = true; + selected.push_back (fd[i]); + } + } + selectionChanged (); + } + } + else if (fileDescr && state & GDK_CONTROL_MASK) { + std::vector::iterator i = std::find (selected.begin(), selected.end(), fileDescr); + if (i!=selected.end()) { + (*i)->selected = false; + selected.erase (i); + } + else { + selected.push_back (fileDescr); + fileDescr->selected = true; + } lastClicked = fileDescr; - selectionChanged (); - } - else { - for (int i=0; iselected = false; - selected.clear (); - if (fileDescr) { - selected.push_back (fileDescr); - fileDescr->selected = true; - } + selectionChanged (); + } + else { + for (int i=0; iselected = false; + selected.clear (); + if (fileDescr) { + selected.push_back (fileDescr); + fileDescr->selected = true; + } lastClicked = fileDescr; - selectionChanged (); - } - } + selectionChanged (); + } + } else if (fileDescr && button==3 && type==GDK_BUTTON_PRESS) { - if (!fileDescr->selected) { - for (int i=0; iselected = false; - selected.clear (); - fileDescr->selected = true; - selected.push_back (fileDescr); + if (!fileDescr->selected) { + for (int i=0; iselected = false; + selected.clear (); + fileDescr->selected = true; + selected.push_back (fileDescr); lastClicked = fileDescr; - selectionChanged (); - } - rightClicked (fileDescr); - } -} - -bool ThumbBrowserBase::Internal::on_expose_event(GdkEventExpose* event) { - - dirty = false; - - Glib::RefPtr window = get_window(); - - int w = get_width(); - int h = get_height(); - - window->clear(); + selectionChanged (); + } + rightClicked (fileDescr); + } +} + +bool ThumbBrowserBase::Internal::on_expose_event(GdkEventExpose* event) { + + dirty = false; + + Glib::RefPtr window = get_window(); + + int w = get_width(); + int h = get_height(); + + window->clear(); // draw thumbnails - Glib::RefPtr context = get_pango_context (); - context->set_font_description (get_style()->get_font()); - for (int i=0; ifd.size(); i++) { - if (!parent->fd[i]->drawable || !parent->fd[i]->insideWindow (0, 0, w, h)) + Glib::RefPtr context = get_pango_context (); + context->set_font_description (get_style()->get_font()); + for (int i=0; ifd.size(); i++) { + if (!parent->fd[i]->drawable || !parent->fd[i]->insideWindow (0, 0, w, h)) parent->fd[i]->updatepriority = false; else { parent->fd[i]->updatepriority = true; parent->fd[i]->draw (); - } - } - - return true; -} - -bool ThumbBrowserBase::Internal::on_button_release_event (GdkEventButton* event) { - - int w = get_width(); - int h = get_height(); - - for (int i=0; ifd.size(); i++) - if (parent->fd[i]->drawable && parent->fd[i]->insideWindow (0, 0, w, h)) - parent->fd[i]->releaseNotify (event->button, event->type, event->state, (int)event->x, (int)event->y); - return true; -} - -bool ThumbBrowserBase::Internal::on_motion_notify_event (GdkEventMotion* event) { - - int w = get_width(); - int h = get_height(); - - for (int i=0; ifd.size(); i++) - if (parent->fd[i]->drawable && parent->fd[i]->insideWindow (0, 0, w, h)) - parent->fd[i]->motionNotify ((int)event->x, (int)event->y); - return true; -} + } + } + + return true; +} -bool ThumbBrowserBase::Internal::on_scroll_event (GdkEventScroll* event) { - - parent->scroll (event->direction); - return true; -} +bool ThumbBrowserBase::Internal::on_button_release_event (GdkEventButton* event) { - -void ThumbBrowserBase::redraw () { - - arrangeFiles (); - queue_draw (); -} - -void ThumbBrowserBase::zoomChanged (bool zoomIn) { - - int newHeight; - int i=0; - if (zoomIn) - for (i=0; i options.thumbSize) - break; - } - else - for (i=options.thumbnailZoomRatios.size()-1; i>=0; i--) { - newHeight = (int)(options.thumbnailZoomRatios[i] * options.maxThumbnailHeight); - if (newHeight < options.thumbSize) - break; - } - previewHeight = options.thumbSize = newHeight; - for (int i=0; iresize (previewHeight); + int w = get_width(); + int h = get_height(); + + for (int i=0; ifd.size(); i++) + if (parent->fd[i]->drawable && parent->fd[i]->insideWindow (0, 0, w, h)) + parent->fd[i]->releaseNotify (event->button, event->type, event->state, (int)event->x, (int)event->y); + return true; +} + +bool ThumbBrowserBase::Internal::on_motion_notify_event (GdkEventMotion* event) { + + int w = get_width(); + int h = get_height(); + + for (int i=0; ifd.size(); i++) + if (parent->fd[i]->drawable && parent->fd[i]->insideWindow (0, 0, w, h)) + parent->fd[i]->motionNotify ((int)event->x, (int)event->y); + return true; +} + +bool ThumbBrowserBase::Internal::on_scroll_event (GdkEventScroll* event) { + + parent->scroll (event->direction); + return true; +} + + +void ThumbBrowserBase::redraw () { + + arrangeFiles (); + queue_draw (); +} + +void ThumbBrowserBase::zoomChanged (bool zoomIn) { + + int newHeight; + int i=0; + if (zoomIn) + for (i=0; i options.thumbSize) + break; + } + else + for (i=options.thumbnailZoomRatios.size()-1; i>=0; i--) { + newHeight = (int)(options.thumbnailZoomRatios[i] * options.maxThumbnailHeight); + if (newHeight < options.thumbSize) + break; + } + previewHeight = options.thumbSize = newHeight; + for (int i=0; iresize (previewHeight); redraw (); -#ifdef _WIN32 - gdk_window_process_updates (get_window()->gobj(), true); -#endif -} -void ThumbBrowserBase::refreshThumbImages () { - - for (int i=0; iresize (previewHeight); // TODO!!! Might be performance bottleneck - fd[i]->refreshThumbnailImage (); - } - - redraw (); +#ifdef _WIN32 + gdk_window_process_updates (get_window()->gobj(), true); +#endif } - -void ThumbBrowserBase::refreshEditedState (const std::set& efiles) { +void ThumbBrowserBase::refreshThumbImages () { - editedFiles = efiles; - for (int i=0; iresize (previewHeight);// TODO!!! Might be performance bottleneck + fd[i]->refreshThumbnailImage (); + } + + redraw (); +} + +void ThumbBrowserBase::refreshEditedState (const std::set& efiles) { + + editedFiles = efiles; + for (int i=0; iframed = editedFiles.find (fd[i]->filename)!=editedFiles.end(); queue_draw (); -} - -void ThumbBrowserBase::setArrangement (Arrangement a) { - - arrangement = a; - redraw (); -} - -void ThumbBrowserBase::initEntry (ThumbBrowserEntryBase* entry) { - - entry->setOffset ((int)(hscroll.get_value()), (int)(vscroll.get_value())); -} +} + +void ThumbBrowserBase::setArrangement (Arrangement a) { + + arrangement = a; + redraw (); +} + +void ThumbBrowserBase::initEntry (ThumbBrowserEntryBase* entry) { + + entry->setOffset ((int)(hscroll.get_value()), (int)(vscroll.get_value())); +} void ThumbBrowserBase::getScrollPosition (double& h, double& v) { h = hscroll.get_value (); @@ -522,27 +522,27 @@ void ThumbBrowserBase::setScrollPosition (double h, double v) { vscroll.set_value (v>vscroll.get_adjustment()->get_upper() ? vscroll.get_adjustment()->get_upper() : v); } -/*void PreviewImgUpdater::processCustomOrder () { - - // find first filtered entry, if any - std::list::iterator i; - for (i=jqueue.begin (); i!=jqueue.end(); i++) - if (!(*i)->filtered) - break; - if (i==jqueue.end()) - i = jqueue.begin(); - - ThumbBrowserEntryBase* current = *i; - jqueue.erase (i); - - current->updateImg (); - if (parent) { - gdk_threads_enter (); - parent->queue_draw (); - if (parent->get_window()) - gdk_window_process_updates (parent->get_window()->gobj(), true); - gdk_threads_leave (); - } -} -*/ +/*void PreviewImgUpdater::processCustomOrder () { + + // find first filtered entry, if any + std::list::iterator i; + for (i=jqueue.begin (); i!=jqueue.end(); i++) + if (!(*i)->filtered) + break; + if (i==jqueue.end()) + i = jqueue.begin(); + + ThumbBrowserEntryBase* current = *i; + jqueue.erase (i); + + current->updateImg (); + if (parent) { + gdk_threads_enter (); + parent->queue_draw (); + if (parent->get_window()) + gdk_window_process_updates (parent->get_window()->gobj(), true); + gdk_threads_leave (); + } +} +*/ diff --git a/rtgui/thumbbrowserbase.h b/rtgui/thumbbrowserbase.h index 80ae72299..2dc38e8b7 100644 --- a/rtgui/thumbbrowserbase.h +++ b/rtgui/thumbbrowserbase.h @@ -1,118 +1,118 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _THUMBNAILBROWSERBASE_ -#define _THUMBNAILBROWSERBASE_ - -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _THUMBNAILBROWSERBASE_ +#define _THUMBNAILBROWSERBASE_ + +#include +#include #include -class ThumbBrowserBase : public Gtk::VBox { - - class Internal : public Gtk::DrawingArea { - - Glib::RefPtr gc_; - int ofsX, ofsY; - ThumbBrowserBase* parent; - bool dirty; - public: - Internal (); - void setParent (ThumbBrowserBase* p); - void on_realize(); - bool on_expose_event(GdkEventExpose* event); - bool on_button_press_event (GdkEventButton* event); - bool on_button_release_event (GdkEventButton* event); +class ThumbBrowserBase : public Gtk::VBox { + + class Internal : public Gtk::DrawingArea { + + Glib::RefPtr gc_; + int ofsX, ofsY; + ThumbBrowserBase* parent; + bool dirty; + public: + Internal (); + void setParent (ThumbBrowserBase* p); + void on_realize(); + bool on_expose_event(GdkEventExpose* event); + bool on_button_press_event (GdkEventButton* event); + bool on_button_release_event (GdkEventButton* event); bool on_motion_notify_event (GdkEventMotion* event); bool on_scroll_event (GdkEventScroll* event); bool on_key_press_event (GdkEventKey* event); - bool on_query_tooltip (int x, int y, bool keyboard_tooltip, const Glib::RefPtr& tooltip); - void setPosition (int x, int y); - - void setDirty () { dirty = true; } - bool isDirty () { return dirty; } - }; - - protected: - - Internal internal; - Gtk::HScrollbar hscroll; - Gtk::VScrollbar vscroll; - - int inW, inH; - - void resizeThumbnailArea (int w, int h); - void internalAreaResized (Gtk::Allocation& req); - void buttonPressed (int x, int y, int button, GdkEventType type, int state, int clx, int cly, int clw, int clh); - - public: - - enum Arrangement {TB_Horizontal, TB_Vertical}; - void configScrollBars (); - void scrollChanged (); - void scroll (int direction); - + bool on_query_tooltip (int x, int y, bool keyboard_tooltip, const Glib::RefPtr& tooltip); + void setPosition (int x, int y); + + void setDirty () { dirty = true; } + bool isDirty () { return dirty; } + }; + protected: - int eventTime; + Internal internal; + Gtk::HScrollbar hscroll; + Gtk::VScrollbar vscroll; + + int inW, inH; + + void resizeThumbnailArea (int w, int h); + void internalAreaResized (Gtk::Allocation& req); + void buttonPressed (int x, int y, int button, GdkEventType type, int state, int clx, int cly, int clw, int clh); + + public: - std::vector fd; - std::vector selected; - ThumbBrowserEntryBase* lastClicked; - - int previewHeight; - - Arrangement arrangement; + enum Arrangement {TB_Horizontal, TB_Vertical}; + void configScrollBars (); + void scrollChanged (); + void scroll (int direction); + + protected: + + int eventTime; + + std::vector fd; + std::vector selected; + ThumbBrowserEntryBase* lastClicked; + + int previewHeight; + + Arrangement arrangement; std::set editedFiles; - - void arrangeFiles (); - void zoomChanged (bool zoomIn); - - public: - - ThumbBrowserBase (); - void zoomIn () { zoomChanged (true); } - void zoomOut () { zoomChanged (false); } - - const std::vector& getEntries () { return fd; } - void styleChanged (const Glib::RefPtr& style); - void redraw (); // arrange files and draw area - void refreshThumbImages (); // refresh thumbnail sizes, re-generate thumbnail images, arrange and draw - void refreshEditedState (const std::set& efiles); - - void initEntry (ThumbBrowserEntryBase* entry); + void arrangeFiles (); + void zoomChanged (bool zoomIn); + + public: + + ThumbBrowserBase (); + + void zoomIn () { zoomChanged (true); } + void zoomOut () { zoomChanged (false); } + + const std::vector& getEntries () { return fd; } + void styleChanged (const Glib::RefPtr& style); + void redraw (); // arrange files and draw area + void refreshThumbImages (); // refresh thumbnail sizes, re-generate thumbnail images, arrange and draw + void refreshEditedState (const std::set& efiles); + + void initEntry (ThumbBrowserEntryBase* entry); void getScrollPosition (double& h, double& v); void setScrollPosition (double h, double v); - - void setArrangement (Arrangement a); - virtual bool checkFilter (ThumbBrowserEntryBase* entry) { return true; } - virtual void rightClicked (ThumbBrowserEntryBase* entry) {} + + void setArrangement (Arrangement a); + virtual bool checkFilter (ThumbBrowserEntryBase* entry) { return true; } + virtual void rightClicked (ThumbBrowserEntryBase* entry) {} virtual void doubleClicked (ThumbBrowserEntryBase* entry) {} virtual bool keyPressed (GdkEventKey* event) {return true;} virtual void selectionChanged () {} virtual void redrawNeeded (ThumbBrowserEntryBase* entry) {} - virtual void thumbRearrangementNeeded () {} + virtual void thumbRearrangementNeeded () {} Gtk::Widget* getDrawingArea () { return &internal; } -}; - -#endif +}; + +#endif diff --git a/rtgui/thumbbrowserentry.cc b/rtgui/thumbbrowserentry.cc index 79531775b..988d588f8 100644 --- a/rtgui/thumbbrowserentry.cc +++ b/rtgui/thumbbrowserentry.cc @@ -1,63 +1,63 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include - -FileBrowserEntry::FileBrowserEntry (Thumbnail* thm, const Glib::ustring& fname) - : ThumbBrowserEntryBase (fname), thumbnail(thm) { - - previewOwner = false; - italicstyle = thumbnail->getType() != FT_Raw; - datetimeline = thumbnail->getDateTimeString (); - exifline = thumbnail->getExifString (); -} - -void ThumbBrowserEntry::obtainThumbnailImage () { +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include - preview = thumbnail ? (guint8*) thumbnail->getThumbnailImage (prew, preh) : NULL; -} - -void ThumbBrowserEntry::obtainThumbnailSize () { - - if (thumbnail) - thumbnail->getThumbnailSize (prew, preh); -} -Glib::RefPtr ThumbBrowserEntry::editedIcon; -Glib::RefPtr ThumbBrowserEntry::recentlySavedIcon; -Glib::RefPtr ThumbBrowserEntry::enqueuedIcon; -std::vector > ThumbBrowserEntry::getIconsOnImageArea () { - - std::vector > ret; - - if (!thumbnail) - return ret; - - if (thumbnail->hasProcParams() && editedIcon) - ret.push_back (editedIcon); - if (thumbnail->isRecentlySaved() && recentlySavedIcon) - ret.push_back (recentlySavedIcon); - if (thumbnail->isEnqueued () && enqueuedIcon) - ret.push_back (enqueuedIcon); - - return ret; -} - -ThumbnailButtonSet* ThumbBrowserEntry::getThumbButtonSet () { - - return (ThumbnailButtonSet*)buttonSet; -} +FileBrowserEntry::FileBrowserEntry (Thumbnail* thm, const Glib::ustring& fname) + : ThumbBrowserEntryBase (fname), thumbnail(thm) { + + previewOwner = false; + italicstyle = thumbnail->getType() != FT_Raw; + datetimeline = thumbnail->getDateTimeString (); + exifline = thumbnail->getExifString (); +} + +void ThumbBrowserEntry::obtainThumbnailImage () { + + preview = thumbnail ? (guint8*) thumbnail->getThumbnailImage (prew, preh) : NULL; +} + +void ThumbBrowserEntry::obtainThumbnailSize () { + + if (thumbnail) + thumbnail->getThumbnailSize (prew, preh); +} +Glib::RefPtr ThumbBrowserEntry::editedIcon; +Glib::RefPtr ThumbBrowserEntry::recentlySavedIcon; +Glib::RefPtr ThumbBrowserEntry::enqueuedIcon; +std::vector > ThumbBrowserEntry::getIconsOnImageArea () { + + std::vector > ret; + + if (!thumbnail) + return ret; + + if (thumbnail->hasProcParams() && editedIcon) + ret.push_back (editedIcon); + if (thumbnail->isRecentlySaved() && recentlySavedIcon) + ret.push_back (recentlySavedIcon); + if (thumbnail->isEnqueued () && enqueuedIcon) + ret.push_back (enqueuedIcon); + + return ret; +} + +ThumbnailButtonSet* ThumbBrowserEntry::getThumbButtonSet () { + + return (ThumbnailButtonSet*)buttonSet; +} diff --git a/rtgui/thumbbrowserentrybase.cc b/rtgui/thumbbrowserentrybase.cc index 3ee3feae9..909008da9 100644 --- a/rtgui/thumbbrowserentrybase.cc +++ b/rtgui/thumbbrowserentrybase.cc @@ -157,7 +157,7 @@ void ThumbBrowserEntryBase::updateBackBuffer () { if (textposx_dt<0) textposx_dt = 0; textposy = upperMargin + bsHeight + 2*borderWidth + preh + borderWidth + textGap; textw = exp_width - 2*textGap; - gc_->set_foreground (selected ? texts : textn); + gc_->set_foreground (selected ? texts : textn); } else { textposx_fn = istartx; @@ -165,45 +165,45 @@ void ThumbBrowserEntryBase::updateBackBuffer () { textposx_dt = istartx; textposy = istarty; textw = prew - (istartx - prex); - gc_->set_foreground (texts); + gc_->set_foreground (texts); } // draw file name - Glib::RefPtr context = w->get_pango_context () ; - Pango::FontDescription fontd = context->get_font_description (); - fontd.set_weight (Pango::WEIGHT_BOLD); - if (italicstyle) - fontd.set_style (Pango::STYLE_ITALIC); - else - fontd.set_style (Pango::STYLE_NORMAL); + Glib::RefPtr context = w->get_pango_context () ; + Pango::FontDescription fontd = context->get_font_description (); + fontd.set_weight (Pango::WEIGHT_BOLD); + if (italicstyle) + fontd.set_style (Pango::STYLE_ITALIC); + else + fontd.set_style (Pango::STYLE_NORMAL); - context->set_font_description (fontd); - Glib::RefPtr fn = w->create_pango_layout (dispname); - fn->set_width (textw*Pango::SCALE); - fn->set_ellipsize (Pango::ELLIPSIZE_MIDDLE); - backBuffer->draw_layout(gc_, textposx_fn, textposy, fn); + context->set_font_description (fontd); + Glib::RefPtr fn = w->create_pango_layout (dispname); + fn->set_width (textw*Pango::SCALE); + fn->set_ellipsize (Pango::ELLIPSIZE_MIDDLE); + backBuffer->draw_layout(gc_, textposx_fn, textposy, fn); - fontd.set_weight (Pango::WEIGHT_NORMAL); - fontd.set_style (Pango::STYLE_NORMAL); - context->set_font_description (fontd); - - // draw date/time label - int tpos = fnlabh; - if (options.fbShowDateTime && datetimeline!="") { - fn = w->create_pango_layout (datetimeline); - fn->set_width (textw*Pango::SCALE); - fn->set_ellipsize (Pango::ELLIPSIZE_MIDDLE); - backBuffer->draw_layout(gc_, textposx_dt, textposy + tpos, fn); - tpos += dtlabh; - } - // draw basic exif info - if (options.fbShowBasicExif && exifline!="") { - fn = w->create_pango_layout (exifline); - fn->set_width (textw*Pango::SCALE); - fn->set_ellipsize (Pango::ELLIPSIZE_MIDDLE); - backBuffer->draw_layout (gc_, textposx_ex, textposy + tpos, fn); - tpos += exlabh; - } + fontd.set_weight (Pango::WEIGHT_NORMAL); + fontd.set_style (Pango::STYLE_NORMAL); + context->set_font_description (fontd); + + // draw date/time label + int tpos = fnlabh; + if (options.fbShowDateTime && datetimeline!="") { + fn = w->create_pango_layout (datetimeline); + fn->set_width (textw*Pango::SCALE); + fn->set_ellipsize (Pango::ELLIPSIZE_MIDDLE); + backBuffer->draw_layout(gc_, textposx_dt, textposy + tpos, fn); + tpos += dtlabh; + } + // draw basic exif info + if (options.fbShowBasicExif && exifline!="") { + fn = w->create_pango_layout (exifline); + fn->set_width (textw*Pango::SCALE); + fn->set_ellipsize (Pango::ELLIPSIZE_MIDDLE); + backBuffer->draw_layout (gc_, textposx_ex, textposy + tpos, fn); + tpos += exlabh; + } } } @@ -275,7 +275,7 @@ void ThumbBrowserEntryBase::resize (int h) { calcThumbnailSize (); width = prew + 2*sideMargin + 2*borderWidth; - if (options.showFileNames && !options.overlayedFileNames) { + if (options.showFileNames && !options.overlayedFileNames) { width = prew + 2*sideMargin + 2*borderWidth; if (width - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _THUMBNAILBROWSERENTRYBASE_ -#define _THUMBNAILBROWSERENTRYBASE_ - -#include -#include +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _THUMBNAILBROWSERENTRYBASE_ +#define _THUMBNAILBROWSERENTRYBASE_ + +#include +#include class ThumbBrowserBase; -class ThumbBrowserEntryBase { - -protected: - int fnlabw, fnlabh; // dimensions of the filename label - int dtlabw, dtlabh; // dimensions of the date/time label - int exlabw, exlabh; // dimensions of the exif label - int prew; // width of the thumbnail - int preh; // height of the thumbnail - int prex; - int prey; - - int upperMargin; - int borderWidth; - int textGap; - int sideMargin; - int lowerMargin; - - guint8* preview; +class ThumbBrowserEntryBase { + +protected: + int fnlabw, fnlabh; // dimensions of the filename label + int dtlabw, dtlabh; // dimensions of the date/time label + int exlabw, exlabh; // dimensions of the exif label + int prew; // width of the thumbnail + int preh; // height of the thumbnail + int prex; + int prey; + + int upperMargin; + int borderWidth; + int textGap; + int sideMargin; + int lowerMargin; + + guint8* preview; + + Glib::ustring dispname; + + LWButtonSet* buttonSet; + + int width; // minimal width + int height; // minimal height +// set by arrangeFiles() of thumbbrowser + int exp_width; // arranged width + int exp_height; // arranged height + int startx; // x coord. in the widget + int starty; // y coord. in the widget - Glib::ustring dispname; - - LWButtonSet* buttonSet; - - int width; // minimal width - int height; // minimal height -// set by arrangeFiles() of thumbbrowser - int exp_width; // arranged width - int exp_height; // arranged height - int startx; // x coord. in the widget - int starty; // y coord. in the widget - int ofsX, ofsY; // offset due to the scrolling of the parent - int redrawRequests; - + int redrawRequests; + ThumbBrowserBase* parent; Glib::RefPtr backBuffer; bool bbSelected, bbFramed; - guint8* bbPreview; + guint8* bbPreview; std::vector > bbIcons; void drawFrame (Cairo::RefPtr cr, const Gdk::Color& bg, const Gdk::Color& fg); - void getTextSizes (int& w, int& h); - - virtual void customBackBufferUpdate (Cairo::RefPtr c) {} - - public: - -// thumbnail preview properties: - Glib::ustring filename; - Glib::ustring shortname; - Glib::ustring exifline; - Glib::ustring datetimeline; - -// misc attributes - bool selected; - bool drawable; - bool filtered; - bool framed; - bool processing; - bool italicstyle; - bool edited; + void getTextSizes (int& w, int& h); + + virtual void customBackBufferUpdate (Cairo::RefPtr c) {} + + public: + +// thumbnail preview properties: + Glib::ustring filename; + Glib::ustring shortname; + Glib::ustring exifline; + Glib::ustring datetimeline; + +// misc attributes + bool selected; + bool drawable; + bool filtered; + bool framed; + bool processing; + bool italicstyle; + bool edited; bool recentlysaved; - bool updatepriority; - - ThumbBrowserEntryBase (const Glib::ustring& fname); - virtual ~ThumbBrowserEntryBase (); - - void setParent (ThumbBrowserBase* l) { parent = l; } + bool updatepriority; + + ThumbBrowserEntryBase (const Glib::ustring& fname); + virtual ~ThumbBrowserEntryBase (); + + void setParent (ThumbBrowserBase* l) { parent = l; } void updateBackBuffer (); - void resize (int h); - virtual void draw (); + void resize (int h); + virtual void draw (); - void addButtonSet (LWButtonSet* bs); - int getMinimalHeight () { return height; } - int getMinimalWidth () { return width; } - bool inside (int x, int y); - bool insideWindow (int x, int y, int w, int h); - void setPosition (int x, int y, int w, int h); - void setOffset (int x, int y); - - bool operator< (ThumbBrowserEntryBase& other) { return shortname.casefold()>other.shortname.casefold(); } - - virtual void refreshThumbnailImage () {} - virtual void calcThumbnailSize () {} + void addButtonSet (LWButtonSet* bs); + int getMinimalHeight () { return height; } + int getMinimalWidth () { return width; } + bool inside (int x, int y); + bool insideWindow (int x, int y, int w, int h); + void setPosition (int x, int y, int w, int h); + void setOffset (int x, int y); + + bool operator< (ThumbBrowserEntryBase& other) { return shortname.casefold()>other.shortname.casefold(); } + + virtual void refreshThumbnailImage () {} + virtual void calcThumbnailSize () {} virtual void drawProgressBar (Glib::RefPtr win, Glib::RefPtr gc, const Gdk::Color& foregr, const Gdk::Color& backgr, int x, int w, int y, int h) {} - virtual std::vector > getIconsOnImageArea () { std::vector > r; return r; } - virtual void getIconSize (int& w, int& h) { w=0; h=0; } - - virtual bool motionNotify (int x, int y); - virtual bool pressNotify (int button, int type, int bstate, int x, int y); - virtual bool releaseNotify (int button, int type, int bstate, int x, int y); - Glib::ustring getToolTip (int x, int y); -}; - -#endif + virtual std::vector > getIconsOnImageArea () { std::vector > r; return r; } + virtual void getIconSize (int& w, int& h) { w=0; h=0; } + + virtual bool motionNotify (int x, int y); + virtual bool pressNotify (int button, int type, int bstate, int x, int y); + virtual bool releaseNotify (int button, int type, int bstate, int x, int y); + Glib::ustring getToolTip (int x, int y); +}; + +#endif diff --git a/rtgui/thumbimageupdater.cc b/rtgui/thumbimageupdater.cc index 2dfaf066c..b4c81d98a 100644 --- a/rtgui/thumbimageupdater.cc +++ b/rtgui/thumbimageupdater.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include diff --git a/rtgui/thumbimageupdater.h b/rtgui/thumbimageupdater.h index 91c0d6956..e93074451 100644 --- a/rtgui/thumbimageupdater.h +++ b/rtgui/thumbimageupdater.h @@ -1,66 +1,66 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _THUMBIMAGEUPDATER_ -#define _THUMBIMAGEUPDATER_ - -#include -#include -#include - -class ThumbImageUpdateListener { - - public: - virtual void updateImage (rtengine::IImage8* img, double scale, rtengine::procparams::CropParams cropParams) {} -}; - -class ThumbImageUpdater { - - struct Job { - Thumbnail* thumbnail; - rtengine::procparams::ProcParams pparams; - int height; - bool* priority; - ThumbImageUpdateListener* listener; - }; - - protected: - bool tostop; - bool stopped; - std::list jqueue; - Glib::Thread* thread; - Glib::Mutex* qMutex; - Glib::Mutex* startMutex; - - public: - ThumbImageUpdater (); - - void add (Thumbnail* t, const rtengine::procparams::ProcParams& params, int height, bool* priority, ThumbImageUpdateListener* l); - void process (); - void stop (); - void removeJobs (); - void removeJobs (ThumbImageUpdateListener* listener); - void terminate (); - - void process_ (); - void processJob (Job current); -}; - -extern ThumbImageUpdater thumbImageUpdater; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _THUMBIMAGEUPDATER_ +#define _THUMBIMAGEUPDATER_ + +#include +#include +#include + +class ThumbImageUpdateListener { + + public: + virtual void updateImage (rtengine::IImage8* img, double scale, rtengine::procparams::CropParams cropParams) {} +}; + +class ThumbImageUpdater { + + struct Job { + Thumbnail* thumbnail; + rtengine::procparams::ProcParams pparams; + int height; + bool* priority; + ThumbImageUpdateListener* listener; + }; + + protected: + bool tostop; + bool stopped; + std::list jqueue; + Glib::Thread* thread; + Glib::Mutex* qMutex; + Glib::Mutex* startMutex; + + public: + ThumbImageUpdater (); + + void add (Thumbnail* t, const rtengine::procparams::ProcParams& params, int height, bool* priority, ThumbImageUpdateListener* l); + void process (); + void stop (); + void removeJobs (); + void removeJobs (ThumbImageUpdateListener* listener); + void terminate (); + + void process_ (); + void processJob (Job current); +}; + +extern ThumbImageUpdater thumbImageUpdater; + +#endif diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index f39cae764..8c22a2c50 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include diff --git a/rtgui/thumbnail.h b/rtgui/thumbnail.h index 389e8e872..fc57d3b6a 100644 --- a/rtgui/thumbnail.h +++ b/rtgui/thumbnail.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _THUMBNAIL_ #define _THUMBNAIL_ diff --git a/rtgui/thumbnailbrowser.h b/rtgui/thumbnailbrowser.h index 9f0731cf4..00863169c 100644 --- a/rtgui/thumbnailbrowser.h +++ b/rtgui/thumbnailbrowser.h @@ -1,95 +1,95 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _THUMBNAILBROWSER_ -#define _THUMBNAILBROWSER_ - -#include -#include -#include - -class ThumbBrowserEntry { - -public: -// set by arrangeFiles(): - int width; // minimal width - int height; // minimal height - int exp_width; // ararnged width - int startx; // x coord. in the widget - int starty; // y coord. in the widget -// thumbnail preview properties: - int prew; // width of the thumbnail - int preh; // height of the thumbnail - guint8* preview; -// file and directory attributes: - Glib::ustring filename; - Glib::ustring shortname; - Glib::ustring dirname; -// the associated thumbnail instance: - Thumbnail* thumbnail; - - ThumbBrowserEntry (Thumbnail* thm, Glib::ustring fname, Glib::ustring sname, Glib::ustring dname, int h) - : thumbnail(thm), filename(fname), shortname(sname), dirname(dname), preh(h) { - preview = thumbnail ? (guint8*) thumbnail->getThumbnailImage (prew, preh) : NULL; - } - - bool operator< (FileDescr& other) { - return shortname>other.shortname; - } -}; - -class ThumbBrowser : public Gtk::DrawingArea { - - protected: - int dx, dy, w, h; - - Glib::RefPtr gc_; - Gdk::Color black; - Gdk::Color white; - Gdk::Color blue; - Gdk::Color bluew; - - std::vector fd; - std::vector selected; - - int rowHeight; - int numOfRows; - - ThumbBrowserListener* tbl; - - void arrangeFiles (int rows); - - public: - - ThumbBrowser (); - - void addEntry (ThumbBrowserEntry* entry); - void setThumbBrowserListener (ThumbBrowserListener* l) { tbl = l; } - - virtual void on_realize(); - virtual bool on_expose_event(GdkEventExpose* event); - virtual bool on_button_press_event (GdkEventButton* event); - virtual bool on_button_release_event (GdkEventButton* event); - virtual void previewReady (FileDescr* fdn); - - void resized (Gtk::Allocation& req); - void redraw (); - void styleChanged (const Glib::RefPtr& style); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _THUMBNAILBROWSER_ +#define _THUMBNAILBROWSER_ + +#include +#include +#include + +class ThumbBrowserEntry { + +public: +// set by arrangeFiles(): + int width; // minimal width + int height; // minimal height + int exp_width; // ararnged width + int startx; // x coord. in the widget + int starty; // y coord. in the widget +// thumbnail preview properties: + int prew; // width of the thumbnail + int preh; // height of the thumbnail + guint8* preview; +// file and directory attributes: + Glib::ustring filename; + Glib::ustring shortname; + Glib::ustring dirname; +// the associated thumbnail instance: + Thumbnail* thumbnail; + + ThumbBrowserEntry (Thumbnail* thm, Glib::ustring fname, Glib::ustring sname, Glib::ustring dname, int h) + : thumbnail(thm), filename(fname), shortname(sname), dirname(dname), preh(h) { + preview = thumbnail ? (guint8*) thumbnail->getThumbnailImage (prew, preh) : NULL; + } + + bool operator< (FileDescr& other) { + return shortname>other.shortname; + } +}; + +class ThumbBrowser : public Gtk::DrawingArea { + + protected: + int dx, dy, w, h; + + Glib::RefPtr gc_; + Gdk::Color black; + Gdk::Color white; + Gdk::Color blue; + Gdk::Color bluew; + + std::vector fd; + std::vector selected; + + int rowHeight; + int numOfRows; + + ThumbBrowserListener* tbl; + + void arrangeFiles (int rows); + + public: + + ThumbBrowser (); + + void addEntry (ThumbBrowserEntry* entry); + void setThumbBrowserListener (ThumbBrowserListener* l) { tbl = l; } + + virtual void on_realize(); + virtual bool on_expose_event(GdkEventExpose* event); + virtual bool on_button_press_event (GdkEventButton* event); + virtual bool on_button_release_event (GdkEventButton* event); + virtual void previewReady (FileDescr* fdn); + + void resized (Gtk::Allocation& req); + void redraw (); + void styleChanged (const Glib::RefPtr& style); +}; + +#endif diff --git a/rtgui/thumbnaillistener.h b/rtgui/thumbnaillistener.h index 49a4eace9..313f97b16 100644 --- a/rtgui/thumbnaillistener.h +++ b/rtgui/thumbnaillistener.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _THUMBNAILLISTENER_ #define _THUMBNAILLISTENER_ diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index 4f3f80110..d151bdc8d 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -1,364 +1,364 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include -#include -#include -#include - -using namespace rtengine; -using namespace rtengine::procparams; - -ToneCurve::ToneCurve () : ToolPanel(), expAdd(false), blackAdd(false), brAdd(false), contrAdd(false) { - -//----------- Auto Levels ---------------------------------- - abox = Gtk::manage (new Gtk::HBox ()); - abox->set_border_width (2); - - autolevels = Gtk::manage (new Gtk::ToggleButton (M("TP_EXPOSURE_AUTOLEVELS"))); - autoconn = autolevels->signal_toggled().connect( sigc::mem_fun(*this, &ToneCurve::autolevels_toggled) ); - - sclip = Gtk::manage (new Gtk::SpinButton ()); - sclip->set_range (0.0, 0.9999); - sclip->set_increments (0.0001, 0.01); - sclip->set_value (0.002); - sclip->set_digits (4); - sclip->signal_value_changed().connect( sigc::mem_fun(*this, &ToneCurve::clip_changed) ); - - abox->pack_start (*autolevels); - abox->pack_end (*sclip); - abox->pack_end (*Gtk::manage (new Gtk::Label (M("TP_EXPOSURE_CLIP")))); - pack_start (*abox); - - pack_start (*Gtk::manage (new Gtk::HSeparator())); - -//----------- Exposure Compensation ------------------------ - expcomp = Gtk::manage (new Adjuster (M("TP_EXPOSURE_EXPCOMP"), -5, 5, 0.01, 0)); - pack_start (*expcomp); - hlcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 150, 1, 0)); - pack_start (*hlcompr); - -//----------- Black Level ---------------------------------- - black = Gtk::manage (new Adjuster (M("TP_EXPOSURE_BLACKLEVEL"), 0, 32768, 1, 0)); - pack_start (*black); - shcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRSHADOWS"), 0, 150, 1, 0)); - pack_start (*shcompr); - - pack_start (*Gtk::manage (new Gtk::HSeparator())); - -//---------Brightness / Contrast ------------------------- - brightness = Gtk::manage (new Adjuster (M("TP_EXPOSURE_BRIGHTNESS"), -100, 100, 1, 0)); - pack_start (*brightness); - contrast = Gtk::manage (new Adjuster (M("TP_EXPOSURE_CONTRAST"), -100, 100, 1, 0)); - pack_start (*contrast); - - -//----------- Curve ------------------------------ - pack_start (*Gtk::manage (new Gtk::HSeparator())); - - shape = Gtk::manage (new CurveEditor ()); - shape->setCurveListener (this); - curvexp = Gtk::manage (new Gtk::Expander (M("TP_EXPOSURE_CURVEEDITOR"))); - curvexp->add (*shape); - - pack_start (*curvexp, Gtk::PACK_SHRINK, 4); - -// --------- Set Up Listeners ------------- - expcomp->setAdjusterListener (this); - brightness->setAdjusterListener (this); - black->setAdjusterListener (this); - hlcompr->setAdjusterListener (this); - shcompr->setAdjusterListener (this); - contrast->setAdjusterListener (this); -} - -void ToneCurve::read (const ProcParams* pp, const ParamsEdited* pedited) { - - disableListener (); - - if (pedited) { - expcomp->setEditedState (pedited->toneCurve.expcomp ? Edited : UnEdited); - black->setEditedState (pedited->toneCurve.black ? Edited : UnEdited); - hlcompr->setEditedState (pedited->toneCurve.hlcompr ? Edited : UnEdited); - shcompr->setEditedState (pedited->toneCurve.shcompr ? Edited : UnEdited); - brightness->setEditedState (pedited->toneCurve.brightness ? Edited : UnEdited); - contrast->setEditedState (pedited->toneCurve.contrast ? Edited : UnEdited); - autolevels->set_inconsistent (!pedited->toneCurve.autoexp); - clipDirty = pedited->toneCurve.clip; - shape->setUnChanged (!pedited->toneCurve.curve); - } - - autoconn.block (true); - autolevels->set_active (pp->toneCurve.autoexp); - autoconn.block (false); - lastAuto = pp->toneCurve.autoexp; - sclip->set_value (pp->toneCurve.clip); - - expcomp->setValue (pp->toneCurve.expcomp); - black->setValue (pp->toneCurve.black); - hlcompr->setValue (pp->toneCurve.hlcompr); - shcompr->setValue (pp->toneCurve.shcompr); - brightness->setValue (pp->toneCurve.brightness); - contrast->setValue (pp->toneCurve.contrast); - shape->setCurve (pp->toneCurve.curve); - - enableListener (); -} - -void ToneCurve::write (ProcParams* pp, ParamsEdited* pedited) { - - pp->toneCurve.autoexp = autolevels->get_active(); - pp->toneCurve.clip = sclip->get_value (); - pp->toneCurve.expcomp = expcomp->getValue (); - pp->toneCurve.black = (int)black->getValue (); - pp->toneCurve.hlcompr = (int)hlcompr->getValue (); - pp->toneCurve.shcompr = (int)shcompr->getValue (); - pp->toneCurve.brightness = (int)brightness->getValue (); - pp->toneCurve.contrast = (int)contrast->getValue (); - pp->toneCurve.curve = shape->getCurve (); - - if (pedited) { - pedited->toneCurve.expcomp = expcomp->getEditedState (); - pedited->toneCurve.black = black->getEditedState (); - pedited->toneCurve.hlcompr = hlcompr->getEditedState (); - pedited->toneCurve.shcompr = shcompr->getEditedState (); - pedited->toneCurve.brightness = brightness->getEditedState (); - pedited->toneCurve.contrast = contrast->getEditedState (); - pedited->toneCurve.autoexp = !autolevels->get_inconsistent(); - pedited->toneCurve.clip = clipDirty; - pedited->toneCurve.curve = !shape->isUnChanged (); - } -} - -void ToneCurve::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { - - expcomp->setDefault (defParams->toneCurve.expcomp); - brightness->setDefault (defParams->toneCurve.brightness); - black->setDefault (defParams->toneCurve.black); - hlcompr->setDefault (defParams->toneCurve.hlcompr); - shcompr->setDefault (defParams->toneCurve.shcompr); - contrast->setDefault (defParams->toneCurve.contrast); - - if (pedited) { - expcomp->setDefaultEditedState (pedited->toneCurve.expcomp ? Edited : UnEdited); - black->setDefaultEditedState (pedited->toneCurve.black ? Edited : UnEdited); - hlcompr->setDefaultEditedState (pedited->toneCurve.hlcompr ? Edited : UnEdited); - shcompr->setDefaultEditedState (pedited->toneCurve.shcompr ? Edited : UnEdited); - brightness->setDefaultEditedState (pedited->toneCurve.brightness ? Edited : UnEdited); - contrast->setDefaultEditedState (pedited->toneCurve.contrast ? Edited : UnEdited); - } - else { - expcomp->setDefaultEditedState (Irrelevant); - black->setDefaultEditedState (Irrelevant); - hlcompr->setDefaultEditedState (Irrelevant); - shcompr->setDefaultEditedState (Irrelevant); - brightness->setDefaultEditedState (Irrelevant); - contrast->setDefaultEditedState (Irrelevant); - } -} - -void ToneCurve::curveChanged () { - - if (listener) { - listener->panelChanged (EvToneCurve, M("HISTORY_CUSTOMCURVE")); - } -} - -void ToneCurve::adjusterChanged (Adjuster* a, double newval) { - - if (autolevels->get_active() && (a==expcomp || a==black || a==hlcompr || a==shcompr)) { - autolevels->set_active (false); - autolevels->set_inconsistent (false); - } - - if (!listener) - return; - - Glib::ustring costr; - if (a==expcomp) - costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), a->getValue()); - else - costr = Glib::ustring::format ((int)a->getValue()); - - if (a==expcomp) - listener->panelChanged (EvExpComp, costr); - else if (a==brightness) - listener->panelChanged (EvBrightness, costr); - else if (a==black) - listener->panelChanged (EvBlack, costr); - else if (a==contrast) - listener->panelChanged (EvContrast, costr); - else if (a==hlcompr) - listener->panelChanged (EvHLCompr, costr); - else if (a==shcompr) - listener->panelChanged (EvSHCompr, costr); -} - -void ToneCurve::autolevels_toggled () { - - if (batchMode) { - if (autolevels->get_inconsistent()) { - autolevels->set_inconsistent (false); - autoconn.block (true); - autolevels->set_active (false); - autoconn.block (false); - } - else if (lastAuto) - autolevels->set_inconsistent (true); - - lastAuto = autolevels->get_active (); - } - - if (!batchMode && autolevels->get_active() && listener) { - listener->panelChanged (EvAutoExp, M("GENERAL_ENABLED")); - waitForAutoExp (); - } - - if (batchMode) { - expcomp->setEditedState (UnEdited); - black->setEditedState (UnEdited); - if (expAdd) - expcomp->setValue (0); - if (blackAdd) - black->setValue (0); - listener->panelChanged (EvAutoExp, M("GENERAL_ENABLED")); - } -} - -void ToneCurve::clip_changed () { - - clipDirty = true; - if (autolevels->get_active() && listener) - Glib::signal_idle().connect (sigc::mem_fun(*this, &ToneCurve::clip_changed_)); -} - -bool ToneCurve::clip_changed_ () { - - if (listener) { - listener->panelChanged (EvClip, Glib::ustring::format (std::setprecision(5), sclip->get_value())); - if (!batchMode) - waitForAutoExp (); - } - return false; -} - -void ToneCurve::waitForAutoExp () { - - sclip->set_sensitive (false); - expcomp->setEnabled (false); - brightness->setEnabled (false); - black->setEnabled (false); - hlcompr->setEnabled (false); - shcompr->setEnabled (false); - contrast->setEnabled (false); - shape->set_sensitive (false); -} - -int aexpcomputed (void* data) { - - gdk_threads_enter(); - ((ToneCurve*)data)->autoExpComputed_ (); - gdk_threads_leave(); - return 0; -} - -void ToneCurve::autoExpChanged (double br, int bl) { - - nextBl = bl; - nextBr = br; - g_idle_add (aexpcomputed, this); - -// Glib::signal_idle().connect (sigc::mem_fun(*this, &ToneCurve::autoExpComputed_)); -} - -void ToneCurve::enableAll () { - - sclip->set_sensitive (true); - expcomp->setEnabled (true); - brightness->setEnabled (true); - black->setEnabled (true); - hlcompr->setEnabled (true); - shcompr->setEnabled (true); - contrast->setEnabled (true); - shape->set_sensitive (true); -} - -bool ToneCurve::autoExpComputed_ () { - - disableListener (); - enableAll (); - expcomp->setValue (nextBr); - black->setValue (nextBl); - enableListener (); - - return false; -} - -void ToneCurve::expandCurve (bool isExpanded) { - - curvexp->set_expanded (isExpanded); -} - -bool ToneCurve::isCurveExpanded () { - - return curvexp->get_expanded (); -} - - -void ToneCurve::setBatchMode (bool batchMode) { - - removeIfThere (abox, autolevels, false); - autolevels = Gtk::manage (new Gtk::CheckButton (M("TP_EXPOSURE_AUTOLEVELS"))); - autoconn = autolevels->signal_toggled().connect( sigc::mem_fun(*this, &ToneCurve::autolevels_toggled) ); - abox->pack_start (*autolevels); - - ToolPanel::setBatchMode (batchMode); - expcomp->showEditedCB (); - black->showEditedCB (); - hlcompr->showEditedCB (); - shcompr->showEditedCB (); - brightness->showEditedCB (); - contrast->showEditedCB (); - - shape->setBatchMode (batchMode); -} - -void ToneCurve::setAdjusterBehavior (bool expadd, bool bradd, bool blackadd, bool contradd) { - - if (!expAdd && expadd || expAdd && !expadd) - expcomp->setLimits (-5, 5, 0.01, 0); - if (!blackAdd && blackadd) - black->setLimits (0, 16384, 1, 0); - else if (blackAdd && !blackadd) - black->setLimits (0, 32768, 1, 0); - if (!brAdd && bradd || brAdd && !bradd) - brightness->setLimits (-100, 100, 1, 0); - if (!contrAdd && contradd || contrAdd && !contradd) - contrast->setLimits (-100, 100, 1, 0); - - expAdd = expadd; - blackAdd = blackadd; - brAdd = bradd; - contrAdd = contradd; -} - -void ToneCurve::updateCurveBackgroundHistogram (unsigned* hist) { - - shape->updateBackgroundHistogram (hist); -} +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include +#include +#include +#include + +using namespace rtengine; +using namespace rtengine::procparams; + +ToneCurve::ToneCurve () : ToolPanel(), expAdd(false), blackAdd(false), brAdd(false), contrAdd(false) { + +//----------- Auto Levels ---------------------------------- + abox = Gtk::manage (new Gtk::HBox ()); + abox->set_border_width (2); + + autolevels = Gtk::manage (new Gtk::ToggleButton (M("TP_EXPOSURE_AUTOLEVELS"))); + autoconn = autolevels->signal_toggled().connect( sigc::mem_fun(*this, &ToneCurve::autolevels_toggled) ); + + sclip = Gtk::manage (new Gtk::SpinButton ()); + sclip->set_range (0.0, 0.9999); + sclip->set_increments (0.0001, 0.01); + sclip->set_value (0.002); + sclip->set_digits (4); + sclip->signal_value_changed().connect( sigc::mem_fun(*this, &ToneCurve::clip_changed) ); + + abox->pack_start (*autolevels); + abox->pack_end (*sclip); + abox->pack_end (*Gtk::manage (new Gtk::Label (M("TP_EXPOSURE_CLIP")))); + pack_start (*abox); + + pack_start (*Gtk::manage (new Gtk::HSeparator())); + +//----------- Exposure Compensation ------------------------ + expcomp = Gtk::manage (new Adjuster (M("TP_EXPOSURE_EXPCOMP"), -5, 5, 0.01, 0)); + pack_start (*expcomp); + hlcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 150, 1, 0)); + pack_start (*hlcompr); + +//----------- Black Level ---------------------------------- + black = Gtk::manage (new Adjuster (M("TP_EXPOSURE_BLACKLEVEL"), 0, 32768, 1, 0)); + pack_start (*black); + shcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRSHADOWS"), 0, 150, 1, 0)); + pack_start (*shcompr); + + pack_start (*Gtk::manage (new Gtk::HSeparator())); + +//---------Brightness / Contrast ------------------------- + brightness = Gtk::manage (new Adjuster (M("TP_EXPOSURE_BRIGHTNESS"), -100, 100, 1, 0)); + pack_start (*brightness); + contrast = Gtk::manage (new Adjuster (M("TP_EXPOSURE_CONTRAST"), -100, 100, 1, 0)); + pack_start (*contrast); + + +//----------- Curve ------------------------------ + pack_start (*Gtk::manage (new Gtk::HSeparator())); + + shape = Gtk::manage (new CurveEditor ()); + shape->setCurveListener (this); + curvexp = Gtk::manage (new Gtk::Expander (M("TP_EXPOSURE_CURVEEDITOR"))); + curvexp->add (*shape); + + pack_start (*curvexp, Gtk::PACK_SHRINK, 4); + +// --------- Set Up Listeners ------------- + expcomp->setAdjusterListener (this); + brightness->setAdjusterListener (this); + black->setAdjusterListener (this); + hlcompr->setAdjusterListener (this); + shcompr->setAdjusterListener (this); + contrast->setAdjusterListener (this); +} + +void ToneCurve::read (const ProcParams* pp, const ParamsEdited* pedited) { + + disableListener (); + + if (pedited) { + expcomp->setEditedState (pedited->toneCurve.expcomp ? Edited : UnEdited); + black->setEditedState (pedited->toneCurve.black ? Edited : UnEdited); + hlcompr->setEditedState (pedited->toneCurve.hlcompr ? Edited : UnEdited); + shcompr->setEditedState (pedited->toneCurve.shcompr ? Edited : UnEdited); + brightness->setEditedState (pedited->toneCurve.brightness ? Edited : UnEdited); + contrast->setEditedState (pedited->toneCurve.contrast ? Edited : UnEdited); + autolevels->set_inconsistent (!pedited->toneCurve.autoexp); + clipDirty = pedited->toneCurve.clip; + shape->setUnChanged (!pedited->toneCurve.curve); + } + + autoconn.block (true); + autolevels->set_active (pp->toneCurve.autoexp); + autoconn.block (false); + lastAuto = pp->toneCurve.autoexp; + sclip->set_value (pp->toneCurve.clip); + + expcomp->setValue (pp->toneCurve.expcomp); + black->setValue (pp->toneCurve.black); + hlcompr->setValue (pp->toneCurve.hlcompr); + shcompr->setValue (pp->toneCurve.shcompr); + brightness->setValue (pp->toneCurve.brightness); + contrast->setValue (pp->toneCurve.contrast); + shape->setCurve (pp->toneCurve.curve); + + enableListener (); +} + +void ToneCurve::write (ProcParams* pp, ParamsEdited* pedited) { + + pp->toneCurve.autoexp = autolevels->get_active(); + pp->toneCurve.clip = sclip->get_value (); + pp->toneCurve.expcomp = expcomp->getValue (); + pp->toneCurve.black = (int)black->getValue (); + pp->toneCurve.hlcompr = (int)hlcompr->getValue (); + pp->toneCurve.shcompr = (int)shcompr->getValue (); + pp->toneCurve.brightness = (int)brightness->getValue (); + pp->toneCurve.contrast = (int)contrast->getValue (); + pp->toneCurve.curve = shape->getCurve (); + + if (pedited) { + pedited->toneCurve.expcomp = expcomp->getEditedState (); + pedited->toneCurve.black = black->getEditedState (); + pedited->toneCurve.hlcompr = hlcompr->getEditedState (); + pedited->toneCurve.shcompr = shcompr->getEditedState (); + pedited->toneCurve.brightness = brightness->getEditedState (); + pedited->toneCurve.contrast = contrast->getEditedState (); + pedited->toneCurve.autoexp = !autolevels->get_inconsistent(); + pedited->toneCurve.clip = clipDirty; + pedited->toneCurve.curve = !shape->isUnChanged (); + } +} + +void ToneCurve::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { + + expcomp->setDefault (defParams->toneCurve.expcomp); + brightness->setDefault (defParams->toneCurve.brightness); + black->setDefault (defParams->toneCurve.black); + hlcompr->setDefault (defParams->toneCurve.hlcompr); + shcompr->setDefault (defParams->toneCurve.shcompr); + contrast->setDefault (defParams->toneCurve.contrast); + + if (pedited) { + expcomp->setDefaultEditedState (pedited->toneCurve.expcomp ? Edited : UnEdited); + black->setDefaultEditedState (pedited->toneCurve.black ? Edited : UnEdited); + hlcompr->setDefaultEditedState (pedited->toneCurve.hlcompr ? Edited : UnEdited); + shcompr->setDefaultEditedState (pedited->toneCurve.shcompr ? Edited : UnEdited); + brightness->setDefaultEditedState (pedited->toneCurve.brightness ? Edited : UnEdited); + contrast->setDefaultEditedState (pedited->toneCurve.contrast ? Edited : UnEdited); + } + else { + expcomp->setDefaultEditedState (Irrelevant); + black->setDefaultEditedState (Irrelevant); + hlcompr->setDefaultEditedState (Irrelevant); + shcompr->setDefaultEditedState (Irrelevant); + brightness->setDefaultEditedState (Irrelevant); + contrast->setDefaultEditedState (Irrelevant); + } +} + +void ToneCurve::curveChanged () { + + if (listener) { + listener->panelChanged (EvToneCurve, M("HISTORY_CUSTOMCURVE")); + } +} + +void ToneCurve::adjusterChanged (Adjuster* a, double newval) { + + if (autolevels->get_active() && (a==expcomp || a==black || a==hlcompr || a==shcompr)) { + autolevels->set_active (false); + autolevels->set_inconsistent (false); + } + + if (!listener) + return; + + Glib::ustring costr; + if (a==expcomp) + costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), a->getValue()); + else + costr = Glib::ustring::format ((int)a->getValue()); + + if (a==expcomp) + listener->panelChanged (EvExpComp, costr); + else if (a==brightness) + listener->panelChanged (EvBrightness, costr); + else if (a==black) + listener->panelChanged (EvBlack, costr); + else if (a==contrast) + listener->panelChanged (EvContrast, costr); + else if (a==hlcompr) + listener->panelChanged (EvHLCompr, costr); + else if (a==shcompr) + listener->panelChanged (EvSHCompr, costr); +} + +void ToneCurve::autolevels_toggled () { + + if (batchMode) { + if (autolevels->get_inconsistent()) { + autolevels->set_inconsistent (false); + autoconn.block (true); + autolevels->set_active (false); + autoconn.block (false); + } + else if (lastAuto) + autolevels->set_inconsistent (true); + + lastAuto = autolevels->get_active (); + } + + if (!batchMode && autolevels->get_active() && listener) { + listener->panelChanged (EvAutoExp, M("GENERAL_ENABLED")); + waitForAutoExp (); + } + + if (batchMode) { + expcomp->setEditedState (UnEdited); + black->setEditedState (UnEdited); + if (expAdd) + expcomp->setValue (0); + if (blackAdd) + black->setValue (0); + listener->panelChanged (EvAutoExp, M("GENERAL_ENABLED")); + } +} + +void ToneCurve::clip_changed () { + + clipDirty = true; + if (autolevels->get_active() && listener) + Glib::signal_idle().connect (sigc::mem_fun(*this, &ToneCurve::clip_changed_)); +} + +bool ToneCurve::clip_changed_ () { + + if (listener) { + listener->panelChanged (EvClip, Glib::ustring::format (std::setprecision(5), sclip->get_value())); + if (!batchMode) + waitForAutoExp (); + } + return false; +} + +void ToneCurve::waitForAutoExp () { + + sclip->set_sensitive (false); + expcomp->setEnabled (false); + brightness->setEnabled (false); + black->setEnabled (false); + hlcompr->setEnabled (false); + shcompr->setEnabled (false); + contrast->setEnabled (false); + shape->set_sensitive (false); +} + +int aexpcomputed (void* data) { + + gdk_threads_enter(); + ((ToneCurve*)data)->autoExpComputed_ (); + gdk_threads_leave(); + return 0; +} + +void ToneCurve::autoExpChanged (double br, int bl) { + + nextBl = bl; + nextBr = br; + g_idle_add (aexpcomputed, this); + +// Glib::signal_idle().connect (sigc::mem_fun(*this, &ToneCurve::autoExpComputed_)); +} + +void ToneCurve::enableAll () { + + sclip->set_sensitive (true); + expcomp->setEnabled (true); + brightness->setEnabled (true); + black->setEnabled (true); + hlcompr->setEnabled (true); + shcompr->setEnabled (true); + contrast->setEnabled (true); + shape->set_sensitive (true); +} + +bool ToneCurve::autoExpComputed_ () { + + disableListener (); + enableAll (); + expcomp->setValue (nextBr); + black->setValue (nextBl); + enableListener (); + + return false; +} + +void ToneCurve::expandCurve (bool isExpanded) { + + curvexp->set_expanded (isExpanded); +} + +bool ToneCurve::isCurveExpanded () { + + return curvexp->get_expanded (); +} + + +void ToneCurve::setBatchMode (bool batchMode) { + + removeIfThere (abox, autolevels, false); + autolevels = Gtk::manage (new Gtk::CheckButton (M("TP_EXPOSURE_AUTOLEVELS"))); + autoconn = autolevels->signal_toggled().connect( sigc::mem_fun(*this, &ToneCurve::autolevels_toggled) ); + abox->pack_start (*autolevels); + + ToolPanel::setBatchMode (batchMode); + expcomp->showEditedCB (); + black->showEditedCB (); + hlcompr->showEditedCB (); + shcompr->showEditedCB (); + brightness->showEditedCB (); + contrast->showEditedCB (); + + shape->setBatchMode (batchMode); +} + +void ToneCurve::setAdjusterBehavior (bool expadd, bool bradd, bool blackadd, bool contradd) { + + if (!expAdd && expadd || expAdd && !expadd) + expcomp->setLimits (-5, 5, 0.01, 0); + if (!blackAdd && blackadd) + black->setLimits (0, 16384, 1, 0); + else if (blackAdd && !blackadd) + black->setLimits (0, 32768, 1, 0); + if (!brAdd && bradd || brAdd && !bradd) + brightness->setLimits (-100, 100, 1, 0); + if (!contrAdd && contradd || contrAdd && !contradd) + contrast->setLimits (-100, 100, 1, 0); + + expAdd = expadd; + blackAdd = blackadd; + brAdd = bradd; + contrAdd = contradd; +} + +void ToneCurve::updateCurveBackgroundHistogram (unsigned* hist) { + + shape->updateBackgroundHistogram (hist); +} diff --git a/rtgui/tonecurve.h b/rtgui/tonecurve.h index 4f4ad5256..900e6f34e 100644 --- a/rtgui/tonecurve.h +++ b/rtgui/tonecurve.h @@ -1,71 +1,71 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _TONECURVE_H_ -#define _TONECURVE_H_ - -#include -#include -#include -#include -#include - -class ToneCurve : public Gtk::VBox, public AdjusterListener, public ToolPanel, public rtengine::AutoExpListener, public CurveListener { - - protected: - Gtk::HBox* abox; - Gtk::ToggleButton* autolevels; - Gtk::SpinButton* sclip; - Adjuster* expcomp; - Adjuster* brightness; - Adjuster* black; - Adjuster* hlcompr; - Adjuster* shcompr; - Adjuster* contrast; - bool expAdd, blackAdd, brAdd, contrAdd, clipDirty, lastAuto; - sigc::connection autoconn; - CurveEditor* shape; - Gtk::Expander* curvexp; - double nextBr; - int nextBl; - - public: - - ToneCurve (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); - void setBatchMode (bool batchMode); - void setAdjusterBehavior (bool expadd, bool bradd, bool blackadd, bool contradd); - - void adjusterChanged (Adjuster* a, double newval); - void autolevels_toggled (); - void clip_changed (); - bool clip_changed_ (); - void waitForAutoExp (); - void autoExpChanged (double br, int bl); - bool autoExpComputed_ (); - void enableAll (); - void curveChanged (); - void expandCurve (bool isExpanded); - bool isCurveExpanded (); - void updateCurveBackgroundHistogram (unsigned* hist); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _TONECURVE_H_ +#define _TONECURVE_H_ + +#include +#include +#include +#include +#include + +class ToneCurve : public Gtk::VBox, public AdjusterListener, public ToolPanel, public rtengine::AutoExpListener, public CurveListener { + + protected: + Gtk::HBox* abox; + Gtk::ToggleButton* autolevels; + Gtk::SpinButton* sclip; + Adjuster* expcomp; + Adjuster* brightness; + Adjuster* black; + Adjuster* hlcompr; + Adjuster* shcompr; + Adjuster* contrast; + bool expAdd, blackAdd, brAdd, contrAdd, clipDirty, lastAuto; + sigc::connection autoconn; + CurveEditor* shape; + Gtk::Expander* curvexp; + double nextBr; + int nextBl; + + public: + + ToneCurve (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); + void setBatchMode (bool batchMode); + void setAdjusterBehavior (bool expadd, bool bradd, bool blackadd, bool contradd); + + void adjusterChanged (Adjuster* a, double newval); + void autolevels_toggled (); + void clip_changed (); + bool clip_changed_ (); + void waitForAutoExp (); + void autoExpChanged (double br, int bl); + bool autoExpComputed_ (); + void enableAll (); + void curveChanged (); + void expandCurve (bool isExpanded); + bool isCurveExpanded (); + void updateCurveBackgroundHistogram (unsigned* hist); +}; + +#endif diff --git a/rtgui/toolbar.cc b/rtgui/toolbar.cc index 2c8ccc2c8..0c7487ac4 100644 --- a/rtgui/toolbar.cc +++ b/rtgui/toolbar.cc @@ -1,195 +1,195 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include "toolbar.h" -#include - -extern Glib::ustring argv0; - -ToolBar::ToolBar () : listener (NULL) { - - handTool = Gtk::manage (new Gtk::ToggleButton ()); - Gtk::Image* handimg = Gtk::manage (new Gtk::Image (argv0+"/images/openhand22.png")); - handTool->add (*handimg); - handimg->show (); - handTool->set_relief(Gtk::RELIEF_NONE); - handTool->show (); - - pack_start (*handTool); - - wbTool = Gtk::manage (new Gtk::ToggleButton ()); - Gtk::Image* wbimg = Gtk::manage (new Gtk::Image (argv0+"/images/wbpicker22.png")); - wbTool->add (*wbimg); - wbimg->show (); - wbTool->set_relief(Gtk::RELIEF_NONE); - wbTool->show (); - - pack_start (*wbTool); - - cropTool = Gtk::manage (new Gtk::ToggleButton ()); - Gtk::Image* cropimg = Gtk::manage (new Gtk::Image (argv0+"/images/crop22.png")); - cropTool->add (*cropimg); - cropimg->show (); - cropTool->set_relief(Gtk::RELIEF_NONE); - cropTool->show (); - - pack_start (*cropTool); - - straTool = Gtk::manage (new Gtk::ToggleButton ()); - Gtk::Image* straimg = Gtk::manage (new Gtk::Image (argv0+"/images/straighten22.png")); - straTool->add (*straimg); - straimg->show (); - straTool->set_relief(Gtk::RELIEF_NONE); - straTool->show (); - - pack_start (*straTool); - - - handTool->set_active (true); - current = TMHand; - - handConn = handTool->signal_toggled().connect( sigc::mem_fun(*this, &ToolBar::hand_pressed)); - wbConn = wbTool->signal_toggled().connect( sigc::mem_fun(*this, &ToolBar::wb_pressed)); - cropConn = cropTool->signal_toggled().connect( sigc::mem_fun(*this, &ToolBar::crop_pressed)); - straConn = straTool->signal_toggled().connect( sigc::mem_fun(*this, &ToolBar::stra_pressed)); +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include "toolbar.h" +#include + +extern Glib::ustring argv0; + +ToolBar::ToolBar () : listener (NULL) { + + handTool = Gtk::manage (new Gtk::ToggleButton ()); + Gtk::Image* handimg = Gtk::manage (new Gtk::Image (argv0+"/images/openhand22.png")); + handTool->add (*handimg); + handimg->show (); + handTool->set_relief(Gtk::RELIEF_NONE); + handTool->show (); + + pack_start (*handTool); + + wbTool = Gtk::manage (new Gtk::ToggleButton ()); + Gtk::Image* wbimg = Gtk::manage (new Gtk::Image (argv0+"/images/wbpicker22.png")); + wbTool->add (*wbimg); + wbimg->show (); + wbTool->set_relief(Gtk::RELIEF_NONE); + wbTool->show (); + + pack_start (*wbTool); + + cropTool = Gtk::manage (new Gtk::ToggleButton ()); + Gtk::Image* cropimg = Gtk::manage (new Gtk::Image (argv0+"/images/crop22.png")); + cropTool->add (*cropimg); + cropimg->show (); + cropTool->set_relief(Gtk::RELIEF_NONE); + cropTool->show (); + + pack_start (*cropTool); + + straTool = Gtk::manage (new Gtk::ToggleButton ()); + Gtk::Image* straimg = Gtk::manage (new Gtk::Image (argv0+"/images/straighten22.png")); + straTool->add (*straimg); + straimg->show (); + straTool->set_relief(Gtk::RELIEF_NONE); + straTool->show (); + + pack_start (*straTool); + + + handTool->set_active (true); + current = TMHand; + + handConn = handTool->signal_toggled().connect( sigc::mem_fun(*this, &ToolBar::hand_pressed)); + wbConn = wbTool->signal_toggled().connect( sigc::mem_fun(*this, &ToolBar::wb_pressed)); + cropConn = cropTool->signal_toggled().connect( sigc::mem_fun(*this, &ToolBar::crop_pressed)); + straConn = straTool->signal_toggled().connect( sigc::mem_fun(*this, &ToolBar::stra_pressed)); handTool->set_tooltip_text (M("TOOLBAR_TOOLTIP_HAND")); wbTool->set_tooltip_text (M("TOOLBAR_TOOLTIP_WB")); cropTool->set_tooltip_text (M("TOOLBAR_TOOLTIP_CROP")); straTool->set_tooltip_text (M("TOOLBAR_TOOLTIP_STRAIGHTEN")); -} - -// -// Selects the desired tool without notifying the listener -// -void ToolBar::setTool (ToolMode tool) { - - handConn.block (true); - cropConn.block (true); - wbConn.block (true); - straConn.block (true); - - handTool->set_active (false); - wbTool->set_active (false); - cropTool->set_active (false); - straTool->set_active (false); - - if (tool==TMHand) - handTool->set_active (true); - else if (tool==TMSpotWB) - wbTool->set_active (true); - else if (tool==TMCropSelect) - cropTool->set_active (true); - else if (tool==TMStraighten) - straTool->set_active (true); - - current = tool; - - handConn.block (false); - cropConn.block (false); - wbConn.block (false); - straConn.block (false); -} - -void ToolBar::hand_pressed () { - - handConn.block (true); - cropConn.block (true); - wbConn.block (true); - straConn.block (true); - if (current!=TMHand) { - wbTool->set_active (false); - cropTool->set_active (false); - straTool->set_active (false); - current = TMHand; - } - handTool->set_active (true); - handConn.block (false); - cropConn.block (false); - wbConn.block (false); - straConn.block (false); - - if (listener) - listener->toolSelected (TMHand); -} - -void ToolBar::wb_pressed () { - - handConn.block (true); - cropConn.block (true); - wbConn.block (true); - straConn.block (true); - if (current!=TMSpotWB) { - handTool->set_active (false); - cropTool->set_active (false); - straTool->set_active (false); - current = TMSpotWB; - } - wbTool->set_active (true); - handConn.block (false); - cropConn.block (false); - wbConn.block (false); - straConn.block (false); - - if (listener) - listener->toolSelected (TMSpotWB); -} - -void ToolBar::crop_pressed () { - - handConn.block (true); - cropConn.block (true); - wbConn.block (true); - straConn.block (true); - if (current!=TMCropSelect) { - handTool->set_active (false); - wbTool->set_active (false); - straTool->set_active (false); - current = TMCropSelect; - } - cropTool->set_active (true); - handConn.block (false); - cropConn.block (false); - wbConn.block (false); - straConn.block (false); - - if (listener) - listener->toolSelected (TMCropSelect); -} - -void ToolBar::stra_pressed () { - - handConn.block (true); - cropConn.block (true); - wbConn.block (true); - straConn.block (true); - if (current!=TMStraighten) { - handTool->set_active (false); - wbTool->set_active (false); - cropTool->set_active (false); - current = TMStraighten; - } - straTool->set_active (true); - handConn.block (false); - cropConn.block (false); - wbConn.block (false); - straConn.block (false); - - if (listener) - listener->toolSelected (TMStraighten); -} +} + +// +// Selects the desired tool without notifying the listener +// +void ToolBar::setTool (ToolMode tool) { + + handConn.block (true); + cropConn.block (true); + wbConn.block (true); + straConn.block (true); + + handTool->set_active (false); + wbTool->set_active (false); + cropTool->set_active (false); + straTool->set_active (false); + + if (tool==TMHand) + handTool->set_active (true); + else if (tool==TMSpotWB) + wbTool->set_active (true); + else if (tool==TMCropSelect) + cropTool->set_active (true); + else if (tool==TMStraighten) + straTool->set_active (true); + + current = tool; + + handConn.block (false); + cropConn.block (false); + wbConn.block (false); + straConn.block (false); +} + +void ToolBar::hand_pressed () { + + handConn.block (true); + cropConn.block (true); + wbConn.block (true); + straConn.block (true); + if (current!=TMHand) { + wbTool->set_active (false); + cropTool->set_active (false); + straTool->set_active (false); + current = TMHand; + } + handTool->set_active (true); + handConn.block (false); + cropConn.block (false); + wbConn.block (false); + straConn.block (false); + + if (listener) + listener->toolSelected (TMHand); +} + +void ToolBar::wb_pressed () { + + handConn.block (true); + cropConn.block (true); + wbConn.block (true); + straConn.block (true); + if (current!=TMSpotWB) { + handTool->set_active (false); + cropTool->set_active (false); + straTool->set_active (false); + current = TMSpotWB; + } + wbTool->set_active (true); + handConn.block (false); + cropConn.block (false); + wbConn.block (false); + straConn.block (false); + + if (listener) + listener->toolSelected (TMSpotWB); +} + +void ToolBar::crop_pressed () { + + handConn.block (true); + cropConn.block (true); + wbConn.block (true); + straConn.block (true); + if (current!=TMCropSelect) { + handTool->set_active (false); + wbTool->set_active (false); + straTool->set_active (false); + current = TMCropSelect; + } + cropTool->set_active (true); + handConn.block (false); + cropConn.block (false); + wbConn.block (false); + straConn.block (false); + + if (listener) + listener->toolSelected (TMCropSelect); +} + +void ToolBar::stra_pressed () { + + handConn.block (true); + cropConn.block (true); + wbConn.block (true); + straConn.block (true); + if (current!=TMStraighten) { + handTool->set_active (false); + wbTool->set_active (false); + cropTool->set_active (false); + current = TMStraighten; + } + straTool->set_active (true); + handConn.block (false); + cropConn.block (false); + wbConn.block (false); + straConn.block (false); + + if (listener) + listener->toolSelected (TMStraighten); +} diff --git a/rtgui/toolbar.h b/rtgui/toolbar.h index a98287222..6d5ac1bab 100644 --- a/rtgui/toolbar.h +++ b/rtgui/toolbar.h @@ -1,60 +1,60 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef __TOOLBAR_H__ -#define __TOOLBAR_H__ - -#include -#include - -class ToolBarListener { - - public: - virtual void toolSelected (ToolMode tool) {} - -}; - -class ToolBar : public Gtk::HBox { - - protected: - Gtk::ToggleButton* handTool; - Gtk::ToggleButton* wbTool; - Gtk::ToggleButton* cropTool; - Gtk::ToggleButton* straTool; - ToolBarListener* listener; - ToolMode current; - sigc::connection handConn; - sigc::connection wbConn; - sigc::connection cropConn; - sigc::connection straConn; - - public: - ToolBar (); - - void setTool (ToolMode tool); - ToolMode getTool () { return current; } - - void setToolBarListener (ToolBarListener* tpl) { listener = tpl; } - - void hand_pressed (); - void wb_pressed (); - void crop_pressed (); - void stra_pressed (); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef __TOOLBAR_H__ +#define __TOOLBAR_H__ + +#include +#include + +class ToolBarListener { + + public: + virtual void toolSelected (ToolMode tool) {} + +}; + +class ToolBar : public Gtk::HBox { + + protected: + Gtk::ToggleButton* handTool; + Gtk::ToggleButton* wbTool; + Gtk::ToggleButton* cropTool; + Gtk::ToggleButton* straTool; + ToolBarListener* listener; + ToolMode current; + sigc::connection handConn; + sigc::connection wbConn; + sigc::connection cropConn; + sigc::connection straConn; + + public: + ToolBar (); + + void setTool (ToolMode tool); + ToolMode getTool () { return current; } + + void setToolBarListener (ToolBarListener* tpl) { listener = tpl; } + + void hand_pressed (); + void wb_pressed (); + void crop_pressed (); + void stra_pressed (); +}; + +#endif diff --git a/rtgui/toolenum.h b/rtgui/toolenum.h index 082084851..b07d63ec3 100644 --- a/rtgui/toolenum.h +++ b/rtgui/toolenum.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _TOOLENUM_ #define _TOOLENUM_ diff --git a/rtgui/toolpanel.h b/rtgui/toolpanel.h index f4fadb8b2..83bb005aa 100644 --- a/rtgui/toolpanel.h +++ b/rtgui/toolpanel.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef __TOOLPANEL__ #define __TOOLPANEL__ diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 642a2df6c..8d6ec4d61 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include @@ -268,83 +268,83 @@ void ToolPanelCoordinator::writeOptions () { options.crvOpen.push_back (curve->isCurveExpanded()); } - -void ToolPanelCoordinator::cropSelectionReady () { - - toolBar->setTool (TMHand); - - if (!ipc) - return; -} - -void ToolPanelCoordinator::rotateSelectionReady (double rotate_deg, Thumbnail* thm) { - - toolBar->setTool (TMHand); - - if (!ipc) - return; - - if (rotate_deg!=0.0) + +void ToolPanelCoordinator::cropSelectionReady () { + + toolBar->setTool (TMHand); + + if (!ipc) + return; +} + +void ToolPanelCoordinator::rotateSelectionReady (double rotate_deg, Thumbnail* thm) { + + toolBar->setTool (TMHand); + + if (!ipc) + return; + + if (rotate_deg!=0.0) rotate->straighten (rotate_deg); -} - -void ToolPanelCoordinator::spotWBselected (int x, int y, Thumbnail* thm) { - - if (!ipc) - return; - -// toolBar->setTool (TOOL_HAND); - if (x>0 && y>0) { - double temp; - double green; +} + +void ToolPanelCoordinator::spotWBselected (int x, int y, Thumbnail* thm) { + + if (!ipc) + return; + +// toolBar->setTool (TOOL_HAND); + if (x>0 && y>0) { + double temp; + double green; ipc->getSpotWB (x, y, whitebalance->getSize (), temp, green); whitebalance->setWB (temp, green); - } -} - -void ToolPanelCoordinator::autoCropRequested () { - - if (!ipc) - return; - - int x1, y1, x2, y2, w, h; - ipc->getAutoCrop (crop->getRatio(), x1, y1, w, h); - x2 = x1 + w - 1; - y2 = y1 + h - 1; - crop->cropInit (x1, y1, w, h); - crop->cropResized (x1, y1, x2, y2); - crop->cropManipReady (); -} - -void ToolPanelCoordinator::straightenRequested () { - - if (!ipc) - return; - - toolBar->setTool (TMStraighten); -} + } +} + +void ToolPanelCoordinator::autoCropRequested () { + + if (!ipc) + return; + + int x1, y1, x2, y2, w, h; + ipc->getAutoCrop (crop->getRatio(), x1, y1, w, h); + x2 = x1 + w - 1; + y2 = y1 + h - 1; + crop->cropInit (x1, y1, w, h); + crop->cropResized (x1, y1, x2, y2); + crop->cropManipReady (); +} + +void ToolPanelCoordinator::straightenRequested () { + + if (!ipc) + return; + + toolBar->setTool (TMStraighten); +} + +void ToolPanelCoordinator::spotWBRequested (int size) { + + if (!ipc) + return; -void ToolPanelCoordinator::spotWBRequested (int size) { - - if (!ipc) - return; - toolBar->setTool (TMSpotWB); -} - -void ToolPanelCoordinator::cropSelectRequested () { - - if (!ipc) - return; - - toolBar->setTool (TMCropSelect); -} +} -void ToolPanelCoordinator::saveInputICCReference (Glib::ustring fname) { - - if (ipc) - ipc->saveInputICCReference (fname); -} +void ToolPanelCoordinator::cropSelectRequested () { + + if (!ipc) + return; + + toolBar->setTool (TMCropSelect); +} + +void ToolPanelCoordinator::saveInputICCReference (Glib::ustring fname) { + + if (ipc) + ipc->saveInputICCReference (fname); +} int ToolPanelCoordinator::getSpotWBRectSize () { diff --git a/rtgui/toolpanelcoord.h b/rtgui/toolpanelcoord.h index eb19edd59..9501c65d3 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef __TOOLPANELCCORD__ #define __TOOLPANELCCORD__ @@ -47,16 +47,16 @@ #include #include #include -#include +#include class ImageEditorCoordinator; class ToolPanelCoordinator : public ToolPanelListener, public ProfileChangeListener, public WBProvider, - public RotateListener, - public SpotWBListener, - public CropPanelListener, + public RotateListener, + public SpotWBListener, + public CropPanelListener, public ICMPanelListener, public ImageAreaToolListener { @@ -137,24 +137,24 @@ class ToolPanelCoordinator : public ToolPanelListener, void getAutoWB (double& temp, double& green) { if (ipc) ipc->getAutoWB (temp, green); } void getCamWB (double& temp, double& green) { if (ipc) ipc->getCamWB (temp, green); } - // rotatelistener interface - void straightenRequested (); - void autoCropRequested (); - - // spotwblistener interface - void spotWBRequested (int size); - - // croppanellistener interface - void cropSelectRequested (); - - // icmpanellistener interface - void saveInputICCReference (Glib::ustring fname); - + // rotatelistener interface + void straightenRequested (); + void autoCropRequested (); + + // spotwblistener interface + void spotWBRequested (int size); + + // croppanellistener interface + void cropSelectRequested (); + + // icmpanellistener interface + void saveInputICCReference (Glib::ustring fname); + // imageareatoollistener interface - void spotWBselected (int x, int y, Thumbnail* thm=NULL); - void cropSelectionReady (); + void spotWBselected (int x, int y, Thumbnail* thm=NULL); + void cropSelectionReady (); void rotateSelectionReady (double rotate_deg, Thumbnail* thm=NULL); - ToolBar* getToolBar () { return toolBar; } + ToolBar* getToolBar () { return toolBar; } int getSpotWBRectSize (); CropGUIListener* startCropEditing (Thumbnail* thm=NULL) { return crop; } }; diff --git a/rtgui/utils.cc b/rtgui/utils.cc index 06d67aa2f..cad454981 100644 --- a/rtgui/utils.cc +++ b/rtgui/utils.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include diff --git a/rtgui/utils.h b/rtgui/utils.h index dfcc299f0..682cdd03f 100644 --- a/rtgui/utils.h +++ b/rtgui/utils.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef __UTILS_ #define __UTILS_ diff --git a/rtgui/vignetting.cc b/rtgui/vignetting.cc index 1d35bc9e5..6bec226be 100644 --- a/rtgui/vignetting.cc +++ b/rtgui/vignetting.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include diff --git a/rtgui/vignetting.h b/rtgui/vignetting.h index ff65e9584..a4fc0dcd3 100644 --- a/rtgui/vignetting.h +++ b/rtgui/vignetting.h @@ -1,46 +1,46 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _VIGNETTING_H_ -#define _VIGNETTING_H_ - -#include -#include -#include - -class Vignetting : public Gtk::VBox, public AdjusterListener, public ToolPanel { - - protected: - Adjuster* amount; - Adjuster* radius; - bool vigAdd; - - public: - - Vignetting (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); - void setBatchMode (bool batchMode); - - void adjusterChanged (Adjuster* a, double newval); - void setAdjusterBehavior (bool bvadd); -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _VIGNETTING_H_ +#define _VIGNETTING_H_ + +#include +#include +#include + +class Vignetting : public Gtk::VBox, public AdjusterListener, public ToolPanel { + + protected: + Adjuster* amount; + Adjuster* radius; + bool vigAdd; + + public: + + Vignetting (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); + void setBatchMode (bool batchMode); + + void adjusterChanged (Adjuster* a, double newval); + void setAdjusterBehavior (bool bvadd); +}; + +#endif diff --git a/rtgui/wbprovider.h b/rtgui/wbprovider.h index f5f70ba9d..928c8f3cb 100644 --- a/rtgui/wbprovider.h +++ b/rtgui/wbprovider.h @@ -1,31 +1,31 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _WBPROVIDER_ -#define _WBPROVIDER_ - - -class WBProvider { - - public: - virtual void getAutoWB (double& temp, double& green) {} - virtual void getCamWB (double& temp, double& green) {} - virtual void spotWBRequested (int size) {} -}; - -#endif +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _WBPROVIDER_ +#define _WBPROVIDER_ + + +class WBProvider { + + public: + virtual void getAutoWB (double& temp, double& green) {} + virtual void getCamWB (double& temp, double& green) {} + virtual void spotWBRequested (int size) {} +}; + +#endif diff --git a/rtgui/whitebalance.cc b/rtgui/whitebalance.cc index 833c5a433..f2da55259 100644 --- a/rtgui/whitebalance.cc +++ b/rtgui/whitebalance.cc @@ -1,247 +1,247 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include - -#define MINTEMP 1200 -#define MAXTEMP 12000 -#define MINGREEN 0.02 -#define MAXGREEN 5.0 - -extern Glib::ustring argv0; - -using namespace rtengine; -using namespace rtengine::procparams; - -WhiteBalance::WhiteBalance () : ToolPanel(), wbp(NULL), wblistener(NULL), tempAdd(false), greenAdd (false) { - - Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox ()); - hbox->show (); - Gtk::Label* lab = Gtk::manage (new Gtk::Label (M("TP_WBALANCE_METHOD"))); - lab->show (); - method = Gtk::manage (new Gtk::ComboBoxText ()); - method->show (); - method->append_text (M("TP_WBALANCE_CAMERA")); - method->append_text (M("TP_WBALANCE_AUTO")); - method->append_text (M("TP_WBALANCE_CUSTOM")); - method->set_active (0); - hbox->pack_start (*lab, Gtk::PACK_SHRINK, 4); - hbox->pack_start (*method); - pack_start (*hbox, Gtk::PACK_SHRINK, 4); - opt = 0; - - Gtk::HBox* spotbox = Gtk::manage (new Gtk::HBox ()); - spotbox->show (); - - spotbutton = Gtk::manage (new Gtk::Button (M("TP_WBALANCE_SPOTWB"))); - Gtk::Image* spotimg = Gtk::manage (new Gtk::Image (argv0+"/images/wbpicker16.png")); - spotimg->show (); - spotbutton->set_image (*spotimg); - spotbutton->show (); - - spotbox->pack_start (*spotbutton); - - Gtk::Label* slab = Gtk::manage (new Gtk::Label (M("TP_WBALANCE_SIZE"))); - slab->show (); - - spotsize = Gtk::manage (new Gtk::ComboBoxText ()); - spotsize->show (); - spotsize->append_text ("2"); - spotsize->append_text ("4"); - spotsize->append_text ("8"); - spotsize->append_text ("16"); - spotsize->append_text ("32"); - spotsize->set_active (2); - - spotbox->pack_end (*spotsize, Gtk::PACK_SHRINK, 4); - spotbox->pack_end (*slab, Gtk::PACK_SHRINK, 4); - - pack_start (*spotbox, Gtk::PACK_SHRINK, 4); - - temp = Gtk::manage (new Adjuster (M("TP_WBALANCE_TEMPERATURE"), MINTEMP, MAXTEMP, 1, 4750)); - green = Gtk::manage (new Adjuster (M("TP_WBALANCE_GREEN"), MINGREEN, MAXGREEN, 0.001, 1.2)); - temp->show (); - green->show (); - - pack_start (*temp); - pack_start (*green); - - temp->setAdjusterListener (this); - green->setAdjusterListener (this); - - spotbutton->signal_pressed().connect( sigc::mem_fun(*this, &WhiteBalance::spotPressed) ); - methconn = method->signal_changed().connect( sigc::mem_fun(*this, &WhiteBalance::optChanged) ); - spotsize->signal_changed().connect( sigc::mem_fun(*this, &WhiteBalance::spotSizeChanged) ); -} - -void WhiteBalance::adjusterChanged (Adjuster* a, double newval) { - - if (method->get_active_row_number()!=2) { - disableListener (); - method->set_active (2); - enableListener (); - } - - if (listener) { - if (a==temp) - listener->panelChanged (EvWBTemp, Glib::ustring::format ((int)a->getValue())); - else if (a==green) - listener->panelChanged (EvWBGreen, Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(3), a->getValue())); - } -} - -void WhiteBalance::optChanged () { - - if (opt!=method->get_active_row_number()) { - opt = method->get_active_row_number(); - Glib::ustring meth = M("TP_WBALANCE_CUSTOM"); - if (opt==0 && wbp) { - double ctemp; double cgreen; - wbp->getCamWB (ctemp, cgreen); - temp->setValue (tempAdd ? 0.0 : (int)ctemp); - green->setValue (greenAdd ? 0.0 : cgreen); - meth = M("TP_WBALANCE_CAMERA"); - if (batchMode) { - temp->setEditedState (UnEdited); - green->setEditedState (UnEdited); - } - } - else if (opt==1 && wbp) { - double ctemp; double cgreen; - wbp->getAutoWB (ctemp, cgreen); - temp->setValue (tempAdd ? 0.0 : (int)ctemp); - green->setValue (greenAdd ? 0.0 : cgreen); - meth = M("TP_WBALANCE_AUTO"); - if (batchMode) { - temp->setEditedState (UnEdited); - green->setEditedState (UnEdited); - } - } - else if (opt==3) { - meth = M("GENERAL_UNCHANGED"); - temp->setEditedState (UnEdited); - green->setEditedState (UnEdited); - } - if (listener) - listener->panelChanged (EvWBMethod, meth); - } -} - -void WhiteBalance::spotPressed () { - - if (wblistener) - wblistener->spotWBRequested (getSize()); -} - -void WhiteBalance::spotSizeChanged () { - - if (wblistener) - wblistener->spotWBRequested (getSize()); -} - -void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited) { - - disableListener (); - methconn.block (true); - - if (pedited) { - temp->setEditedState (UnEdited); - green->setEditedState (UnEdited); - } - - if (pedited && !pedited->wb.method) { - method->set_active (3); - opt = 3; - } - else { - if (pp->wb.method == "Camera") { - method->set_active (0); - if (wbp) { - double ctemp; double cgreen; - wbp->getCamWB (ctemp, cgreen); - temp->setValue (tempAdd ? 0.0 : (int)ctemp); - green->setValue (greenAdd ? 0.0 : cgreen); - } - opt = 0; - } - else if (pp->wb.method == "Auto") { - method->set_active (1); - if (wbp) { - double ctemp; double cgreen; - wbp->getAutoWB (ctemp, cgreen); - temp->setValue (tempAdd ? 0.0 : (int)ctemp); - green->setValue (greenAdd ? 0.0 : cgreen); - } - opt = 1; - } - else if (pp->wb.method == "Custom") { - method->set_active (2); - temp->setValue (pp->wb.temperature); - green->setValue (pp->wb.green); - opt = 2; - if (pedited) { - temp->setEditedState (pedited->wb.temperature ? Edited : UnEdited); - green->setEditedState (pedited->wb.green ? Edited : UnEdited); - } - } +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include + +#define MINTEMP 1200 +#define MAXTEMP 12000 +#define MINGREEN 0.02 +#define MAXGREEN 5.0 + +extern Glib::ustring argv0; + +using namespace rtengine; +using namespace rtengine::procparams; + +WhiteBalance::WhiteBalance () : ToolPanel(), wbp(NULL), wblistener(NULL), tempAdd(false), greenAdd (false) { + + Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox ()); + hbox->show (); + Gtk::Label* lab = Gtk::manage (new Gtk::Label (M("TP_WBALANCE_METHOD"))); + lab->show (); + method = Gtk::manage (new Gtk::ComboBoxText ()); + method->show (); + method->append_text (M("TP_WBALANCE_CAMERA")); + method->append_text (M("TP_WBALANCE_AUTO")); + method->append_text (M("TP_WBALANCE_CUSTOM")); + method->set_active (0); + hbox->pack_start (*lab, Gtk::PACK_SHRINK, 4); + hbox->pack_start (*method); + pack_start (*hbox, Gtk::PACK_SHRINK, 4); + opt = 0; + + Gtk::HBox* spotbox = Gtk::manage (new Gtk::HBox ()); + spotbox->show (); + + spotbutton = Gtk::manage (new Gtk::Button (M("TP_WBALANCE_SPOTWB"))); + Gtk::Image* spotimg = Gtk::manage (new Gtk::Image (argv0+"/images/wbpicker16.png")); + spotimg->show (); + spotbutton->set_image (*spotimg); + spotbutton->show (); + + spotbox->pack_start (*spotbutton); + + Gtk::Label* slab = Gtk::manage (new Gtk::Label (M("TP_WBALANCE_SIZE"))); + slab->show (); + + spotsize = Gtk::manage (new Gtk::ComboBoxText ()); + spotsize->show (); + spotsize->append_text ("2"); + spotsize->append_text ("4"); + spotsize->append_text ("8"); + spotsize->append_text ("16"); + spotsize->append_text ("32"); + spotsize->set_active (2); + + spotbox->pack_end (*spotsize, Gtk::PACK_SHRINK, 4); + spotbox->pack_end (*slab, Gtk::PACK_SHRINK, 4); + + pack_start (*spotbox, Gtk::PACK_SHRINK, 4); + + temp = Gtk::manage (new Adjuster (M("TP_WBALANCE_TEMPERATURE"), MINTEMP, MAXTEMP, 1, 4750)); + green = Gtk::manage (new Adjuster (M("TP_WBALANCE_GREEN"), MINGREEN, MAXGREEN, 0.001, 1.2)); + temp->show (); + green->show (); + + pack_start (*temp); + pack_start (*green); + + temp->setAdjusterListener (this); + green->setAdjusterListener (this); + + spotbutton->signal_pressed().connect( sigc::mem_fun(*this, &WhiteBalance::spotPressed) ); + methconn = method->signal_changed().connect( sigc::mem_fun(*this, &WhiteBalance::optChanged) ); + spotsize->signal_changed().connect( sigc::mem_fun(*this, &WhiteBalance::spotSizeChanged) ); +} + +void WhiteBalance::adjusterChanged (Adjuster* a, double newval) { + + if (method->get_active_row_number()!=2) { + disableListener (); + method->set_active (2); + enableListener (); } - methconn.block (false); - enableListener (); -} - -void WhiteBalance::write (ProcParams* pp, ParamsEdited* pedited) { - - if (pedited) { - pedited->wb.temperature = temp->getEditedState (); - pedited->wb.green = green->getEditedState (); - pedited->wb.method = method->get_active_row_number()!=3; - } - - if (method->get_active_row_number()==0) - pp->wb.method = "Camera"; - else if (method->get_active_row_number()==1) - pp->wb.method = "Auto"; - else if (method->get_active_row_number()>=2) - pp->wb.method = "Custom"; - - pp->wb.temperature = (int)temp->getValue (); + + if (listener) { + if (a==temp) + listener->panelChanged (EvWBTemp, Glib::ustring::format ((int)a->getValue())); + else if (a==green) + listener->panelChanged (EvWBGreen, Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(3), a->getValue())); + } +} + +void WhiteBalance::optChanged () { + + if (opt!=method->get_active_row_number()) { + opt = method->get_active_row_number(); + Glib::ustring meth = M("TP_WBALANCE_CUSTOM"); + if (opt==0 && wbp) { + double ctemp; double cgreen; + wbp->getCamWB (ctemp, cgreen); + temp->setValue (tempAdd ? 0.0 : (int)ctemp); + green->setValue (greenAdd ? 0.0 : cgreen); + meth = M("TP_WBALANCE_CAMERA"); + if (batchMode) { + temp->setEditedState (UnEdited); + green->setEditedState (UnEdited); + } + } + else if (opt==1 && wbp) { + double ctemp; double cgreen; + wbp->getAutoWB (ctemp, cgreen); + temp->setValue (tempAdd ? 0.0 : (int)ctemp); + green->setValue (greenAdd ? 0.0 : cgreen); + meth = M("TP_WBALANCE_AUTO"); + if (batchMode) { + temp->setEditedState (UnEdited); + green->setEditedState (UnEdited); + } + } + else if (opt==3) { + meth = M("GENERAL_UNCHANGED"); + temp->setEditedState (UnEdited); + green->setEditedState (UnEdited); + } + if (listener) + listener->panelChanged (EvWBMethod, meth); + } +} + +void WhiteBalance::spotPressed () { + + if (wblistener) + wblistener->spotWBRequested (getSize()); +} + +void WhiteBalance::spotSizeChanged () { + + if (wblistener) + wblistener->spotWBRequested (getSize()); +} + +void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited) { + + disableListener (); + methconn.block (true); + + if (pedited) { + temp->setEditedState (UnEdited); + green->setEditedState (UnEdited); + } + + if (pedited && !pedited->wb.method) { + method->set_active (3); + opt = 3; + } + else { + if (pp->wb.method == "Camera") { + method->set_active (0); + if (wbp) { + double ctemp; double cgreen; + wbp->getCamWB (ctemp, cgreen); + temp->setValue (tempAdd ? 0.0 : (int)ctemp); + green->setValue (greenAdd ? 0.0 : cgreen); + } + opt = 0; + } + else if (pp->wb.method == "Auto") { + method->set_active (1); + if (wbp) { + double ctemp; double cgreen; + wbp->getAutoWB (ctemp, cgreen); + temp->setValue (tempAdd ? 0.0 : (int)ctemp); + green->setValue (greenAdd ? 0.0 : cgreen); + } + opt = 1; + } + else if (pp->wb.method == "Custom") { + method->set_active (2); + temp->setValue (pp->wb.temperature); + green->setValue (pp->wb.green); + opt = 2; + if (pedited) { + temp->setEditedState (pedited->wb.temperature ? Edited : UnEdited); + green->setEditedState (pedited->wb.green ? Edited : UnEdited); + } + } + } + methconn.block (false); + enableListener (); +} + +void WhiteBalance::write (ProcParams* pp, ParamsEdited* pedited) { + + if (pedited) { + pedited->wb.temperature = temp->getEditedState (); + pedited->wb.green = green->getEditedState (); + pedited->wb.method = method->get_active_row_number()!=3; + } + + if (method->get_active_row_number()==0) + pp->wb.method = "Camera"; + else if (method->get_active_row_number()==1) + pp->wb.method = "Auto"; + else if (method->get_active_row_number()>=2) + pp->wb.method = "Custom"; + + pp->wb.temperature = (int)temp->getValue (); pp->wb.green = green->getValue (); -} - -void WhiteBalance::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { +} - if (wbp && defParams->wb.method == "Camera") { - double ctemp; double cgreen; +void WhiteBalance::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { + + if (wbp && defParams->wb.method == "Camera") { + double ctemp; double cgreen; wbp->getCamWB (ctemp, cgreen); - temp->setDefault (tempAdd ? 0 : (int)ctemp); - green->setDefault (greenAdd ? 0 : cgreen); - } - else if (wbp && defParams->wb.method == "Auto") { - double ctemp; double cgreen; - wbp->getAutoWB (ctemp, cgreen); - temp->setDefault (tempAdd ? 0 : (int)ctemp); - green->setDefault (greenAdd ? 0 : cgreen); - } - else if (defParams->wb.method == "Custom") { - temp->setDefault (defParams->wb.temperature); - green->setDefault (defParams->wb.green); + temp->setDefault (tempAdd ? 0 : (int)ctemp); + green->setDefault (greenAdd ? 0 : cgreen); + } + else if (wbp && defParams->wb.method == "Auto") { + double ctemp; double cgreen; + wbp->getAutoWB (ctemp, cgreen); + temp->setDefault (tempAdd ? 0 : (int)ctemp); + green->setDefault (greenAdd ? 0 : cgreen); + } + else if (defParams->wb.method == "Custom") { + temp->setDefault (defParams->wb.temperature); + green->setDefault (defParams->wb.green); } if (pedited) { temp->setDefaultEditedState (pedited->wb.temperature ? Edited : UnEdited); @@ -251,47 +251,47 @@ void WhiteBalance::setDefaults (const ProcParams* defParams, const ParamsEdited* temp->setDefaultEditedState (Irrelevant); green->setDefaultEditedState (Irrelevant); } -} +} void WhiteBalance::setBatchMode (bool batchMode) { ToolPanel::setBatchMode (batchMode); temp->showEditedCB (); green->showEditedCB (); - method->append_text (M("GENERAL_UNCHANGED")); + method->append_text (M("GENERAL_UNCHANGED")); } - -int WhiteBalance::getSize () { - - return atoi(spotsize->get_active_text().c_str()); -} - -void WhiteBalance::setWB (int vtemp, double vgreen) { - - disableListener (); - temp->setValue (vtemp); - green->setValue (vgreen); - method->set_active (2); - temp->setEditedState (Edited); - green->setEditedState (Edited); - enableListener (); - - if (listener) - listener->panelChanged (EvWBTemp, Glib::ustring::compose("%1, %2", (int)temp->getValue(), Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(3), green->getValue()))); -} - void WhiteBalance::setAdjusterBehavior (bool btempadd, bool bgreenadd) { - - if (!tempAdd && btempadd) - temp->setLimits (-4000, +4000, 1, 0); - else if (tempAdd && !btempadd) - temp->setLimits (MINTEMP, MAXTEMP, 1, 4750); - if (!greenAdd && bgreenadd) - green->setLimits (-1.0, +1.0, 0.001, 0); - else if (greenAdd && bgreenadd) - green->setLimits (MINGREEN, MAXGREEN, 0.001, 1.2); - - tempAdd = btempadd; - greenAdd = bgreenadd; -} +int WhiteBalance::getSize () { + + return atoi(spotsize->get_active_text().c_str()); +} + +void WhiteBalance::setWB (int vtemp, double vgreen) { + + disableListener (); + temp->setValue (vtemp); + green->setValue (vgreen); + method->set_active (2); + temp->setEditedState (Edited); + green->setEditedState (Edited); + enableListener (); + + if (listener) + listener->panelChanged (EvWBTemp, Glib::ustring::compose("%1, %2", (int)temp->getValue(), Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(3), green->getValue()))); +} +void WhiteBalance::setAdjusterBehavior (bool btempadd, bool bgreenadd) { + + if (!tempAdd && btempadd) + temp->setLimits (-4000, +4000, 1, 0); + else if (tempAdd && !btempadd) + temp->setLimits (MINTEMP, MAXTEMP, 1, 4750); + + if (!greenAdd && bgreenadd) + green->setLimits (-1.0, +1.0, 0.001, 0); + else if (greenAdd && bgreenadd) + green->setLimits (MINGREEN, MAXGREEN, 0.001, 1.2); + + tempAdd = btempadd; + greenAdd = bgreenadd; +} diff --git a/rtgui/whitebalance.h b/rtgui/whitebalance.h index 89e6b97d8..f14f91148 100644 --- a/rtgui/whitebalance.h +++ b/rtgui/whitebalance.h @@ -1,71 +1,71 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _WB_H_ -#define _WB_H_ - -#include -#include -#include -#include - -class SpotWBListener { - - public: - virtual void spotWBRequested (int size) {} -}; - -class WhiteBalance : public Gtk::VBox, public AdjusterListener, public ToolPanel { - - protected: - Gtk::ComboBoxText* method; - Gtk::ComboBoxText* spotsize; - Adjuster* temp; - Adjuster* green; - Gtk::Button* spotbutton; - int opt; - double nextTemp; - double nextGreen; - WBProvider *wbp; - SpotWBListener* wblistener; - sigc::connection methconn; - bool tempAdd, greenAdd; - - public: - - WhiteBalance (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _WB_H_ +#define _WB_H_ + +#include +#include +#include +#include + +class SpotWBListener { + + public: + virtual void spotWBRequested (int size) {} +}; + +class WhiteBalance : public Gtk::VBox, public AdjusterListener, public ToolPanel { + + protected: + Gtk::ComboBoxText* method; + Gtk::ComboBoxText* spotsize; + Adjuster* temp; + Adjuster* green; + Gtk::Button* spotbutton; + int opt; + double nextTemp; + double nextGreen; + WBProvider *wbp; + SpotWBListener* wblistener; + sigc::connection methconn; + bool tempAdd, greenAdd; + + public: + + WhiteBalance (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); void setBatchMode (bool batchMode); - - void optChanged (); - void spotPressed (); - void spotSizeChanged (); - void adjusterChanged (Adjuster* a, double newval); - int getSize (); + + void optChanged (); + void spotPressed (); + void spotSizeChanged (); + void adjusterChanged (Adjuster* a, double newval); + int getSize (); void setWBProvider (WBProvider* p) { wbp = p; } - void setSpotWBListener (SpotWBListener* l) { wblistener = l; } + void setSpotWBListener (SpotWBListener* l) { wblistener = l; } void setWB (int temp, double green); - void setAdjusterBehavior (bool btempadd, bool bgreenadd); -}; - -#endif + void setAdjusterBehavior (bool btempadd, bool bgreenadd); +}; + +#endif diff --git a/rtgui/windirmonitor.cc b/rtgui/windirmonitor.cc index b5284a02a..732607ea7 100644 --- a/rtgui/windirmonitor.cc +++ b/rtgui/windirmonitor.cc @@ -1,80 +1,80 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include - -static void CALLBACK current_directory_monitor_callback (DWORD error, DWORD nBytes, LPOVERLAPPED lpOverlapped) { - -// printf ("hivas: %d %d %d\n", error, nBytes, lpOverlapped); - - WinDirMonitor::MonitorData* monData = (WinDirMonitor::MonitorData*)lpOverlapped; - if (!nBytes) { - delete monData; - return; - } - - if (monData->listener) - monData->listener->winDirChanged (); - - ReadDirectoryChangesW (monData->hDirectory, - monData->file_notify_buffer, - monData->buffer_allocated_bytes, - FALSE, - FILE_NOTIFY_CHANGE_FILE_NAME | - FILE_NOTIFY_CHANGE_DIR_NAME | - FILE_NOTIFY_CHANGE_ATTRIBUTES | - FILE_NOTIFY_CHANGE_SIZE, - &monData->buffer_filled_bytes, - &monData->overlapped, - current_directory_monitor_callback); -} - -WinDirMonitor::WinDirMonitor (Glib::ustring dirName, WinDirChangeListener* listener) : monData(NULL) { - - wchar_t* wdirname = (wchar_t*)g_utf8_to_utf16 (dirName.raw().c_str(), -1, NULL, NULL, NULL); - HANDLE hDirectory = CreateFileW (wdirname, FILE_LIST_DIRECTORY,FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, NULL); - g_free (wdirname); - - if (hDirectory != INVALID_HANDLE_VALUE) { - - monData = new MonitorData (); - monData->listener = listener; - monData->buffer_allocated_bytes = 32768; - monData->file_notify_buffer = new char [monData->buffer_allocated_bytes]; - monData->hDirectory = hDirectory; - -// printf ("mondata=%d\n", monData); - ReadDirectoryChangesW (monData->hDirectory, - monData->file_notify_buffer, - monData->buffer_allocated_bytes, - FALSE, - FILE_NOTIFY_CHANGE_FILE_NAME | - FILE_NOTIFY_CHANGE_DIR_NAME | - FILE_NOTIFY_CHANGE_ATTRIBUTES | - FILE_NOTIFY_CHANGE_SIZE, - &monData->buffer_filled_bytes, - &monData->overlapped, - current_directory_monitor_callback); - } -} - -WinDirMonitor::~WinDirMonitor () { - - if (monData && monData->hDirectory != INVALID_HANDLE_VALUE) - CloseHandle (monData->hDirectory); -} +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include + +static void CALLBACK current_directory_monitor_callback (DWORD error, DWORD nBytes, LPOVERLAPPED lpOverlapped) { + +// printf ("hivas: %d %d %d\n", error, nBytes, lpOverlapped); + + WinDirMonitor::MonitorData* monData = (WinDirMonitor::MonitorData*)lpOverlapped; + if (!nBytes) { + delete monData; + return; + } + + if (monData->listener) + monData->listener->winDirChanged (); + + ReadDirectoryChangesW (monData->hDirectory, + monData->file_notify_buffer, + monData->buffer_allocated_bytes, + FALSE, + FILE_NOTIFY_CHANGE_FILE_NAME | + FILE_NOTIFY_CHANGE_DIR_NAME | + FILE_NOTIFY_CHANGE_ATTRIBUTES | + FILE_NOTIFY_CHANGE_SIZE, + &monData->buffer_filled_bytes, + &monData->overlapped, + current_directory_monitor_callback); +} + +WinDirMonitor::WinDirMonitor (Glib::ustring dirName, WinDirChangeListener* listener) : monData(NULL) { + + wchar_t* wdirname = (wchar_t*)g_utf8_to_utf16 (dirName.raw().c_str(), -1, NULL, NULL, NULL); + HANDLE hDirectory = CreateFileW (wdirname, FILE_LIST_DIRECTORY,FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, NULL); + g_free (wdirname); + + if (hDirectory != INVALID_HANDLE_VALUE) { + + monData = new MonitorData (); + monData->listener = listener; + monData->buffer_allocated_bytes = 32768; + monData->file_notify_buffer = new char [monData->buffer_allocated_bytes]; + monData->hDirectory = hDirectory; + +// printf ("mondata=%d\n", monData); + ReadDirectoryChangesW (monData->hDirectory, + monData->file_notify_buffer, + monData->buffer_allocated_bytes, + FALSE, + FILE_NOTIFY_CHANGE_FILE_NAME | + FILE_NOTIFY_CHANGE_DIR_NAME | + FILE_NOTIFY_CHANGE_ATTRIBUTES | + FILE_NOTIFY_CHANGE_SIZE, + &monData->buffer_filled_bytes, + &monData->overlapped, + current_directory_monitor_callback); + } +} + +WinDirMonitor::~WinDirMonitor () { + + if (monData && monData->hDirectory != INVALID_HANDLE_VALUE) + CloseHandle (monData->hDirectory); +} diff --git a/rtgui/windirmonitor.h b/rtgui/windirmonitor.h index 10f4b39f2..b0d6243a0 100644 --- a/rtgui/windirmonitor.h +++ b/rtgui/windirmonitor.h @@ -1,53 +1,53 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _WINDIRMONITOR_ -#define _WINDIRMONITOR_ - -#include -#include - -class WinDirChangeListener { - - public: - virtual void winDirChanged () {} -}; - -class WinDirMonitor : public Glib::Object { - - public: - struct MonitorData { - OVERLAPPED overlapped; - DWORD buffer_allocated_bytes; - char *file_notify_buffer; - DWORD buffer_filled_bytes; - HANDLE hDirectory; - WinDirChangeListener* listener; - int bigyo; - }; - - private: - MonitorData* monData; - - public: - WinDirMonitor (Glib::ustring dirName, WinDirChangeListener* listener); - ~WinDirMonitor (); -}; - -#endif - +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _WINDIRMONITOR_ +#define _WINDIRMONITOR_ + +#include +#include + +class WinDirChangeListener { + + public: + virtual void winDirChanged () {} +}; + +class WinDirMonitor : public Glib::Object { + + public: + struct MonitorData { + OVERLAPPED overlapped; + DWORD buffer_allocated_bytes; + char *file_notify_buffer; + DWORD buffer_filled_bytes; + HANDLE hDirectory; + WinDirChangeListener* listener; + int bigyo; + }; + + private: + MonitorData* monData; + + public: + WinDirMonitor (Glib::ustring dirName, WinDirChangeListener* listener); + ~WinDirMonitor (); +}; + +#endif + diff --git a/rtgui/zoompanel.cc b/rtgui/zoompanel.cc index ac0876c07..d49dcfea1 100644 --- a/rtgui/zoompanel.cc +++ b/rtgui/zoompanel.cc @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #include #include #include diff --git a/rtgui/zoompanel.h b/rtgui/zoompanel.h index 2733c0a71..f1a56da99 100644 --- a/rtgui/zoompanel.h +++ b/rtgui/zoompanel.h @@ -1,21 +1,21 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ #ifndef _ZOOMPANEL_ #define _ZOOMPANEL_ diff --git a/winclude/deflate.h b/winclude/deflate.h index c5958df63..b99a48a52 100755 --- a/winclude/deflate.h +++ b/winclude/deflate.h @@ -1,318 +1,318 @@ -/* deflate.h -- internal compression state - * Copyright (C) 1995-2002 Jean-loup Gailly - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* @(#) $Id$ */ - -#ifndef _DEFLATE_H -#define _DEFLATE_H - -#include "zutil.h" - -/* =========================================================================== - * Internal compression state. - */ - -#define LENGTH_CODES 29 -/* number of length codes, not counting the special END_BLOCK code */ - -#define LITERALS 256 -/* number of literal bytes 0..255 */ - -#define L_CODES (LITERALS+1+LENGTH_CODES) -/* number of Literal or Length codes, including the END_BLOCK code */ - -#define D_CODES 30 -/* number of distance codes */ - -#define BL_CODES 19 -/* number of codes used to transfer the bit lengths */ - -#define HEAP_SIZE (2*L_CODES+1) -/* maximum heap size */ - -#define MAX_BITS 15 -/* All codes must not exceed MAX_BITS bits */ - -#define INIT_STATE 42 -#define BUSY_STATE 113 -#define FINISH_STATE 666 -/* Stream status */ - - -/* Data structure describing a single value and its code string. */ -typedef struct ct_data_s { - union { - ush freq; /* frequency count */ - ush code; /* bit string */ - } fc; - union { - ush dad; /* father node in Huffman tree */ - ush len; /* length of bit string */ - } dl; -} FAR ct_data; - -#define Freq fc.freq -#define Code fc.code -#define Dad dl.dad -#define Len dl.len - -typedef struct static_tree_desc_s static_tree_desc; - -typedef struct tree_desc_s { - ct_data *dyn_tree; /* the dynamic tree */ - int max_code; /* largest code with non zero frequency */ - static_tree_desc *stat_desc; /* the corresponding static tree */ -} FAR tree_desc; - -typedef ush Pos; -typedef Pos FAR Posf; -typedef unsigned IPos; - -/* A Pos is an index in the character window. We use short instead of int to - * save space in the various tables. IPos is used only for parameter passing. - */ - -typedef struct internal_state { - z_streamp strm; /* pointer back to this zlib stream */ - int status; /* as the name implies */ - Bytef *pending_buf; /* output still pending */ - ulg pending_buf_size; /* size of pending_buf */ - Bytef *pending_out; /* next pending byte to output to the stream */ - int pending; /* nb of bytes in the pending buffer */ - int noheader; /* suppress zlib header and adler32 */ - Byte data_type; /* UNKNOWN, BINARY or ASCII */ - Byte method; /* STORED (for zip only) or DEFLATED */ - int last_flush; /* value of flush param for previous deflate call */ - - /* used by deflate.c: */ - - uInt w_size; /* LZ77 window size (32K by default) */ - uInt w_bits; /* log2(w_size) (8..16) */ - uInt w_mask; /* w_size - 1 */ - - Bytef *window; - /* Sliding window. Input bytes are read into the second half of the window, - * and move to the first half later to keep a dictionary of at least wSize - * bytes. With this organization, matches are limited to a distance of - * wSize-MAX_MATCH bytes, but this ensures that IO is always - * performed with a length multiple of the block size. Also, it limits - * the window size to 64K, which is quite useful on MSDOS. - * To do: use the user input buffer as sliding window. - */ - - ulg window_size; - /* Actual size of window: 2*wSize, except when the user input buffer - * is directly used as sliding window. - */ - - Posf *prev; - /* Link to older string with same hash index. To limit the size of this - * array to 64K, this link is maintained only for the last 32K strings. - * An index in this array is thus a window index modulo 32K. - */ - - Posf *head; /* Heads of the hash chains or NIL. */ - - uInt ins_h; /* hash index of string to be inserted */ - uInt hash_size; /* number of elements in hash table */ - uInt hash_bits; /* log2(hash_size) */ - uInt hash_mask; /* hash_size-1 */ - - uInt hash_shift; - /* Number of bits by which ins_h must be shifted at each input - * step. It must be such that after MIN_MATCH steps, the oldest - * byte no longer takes part in the hash key, that is: - * hash_shift * MIN_MATCH >= hash_bits - */ - - long block_start; - /* Window position at the beginning of the current output block. Gets - * negative when the window is moved backwards. - */ - - uInt match_length; /* length of best match */ - IPos prev_match; /* previous match */ - int match_available; /* set if previous match exists */ - uInt strstart; /* start of string to insert */ - uInt match_start; /* start of matching string */ - uInt lookahead; /* number of valid bytes ahead in window */ - - uInt prev_length; - /* Length of the best match at previous step. Matches not greater than this - * are discarded. This is used in the lazy match evaluation. - */ - - uInt max_chain_length; - /* To speed up deflation, hash chains are never searched beyond this - * length. A higher limit improves compression ratio but degrades the - * speed. - */ - - uInt max_lazy_match; - /* Attempt to find a better match only when the current match is strictly - * smaller than this value. This mechanism is used only for compression - * levels >= 4. - */ -# define max_insert_length max_lazy_match - /* Insert new strings in the hash table only if the match length is not - * greater than this length. This saves time but degrades compression. - * max_insert_length is used only for compression levels <= 3. - */ - - int level; /* compression level (1..9) */ - int strategy; /* favor or force Huffman coding*/ - - uInt good_match; - /* Use a faster search when the previous match is longer than this */ - - int nice_match; /* Stop searching when current match exceeds this */ - - /* used by trees.c: */ - /* Didn't use ct_data typedef below to supress compiler warning */ - struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ - struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ - struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ - - struct tree_desc_s l_desc; /* desc. for literal tree */ - struct tree_desc_s d_desc; /* desc. for distance tree */ - struct tree_desc_s bl_desc; /* desc. for bit length tree */ - - ush bl_count[MAX_BITS+1]; - /* number of codes at each bit length for an optimal tree */ - - int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ - int heap_len; /* number of elements in the heap */ - int heap_max; /* element of largest frequency */ - /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. - * The same heap array is used to build all trees. - */ - - uch depth[2*L_CODES+1]; - /* Depth of each subtree used as tie breaker for trees of equal frequency - */ - - uchf *l_buf; /* buffer for literals or lengths */ - - uInt lit_bufsize; - /* Size of match buffer for literals/lengths. There are 4 reasons for - * limiting lit_bufsize to 64K: - * - frequencies can be kept in 16 bit counters - * - if compression is not successful for the first block, all input - * data is still in the window so we can still emit a stored block even - * when input comes from standard input. (This can also be done for - * all blocks if lit_bufsize is not greater than 32K.) - * - if compression is not successful for a file smaller than 64K, we can - * even emit a stored file instead of a stored block (saving 5 bytes). - * This is applicable only for zip (not gzip or zlib). - * - creating new Huffman trees less frequently may not provide fast - * adaptation to changes in the input data statistics. (Take for - * example a binary file with poorly compressible code followed by - * a highly compressible string table.) Smaller buffer sizes give - * fast adaptation but have of course the overhead of transmitting - * trees more frequently. - * - I can't count above 4 - */ - - uInt last_lit; /* running index in l_buf */ - - ushf *d_buf; - /* Buffer for distances. To simplify the code, d_buf and l_buf have - * the same number of elements. To use different lengths, an extra flag - * array would be necessary. - */ - - ulg opt_len; /* bit length of current block with optimal trees */ - ulg static_len; /* bit length of current block with static trees */ - uInt matches; /* number of string matches in current block */ - int last_eob_len; /* bit length of EOB code for last block */ - -#ifdef DEBUG - ulg compressed_len; /* total bit length of compressed file mod 2^32 */ - ulg bits_sent; /* bit length of compressed data sent mod 2^32 */ -#endif - - ush bi_buf; - /* Output buffer. bits are inserted starting at the bottom (least - * significant bits). - */ - int bi_valid; - /* Number of valid bits in bi_buf. All bits above the last valid bit - * are always zero. - */ - -} FAR deflate_state; - -/* Output a byte on the stream. - * IN assertion: there is enough room in pending_buf. - */ -#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} - - -#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) -/* Minimum amount of lookahead, except at the end of the input file. - * See deflate.c for comments about the MIN_MATCH+1. - */ - -#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) -/* In order to simplify the code, particularly on 16 bit machines, match - * distances are limited to MAX_DIST instead of WSIZE. - */ - - /* in trees.c */ -void _tr_init OF((deflate_state *s)); -int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); -void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len, - int eof)); -void _tr_align OF((deflate_state *s)); -void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len, - int eof)); - -#define d_code(dist) \ - ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) -/* Mapping from a distance to a distance code. dist is the distance - 1 and - * must not have side effects. _dist_code[256] and _dist_code[257] are never - * used. - */ - -#ifndef DEBUG -/* Inline versions of _tr_tally for speed: */ - -#if defined(GEN_TREES_H) || !defined(STDC) - extern uch _length_code[]; - extern uch _dist_code[]; -#else - extern const uch _length_code[]; - extern const uch _dist_code[]; -#endif - -# define _tr_tally_lit(s, c, flush) \ - { uch cc = (c); \ - s->d_buf[s->last_lit] = 0; \ - s->l_buf[s->last_lit++] = cc; \ - s->dyn_ltree[cc].Freq++; \ - flush = (s->last_lit == s->lit_bufsize-1); \ - } -# define _tr_tally_dist(s, distance, length, flush) \ - { uch len = (length); \ - ush dist = (distance); \ - s->d_buf[s->last_lit] = dist; \ - s->l_buf[s->last_lit++] = len; \ - dist--; \ - s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ - s->dyn_dtree[d_code(dist)].Freq++; \ - flush = (s->last_lit == s->lit_bufsize-1); \ - } -#else -# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) -# define _tr_tally_dist(s, distance, length, flush) \ - flush = _tr_tally(s, distance, length) -#endif - -#endif +/* deflate.h -- internal compression state + * Copyright (C) 1995-2002 Jean-loup Gailly + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* @(#) $Id$ */ + +#ifndef _DEFLATE_H +#define _DEFLATE_H + +#include "zutil.h" + +/* =========================================================================== + * Internal compression state. + */ + +#define LENGTH_CODES 29 +/* number of length codes, not counting the special END_BLOCK code */ + +#define LITERALS 256 +/* number of literal bytes 0..255 */ + +#define L_CODES (LITERALS+1+LENGTH_CODES) +/* number of Literal or Length codes, including the END_BLOCK code */ + +#define D_CODES 30 +/* number of distance codes */ + +#define BL_CODES 19 +/* number of codes used to transfer the bit lengths */ + +#define HEAP_SIZE (2*L_CODES+1) +/* maximum heap size */ + +#define MAX_BITS 15 +/* All codes must not exceed MAX_BITS bits */ + +#define INIT_STATE 42 +#define BUSY_STATE 113 +#define FINISH_STATE 666 +/* Stream status */ + + +/* Data structure describing a single value and its code string. */ +typedef struct ct_data_s { + union { + ush freq; /* frequency count */ + ush code; /* bit string */ + } fc; + union { + ush dad; /* father node in Huffman tree */ + ush len; /* length of bit string */ + } dl; +} FAR ct_data; + +#define Freq fc.freq +#define Code fc.code +#define Dad dl.dad +#define Len dl.len + +typedef struct static_tree_desc_s static_tree_desc; + +typedef struct tree_desc_s { + ct_data *dyn_tree; /* the dynamic tree */ + int max_code; /* largest code with non zero frequency */ + static_tree_desc *stat_desc; /* the corresponding static tree */ +} FAR tree_desc; + +typedef ush Pos; +typedef Pos FAR Posf; +typedef unsigned IPos; + +/* A Pos is an index in the character window. We use short instead of int to + * save space in the various tables. IPos is used only for parameter passing. + */ + +typedef struct internal_state { + z_streamp strm; /* pointer back to this zlib stream */ + int status; /* as the name implies */ + Bytef *pending_buf; /* output still pending */ + ulg pending_buf_size; /* size of pending_buf */ + Bytef *pending_out; /* next pending byte to output to the stream */ + int pending; /* nb of bytes in the pending buffer */ + int noheader; /* suppress zlib header and adler32 */ + Byte data_type; /* UNKNOWN, BINARY or ASCII */ + Byte method; /* STORED (for zip only) or DEFLATED */ + int last_flush; /* value of flush param for previous deflate call */ + + /* used by deflate.c: */ + + uInt w_size; /* LZ77 window size (32K by default) */ + uInt w_bits; /* log2(w_size) (8..16) */ + uInt w_mask; /* w_size - 1 */ + + Bytef *window; + /* Sliding window. Input bytes are read into the second half of the window, + * and move to the first half later to keep a dictionary of at least wSize + * bytes. With this organization, matches are limited to a distance of + * wSize-MAX_MATCH bytes, but this ensures that IO is always + * performed with a length multiple of the block size. Also, it limits + * the window size to 64K, which is quite useful on MSDOS. + * To do: use the user input buffer as sliding window. + */ + + ulg window_size; + /* Actual size of window: 2*wSize, except when the user input buffer + * is directly used as sliding window. + */ + + Posf *prev; + /* Link to older string with same hash index. To limit the size of this + * array to 64K, this link is maintained only for the last 32K strings. + * An index in this array is thus a window index modulo 32K. + */ + + Posf *head; /* Heads of the hash chains or NIL. */ + + uInt ins_h; /* hash index of string to be inserted */ + uInt hash_size; /* number of elements in hash table */ + uInt hash_bits; /* log2(hash_size) */ + uInt hash_mask; /* hash_size-1 */ + + uInt hash_shift; + /* Number of bits by which ins_h must be shifted at each input + * step. It must be such that after MIN_MATCH steps, the oldest + * byte no longer takes part in the hash key, that is: + * hash_shift * MIN_MATCH >= hash_bits + */ + + long block_start; + /* Window position at the beginning of the current output block. Gets + * negative when the window is moved backwards. + */ + + uInt match_length; /* length of best match */ + IPos prev_match; /* previous match */ + int match_available; /* set if previous match exists */ + uInt strstart; /* start of string to insert */ + uInt match_start; /* start of matching string */ + uInt lookahead; /* number of valid bytes ahead in window */ + + uInt prev_length; + /* Length of the best match at previous step. Matches not greater than this + * are discarded. This is used in the lazy match evaluation. + */ + + uInt max_chain_length; + /* To speed up deflation, hash chains are never searched beyond this + * length. A higher limit improves compression ratio but degrades the + * speed. + */ + + uInt max_lazy_match; + /* Attempt to find a better match only when the current match is strictly + * smaller than this value. This mechanism is used only for compression + * levels >= 4. + */ +# define max_insert_length max_lazy_match + /* Insert new strings in the hash table only if the match length is not + * greater than this length. This saves time but degrades compression. + * max_insert_length is used only for compression levels <= 3. + */ + + int level; /* compression level (1..9) */ + int strategy; /* favor or force Huffman coding*/ + + uInt good_match; + /* Use a faster search when the previous match is longer than this */ + + int nice_match; /* Stop searching when current match exceeds this */ + + /* used by trees.c: */ + /* Didn't use ct_data typedef below to supress compiler warning */ + struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ + struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ + struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ + + struct tree_desc_s l_desc; /* desc. for literal tree */ + struct tree_desc_s d_desc; /* desc. for distance tree */ + struct tree_desc_s bl_desc; /* desc. for bit length tree */ + + ush bl_count[MAX_BITS+1]; + /* number of codes at each bit length for an optimal tree */ + + int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ + int heap_len; /* number of elements in the heap */ + int heap_max; /* element of largest frequency */ + /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + * The same heap array is used to build all trees. + */ + + uch depth[2*L_CODES+1]; + /* Depth of each subtree used as tie breaker for trees of equal frequency + */ + + uchf *l_buf; /* buffer for literals or lengths */ + + uInt lit_bufsize; + /* Size of match buffer for literals/lengths. There are 4 reasons for + * limiting lit_bufsize to 64K: + * - frequencies can be kept in 16 bit counters + * - if compression is not successful for the first block, all input + * data is still in the window so we can still emit a stored block even + * when input comes from standard input. (This can also be done for + * all blocks if lit_bufsize is not greater than 32K.) + * - if compression is not successful for a file smaller than 64K, we can + * even emit a stored file instead of a stored block (saving 5 bytes). + * This is applicable only for zip (not gzip or zlib). + * - creating new Huffman trees less frequently may not provide fast + * adaptation to changes in the input data statistics. (Take for + * example a binary file with poorly compressible code followed by + * a highly compressible string table.) Smaller buffer sizes give + * fast adaptation but have of course the overhead of transmitting + * trees more frequently. + * - I can't count above 4 + */ + + uInt last_lit; /* running index in l_buf */ + + ushf *d_buf; + /* Buffer for distances. To simplify the code, d_buf and l_buf have + * the same number of elements. To use different lengths, an extra flag + * array would be necessary. + */ + + ulg opt_len; /* bit length of current block with optimal trees */ + ulg static_len; /* bit length of current block with static trees */ + uInt matches; /* number of string matches in current block */ + int last_eob_len; /* bit length of EOB code for last block */ + +#ifdef DEBUG + ulg compressed_len; /* total bit length of compressed file mod 2^32 */ + ulg bits_sent; /* bit length of compressed data sent mod 2^32 */ +#endif + + ush bi_buf; + /* Output buffer. bits are inserted starting at the bottom (least + * significant bits). + */ + int bi_valid; + /* Number of valid bits in bi_buf. All bits above the last valid bit + * are always zero. + */ + +} FAR deflate_state; + +/* Output a byte on the stream. + * IN assertion: there is enough room in pending_buf. + */ +#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} + + +#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) +/* Minimum amount of lookahead, except at the end of the input file. + * See deflate.c for comments about the MIN_MATCH+1. + */ + +#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) +/* In order to simplify the code, particularly on 16 bit machines, match + * distances are limited to MAX_DIST instead of WSIZE. + */ + + /* in trees.c */ +void _tr_init OF((deflate_state *s)); +int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); +void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len, + int eof)); +void _tr_align OF((deflate_state *s)); +void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len, + int eof)); + +#define d_code(dist) \ + ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) +/* Mapping from a distance to a distance code. dist is the distance - 1 and + * must not have side effects. _dist_code[256] and _dist_code[257] are never + * used. + */ + +#ifndef DEBUG +/* Inline versions of _tr_tally for speed: */ + +#if defined(GEN_TREES_H) || !defined(STDC) + extern uch _length_code[]; + extern uch _dist_code[]; +#else + extern const uch _length_code[]; + extern const uch _dist_code[]; +#endif + +# define _tr_tally_lit(s, c, flush) \ + { uch cc = (c); \ + s->d_buf[s->last_lit] = 0; \ + s->l_buf[s->last_lit++] = cc; \ + s->dyn_ltree[cc].Freq++; \ + flush = (s->last_lit == s->lit_bufsize-1); \ + } +# define _tr_tally_dist(s, distance, length, flush) \ + { uch len = (length); \ + ush dist = (distance); \ + s->d_buf[s->last_lit] = dist; \ + s->l_buf[s->last_lit++] = len; \ + dist--; \ + s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ + s->dyn_dtree[d_code(dist)].Freq++; \ + flush = (s->last_lit == s->lit_bufsize-1); \ + } +#else +# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) +# define _tr_tally_dist(s, distance, length, flush) \ + flush = _tr_tally(s, distance, length) +#endif + +#endif diff --git a/winclude/infblock.h b/winclude/infblock.h index 4cf0fa969..173b2267a 100755 --- a/winclude/infblock.h +++ b/winclude/infblock.h @@ -1,39 +1,39 @@ -/* infblock.h -- header to use infblock.c - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -struct inflate_blocks_state; -typedef struct inflate_blocks_state FAR inflate_blocks_statef; - -extern inflate_blocks_statef * inflate_blocks_new OF(( - z_streamp z, - check_func c, /* check function */ - uInt w)); /* window size */ - -extern int inflate_blocks OF(( - inflate_blocks_statef *, - z_streamp , - int)); /* initial return code */ - -extern void inflate_blocks_reset OF(( - inflate_blocks_statef *, - z_streamp , - uLongf *)); /* check value on output */ - -extern int inflate_blocks_free OF(( - inflate_blocks_statef *, - z_streamp)); - -extern void inflate_set_dictionary OF(( - inflate_blocks_statef *s, - const Bytef *d, /* dictionary */ - uInt n)); /* dictionary length */ - -extern int inflate_blocks_sync_point OF(( - inflate_blocks_statef *s)); +/* infblock.h -- header to use infblock.c + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +struct inflate_blocks_state; +typedef struct inflate_blocks_state FAR inflate_blocks_statef; + +extern inflate_blocks_statef * inflate_blocks_new OF(( + z_streamp z, + check_func c, /* check function */ + uInt w)); /* window size */ + +extern int inflate_blocks OF(( + inflate_blocks_statef *, + z_streamp , + int)); /* initial return code */ + +extern void inflate_blocks_reset OF(( + inflate_blocks_statef *, + z_streamp , + uLongf *)); /* check value on output */ + +extern int inflate_blocks_free OF(( + inflate_blocks_statef *, + z_streamp)); + +extern void inflate_set_dictionary OF(( + inflate_blocks_statef *s, + const Bytef *d, /* dictionary */ + uInt n)); /* dictionary length */ + +extern int inflate_blocks_sync_point OF(( + inflate_blocks_statef *s)); diff --git a/winclude/infcodes.h b/winclude/infcodes.h index 531d41927..46821a02b 100755 --- a/winclude/infcodes.h +++ b/winclude/infcodes.h @@ -1,27 +1,27 @@ -/* infcodes.h -- header to use infcodes.c - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -struct inflate_codes_state; -typedef struct inflate_codes_state FAR inflate_codes_statef; - -extern inflate_codes_statef *inflate_codes_new OF(( - uInt, uInt, - inflate_huft *, inflate_huft *, - z_streamp )); - -extern int inflate_codes OF(( - inflate_blocks_statef *, - z_streamp , - int)); - -extern void inflate_codes_free OF(( - inflate_codes_statef *, - z_streamp )); - +/* infcodes.h -- header to use infcodes.c + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +struct inflate_codes_state; +typedef struct inflate_codes_state FAR inflate_codes_statef; + +extern inflate_codes_statef *inflate_codes_new OF(( + uInt, uInt, + inflate_huft *, inflate_huft *, + z_streamp )); + +extern int inflate_codes OF(( + inflate_blocks_statef *, + z_streamp , + int)); + +extern void inflate_codes_free OF(( + inflate_codes_statef *, + z_streamp )); + diff --git a/winclude/inffast.h b/winclude/inffast.h index ac643b329..a31a4bbb0 100755 --- a/winclude/inffast.h +++ b/winclude/inffast.h @@ -1,17 +1,17 @@ -/* inffast.h -- header to use inffast.c - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -extern int inflate_fast OF(( - uInt, - uInt, - inflate_huft *, - inflate_huft *, - inflate_blocks_statef *, - z_streamp )); +/* inffast.h -- header to use inffast.c + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +extern int inflate_fast OF(( + uInt, + uInt, + inflate_huft *, + inflate_huft *, + inflate_blocks_statef *, + z_streamp )); diff --git a/winclude/inffixed.h b/winclude/inffixed.h index e997507c3..77f7e7631 100755 --- a/winclude/inffixed.h +++ b/winclude/inffixed.h @@ -1,151 +1,151 @@ -/* inffixed.h -- table for decoding fixed codes - * Generated automatically by the maketree.c program - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -local uInt fixed_bl = 9; -local uInt fixed_bd = 5; -local inflate_huft fixed_tl[] = { - {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115}, - {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192}, - {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160}, - {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224}, - {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144}, - {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208}, - {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176}, - {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240}, - {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227}, - {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200}, - {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168}, - {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232}, - {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152}, - {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216}, - {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184}, - {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248}, - {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163}, - {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196}, - {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164}, - {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228}, - {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148}, - {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212}, - {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180}, - {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244}, - {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0}, - {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204}, - {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172}, - {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236}, - {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156}, - {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220}, - {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188}, - {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252}, - {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131}, - {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194}, - {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162}, - {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226}, - {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146}, - {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210}, - {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178}, - {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242}, - {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258}, - {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202}, - {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170}, - {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234}, - {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154}, - {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218}, - {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186}, - {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250}, - {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195}, - {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198}, - {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166}, - {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230}, - {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150}, - {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214}, - {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182}, - {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246}, - {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0}, - {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206}, - {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174}, - {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238}, - {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158}, - {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222}, - {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190}, - {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254}, - {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115}, - {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193}, - {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161}, - {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225}, - {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145}, - {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209}, - {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177}, - {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241}, - {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227}, - {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201}, - {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169}, - {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233}, - {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153}, - {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217}, - {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185}, - {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249}, - {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163}, - {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197}, - {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165}, - {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229}, - {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149}, - {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213}, - {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181}, - {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245}, - {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0}, - {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205}, - {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173}, - {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237}, - {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157}, - {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221}, - {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189}, - {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253}, - {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131}, - {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195}, - {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163}, - {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227}, - {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147}, - {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211}, - {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179}, - {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243}, - {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258}, - {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203}, - {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171}, - {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235}, - {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155}, - {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219}, - {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187}, - {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251}, - {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195}, - {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199}, - {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167}, - {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231}, - {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151}, - {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215}, - {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183}, - {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247}, - {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0}, - {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207}, - {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175}, - {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239}, - {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159}, - {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223}, - {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191}, - {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255} - }; -local inflate_huft fixed_td[] = { - {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097}, - {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385}, - {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193}, - {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577}, - {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145}, - {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577}, - {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289}, - {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577} - }; +/* inffixed.h -- table for decoding fixed codes + * Generated automatically by the maketree.c program + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +local uInt fixed_bl = 9; +local uInt fixed_bd = 5; +local inflate_huft fixed_tl[] = { + {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115}, + {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192}, + {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160}, + {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224}, + {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144}, + {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208}, + {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176}, + {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240}, + {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227}, + {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200}, + {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168}, + {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232}, + {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152}, + {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216}, + {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184}, + {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248}, + {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163}, + {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196}, + {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164}, + {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228}, + {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148}, + {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212}, + {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180}, + {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244}, + {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204}, + {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172}, + {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236}, + {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156}, + {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220}, + {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188}, + {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252}, + {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131}, + {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194}, + {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162}, + {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226}, + {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146}, + {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210}, + {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178}, + {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242}, + {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258}, + {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202}, + {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170}, + {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234}, + {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154}, + {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218}, + {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186}, + {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250}, + {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195}, + {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198}, + {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166}, + {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230}, + {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150}, + {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214}, + {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182}, + {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246}, + {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206}, + {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174}, + {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238}, + {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158}, + {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222}, + {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190}, + {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254}, + {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115}, + {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193}, + {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161}, + {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225}, + {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145}, + {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209}, + {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177}, + {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241}, + {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227}, + {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201}, + {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169}, + {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233}, + {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153}, + {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217}, + {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185}, + {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249}, + {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163}, + {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197}, + {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165}, + {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229}, + {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149}, + {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213}, + {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181}, + {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245}, + {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205}, + {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173}, + {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237}, + {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157}, + {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221}, + {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189}, + {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253}, + {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131}, + {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195}, + {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163}, + {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227}, + {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147}, + {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211}, + {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179}, + {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243}, + {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258}, + {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203}, + {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171}, + {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235}, + {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155}, + {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219}, + {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187}, + {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251}, + {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195}, + {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199}, + {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167}, + {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231}, + {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151}, + {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215}, + {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183}, + {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247}, + {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207}, + {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175}, + {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239}, + {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159}, + {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223}, + {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191}, + {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255} + }; +local inflate_huft fixed_td[] = { + {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097}, + {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385}, + {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193}, + {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577}, + {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145}, + {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577}, + {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289}, + {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577} + }; diff --git a/winclude/inftrees.h b/winclude/inftrees.h index affbb3b21..04b73b729 100755 --- a/winclude/inftrees.h +++ b/winclude/inftrees.h @@ -1,58 +1,58 @@ -/* inftrees.h -- header to use inftrees.c - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* Huffman code lookup table entry--this entry is four bytes for machines - that have 16-bit pointers (e.g. PC's in the small or medium model). */ - -typedef struct inflate_huft_s FAR inflate_huft; - -struct inflate_huft_s { - union { - struct { - Byte Exop; /* number of extra bits or operation */ - Byte Bits; /* number of bits in this code or subcode */ - } what; - uInt pad; /* pad structure to a power of 2 (4 bytes for */ - } word; /* 16-bit, 8 bytes for 32-bit int's) */ - uInt base; /* literal, length base, distance base, - or table offset */ -}; - -/* Maximum size of dynamic tree. The maximum found in a long but non- - exhaustive search was 1004 huft structures (850 for length/literals - and 154 for distances, the latter actually the result of an - exhaustive search). The actual maximum is not known, but the - value below is more than safe. */ -#define MANY 1440 - -extern int inflate_trees_bits OF(( - uIntf *, /* 19 code lengths */ - uIntf *, /* bits tree desired/actual depth */ - inflate_huft * FAR *, /* bits tree result */ - inflate_huft *, /* space for trees */ - z_streamp)); /* for messages */ - -extern int inflate_trees_dynamic OF(( - uInt, /* number of literal/length codes */ - uInt, /* number of distance codes */ - uIntf *, /* that many (total) code lengths */ - uIntf *, /* literal desired/actual bit depth */ - uIntf *, /* distance desired/actual bit depth */ - inflate_huft * FAR *, /* literal/length tree result */ - inflate_huft * FAR *, /* distance tree result */ - inflate_huft *, /* space for trees */ - z_streamp)); /* for messages */ - -extern int inflate_trees_fixed OF(( - uIntf *, /* literal desired/actual bit depth */ - uIntf *, /* distance desired/actual bit depth */ - inflate_huft * FAR *, /* literal/length tree result */ - inflate_huft * FAR *, /* distance tree result */ - z_streamp)); /* for memory allocation */ +/* inftrees.h -- header to use inftrees.c + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* Huffman code lookup table entry--this entry is four bytes for machines + that have 16-bit pointers (e.g. PC's in the small or medium model). */ + +typedef struct inflate_huft_s FAR inflate_huft; + +struct inflate_huft_s { + union { + struct { + Byte Exop; /* number of extra bits or operation */ + Byte Bits; /* number of bits in this code or subcode */ + } what; + uInt pad; /* pad structure to a power of 2 (4 bytes for */ + } word; /* 16-bit, 8 bytes for 32-bit int's) */ + uInt base; /* literal, length base, distance base, + or table offset */ +}; + +/* Maximum size of dynamic tree. The maximum found in a long but non- + exhaustive search was 1004 huft structures (850 for length/literals + and 154 for distances, the latter actually the result of an + exhaustive search). The actual maximum is not known, but the + value below is more than safe. */ +#define MANY 1440 + +extern int inflate_trees_bits OF(( + uIntf *, /* 19 code lengths */ + uIntf *, /* bits tree desired/actual depth */ + inflate_huft * FAR *, /* bits tree result */ + inflate_huft *, /* space for trees */ + z_streamp)); /* for messages */ + +extern int inflate_trees_dynamic OF(( + uInt, /* number of literal/length codes */ + uInt, /* number of distance codes */ + uIntf *, /* that many (total) code lengths */ + uIntf *, /* literal desired/actual bit depth */ + uIntf *, /* distance desired/actual bit depth */ + inflate_huft * FAR *, /* literal/length tree result */ + inflate_huft * FAR *, /* distance tree result */ + inflate_huft *, /* space for trees */ + z_streamp)); /* for messages */ + +extern int inflate_trees_fixed OF(( + uIntf *, /* literal desired/actual bit depth */ + uIntf *, /* distance desired/actual bit depth */ + inflate_huft * FAR *, /* literal/length tree result */ + inflate_huft * FAR *, /* distance tree result */ + z_streamp)); /* for memory allocation */ diff --git a/winclude/infutil.h b/winclude/infutil.h index 0c0ace366..4401df82f 100755 --- a/winclude/infutil.h +++ b/winclude/infutil.h @@ -1,98 +1,98 @@ -/* infutil.h -- types and macros common to blocks and codes - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -#ifndef _INFUTIL_H -#define _INFUTIL_H - -typedef enum { - TYPE, /* get type bits (3, including end bit) */ - LENS, /* get lengths for stored */ - STORED, /* processing stored block */ - TABLE, /* get table lengths */ - BTREE, /* get bit lengths tree for a dynamic block */ - DTREE, /* get length, distance trees for a dynamic block */ - CODES, /* processing fixed or dynamic block */ - DRY, /* output remaining window bytes */ - DONE, /* finished last block, done */ - BAD} /* got a data error--stuck here */ -inflate_block_mode; - -/* inflate blocks semi-private state */ -struct inflate_blocks_state { - - /* mode */ - inflate_block_mode mode; /* current inflate_block mode */ - - /* mode dependent information */ - union { - uInt left; /* if STORED, bytes left to copy */ - struct { - uInt table; /* table lengths (14 bits) */ - uInt index; /* index into blens (or border) */ - uIntf *blens; /* bit lengths of codes */ - uInt bb; /* bit length tree depth */ - inflate_huft *tb; /* bit length decoding tree */ - } trees; /* if DTREE, decoding info for trees */ - struct { - inflate_codes_statef - *codes; - } decode; /* if CODES, current state */ - } sub; /* submode */ - uInt last; /* true if this block is the last block */ - - /* mode independent information */ - uInt bitk; /* bits in bit buffer */ - uLong bitb; /* bit buffer */ - inflate_huft *hufts; /* single malloc for tree space */ - Bytef *window; /* sliding window */ - Bytef *end; /* one byte after sliding window */ - Bytef *read; /* window read pointer */ - Bytef *write; /* window write pointer */ - check_func checkfn; /* check function */ - uLong check; /* check on output */ - -}; - - -/* defines for inflate input/output */ -/* update pointers and return */ -#define UPDBITS {s->bitb=b;s->bitk=k;} -#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;} -#define UPDOUT {s->write=q;} -#define UPDATE {UPDBITS UPDIN UPDOUT} -#define LEAVE {UPDATE return inflate_flush(s,z,r);} -/* get bytes and bits */ -#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;} -#define NEEDBYTE {if(n)r=Z_OK;else LEAVE} -#define NEXTBYTE (n--,*p++) -#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<>=(j);k-=(j);} -/* output bytes */ -#define WAVAIL (uInt)(qread?s->read-q-1:s->end-q) -#define LOADOUT {q=s->write;m=(uInt)WAVAIL;} -#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}} -#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT} -#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;} -#define OUTBYTE(a) {*q++=(Byte)(a);m--;} -/* load local pointers */ -#define LOAD {LOADIN LOADOUT} - -/* masks for lower bits (size given to avoid silly warnings with Visual C++) */ -extern uInt inflate_mask[17]; - -/* copy as much as possible from the sliding window to the output area */ -extern int inflate_flush OF(( - inflate_blocks_statef *, - z_streamp , - int)); - -struct internal_state {int dummy;}; /* for buggy compilers */ - -#endif +/* infutil.h -- types and macros common to blocks and codes + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +#ifndef _INFUTIL_H +#define _INFUTIL_H + +typedef enum { + TYPE, /* get type bits (3, including end bit) */ + LENS, /* get lengths for stored */ + STORED, /* processing stored block */ + TABLE, /* get table lengths */ + BTREE, /* get bit lengths tree for a dynamic block */ + DTREE, /* get length, distance trees for a dynamic block */ + CODES, /* processing fixed or dynamic block */ + DRY, /* output remaining window bytes */ + DONE, /* finished last block, done */ + BAD} /* got a data error--stuck here */ +inflate_block_mode; + +/* inflate blocks semi-private state */ +struct inflate_blocks_state { + + /* mode */ + inflate_block_mode mode; /* current inflate_block mode */ + + /* mode dependent information */ + union { + uInt left; /* if STORED, bytes left to copy */ + struct { + uInt table; /* table lengths (14 bits) */ + uInt index; /* index into blens (or border) */ + uIntf *blens; /* bit lengths of codes */ + uInt bb; /* bit length tree depth */ + inflate_huft *tb; /* bit length decoding tree */ + } trees; /* if DTREE, decoding info for trees */ + struct { + inflate_codes_statef + *codes; + } decode; /* if CODES, current state */ + } sub; /* submode */ + uInt last; /* true if this block is the last block */ + + /* mode independent information */ + uInt bitk; /* bits in bit buffer */ + uLong bitb; /* bit buffer */ + inflate_huft *hufts; /* single malloc for tree space */ + Bytef *window; /* sliding window */ + Bytef *end; /* one byte after sliding window */ + Bytef *read; /* window read pointer */ + Bytef *write; /* window write pointer */ + check_func checkfn; /* check function */ + uLong check; /* check on output */ + +}; + + +/* defines for inflate input/output */ +/* update pointers and return */ +#define UPDBITS {s->bitb=b;s->bitk=k;} +#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;} +#define UPDOUT {s->write=q;} +#define UPDATE {UPDBITS UPDIN UPDOUT} +#define LEAVE {UPDATE return inflate_flush(s,z,r);} +/* get bytes and bits */ +#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;} +#define NEEDBYTE {if(n)r=Z_OK;else LEAVE} +#define NEXTBYTE (n--,*p++) +#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<>=(j);k-=(j);} +/* output bytes */ +#define WAVAIL (uInt)(qread?s->read-q-1:s->end-q) +#define LOADOUT {q=s->write;m=(uInt)WAVAIL;} +#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}} +#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT} +#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;} +#define OUTBYTE(a) {*q++=(Byte)(a);m--;} +/* load local pointers */ +#define LOAD {LOADIN LOADOUT} + +/* masks for lower bits (size given to avoid silly warnings with Visual C++) */ +extern uInt inflate_mask[17]; + +/* copy as much as possible from the sliding window to the output area */ +extern int inflate_flush OF(( + inflate_blocks_statef *, + z_streamp , + int)); + +struct internal_state {int dummy;}; /* for buggy compilers */ + +#endif diff --git a/winclude/png.h b/winclude/png.h index 71cfcdd0b..f059910e6 100755 --- a/winclude/png.h +++ b/winclude/png.h @@ -1,3283 +1,3283 @@ -/* png.h - header file for PNG reference library - * - * libpng version 1.2.5 - October 3, 2002 - * Copyright (c) 1998-2002 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * Authors and maintainers: - * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat - * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.2.5 - October 3, 2002: Glenn - * See also "Contributing Authors", below. - * - * Note about libpng version numbers: - * - * Due to various miscommunications, unforeseen code incompatibilities - * and occasional factors outside the authors' control, version numbering - * on the library has not always been consistent and straightforward. - * The following table summarizes matters since version 0.89c, which was - * the first widely used release: - * - * source png.h png.h shared-lib - * version string int version - * ------- ------ ----- ---------- - * 0.89c "1.0 beta 3" 0.89 89 1.0.89 - * 0.90 "1.0 beta 4" 0.90 90 0.90 [should have been 2.0.90] - * 0.95 "1.0 beta 5" 0.95 95 0.95 [should have been 2.0.95] - * 0.96 "1.0 beta 6" 0.96 96 0.96 [should have been 2.0.96] - * 0.97b "1.00.97 beta 7" 1.00.97 97 1.0.1 [should have been 2.0.97] - * 0.97c 0.97 97 2.0.97 - * 0.98 0.98 98 2.0.98 - * 0.99 0.99 98 2.0.99 - * 0.99a-m 0.99 99 2.0.99 - * 1.00 1.00 100 2.1.0 [100 should be 10000] - * 1.0.0 (from here on, the 100 2.1.0 [100 should be 10000] - * 1.0.1 png.h string is 10001 2.1.0 - * 1.0.1a-e identical to the 10002 from here on, the shared library - * 1.0.2 source version) 10002 is 2.V where V is the source code - * 1.0.2a-b 10003 version, except as noted. - * 1.0.3 10003 - * 1.0.3a-d 10004 - * 1.0.4 10004 - * 1.0.4a-f 10005 - * 1.0.5 (+ 2 patches) 10005 - * 1.0.5a-d 10006 - * 1.0.5e-r 10100 (not source compatible) - * 1.0.5s-v 10006 (not binary compatible) - * 1.0.6 (+ 3 patches) 10006 (still binary incompatible) - * 1.0.6d-f 10007 (still binary incompatible) - * 1.0.6g 10007 - * 1.0.6h 10007 10.6h (testing xy.z so-numbering) - * 1.0.6i 10007 10.6i - * 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0) - * 1.0.7beta11-14 DLLNUM 10007 2.1.0.7beta11-14 (binary compatible) - * 1.0.7beta15-18 1 10007 2.1.0.7beta15-18 (binary compatible) - * 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible) - * 1.0.7 1 10007 (still compatible) - * 1.0.8beta1-4 1 10008 2.1.0.8beta1-4 - * 1.0.8rc1 1 10008 2.1.0.8rc1 - * 1.0.8 1 10008 2.1.0.8 - * 1.0.9beta1-6 1 10009 2.1.0.9beta1-6 - * 1.0.9rc1 1 10009 2.1.0.9rc1 - * 1.0.9beta7-10 1 10009 2.1.0.9beta7-10 - * 1.0.9rc2 1 10009 2.1.0.9rc2 - * 1.0.9 1 10009 2.1.0.9 - * 1.0.10beta1 1 10010 2.1.0.10beta1 - * 1.0.10rc1 1 10010 2.1.0.10rc1 - * 1.0.10 1 10010 2.1.0.10 - * 1.0.11beta1-3 1 10011 2.1.0.11beta1-3 - * 1.0.11rc1 1 10011 2.1.0.11rc1 - * 1.0.11 1 10011 2.1.0.11 - * 1.0.12beta1-2 2 10012 2.1.0.12beta1-2 - * 1.0.12rc1 2 10012 2.1.0.12rc1 - * 1.0.12 2 10012 2.1.0.12 - * 1.1.0a-f - 10100 2.1.1.0a-f (branch abandoned) - * 1.2.0beta1-2 2 10200 2.1.2.0beta1-2 - * 1.2.0beta3-5 3 10200 3.1.2.0beta3-5 - * 1.2.0rc1 3 10200 3.1.2.0rc1 - * 1.2.0 3 10200 3.1.2.0 - * 1.2.1beta1-4 3 10201 3.1.2.1beta1-4 - * 1.2.1rc1-2 3 10201 3.1.2.1rc1-2 - * 1.2.1 3 10201 3.1.2.1 - * 1.2.2beta1-6 12 10202 12.so.0.1.2.2beta1-6 - * 1.0.13beta1 10 10013 10.so.0.1.0.13beta1 - * 1.0.13rc1 10 10013 10.so.0.1.0.13rc1 - * 1.2.2rc1 12 10202 12.so.0.1.2.2rc1 - * 1.0.13 10 10013 10.so.0.1.0.13 - * 1.2.2 12 10202 12.so.0.1.2.2 - * 1.2.3rc1-6 12 10203 12.so.0.1.2.3rc1-6 - * 1.2.3 12 10203 12.so.0.1.2.3 - * 1.2.4beta1-3 13 10204 12.so.0.1.2.4beta1-3 - * 1.0.14rc1 13 10014 10.so.0.1.0.14rc1 - * 1.2.4rc1 13 10204 12.so.0.1.2.4rc1 - * 1.0.14 10 10014 10.so.0.1.0.14 - * 1.2.4 13 10204 12.so.0.1.2.4 - * 1.2.5beta1-2 13 10205 12.so.0.1.2.5beta1-2 - * 1.0.15rc1-3 10 10015 10.so.0.1.0.15rc1-3 - * 1.2.5rc1-3 13 10205 12.so.0.1.2.5rc1-3 - * 1.0.15 10 10015 10.so.0.1.0.15 - * 1.2.5 13 10205 12.so.0.1.2.5 - * - * Henceforth the source version will match the shared-library major - * and minor numbers; the shared-library major version number will be - * used for changes in backward compatibility, as it is intended. The - * PNG_LIBPNG_VER macro, which is not used within libpng but is available - * for applications, is an unsigned integer of the form xyyzz corresponding - * to the source version x.y.z (leading zeros in y and z). Beta versions - * were given the previous public release number plus a letter, until - * version 1.0.6j; from then on they were given the upcoming public - * release number plus "betaNN" or "rcN". - * - * Binary incompatibility exists only when applications make direct access - * to the info_ptr or png_ptr members through png.h, and the compiled - * application is loaded with a different version of the library. - * - * DLLNUM will change each time there are forward or backward changes - * in binary compatibility (e.g., when a new feature is added). - * - * See libpng.txt or libpng.3 for more information. The PNG specification - * is available as RFC 2083 - * and as a W3C Recommendation - */ - -/* - * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: - * - * If you modify libpng you may insert additional notices immediately following - * this sentence. - * - * libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are - * Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are - * distributed according to the same disclaimer and license as libpng-1.0.6 - * with the following individuals added to the list of Contributing Authors - * - * Simon-Pierre Cadieux - * Eric S. Raymond - * Gilles Vollant - * - * and with the following additions to the disclaimer: - * - * There is no warranty against interference with your enjoyment of the - * library or against infringement. There is no warranty that our - * efforts or the library will fulfill any of your particular purposes - * or needs. This library is provided with all faults, and the entire - * risk of satisfactory quality, performance, accuracy, and effort is with - * the user. - * - * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are - * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson - * Distributed according to the same disclaimer and license as libpng-0.96, - * with the following individuals added to the list of Contributing Authors: - * - * Tom Lane - * Glenn Randers-Pehrson - * Willem van Schaik - * - * libpng versions 0.89, June 1996, through 0.96, May 1997, are - * Copyright (c) 1996, 1997 Andreas Dilger - * Distributed according to the same disclaimer and license as libpng-0.88, - * with the following individuals added to the list of Contributing Authors: - * - * John Bowler - * Kevin Bracey - * Sam Bushell - * Magnus Holmgren - * Greg Roelofs - * Tom Tanner - * - * libpng versions 0.5, May 1995, through 0.88, January 1996, are - * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. - * - * For the purposes of this copyright and license, "Contributing Authors" - * is defined as the following set of individuals: - * - * Andreas Dilger - * Dave Martindale - * Guy Eric Schalnat - * Paul Schmidt - * Tim Wegner - * - * The PNG Reference Library is supplied "AS IS". The Contributing Authors - * and Group 42, Inc. disclaim all warranties, expressed or implied, - * including, without limitation, the warranties of merchantability and of - * fitness for any purpose. The Contributing Authors and Group 42, Inc. - * assume no liability for direct, indirect, incidental, special, exemplary, - * or consequential damages, which may result from the use of the PNG - * Reference Library, even if advised of the possibility of such damage. - * - * Permission is hereby granted to use, copy, modify, and distribute this - * source code, or portions hereof, for any purpose, without fee, subject - * to the following restrictions: - * - * 1. The origin of this source code must not be misrepresented. - * - * 2. Altered versions must be plainly marked as such and - * must not be misrepresented as being the original source. - * - * 3. This Copyright notice may not be removed or altered from - * any source or altered source distribution. - * - * The Contributing Authors and Group 42, Inc. specifically permit, without - * fee, and encourage the use of this source code as a component to - * supporting the PNG file format in commercial products. If you use this - * source code in a product, acknowledgment is not required but would be - * appreciated. - */ - -/* - * A "png_get_copyright" function is available, for convenient use in "about" - * boxes and the like: - * - * printf("%s",png_get_copyright(NULL)); - * - * Also, the PNG logo (in PNG format, of course) is supplied in the - * files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). - */ - -/* - * Libpng is OSI Certified Open Source Software. OSI Certified is a - * certification mark of the Open Source Initiative. - */ - -/* - * The contributing authors would like to thank all those who helped - * with testing, bug fixes, and patience. This wouldn't have been - * possible without all of you. - * - * Thanks to Frank J. T. Wojcik for helping with the documentation. - */ - -/* - * Y2K compliance in libpng: - * ========================= - * - * October 3, 2002 - * - * Since the PNG Development group is an ad-hoc body, we can't make - * an official declaration. - * - * This is your unofficial assurance that libpng from version 0.71 and - * upward through 1.2.5 are Y2K compliant. It is my belief that earlier - * versions were also Y2K compliant. - * - * Libpng only has three year fields. One is a 2-byte unsigned integer - * that will hold years up to 65535. The other two hold the date in text - * format, and will hold years up to 9999. - * - * The integer is - * "png_uint_16 year" in png_time_struct. - * - * The strings are - * "png_charp time_buffer" in png_struct and - * "near_time_buffer", which is a local character string in png.c. - * - * There are seven time-related functions: - * png.c: png_convert_to_rfc_1123() in png.c - * (formerly png_convert_to_rfc_1152() in error) - * png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c - * png_convert_from_time_t() in pngwrite.c - * png_get_tIME() in pngget.c - * png_handle_tIME() in pngrutil.c, called in pngread.c - * png_set_tIME() in pngset.c - * png_write_tIME() in pngwutil.c, called in pngwrite.c - * - * All handle dates properly in a Y2K environment. The - * png_convert_from_time_t() function calls gmtime() to convert from system - * clock time, which returns (year - 1900), which we properly convert to - * the full 4-digit year. There is a possibility that applications using - * libpng are not passing 4-digit years into the png_convert_to_rfc_1123() - * function, or that they are incorrectly passing only a 2-digit year - * instead of "year - 1900" into the png_convert_from_struct_tm() function, - * but this is not under our control. The libpng documentation has always - * stated that it works with 4-digit years, and the APIs have been - * documented as such. - * - * The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned - * integer to hold the year, and can hold years as large as 65535. - * - * zlib, upon which libpng depends, is also Y2K compliant. It contains - * no date-related code. - * - * Glenn Randers-Pehrson - * libpng maintainer - * PNG Development Group - */ - -#ifndef PNG_H -#define PNG_H - -/* This is not the place to learn how to use libpng. The file libpng.txt - * describes how to use libpng, and the file example.c summarizes it - * with some code on which to build. This file is useful for looking - * at the actual function definitions and structure components. - */ - -/* Version information for png.h - this should match the version in png.c */ -#define PNG_LIBPNG_VER_STRING "1.2.5" - -#define PNG_LIBPNG_VER_SONUM 0 -#define PNG_LIBPNG_VER_DLLNUM %DLLNUM% - -/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ -#define PNG_LIBPNG_VER_MAJOR 1 -#define PNG_LIBPNG_VER_MINOR 2 -#define PNG_LIBPNG_VER_RELEASE 5 -/* This should match the numeric part of the final component of - * PNG_LIBPNG_VER_STRING, omitting any leading zero: */ - -#define PNG_LIBPNG_VER_BUILD 0 - -#define PNG_LIBPNG_BUILD_ALPHA 1 -#define PNG_LIBPNG_BUILD_BETA 2 -#define PNG_LIBPNG_BUILD_RC 3 -#define PNG_LIBPNG_BUILD_STABLE 4 -#define PNG_LIBPNG_BUILD_TYPEMASK 7 -#define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with STABLE only */ -#define PNG_LIBPNG_BUILD_TYPE 4 - -/* Careful here. At one time, Guy wanted to use 082, but that would be octal. - * We must not include leading zeros. - * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only - * version 1.0.0 was mis-numbered 100 instead of 10000). From - * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */ -#define PNG_LIBPNG_VER 10205 /* 1.2.5 */ - -#ifndef PNG_VERSION_INFO_ONLY - -/* include the compression library's header */ -#include "zlib.h" - -/* include all user configurable info, including optional assembler routines */ -#include "pngconf.h" - -/* Inhibit C++ name-mangling for libpng functions but not for system calls. */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* This file is arranged in several sections. The first section contains - * structure and type definitions. The second section contains the external - * library functions, while the third has the internal library functions, - * which applications aren't expected to use directly. - */ - -#ifndef PNG_NO_TYPECAST_NULL -#define int_p_NULL (int *)NULL -#define png_bytep_NULL (png_bytep)NULL -#define png_bytepp_NULL (png_bytepp)NULL -#define png_doublep_NULL (png_doublep)NULL -#define png_error_ptr_NULL (png_error_ptr)NULL -#define png_flush_ptr_NULL (png_flush_ptr)NULL -#define png_free_ptr_NULL (png_free_ptr)NULL -#define png_infopp_NULL (png_infopp)NULL -#define png_malloc_ptr_NULL (png_malloc_ptr)NULL -#define png_read_status_ptr_NULL (png_read_status_ptr)NULL -#define png_rw_ptr_NULL (png_rw_ptr)NULL -#define png_structp_NULL (png_structp)NULL -#define png_uint_16p_NULL (png_uint_16p)NULL -#define png_voidp_NULL (png_voidp)NULL -#define png_write_status_ptr_NULL (png_write_status_ptr)NULL -#else -#define int_p_NULL NULL -#define png_bytep_NULL NULL -#define png_bytepp_NULL NULL -#define png_doublep_NULL NULL -#define png_error_ptr_NULL NULL -#define png_flush_ptr_NULL NULL -#define png_free_ptr_NULL NULL -#define png_infopp_NULL NULL -#define png_malloc_ptr_NULL NULL -#define png_read_status_ptr_NULL NULL -#define png_rw_ptr_NULL NULL -#define png_structp_NULL NULL -#define png_uint_16p_NULL NULL -#define png_voidp_NULL NULL -#define png_write_status_ptr_NULL NULL -#endif - -/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */ -#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN) -/* Version information for C files, stored in png.c. This had better match - * the version above. - */ -#ifdef PNG_USE_GLOBAL_ARRAYS -PNG_EXPORT_VAR (const char) png_libpng_ver[18]; - /* need room for 99.99.99beta99z */ -#else -#define png_libpng_ver png_get_header_ver(NULL) -#endif - -#ifdef PNG_USE_GLOBAL_ARRAYS -/* This was removed in version 1.0.5c */ -/* Structures to facilitate easy interlacing. See png.c for more details */ -PNG_EXPORT_VAR (const int FARDATA) png_pass_start[7]; -PNG_EXPORT_VAR (const int FARDATA) png_pass_inc[7]; -PNG_EXPORT_VAR (const int FARDATA) png_pass_ystart[7]; -PNG_EXPORT_VAR (const int FARDATA) png_pass_yinc[7]; -PNG_EXPORT_VAR (const int FARDATA) png_pass_mask[7]; -PNG_EXPORT_VAR (const int FARDATA) png_pass_dsp_mask[7]; -#ifdef PNG_HAVE_ASSEMBLER_COMBINE_ROW -PNG_EXPORT_VAR (const int FARDATA) png_pass_width[7]; -#endif -/* This isn't currently used. If you need it, see png.c for more details. -PNG_EXPORT_VAR (const int FARDATA) png_pass_height[7]; -*/ -#endif - -#endif /* PNG_NO_EXTERN */ - -/* Three color definitions. The order of the red, green, and blue, (and the - * exact size) is not important, although the size of the fields need to - * be png_byte or png_uint_16 (as defined below). - */ -typedef struct png_color_struct -{ - png_byte red; - png_byte green; - png_byte blue; -} png_color; -typedef png_color FAR * png_colorp; -typedef png_color FAR * FAR * png_colorpp; - -typedef struct png_color_16_struct -{ - png_byte index; /* used for palette files */ - png_uint_16 red; /* for use in red green blue files */ - png_uint_16 green; - png_uint_16 blue; - png_uint_16 gray; /* for use in grayscale files */ -} png_color_16; -typedef png_color_16 FAR * png_color_16p; -typedef png_color_16 FAR * FAR * png_color_16pp; - -typedef struct png_color_8_struct -{ - png_byte red; /* for use in red green blue files */ - png_byte green; - png_byte blue; - png_byte gray; /* for use in grayscale files */ - png_byte alpha; /* for alpha channel files */ -} png_color_8; -typedef png_color_8 FAR * png_color_8p; -typedef png_color_8 FAR * FAR * png_color_8pp; - -/* - * The following two structures are used for the in-core representation - * of sPLT chunks. - */ -typedef struct png_sPLT_entry_struct -{ - png_uint_16 red; - png_uint_16 green; - png_uint_16 blue; - png_uint_16 alpha; - png_uint_16 frequency; -} png_sPLT_entry; -typedef png_sPLT_entry FAR * png_sPLT_entryp; -typedef png_sPLT_entry FAR * FAR * png_sPLT_entrypp; - -/* When the depth of the sPLT palette is 8 bits, the color and alpha samples - * occupy the LSB of their respective members, and the MSB of each member - * is zero-filled. The frequency member always occupies the full 16 bits. - */ - -typedef struct png_sPLT_struct -{ - png_charp name; /* palette name */ - png_byte depth; /* depth of palette samples */ - png_sPLT_entryp entries; /* palette entries */ - png_int_32 nentries; /* number of palette entries */ -} png_sPLT_t; -typedef png_sPLT_t FAR * png_sPLT_tp; -typedef png_sPLT_t FAR * FAR * png_sPLT_tpp; - -#ifdef PNG_TEXT_SUPPORTED -/* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file, - * and whether that contents is compressed or not. The "key" field - * points to a regular zero-terminated C string. The "text", "lang", and - * "lang_key" fields can be regular C strings, empty strings, or NULL pointers. - * However, the * structure returned by png_get_text() will always contain - * regular zero-terminated C strings (possibly empty), never NULL pointers, - * so they can be safely used in printf() and other string-handling functions. - */ -typedef struct png_text_struct -{ - int compression; /* compression value: - -1: tEXt, none - 0: zTXt, deflate - 1: iTXt, none - 2: iTXt, deflate */ - png_charp key; /* keyword, 1-79 character description of "text" */ - png_charp text; /* comment, may be an empty string (ie "") - or a NULL pointer */ - png_size_t text_length; /* length of the text string */ -#ifdef PNG_iTXt_SUPPORTED - png_size_t itxt_length; /* length of the itxt string */ - png_charp lang; /* language code, 0-79 characters - or a NULL pointer */ - png_charp lang_key; /* keyword translated UTF-8 string, 0 or more - chars or a NULL pointer */ -#endif -} png_text; -typedef png_text FAR * png_textp; -typedef png_text FAR * FAR * png_textpp; -#endif - -/* Supported compression types for text in PNG files (tEXt, and zTXt). - * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. */ -#define PNG_TEXT_COMPRESSION_NONE_WR -3 -#define PNG_TEXT_COMPRESSION_zTXt_WR -2 -#define PNG_TEXT_COMPRESSION_NONE -1 -#define PNG_TEXT_COMPRESSION_zTXt 0 -#define PNG_ITXT_COMPRESSION_NONE 1 -#define PNG_ITXT_COMPRESSION_zTXt 2 -#define PNG_TEXT_COMPRESSION_LAST 3 /* Not a valid value */ - -/* png_time is a way to hold the time in an machine independent way. - * Two conversions are provided, both from time_t and struct tm. There - * is no portable way to convert to either of these structures, as far - * as I know. If you know of a portable way, send it to me. As a side - * note - PNG has always been Year 2000 compliant! - */ -typedef struct png_time_struct -{ - png_uint_16 year; /* full year, as in, 1995 */ - png_byte month; /* month of year, 1 - 12 */ - png_byte day; /* day of month, 1 - 31 */ - png_byte hour; /* hour of day, 0 - 23 */ - png_byte minute; /* minute of hour, 0 - 59 */ - png_byte second; /* second of minute, 0 - 60 (for leap seconds) */ -} png_time; -typedef png_time FAR * png_timep; -typedef png_time FAR * FAR * png_timepp; - -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) -/* png_unknown_chunk is a structure to hold queued chunks for which there is - * no specific support. The idea is that we can use this to queue - * up private chunks for output even though the library doesn't actually - * know about their semantics. - */ -typedef struct png_unknown_chunk_t -{ - png_byte name[5]; - png_byte *data; - png_size_t size; - - /* libpng-using applications should NOT directly modify this byte. */ - png_byte location; /* mode of operation at read time */ -} -png_unknown_chunk; -typedef png_unknown_chunk FAR * png_unknown_chunkp; -typedef png_unknown_chunk FAR * FAR * png_unknown_chunkpp; -#endif - -/* png_info is a structure that holds the information in a PNG file so - * that the application can find out the characteristics of the image. - * If you are reading the file, this structure will tell you what is - * in the PNG file. If you are writing the file, fill in the information - * you want to put into the PNG file, then call png_write_info(). - * The names chosen should be very close to the PNG specification, so - * consult that document for information about the meaning of each field. - * - * With libpng < 0.95, it was only possible to directly set and read the - * the values in the png_info_struct, which meant that the contents and - * order of the values had to remain fixed. With libpng 0.95 and later, - * however, there are now functions that abstract the contents of - * png_info_struct from the application, so this makes it easier to use - * libpng with dynamic libraries, and even makes it possible to use - * libraries that don't have all of the libpng ancillary chunk-handing - * functionality. - * - * In any case, the order of the parameters in png_info_struct should NOT - * be changed for as long as possible to keep compatibility with applications - * that use the old direct-access method with png_info_struct. - * - * The following members may have allocated storage attached that should be - * cleaned up before the structure is discarded: palette, trans, text, - * pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile, - * splt_palettes, scal_unit, row_pointers, and unknowns. By default, these - * are automatically freed when the info structure is deallocated, if they were - * allocated internally by libpng. This behavior can be changed by means - * of the png_data_freer() function. - * - * More allocation details: all the chunk-reading functions that - * change these members go through the corresponding png_set_* - * functions. A function to clear these members is available: see - * png_free_data(). The png_set_* functions do not depend on being - * able to point info structure members to any of the storage they are - * passed (they make their own copies), EXCEPT that the png_set_text - * functions use the same storage passed to them in the text_ptr or - * itxt_ptr structure argument, and the png_set_rows and png_set_unknowns - * functions do not make their own copies. - */ -typedef struct png_info_struct -{ - /* the following are necessary for every PNG file */ - png_uint_32 width; /* width of image in pixels (from IHDR) */ - png_uint_32 height; /* height of image in pixels (from IHDR) */ - png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */ - png_uint_32 rowbytes; /* bytes needed to hold an untransformed row */ - png_colorp palette; /* array of color values (valid & PNG_INFO_PLTE) */ - png_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */ - png_uint_16 num_trans; /* number of transparent palette color (tRNS) */ - png_byte bit_depth; /* 1, 2, 4, 8, or 16 bits/channel (from IHDR) */ - png_byte color_type; /* see PNG_COLOR_TYPE_ below (from IHDR) */ - /* The following three should have been named *_method not *_type */ - png_byte compression_type; /* must be PNG_COMPRESSION_TYPE_BASE (IHDR) */ - png_byte filter_type; /* must be PNG_FILTER_TYPE_BASE (from IHDR) */ - png_byte interlace_type; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ - - /* The following is informational only on read, and not used on writes. */ - png_byte channels; /* number of data channels per pixel (1, 2, 3, 4) */ - png_byte pixel_depth; /* number of bits per pixel */ - png_byte spare_byte; /* to align the data, and for future use */ - png_byte signature[8]; /* magic bytes read by libpng from start of file */ - - /* The rest of the data is optional. If you are reading, check the - * valid field to see if the information in these are valid. If you - * are writing, set the valid field to those chunks you want written, - * and initialize the appropriate fields below. - */ - -#if defined(PNG_gAMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) - /* The gAMA chunk describes the gamma characteristics of the system - * on which the image was created, normally in the range [1.0, 2.5]. - * Data is valid if (valid & PNG_INFO_gAMA) is non-zero. - */ - float gamma; /* gamma value of image, if (valid & PNG_INFO_gAMA) */ -#endif - -#if defined(PNG_sRGB_SUPPORTED) - /* GR-P, 0.96a */ - /* Data valid if (valid & PNG_INFO_sRGB) non-zero. */ - png_byte srgb_intent; /* sRGB rendering intent [0, 1, 2, or 3] */ -#endif - -#if defined(PNG_TEXT_SUPPORTED) - /* The tEXt, and zTXt chunks contain human-readable textual data in - * uncompressed, compressed, and optionally compressed forms, respectively. - * The data in "text" is an array of pointers to uncompressed, - * null-terminated C strings. Each chunk has a keyword that describes the - * textual data contained in that chunk. Keywords are not required to be - * unique, and the text string may be empty. Any number of text chunks may - * be in an image. - */ - int num_text; /* number of comments read/to write */ - int max_text; /* current size of text array */ - png_textp text; /* array of comments read/to write */ -#endif /* PNG_TEXT_SUPPORTED */ - -#if defined(PNG_tIME_SUPPORTED) - /* The tIME chunk holds the last time the displayed image data was - * modified. See the png_time struct for the contents of this struct. - */ - png_time mod_time; -#endif - -#if defined(PNG_sBIT_SUPPORTED) - /* The sBIT chunk specifies the number of significant high-order bits - * in the pixel data. Values are in the range [1, bit_depth], and are - * only specified for the channels in the pixel data. The contents of - * the low-order bits is not specified. Data is valid if - * (valid & PNG_INFO_sBIT) is non-zero. - */ - png_color_8 sig_bit; /* significant bits in color channels */ -#endif - -#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_EXPAND_SUPPORTED) || \ -defined(PNG_READ_BACKGROUND_SUPPORTED) - /* The tRNS chunk supplies transparency data for paletted images and - * other image types that don't need a full alpha channel. There are - * "num_trans" transparency values for a paletted image, stored in the - * same order as the palette colors, starting from index 0. Values - * for the data are in the range [0, 255], ranging from fully transparent - * to fully opaque, respectively. For non-paletted images, there is a - * single color specified that should be treated as fully transparent. - * Data is valid if (valid & PNG_INFO_tRNS) is non-zero. - */ - png_bytep trans; /* transparent values for paletted image */ - png_color_16 trans_values; /* transparent color for non-palette image */ -#endif - -#if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - /* The bKGD chunk gives the suggested image background color if the - * display program does not have its own background color and the image - * is needs to composited onto a background before display. The colors - * in "background" are normally in the same color space/depth as the - * pixel data. Data is valid if (valid & PNG_INFO_bKGD) is non-zero. - */ - png_color_16 background; -#endif - -#if defined(PNG_oFFs_SUPPORTED) - /* The oFFs chunk gives the offset in "offset_unit_type" units rightwards - * and downwards from the top-left corner of the display, page, or other - * application-specific co-ordinate space. See the PNG_OFFSET_ defines - * below for the unit types. Valid if (valid & PNG_INFO_oFFs) non-zero. - */ - png_int_32 x_offset; /* x offset on page */ - png_int_32 y_offset; /* y offset on page */ - png_byte offset_unit_type; /* offset units type */ -#endif - -#if defined(PNG_pHYs_SUPPORTED) - /* The pHYs chunk gives the physical pixel density of the image for - * display or printing in "phys_unit_type" units (see PNG_RESOLUTION_ - * defines below). Data is valid if (valid & PNG_INFO_pHYs) is non-zero. - */ - png_uint_32 x_pixels_per_unit; /* horizontal pixel density */ - png_uint_32 y_pixels_per_unit; /* vertical pixel density */ - png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */ -#endif - -#if defined(PNG_hIST_SUPPORTED) - /* The hIST chunk contains the relative frequency or importance of the - * various palette entries, so that a viewer can intelligently select a - * reduced-color palette, if required. Data is an array of "num_palette" - * values in the range [0,65535]. Data valid if (valid & PNG_INFO_hIST) - * is non-zero. - */ - png_uint_16p hist; -#endif - -#ifdef PNG_cHRM_SUPPORTED - /* The cHRM chunk describes the CIE color characteristics of the monitor - * on which the PNG was created. This data allows the viewer to do gamut - * mapping of the input image to ensure that the viewer sees the same - * colors in the image as the creator. Values are in the range - * [0.0, 0.8]. Data valid if (valid & PNG_INFO_cHRM) non-zero. - */ -#ifdef PNG_FLOATING_POINT_SUPPORTED - float x_white; - float y_white; - float x_red; - float y_red; - float x_green; - float y_green; - float x_blue; - float y_blue; -#endif -#endif - -#if defined(PNG_pCAL_SUPPORTED) - /* The pCAL chunk describes a transformation between the stored pixel - * values and original physical data values used to create the image. - * The integer range [0, 2^bit_depth - 1] maps to the floating-point - * range given by [pcal_X0, pcal_X1], and are further transformed by a - * (possibly non-linear) transformation function given by "pcal_type" - * and "pcal_params" into "pcal_units". Please see the PNG_EQUATION_ - * defines below, and the PNG-Group's PNG extensions document for a - * complete description of the transformations and how they should be - * implemented, and for a description of the ASCII parameter strings. - * Data values are valid if (valid & PNG_INFO_pCAL) non-zero. - */ - png_charp pcal_purpose; /* pCAL chunk description string */ - png_int_32 pcal_X0; /* minimum value */ - png_int_32 pcal_X1; /* maximum value */ - png_charp pcal_units; /* Latin-1 string giving physical units */ - png_charpp pcal_params; /* ASCII strings containing parameter values */ - png_byte pcal_type; /* equation type (see PNG_EQUATION_ below) */ - png_byte pcal_nparams; /* number of parameters given in pcal_params */ -#endif - -/* New members added in libpng-1.0.6 */ -#ifdef PNG_FREE_ME_SUPPORTED - png_uint_32 free_me; /* flags items libpng is responsible for freeing */ -#endif - -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - /* storage for unknown chunks that the library doesn't recognize. */ - png_unknown_chunkp unknown_chunks; - png_size_t unknown_chunks_num; -#endif - -#if defined(PNG_iCCP_SUPPORTED) - /* iCCP chunk data. */ - png_charp iccp_name; /* profile name */ - png_charp iccp_profile; /* International Color Consortium profile data */ - /* Note to maintainer: should be png_bytep */ - png_uint_32 iccp_proflen; /* ICC profile data length */ - png_byte iccp_compression; /* Always zero */ -#endif - -#if defined(PNG_sPLT_SUPPORTED) - /* data on sPLT chunks (there may be more than one). */ - png_sPLT_tp splt_palettes; - png_uint_32 splt_palettes_num; -#endif - -#if defined(PNG_sCAL_SUPPORTED) - /* The sCAL chunk describes the actual physical dimensions of the - * subject matter of the graphic. The chunk contains a unit specification - * a byte value, and two ASCII strings representing floating-point - * values. The values are width and height corresponsing to one pixel - * in the image. This external representation is converted to double - * here. Data values are valid if (valid & PNG_INFO_sCAL) is non-zero. - */ - png_byte scal_unit; /* unit of physical scale */ -#ifdef PNG_FLOATING_POINT_SUPPORTED - double scal_pixel_width; /* width of one pixel */ - double scal_pixel_height; /* height of one pixel */ -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED - png_charp scal_s_width; /* string containing height */ - png_charp scal_s_height; /* string containing width */ -#endif -#endif - -#if defined(PNG_INFO_IMAGE_SUPPORTED) - /* Memory has been allocated if (valid & PNG_ALLOCATED_INFO_ROWS) non-zero */ - /* Data valid if (valid & PNG_INFO_IDAT) non-zero */ - png_bytepp row_pointers; /* the image bits */ -#endif - -#if defined(PNG_FIXED_POINT_SUPPORTED) && defined(PNG_gAMA_SUPPORTED) - png_fixed_point int_gamma; /* gamma of image, if (valid & PNG_INFO_gAMA) */ -#endif - -#if defined(PNG_cHRM_SUPPORTED) && defined(PNG_FIXED_POINT_SUPPORTED) - png_fixed_point int_x_white; - png_fixed_point int_y_white; - png_fixed_point int_x_red; - png_fixed_point int_y_red; - png_fixed_point int_x_green; - png_fixed_point int_y_green; - png_fixed_point int_x_blue; - png_fixed_point int_y_blue; -#endif - -} png_info; - -typedef png_info FAR * png_infop; -typedef png_info FAR * FAR * png_infopp; - -/* Maximum positive integer used in PNG is (2^31)-1 */ -#define PNG_MAX_UINT ((png_uint_32)0x7fffffffL) - -/* These describe the color_type field in png_info. */ -/* color type masks */ -#define PNG_COLOR_MASK_PALETTE 1 -#define PNG_COLOR_MASK_COLOR 2 -#define PNG_COLOR_MASK_ALPHA 4 - -/* color types. Note that not all combinations are legal */ -#define PNG_COLOR_TYPE_GRAY 0 -#define PNG_COLOR_TYPE_PALETTE (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE) -#define PNG_COLOR_TYPE_RGB (PNG_COLOR_MASK_COLOR) -#define PNG_COLOR_TYPE_RGB_ALPHA (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA) -#define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA) -/* aliases */ -#define PNG_COLOR_TYPE_RGBA PNG_COLOR_TYPE_RGB_ALPHA -#define PNG_COLOR_TYPE_GA PNG_COLOR_TYPE_GRAY_ALPHA - -/* This is for compression type. PNG 1.0-1.2 only define the single type. */ -#define PNG_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */ -#define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE - -/* This is for filter type. PNG 1.0-1.2 only define the single type. */ -#define PNG_FILTER_TYPE_BASE 0 /* Single row per-byte filtering */ -#define PNG_INTRAPIXEL_DIFFERENCING 64 /* Used only in MNG datastreams */ -#define PNG_FILTER_TYPE_DEFAULT PNG_FILTER_TYPE_BASE - -/* These are for the interlacing type. These values should NOT be changed. */ -#define PNG_INTERLACE_NONE 0 /* Non-interlaced image */ -#define PNG_INTERLACE_ADAM7 1 /* Adam7 interlacing */ -#define PNG_INTERLACE_LAST 2 /* Not a valid value */ - -/* These are for the oFFs chunk. These values should NOT be changed. */ -#define PNG_OFFSET_PIXEL 0 /* Offset in pixels */ -#define PNG_OFFSET_MICROMETER 1 /* Offset in micrometers (1/10^6 meter) */ -#define PNG_OFFSET_LAST 2 /* Not a valid value */ - -/* These are for the pCAL chunk. These values should NOT be changed. */ -#define PNG_EQUATION_LINEAR 0 /* Linear transformation */ -#define PNG_EQUATION_BASE_E 1 /* Exponential base e transform */ -#define PNG_EQUATION_ARBITRARY 2 /* Arbitrary base exponential transform */ -#define PNG_EQUATION_HYPERBOLIC 3 /* Hyperbolic sine transformation */ -#define PNG_EQUATION_LAST 4 /* Not a valid value */ - -/* These are for the sCAL chunk. These values should NOT be changed. */ -#define PNG_SCALE_UNKNOWN 0 /* unknown unit (image scale) */ -#define PNG_SCALE_METER 1 /* meters per pixel */ -#define PNG_SCALE_RADIAN 2 /* radians per pixel */ -#define PNG_SCALE_LAST 3 /* Not a valid value */ - -/* These are for the pHYs chunk. These values should NOT be changed. */ -#define PNG_RESOLUTION_UNKNOWN 0 /* pixels/unknown unit (aspect ratio) */ -#define PNG_RESOLUTION_METER 1 /* pixels/meter */ -#define PNG_RESOLUTION_LAST 2 /* Not a valid value */ - -/* These are for the sRGB chunk. These values should NOT be changed. */ -#define PNG_sRGB_INTENT_PERCEPTUAL 0 -#define PNG_sRGB_INTENT_RELATIVE 1 -#define PNG_sRGB_INTENT_SATURATION 2 -#define PNG_sRGB_INTENT_ABSOLUTE 3 -#define PNG_sRGB_INTENT_LAST 4 /* Not a valid value */ - -/* This is for text chunks */ -#define PNG_KEYWORD_MAX_LENGTH 79 - -/* Maximum number of entries in PLTE/sPLT/tRNS arrays */ -#define PNG_MAX_PALETTE_LENGTH 256 - -/* These determine if an ancillary chunk's data has been successfully read - * from the PNG header, or if the application has filled in the corresponding - * data in the info_struct to be written into the output file. The values - * of the PNG_INFO_ defines should NOT be changed. - */ -#define PNG_INFO_gAMA 0x0001 -#define PNG_INFO_sBIT 0x0002 -#define PNG_INFO_cHRM 0x0004 -#define PNG_INFO_PLTE 0x0008 -#define PNG_INFO_tRNS 0x0010 -#define PNG_INFO_bKGD 0x0020 -#define PNG_INFO_hIST 0x0040 -#define PNG_INFO_pHYs 0x0080 -#define PNG_INFO_oFFs 0x0100 -#define PNG_INFO_tIME 0x0200 -#define PNG_INFO_pCAL 0x0400 -#define PNG_INFO_sRGB 0x0800 /* GR-P, 0.96a */ -#define PNG_INFO_iCCP 0x1000 /* ESR, 1.0.6 */ -#define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ -#define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ -#define PNG_INFO_IDAT 0x8000L /* ESR, 1.0.6 */ - -/* This is used for the transformation routines, as some of them - * change these values for the row. It also should enable using - * the routines for other purposes. - */ -typedef struct png_row_info_struct -{ - png_uint_32 width; /* width of row */ - png_uint_32 rowbytes; /* number of bytes in row */ - png_byte color_type; /* color type of row */ - png_byte bit_depth; /* bit depth of row */ - png_byte channels; /* number of channels (1, 2, 3, or 4) */ - png_byte pixel_depth; /* bits per pixel (depth * channels) */ -} png_row_info; - -typedef png_row_info FAR * png_row_infop; -typedef png_row_info FAR * FAR * png_row_infopp; - -/* These are the function types for the I/O functions and for the functions - * that allow the user to override the default I/O functions with his or her - * own. The png_error_ptr type should match that of user-supplied warning - * and error functions, while the png_rw_ptr type should match that of the - * user read/write data functions. - */ -typedef struct png_struct_def png_struct; -typedef png_struct FAR * png_structp; - -typedef void (PNGAPI *png_error_ptr) PNGARG((png_structp, png_const_charp)); -typedef void (PNGAPI *png_rw_ptr) PNGARG((png_structp, png_bytep, png_size_t)); -typedef void (PNGAPI *png_flush_ptr) PNGARG((png_structp)); -typedef void (PNGAPI *png_read_status_ptr) PNGARG((png_structp, png_uint_32, - int)); -typedef void (PNGAPI *png_write_status_ptr) PNGARG((png_structp, png_uint_32, - int)); - -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -typedef void (PNGAPI *png_progressive_info_ptr) PNGARG((png_structp, png_infop)); -typedef void (PNGAPI *png_progressive_end_ptr) PNGARG((png_structp, png_infop)); -typedef void (PNGAPI *png_progressive_row_ptr) PNGARG((png_structp, png_bytep, - png_uint_32, int)); -#endif - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) -typedef void (PNGAPI *png_user_transform_ptr) PNGARG((png_structp, - png_row_infop, png_bytep)); -#endif - -#if defined(PNG_USER_CHUNKS_SUPPORTED) -typedef int (PNGAPI *png_user_chunk_ptr) PNGARG((png_structp, png_unknown_chunkp)); -#endif -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) -typedef void (PNGAPI *png_unknown_chunk_ptr) PNGARG((png_structp)); -#endif - -/* Transform masks for the high-level interface */ -#define PNG_TRANSFORM_IDENTITY 0x0000 /* read and write */ -#define PNG_TRANSFORM_STRIP_16 0x0001 /* read only */ -#define PNG_TRANSFORM_STRIP_ALPHA 0x0002 /* read only */ -#define PNG_TRANSFORM_PACKING 0x0004 /* read and write */ -#define PNG_TRANSFORM_PACKSWAP 0x0008 /* read and write */ -#define PNG_TRANSFORM_EXPAND 0x0010 /* read only */ -#define PNG_TRANSFORM_INVERT_MONO 0x0020 /* read and write */ -#define PNG_TRANSFORM_SHIFT 0x0040 /* read and write */ -#define PNG_TRANSFORM_BGR 0x0080 /* read and write */ -#define PNG_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */ -#define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ -#define PNG_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */ -#define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* WRITE only */ - -/* Flags for MNG supported features */ -#define PNG_FLAG_MNG_EMPTY_PLTE 0x01 -#define PNG_FLAG_MNG_FILTER_64 0x04 -#define PNG_ALL_MNG_FEATURES 0x05 - -typedef png_voidp (*png_malloc_ptr) PNGARG((png_structp, png_size_t)); -typedef void (*png_free_ptr) PNGARG((png_structp, png_voidp)); - -/* The structure that holds the information to read and write PNG files. - * The only people who need to care about what is inside of this are the - * people who will be modifying the library for their own special needs. - * It should NOT be accessed directly by an application, except to store - * the jmp_buf. - */ - -struct png_struct_def -{ -#ifdef PNG_SETJMP_SUPPORTED - jmp_buf jmpbuf; /* used in png_error */ -#endif - png_error_ptr error_fn; /* function for printing errors and aborting */ - png_error_ptr warning_fn; /* function for printing warnings */ - png_voidp error_ptr; /* user supplied struct for error functions */ - png_rw_ptr write_data_fn; /* function for writing output data */ - png_rw_ptr read_data_fn; /* function for reading input data */ - png_voidp io_ptr; /* ptr to application struct for I/O functions */ - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - png_user_transform_ptr read_user_transform_fn; /* user read transform */ -#endif - -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) - png_user_transform_ptr write_user_transform_fn; /* user write transform */ -#endif - -/* These were added in libpng-1.0.2 */ -#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) - png_voidp user_transform_ptr; /* user supplied struct for user transform */ - png_byte user_transform_depth; /* bit depth of user transformed pixels */ - png_byte user_transform_channels; /* channels in user transformed pixels */ -#endif -#endif - - png_uint_32 mode; /* tells us where we are in the PNG file */ - png_uint_32 flags; /* flags indicating various things to libpng */ - png_uint_32 transformations; /* which transformations to perform */ - - z_stream zstream; /* pointer to decompression structure (below) */ - png_bytep zbuf; /* buffer for zlib */ - png_size_t zbuf_size; /* size of zbuf */ - int zlib_level; /* holds zlib compression level */ - int zlib_method; /* holds zlib compression method */ - int zlib_window_bits; /* holds zlib compression window bits */ - int zlib_mem_level; /* holds zlib compression memory level */ - int zlib_strategy; /* holds zlib compression strategy */ - - png_uint_32 width; /* width of image in pixels */ - png_uint_32 height; /* height of image in pixels */ - png_uint_32 num_rows; /* number of rows in current pass */ - png_uint_32 usr_width; /* width of row at start of write */ - png_uint_32 rowbytes; /* size of row in bytes */ - png_uint_32 irowbytes; /* size of current interlaced row in bytes */ - png_uint_32 iwidth; /* width of current interlaced row in pixels */ - png_uint_32 row_number; /* current row in interlace pass */ - png_bytep prev_row; /* buffer to save previous (unfiltered) row */ - png_bytep row_buf; /* buffer to save current (unfiltered) row */ - png_bytep sub_row; /* buffer to save "sub" row when filtering */ - png_bytep up_row; /* buffer to save "up" row when filtering */ - png_bytep avg_row; /* buffer to save "avg" row when filtering */ - png_bytep paeth_row; /* buffer to save "Paeth" row when filtering */ - png_row_info row_info; /* used for transformation routines */ - - png_uint_32 idat_size; /* current IDAT size for read */ - png_uint_32 crc; /* current chunk CRC value */ - png_colorp palette; /* palette from the input file */ - png_uint_16 num_palette; /* number of color entries in palette */ - png_uint_16 num_trans; /* number of transparency values */ - png_byte chunk_name[5]; /* null-terminated name of current chunk */ - png_byte compression; /* file compression type (always 0) */ - png_byte filter; /* file filter type (always 0) */ - png_byte interlaced; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ - png_byte pass; /* current interlace pass (0 - 6) */ - png_byte do_filter; /* row filter flags (see PNG_FILTER_ below ) */ - png_byte color_type; /* color type of file */ - png_byte bit_depth; /* bit depth of file */ - png_byte usr_bit_depth; /* bit depth of users row */ - png_byte pixel_depth; /* number of bits per pixel */ - png_byte channels; /* number of channels in file */ - png_byte usr_channels; /* channels at start of write */ - png_byte sig_bytes; /* magic bytes read/written from start of file */ - -#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) -#ifdef PNG_LEGACY_SUPPORTED - png_byte filler; /* filler byte for pixel expansion */ -#else - png_uint_16 filler; /* filler bytes for pixel expansion */ -#endif -#endif - -#if defined(PNG_bKGD_SUPPORTED) - png_byte background_gamma_type; -# ifdef PNG_FLOATING_POINT_SUPPORTED - float background_gamma; -# endif - png_color_16 background; /* background color in screen gamma space */ -#if defined(PNG_READ_GAMMA_SUPPORTED) - png_color_16 background_1; /* background normalized to gamma 1.0 */ -#endif -#endif /* PNG_bKGD_SUPPORTED */ - -#if defined(PNG_WRITE_FLUSH_SUPPORTED) - png_flush_ptr output_flush_fn;/* Function for flushing output */ - png_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */ - png_uint_32 flush_rows; /* number of rows written since last flush */ -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - int gamma_shift; /* number of "insignificant" bits 16-bit gamma */ -#ifdef PNG_FLOATING_POINT_SUPPORTED - float gamma; /* file gamma value */ - float screen_gamma; /* screen gamma value (display_exponent) */ -#endif -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - png_bytep gamma_table; /* gamma table for 8-bit depth files */ - png_bytep gamma_from_1; /* converts from 1.0 to screen */ - png_bytep gamma_to_1; /* converts from file to 1.0 */ - png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */ - png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */ - png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */ -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED) - png_color_8 sig_bit; /* significant bits in each available channel */ -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) - png_color_8 shift; /* shift for significant bit tranformation */ -#endif - -#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \ - || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - png_bytep trans; /* transparency values for paletted files */ - png_color_16 trans_values; /* transparency values for non-paletted files */ -#endif - - png_read_status_ptr read_row_fn; /* called after each row is decoded */ - png_write_status_ptr write_row_fn; /* called after each row is encoded */ -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED - png_progressive_info_ptr info_fn; /* called after header data fully read */ - png_progressive_row_ptr row_fn; /* called after each prog. row is decoded */ - png_progressive_end_ptr end_fn; /* called after image is complete */ - png_bytep save_buffer_ptr; /* current location in save_buffer */ - png_bytep save_buffer; /* buffer for previously read data */ - png_bytep current_buffer_ptr; /* current location in current_buffer */ - png_bytep current_buffer; /* buffer for recently used data */ - png_uint_32 push_length; /* size of current input chunk */ - png_uint_32 skip_length; /* bytes to skip in input data */ - png_size_t save_buffer_size; /* amount of data now in save_buffer */ - png_size_t save_buffer_max; /* total size of save_buffer */ - png_size_t buffer_size; /* total amount of available input data */ - png_size_t current_buffer_size; /* amount of data now in current_buffer */ - int process_mode; /* what push library is currently doing */ - int cur_palette; /* current push library palette index */ - -# if defined(PNG_TEXT_SUPPORTED) - png_size_t current_text_size; /* current size of text input data */ - png_size_t current_text_left; /* how much text left to read in input */ - png_charp current_text; /* current text chunk buffer */ - png_charp current_text_ptr; /* current location in current_text */ -# endif /* PNG_PROGRESSIVE_READ_SUPPORTED && PNG_TEXT_SUPPORTED */ - -#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ - -#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) -/* for the Borland special 64K segment handler */ - png_bytepp offset_table_ptr; - png_bytep offset_table; - png_uint_16 offset_table_number; - png_uint_16 offset_table_count; - png_uint_16 offset_table_count_free; -#endif - -#if defined(PNG_READ_DITHER_SUPPORTED) - png_bytep palette_lookup; /* lookup table for dithering */ - png_bytep dither_index; /* index translation for palette files */ -#endif - -#if defined(PNG_READ_DITHER_SUPPORTED) || defined(PNG_hIST_SUPPORTED) - png_uint_16p hist; /* histogram */ -#endif - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - png_byte heuristic_method; /* heuristic for row filter selection */ - png_byte num_prev_filters; /* number of weights for previous rows */ - png_bytep prev_filters; /* filter type(s) of previous row(s) */ - png_uint_16p filter_weights; /* weight(s) for previous line(s) */ - png_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */ - png_uint_16p filter_costs; /* relative filter calculation cost */ - png_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */ -#endif - -#if defined(PNG_TIME_RFC1123_SUPPORTED) - png_charp time_buffer; /* String to hold RFC 1123 time text */ -#endif - -/* New members added in libpng-1.0.6 */ - -#ifdef PNG_FREE_ME_SUPPORTED - png_uint_32 free_me; /* flags items libpng is responsible for freeing */ -#endif - -#if defined(PNG_USER_CHUNKS_SUPPORTED) - png_voidp user_chunk_ptr; - png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */ -#endif - -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - int num_chunk_list; - png_bytep chunk_list; -#endif - -/* New members added in libpng-1.0.3 */ -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - png_byte rgb_to_gray_status; - /* These were changed from png_byte in libpng-1.0.6 */ - png_uint_16 rgb_to_gray_red_coeff; - png_uint_16 rgb_to_gray_green_coeff; - png_uint_16 rgb_to_gray_blue_coeff; -#endif - -/* New member added in libpng-1.0.4 (renamed in 1.0.9) */ -#if defined(PNG_MNG_FEATURES_SUPPORTED) || \ - defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ - defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) -/* changed from png_byte to png_uint_32 at version 1.2.0 */ -#ifdef PNG_1_0_X - png_byte mng_features_permitted; -#else - png_uint_32 mng_features_permitted; -#endif /* PNG_1_0_X */ -#endif - -/* New member added in libpng-1.0.7 */ -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - png_fixed_point int_gamma; -#endif - -/* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */ -#if defined(PNG_MNG_FEATURES_SUPPORTED) - png_byte filter_type; -#endif - -#if defined(PNG_1_0_X) || (defined(PNG_DEBUG) && defined(PNG_USE_PNGGCCRD)) -/* New member added in libpng-1.0.10, ifdef'ed out in 1.2.0 */ - png_uint_32 row_buf_size; -#endif - -/* New members added in libpng-1.2.0 */ -#if !defined(PNG_1_0_X) && defined(PNG_ASSEMBLER_CODE_SUPPORTED) - png_byte mmx_bitdepth_threshold; - png_uint_32 mmx_rowbytes_threshold; - png_uint_32 asm_flags; -#endif - -/* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ -#ifdef PNG_USER_MEM_SUPPORTED - png_voidp mem_ptr; /* user supplied struct for mem functions */ - png_malloc_ptr malloc_fn; /* function for allocating memory */ - png_free_ptr free_fn; /* function for freeing memory */ -#endif - -/* New member added in libpng-1.0.13 and 1.2.0 */ - png_bytep big_row_buf; /* buffer to save current (unfiltered) row */ - -#if defined(PNG_READ_DITHER_SUPPORTED) -/* The following three members were added at version 1.0.14 and 1.2.4 */ - png_bytep dither_sort; /* working sort array */ - png_bytep index_to_palette; /* where the original index currently is */ - /* in the palette */ - png_bytep palette_to_index; /* which original index points to this */ - /* palette color */ -#endif - -}; - - -/* This prevents a compiler error in png.c if png.c and png.h are both at - version 1.2.5 - */ -typedef png_structp version_1_2_5; - -typedef png_struct FAR * FAR * png_structpp; - -/* Here are the function definitions most commonly used. This is not - * the place to find out how to use libpng. See libpng.txt for the - * full explanation, see example.c for the summary. This just provides - * a simple one line description of the use of each function. - */ - -/* Returns the version number of the library */ -extern PNG_EXPORT(png_uint_32,png_access_version_number) PNGARG((void)); - -/* Tell lib we have already handled the first magic bytes. - * Handling more than 8 bytes from the beginning of the file is an error. - */ -extern PNG_EXPORT(void,png_set_sig_bytes) PNGARG((png_structp png_ptr, - int num_bytes)); - -/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a - * PNG file. Returns zero if the supplied bytes match the 8-byte PNG - * signature, and non-zero otherwise. Having num_to_check == 0 or - * start > 7 will always fail (ie return non-zero). - */ -extern PNG_EXPORT(int,png_sig_cmp) PNGARG((png_bytep sig, png_size_t start, - png_size_t num_to_check)); - -/* Simple signature checking function. This is the same as calling - * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n). - */ -extern PNG_EXPORT(int,png_check_sig) PNGARG((png_bytep sig, int num)); - -/* Allocate and initialize png_ptr struct for reading, and any other memory. */ -extern PNG_EXPORT(png_structp,png_create_read_struct) - PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn)); - -/* Allocate and initialize png_ptr struct for writing, and any other memory */ -extern PNG_EXPORT(png_structp,png_create_write_struct) - PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn)); - -extern PNG_EXPORT(png_uint_32,png_get_compression_buffer_size) - PNGARG((png_structp png_ptr)); - -extern PNG_EXPORT(void,png_set_compression_buffer_size) - PNGARG((png_structp png_ptr, png_uint_32 size)); - -/* Reset the compression stream */ -extern PNG_EXPORT(int,png_reset_zstream) PNGARG((png_structp png_ptr)); - -/* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */ -#ifdef PNG_USER_MEM_SUPPORTED -extern PNG_EXPORT(png_structp,png_create_read_struct_2) - PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, - png_malloc_ptr malloc_fn, png_free_ptr free_fn)); -extern PNG_EXPORT(png_structp,png_create_write_struct_2) - PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, - png_malloc_ptr malloc_fn, png_free_ptr free_fn)); -#endif - -/* Write a PNG chunk - size, type, (optional) data, CRC. */ -extern PNG_EXPORT(void,png_write_chunk) PNGARG((png_structp png_ptr, - png_bytep chunk_name, png_bytep data, png_size_t length)); - -/* Write the start of a PNG chunk - length and chunk name. */ -extern PNG_EXPORT(void,png_write_chunk_start) PNGARG((png_structp png_ptr, - png_bytep chunk_name, png_uint_32 length)); - -/* Write the data of a PNG chunk started with png_write_chunk_start(). */ -extern PNG_EXPORT(void,png_write_chunk_data) PNGARG((png_structp png_ptr, - png_bytep data, png_size_t length)); - -/* Finish a chunk started with png_write_chunk_start() (includes CRC). */ -extern PNG_EXPORT(void,png_write_chunk_end) PNGARG((png_structp png_ptr)); - -/* Allocate and initialize the info structure */ -extern PNG_EXPORT(png_infop,png_create_info_struct) - PNGARG((png_structp png_ptr)); - -/* Initialize the info structure (old interface - DEPRECATED) */ -extern PNG_EXPORT(void,png_info_init) PNGARG((png_infop info_ptr)); -#undef png_info_init -#define png_info_init(info_ptr) png_info_init_3(&info_ptr, sizeof(png_info)); -extern PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr, - png_size_t png_info_struct_size)); - -/* Writes all the PNG information before the image. */ -extern PNG_EXPORT(void,png_write_info_before_PLTE) PNGARG((png_structp png_ptr, - png_infop info_ptr)); -extern PNG_EXPORT(void,png_write_info) PNGARG((png_structp png_ptr, - png_infop info_ptr)); - -/* read the information before the actual image data. */ -extern PNG_EXPORT(void,png_read_info) PNGARG((png_structp png_ptr, - png_infop info_ptr)); - -#if defined(PNG_TIME_RFC1123_SUPPORTED) -extern PNG_EXPORT(png_charp,png_convert_to_rfc1123) - PNGARG((png_structp png_ptr, png_timep ptime)); -#endif - -#if !defined(_WIN32_WCE) -/* "time.h" functions are not supported on WindowsCE */ -#if defined(PNG_WRITE_tIME_SUPPORTED) -/* convert from a struct tm to png_time */ -extern PNG_EXPORT(void,png_convert_from_struct_tm) PNGARG((png_timep ptime, - struct tm FAR * ttime)); - -/* convert from time_t to png_time. Uses gmtime() */ -extern PNG_EXPORT(void,png_convert_from_time_t) PNGARG((png_timep ptime, - time_t ttime)); -#endif /* PNG_WRITE_tIME_SUPPORTED */ -#endif /* _WIN32_WCE */ - -#if defined(PNG_READ_EXPAND_SUPPORTED) -/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */ -extern PNG_EXPORT(void,png_set_expand) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(void,png_set_gray_1_2_4_to_8) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(void,png_set_palette_to_rgb) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(void,png_set_tRNS_to_alpha) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) -/* Use blue, green, red order for pixels. */ -extern PNG_EXPORT(void,png_set_bgr) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) -/* Expand the grayscale to 24-bit RGB if necessary. */ -extern PNG_EXPORT(void,png_set_gray_to_rgb) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) -/* Reduce RGB to grayscale. */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_rgb_to_gray) PNGARG((png_structp png_ptr, - int error_action, double red, double green )); -#endif -extern PNG_EXPORT(void,png_set_rgb_to_gray_fixed) PNGARG((png_structp png_ptr, - int error_action, png_fixed_point red, png_fixed_point green )); -extern PNG_EXPORT(png_byte,png_get_rgb_to_gray_status) PNGARG((png_structp - png_ptr)); -#endif - -extern PNG_EXPORT(void,png_build_grayscale_palette) PNGARG((int bit_depth, - png_colorp palette)); - -#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) -extern PNG_EXPORT(void,png_set_strip_alpha) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ - defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) -extern PNG_EXPORT(void,png_set_swap_alpha) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ - defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) -extern PNG_EXPORT(void,png_set_invert_alpha) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) -/* Add a filler byte to 24-bit RGB images. */ -extern PNG_EXPORT(void,png_set_filler) PNGARG((png_structp png_ptr, - png_uint_32 filler, int flags)); -/* The values of the PNG_FILLER_ defines should NOT be changed */ -#define PNG_FILLER_BEFORE 0 -#define PNG_FILLER_AFTER 1 -#endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */ - -#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) -/* Swap bytes in 16-bit depth files. */ -extern PNG_EXPORT(void,png_set_swap) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) -/* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */ -extern PNG_EXPORT(void,png_set_packing) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED) -/* Swap packing order of pixels in bytes. */ -extern PNG_EXPORT(void,png_set_packswap) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) -/* Converts files to legal bit depths. */ -extern PNG_EXPORT(void,png_set_shift) PNGARG((png_structp png_ptr, - png_color_8p true_bits)); -#endif - -#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ - defined(PNG_WRITE_INTERLACING_SUPPORTED) -/* Have the code handle the interlacing. Returns the number of passes. */ -extern PNG_EXPORT(int,png_set_interlace_handling) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) -/* Invert monochrome files */ -extern PNG_EXPORT(void,png_set_invert_mono) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) -/* Handle alpha and tRNS by replacing with a background color. */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_background) PNGARG((png_structp png_ptr, - png_color_16p background_color, int background_gamma_code, - int need_expand, double background_gamma)); -#endif -#define PNG_BACKGROUND_GAMMA_UNKNOWN 0 -#define PNG_BACKGROUND_GAMMA_SCREEN 1 -#define PNG_BACKGROUND_GAMMA_FILE 2 -#define PNG_BACKGROUND_GAMMA_UNIQUE 3 -#endif - -#if defined(PNG_READ_16_TO_8_SUPPORTED) -/* strip the second byte of information from a 16-bit depth file. */ -extern PNG_EXPORT(void,png_set_strip_16) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_DITHER_SUPPORTED) -/* Turn on dithering, and reduce the palette to the number of colors available. */ -extern PNG_EXPORT(void,png_set_dither) PNGARG((png_structp png_ptr, - png_colorp palette, int num_palette, int maximum_colors, - png_uint_16p histogram, int full_dither)); -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) -/* Handle gamma correction. Screen_gamma=(display_exponent) */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_gamma) PNGARG((png_structp png_ptr, - double screen_gamma, double default_file_gamma)); -#endif -#endif - -#if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ - defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) -/* Permit or disallow empty PLTE (0: not permitted, 1: permitted) */ -/* Deprecated and will be removed. Use png_permit_mng_features() instead. */ -extern PNG_EXPORT(void,png_permit_empty_plte) PNGARG((png_structp png_ptr, - int empty_plte_permitted)); -#endif - -#if defined(PNG_WRITE_FLUSH_SUPPORTED) -/* Set how many lines between output flushes - 0 for no flushing */ -extern PNG_EXPORT(void,png_set_flush) PNGARG((png_structp png_ptr, int nrows)); -/* Flush the current PNG output buffer */ -extern PNG_EXPORT(void,png_write_flush) PNGARG((png_structp png_ptr)); -#endif - -/* optional update palette with requested transformations */ -extern PNG_EXPORT(void,png_start_read_image) PNGARG((png_structp png_ptr)); - -/* optional call to update the users info structure */ -extern PNG_EXPORT(void,png_read_update_info) PNGARG((png_structp png_ptr, - png_infop info_ptr)); - -/* read one or more rows of image data. */ -extern PNG_EXPORT(void,png_read_rows) PNGARG((png_structp png_ptr, - png_bytepp row, png_bytepp display_row, png_uint_32 num_rows)); - -/* read a row of data. */ -extern PNG_EXPORT(void,png_read_row) PNGARG((png_structp png_ptr, - png_bytep row, - png_bytep display_row)); - -/* read the whole image into memory at once. */ -extern PNG_EXPORT(void,png_read_image) PNGARG((png_structp png_ptr, - png_bytepp image)); - -/* write a row of image data */ -extern PNG_EXPORT(void,png_write_row) PNGARG((png_structp png_ptr, - png_bytep row)); - -/* write a few rows of image data */ -extern PNG_EXPORT(void,png_write_rows) PNGARG((png_structp png_ptr, - png_bytepp row, png_uint_32 num_rows)); - -/* write the image data */ -extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr, - png_bytepp image)); - -/* writes the end of the PNG file. */ -extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr, - png_infop info_ptr)); - -/* read the end of the PNG file. */ -extern PNG_EXPORT(void,png_read_end) PNGARG((png_structp png_ptr, - png_infop info_ptr)); - -/* free any memory associated with the png_info_struct */ -extern PNG_EXPORT(void,png_destroy_info_struct) PNGARG((png_structp png_ptr, - png_infopp info_ptr_ptr)); - -/* free any memory associated with the png_struct and the png_info_structs */ -extern PNG_EXPORT(void,png_destroy_read_struct) PNGARG((png_structpp - png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)); - -/* free all memory used by the read (old method - NOT DLL EXPORTED) */ -extern void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr, - png_infop end_info_ptr)); - -/* free any memory associated with the png_struct and the png_info_structs */ -extern PNG_EXPORT(void,png_destroy_write_struct) - PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)); - -/* free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */ -extern void png_write_destroy PNGARG((png_structp png_ptr)); - -/* set the libpng method of handling chunk CRC errors */ -extern PNG_EXPORT(void,png_set_crc_action) PNGARG((png_structp png_ptr, - int crit_action, int ancil_action)); - -/* Values for png_set_crc_action() to say how to handle CRC errors in - * ancillary and critical chunks, and whether to use the data contained - * therein. Note that it is impossible to "discard" data in a critical - * chunk. For versions prior to 0.90, the action was always error/quit, - * whereas in version 0.90 and later, the action for CRC errors in ancillary - * chunks is warn/discard. These values should NOT be changed. - * - * value action:critical action:ancillary - */ -#define PNG_CRC_DEFAULT 0 /* error/quit warn/discard data */ -#define PNG_CRC_ERROR_QUIT 1 /* error/quit error/quit */ -#define PNG_CRC_WARN_DISCARD 2 /* (INVALID) warn/discard data */ -#define PNG_CRC_WARN_USE 3 /* warn/use data warn/use data */ -#define PNG_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */ -#define PNG_CRC_NO_CHANGE 5 /* use current value use current value */ - -/* These functions give the user control over the scan-line filtering in - * libpng and the compression methods used by zlib. These functions are - * mainly useful for testing, as the defaults should work with most users. - * Those users who are tight on memory or want faster performance at the - * expense of compression can modify them. See the compression library - * header file (zlib.h) for an explination of the compression functions. - */ - -/* set the filtering method(s) used by libpng. Currently, the only valid - * value for "method" is 0. - */ -extern PNG_EXPORT(void,png_set_filter) PNGARG((png_structp png_ptr, int method, - int filters)); - -/* Flags for png_set_filter() to say which filters to use. The flags - * are chosen so that they don't conflict with real filter types - * below, in case they are supplied instead of the #defined constants. - * These values should NOT be changed. - */ -#define PNG_NO_FILTERS 0x00 -#define PNG_FILTER_NONE 0x08 -#define PNG_FILTER_SUB 0x10 -#define PNG_FILTER_UP 0x20 -#define PNG_FILTER_AVG 0x40 -#define PNG_FILTER_PAETH 0x80 -#define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \ - PNG_FILTER_AVG | PNG_FILTER_PAETH) - -/* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now. - * These defines should NOT be changed. - */ -#define PNG_FILTER_VALUE_NONE 0 -#define PNG_FILTER_VALUE_SUB 1 -#define PNG_FILTER_VALUE_UP 2 -#define PNG_FILTER_VALUE_AVG 3 -#define PNG_FILTER_VALUE_PAETH 4 -#define PNG_FILTER_VALUE_LAST 5 - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) /* EXPERIMENTAL */ -/* The "heuristic_method" is given by one of the PNG_FILTER_HEURISTIC_ - * defines, either the default (minimum-sum-of-absolute-differences), or - * the experimental method (weighted-minimum-sum-of-absolute-differences). - * - * Weights are factors >= 1.0, indicating how important it is to keep the - * filter type consistent between rows. Larger numbers mean the current - * filter is that many times as likely to be the same as the "num_weights" - * previous filters. This is cumulative for each previous row with a weight. - * There needs to be "num_weights" values in "filter_weights", or it can be - * NULL if the weights aren't being specified. Weights have no influence on - * the selection of the first row filter. Well chosen weights can (in theory) - * improve the compression for a given image. - * - * Costs are factors >= 1.0 indicating the relative decoding costs of a - * filter type. Higher costs indicate more decoding expense, and are - * therefore less likely to be selected over a filter with lower computational - * costs. There needs to be a value in "filter_costs" for each valid filter - * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't - * setting the costs. Costs try to improve the speed of decompression without - * unduly increasing the compressed image size. - * - * A negative weight or cost indicates the default value is to be used, and - * values in the range [0.0, 1.0) indicate the value is to remain unchanged. - * The default values for both weights and costs are currently 1.0, but may - * change if good general weighting/cost heuristics can be found. If both - * the weights and costs are set to 1.0, this degenerates the WEIGHTED method - * to the UNWEIGHTED method, but with added encoding time/computation. - */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_filter_heuristics) PNGARG((png_structp png_ptr, - int heuristic_method, int num_weights, png_doublep filter_weights, - png_doublep filter_costs)); -#endif -#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */ - -/* Heuristic used for row filter selection. These defines should NOT be - * changed. - */ -#define PNG_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */ -#define PNG_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libpng < 0.95 */ -#define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */ -#define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */ - -/* Set the library compression level. Currently, valid values range from - * 0 - 9, corresponding directly to the zlib compression levels 0 - 9 - * (0 - no compression, 9 - "maximal" compression). Note that tests have - * shown that zlib compression levels 3-6 usually perform as well as level 9 - * for PNG images, and do considerably fewer caclulations. In the future, - * these values may not correspond directly to the zlib compression levels. - */ -extern PNG_EXPORT(void,png_set_compression_level) PNGARG((png_structp png_ptr, - int level)); - -extern PNG_EXPORT(void,png_set_compression_mem_level) - PNGARG((png_structp png_ptr, int mem_level)); - -extern PNG_EXPORT(void,png_set_compression_strategy) - PNGARG((png_structp png_ptr, int strategy)); - -extern PNG_EXPORT(void,png_set_compression_window_bits) - PNGARG((png_structp png_ptr, int window_bits)); - -extern PNG_EXPORT(void,png_set_compression_method) PNGARG((png_structp png_ptr, - int method)); - -/* These next functions are called for input/output, memory, and error - * handling. They are in the file pngrio.c, pngwio.c, and pngerror.c, - * and call standard C I/O routines such as fread(), fwrite(), and - * fprintf(). These functions can be made to use other I/O routines - * at run time for those applications that need to handle I/O in a - * different manner by calling png_set_???_fn(). See libpng.txt for - * more information. - */ - -#if !defined(PNG_NO_STDIO) -/* Initialize the input/output for the PNG file to the default functions. */ -extern PNG_EXPORT(void,png_init_io) PNGARG((png_structp png_ptr, png_FILE_p fp)); -#endif - -/* Replace the (error and abort), and warning functions with user - * supplied functions. If no messages are to be printed you must still - * write and use replacement functions. The replacement error_fn should - * still do a longjmp to the last setjmp location if you are using this - * method of error handling. If error_fn or warning_fn is NULL, the - * default function will be used. - */ - -extern PNG_EXPORT(void,png_set_error_fn) PNGARG((png_structp png_ptr, - png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)); - -/* Return the user pointer associated with the error functions */ -extern PNG_EXPORT(png_voidp,png_get_error_ptr) PNGARG((png_structp png_ptr)); - -/* Replace the default data output functions with a user supplied one(s). - * If buffered output is not used, then output_flush_fn can be set to NULL. - * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time - * output_flush_fn will be ignored (and thus can be NULL). - */ -extern PNG_EXPORT(void,png_set_write_fn) PNGARG((png_structp png_ptr, - png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)); - -/* Replace the default data input function with a user supplied one. */ -extern PNG_EXPORT(void,png_set_read_fn) PNGARG((png_structp png_ptr, - png_voidp io_ptr, png_rw_ptr read_data_fn)); - -/* Return the user pointer associated with the I/O functions */ -extern PNG_EXPORT(png_voidp,png_get_io_ptr) PNGARG((png_structp png_ptr)); - -extern PNG_EXPORT(void,png_set_read_status_fn) PNGARG((png_structp png_ptr, - png_read_status_ptr read_row_fn)); - -extern PNG_EXPORT(void,png_set_write_status_fn) PNGARG((png_structp png_ptr, - png_write_status_ptr write_row_fn)); - -#ifdef PNG_USER_MEM_SUPPORTED -/* Replace the default memory allocation functions with user supplied one(s). */ -extern PNG_EXPORT(void,png_set_mem_fn) PNGARG((png_structp png_ptr, - png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)); -/* Return the user pointer associated with the memory functions */ -extern PNG_EXPORT(png_voidp,png_get_mem_ptr) PNGARG((png_structp png_ptr)); -#endif - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) -extern PNG_EXPORT(void,png_set_read_user_transform_fn) PNGARG((png_structp - png_ptr, png_user_transform_ptr read_user_transform_fn)); -#endif - -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) -extern PNG_EXPORT(void,png_set_write_user_transform_fn) PNGARG((png_structp - png_ptr, png_user_transform_ptr write_user_transform_fn)); -#endif - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) -extern PNG_EXPORT(void,png_set_user_transform_info) PNGARG((png_structp - png_ptr, png_voidp user_transform_ptr, int user_transform_depth, - int user_transform_channels)); -/* Return the user pointer associated with the user transform functions */ -extern PNG_EXPORT(png_voidp,png_get_user_transform_ptr) - PNGARG((png_structp png_ptr)); -#endif - -#ifdef PNG_USER_CHUNKS_SUPPORTED -extern PNG_EXPORT(void,png_set_read_user_chunk_fn) PNGARG((png_structp png_ptr, - png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)); -extern PNG_EXPORT(png_voidp,png_get_user_chunk_ptr) PNGARG((png_structp - png_ptr)); -#endif - -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -/* Sets the function callbacks for the push reader, and a pointer to a - * user-defined structure available to the callback functions. - */ -extern PNG_EXPORT(void,png_set_progressive_read_fn) PNGARG((png_structp png_ptr, - png_voidp progressive_ptr, - png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, - png_progressive_end_ptr end_fn)); - -/* returns the user pointer associated with the push read functions */ -extern PNG_EXPORT(png_voidp,png_get_progressive_ptr) - PNGARG((png_structp png_ptr)); - -/* function to be called when data becomes available */ -extern PNG_EXPORT(void,png_process_data) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_bytep buffer, png_size_t buffer_size)); - -/* function that combines rows. Not very much different than the - * png_combine_row() call. Is this even used????? - */ -extern PNG_EXPORT(void,png_progressive_combine_row) PNGARG((png_structp png_ptr, - png_bytep old_row, png_bytep new_row)); -#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ - -extern PNG_EXPORT(png_voidp,png_malloc) PNGARG((png_structp png_ptr, - png_uint_32 size)); - -#if defined(PNG_1_0_X) -# define png_malloc_warn png_malloc -#else -/* Added at libpng version 1.2.4 */ -extern PNG_EXPORT(png_voidp,png_malloc_warn) PNGARG((png_structp png_ptr, - png_uint_32 size)); -#endif - -/* frees a pointer allocated by png_malloc() */ -extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr)); - -#if defined(PNG_1_0_X) -/* Function to allocate memory for zlib. */ -extern PNG_EXPORT(voidpf,png_zalloc) PNGARG((voidpf png_ptr, uInt items, - uInt size)); - -/* Function to free memory for zlib */ -extern PNG_EXPORT(void,png_zfree) PNGARG((voidpf png_ptr, voidpf ptr)); -#endif - -/* Free data that was allocated internally */ -extern PNG_EXPORT(void,png_free_data) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 free_me, int num)); -#ifdef PNG_FREE_ME_SUPPORTED -/* Reassign responsibility for freeing existing data, whether allocated - * by libpng or by the application */ -extern PNG_EXPORT(void,png_data_freer) PNGARG((png_structp png_ptr, - png_infop info_ptr, int freer, png_uint_32 mask)); -#endif -/* assignments for png_data_freer */ -#define PNG_DESTROY_WILL_FREE_DATA 1 -#define PNG_SET_WILL_FREE_DATA 1 -#define PNG_USER_WILL_FREE_DATA 2 -/* Flags for png_ptr->free_me and info_ptr->free_me */ -#define PNG_FREE_HIST 0x0008 -#define PNG_FREE_ICCP 0x0010 -#define PNG_FREE_SPLT 0x0020 -#define PNG_FREE_ROWS 0x0040 -#define PNG_FREE_PCAL 0x0080 -#define PNG_FREE_SCAL 0x0100 -#define PNG_FREE_UNKN 0x0200 -#define PNG_FREE_LIST 0x0400 -#define PNG_FREE_PLTE 0x1000 -#define PNG_FREE_TRNS 0x2000 -#define PNG_FREE_TEXT 0x4000 -#define PNG_FREE_ALL 0x7fff -#define PNG_FREE_MUL 0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */ - -#ifdef PNG_USER_MEM_SUPPORTED -extern PNG_EXPORT(png_voidp,png_malloc_default) PNGARG((png_structp png_ptr, - png_uint_32 size)); -extern PNG_EXPORT(void,png_free_default) PNGARG((png_structp png_ptr, - png_voidp ptr)); -#endif - -extern PNG_EXPORT(png_voidp,png_memcpy_check) PNGARG((png_structp png_ptr, - png_voidp s1, png_voidp s2, png_uint_32 size)); - -extern PNG_EXPORT(png_voidp,png_memset_check) PNGARG((png_structp png_ptr, - png_voidp s1, int value, png_uint_32 size)); - -#if defined(USE_FAR_KEYWORD) /* memory model conversion function */ -extern void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr, - int check)); -#endif /* USE_FAR_KEYWORD */ - -/* Fatal error in PNG image of libpng - can't continue */ -extern PNG_EXPORT(void,png_error) PNGARG((png_structp png_ptr, - png_const_charp error_message)); - -/* The same, but the chunk name is prepended to the error string. */ -extern PNG_EXPORT(void,png_chunk_error) PNGARG((png_structp png_ptr, - png_const_charp error_message)); - -/* Non-fatal error in libpng. Can continue, but may have a problem. */ -extern PNG_EXPORT(void,png_warning) PNGARG((png_structp png_ptr, - png_const_charp warning_message)); - -/* Non-fatal error in libpng, chunk name is prepended to message. */ -extern PNG_EXPORT(void,png_chunk_warning) PNGARG((png_structp png_ptr, - png_const_charp warning_message)); - -/* The png_set_ functions are for storing values in the png_info_struct. - * Similarly, the png_get_ calls are used to read values from the - * png_info_struct, either storing the parameters in the passed variables, or - * setting pointers into the png_info_struct where the data is stored. The - * png_get_ functions return a non-zero value if the data was available - * in info_ptr, or return zero and do not change any of the parameters if the - * data was not available. - * - * These functions should be used instead of directly accessing png_info - * to avoid problems with future changes in the size and internal layout of - * png_info_struct. - */ -/* Returns "flag" if chunk data is valid in info_ptr. */ -extern PNG_EXPORT(png_uint_32,png_get_valid) PNGARG((png_structp png_ptr, -png_infop info_ptr, png_uint_32 flag)); - -/* Returns number of bytes needed to hold a transformed row. */ -extern PNG_EXPORT(png_uint_32,png_get_rowbytes) PNGARG((png_structp png_ptr, -png_infop info_ptr)); - -#if defined(PNG_INFO_IMAGE_SUPPORTED) -/* Returns row_pointers, which is an array of pointers to scanlines that was -returned from png_read_png(). */ -extern PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((png_structp png_ptr, -png_infop info_ptr)); -/* Set row_pointers, which is an array of pointers to scanlines for use -by png_write_png(). */ -extern PNG_EXPORT(void,png_set_rows) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_bytepp row_pointers)); -#endif - -/* Returns number of color channels in image. */ -extern PNG_EXPORT(png_byte,png_get_channels) PNGARG((png_structp png_ptr, -png_infop info_ptr)); - -#ifdef PNG_EASY_ACCESS_SUPPORTED -/* Returns image width in pixels. */ -extern PNG_EXPORT(png_uint_32, png_get_image_width) PNGARG((png_structp -png_ptr, png_infop info_ptr)); - -/* Returns image height in pixels. */ -extern PNG_EXPORT(png_uint_32, png_get_image_height) PNGARG((png_structp -png_ptr, png_infop info_ptr)); - -/* Returns image bit_depth. */ -extern PNG_EXPORT(png_byte, png_get_bit_depth) PNGARG((png_structp -png_ptr, png_infop info_ptr)); - -/* Returns image color_type. */ -extern PNG_EXPORT(png_byte, png_get_color_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); - -/* Returns image filter_type. */ -extern PNG_EXPORT(png_byte, png_get_filter_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); - -/* Returns image interlace_type. */ -extern PNG_EXPORT(png_byte, png_get_interlace_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); - -/* Returns image compression_type. */ -extern PNG_EXPORT(png_byte, png_get_compression_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); - -/* Returns image resolution in pixels per meter, from pHYs chunk data. */ -extern PNG_EXPORT(png_uint_32, png_get_pixels_per_meter) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_uint_32, png_get_x_pixels_per_meter) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_uint_32, png_get_y_pixels_per_meter) PNGARG((png_structp -png_ptr, png_infop info_ptr)); - -/* Returns pixel aspect ratio, computed from pHYs chunk data. */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(float, png_get_pixel_aspect_ratio) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -#endif - -/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */ -extern PNG_EXPORT(png_int_32, png_get_x_offset_pixels) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_int_32, png_get_y_offset_pixels) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_int_32, png_get_x_offset_microns) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_int_32, png_get_y_offset_microns) PNGARG((png_structp -png_ptr, png_infop info_ptr)); - -#endif /* PNG_EASY_ACCESS_SUPPORTED */ - -/* Returns pointer to signature string read from PNG header */ -extern PNG_EXPORT(png_bytep,png_get_signature) PNGARG((png_structp png_ptr, -png_infop info_ptr)); - -#if defined(PNG_bKGD_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_bKGD) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_color_16p *background)); -#endif - -#if defined(PNG_bKGD_SUPPORTED) -extern PNG_EXPORT(void,png_set_bKGD) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_color_16p background)); -#endif - -#if defined(PNG_cHRM_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_cHRM) PNGARG((png_structp png_ptr, - png_infop info_ptr, double *white_x, double *white_y, double *red_x, - double *red_y, double *green_x, double *green_y, double *blue_x, - double *blue_y)); -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_cHRM_fixed) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_fixed_point *int_white_x, png_fixed_point - *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y, - png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point - *int_blue_x, png_fixed_point *int_blue_y)); -#endif -#endif - -#if defined(PNG_cHRM_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_cHRM) PNGARG((png_structp png_ptr, - png_infop info_ptr, double white_x, double white_y, double red_x, - double red_y, double green_x, double green_y, double blue_x, double blue_y)); -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_cHRM_fixed) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y, - png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point - int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, - png_fixed_point int_blue_y)); -#endif -#endif - -#if defined(PNG_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_gAMA) PNGARG((png_structp png_ptr, - png_infop info_ptr, double *file_gamma)); -#endif -extern PNG_EXPORT(png_uint_32,png_get_gAMA_fixed) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_fixed_point *int_file_gamma)); -#endif - -#if defined(PNG_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_gAMA) PNGARG((png_structp png_ptr, - png_infop info_ptr, double file_gamma)); -#endif -extern PNG_EXPORT(void,png_set_gAMA_fixed) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_fixed_point int_file_gamma)); -#endif - -#if defined(PNG_hIST_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_hIST) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_16p *hist)); -#endif - -#if defined(PNG_hIST_SUPPORTED) -extern PNG_EXPORT(void,png_set_hIST) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_16p hist)); -#endif - -extern PNG_EXPORT(png_uint_32,png_get_IHDR) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 *width, png_uint_32 *height, - int *bit_depth, int *color_type, int *interlace_method, - int *compression_method, int *filter_method)); - -extern PNG_EXPORT(void,png_set_IHDR) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, - int color_type, int interlace_method, int compression_method, - int filter_method)); - -#if defined(PNG_oFFs_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_oFFs) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, - int *unit_type)); -#endif - -#if defined(PNG_oFFs_SUPPORTED) -extern PNG_EXPORT(void,png_set_oFFs) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_int_32 offset_x, png_int_32 offset_y, - int unit_type)); -#endif - -#if defined(PNG_pCAL_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_pCAL) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1, - int *type, int *nparams, png_charp *units, png_charpp *params)); -#endif - -#if defined(PNG_pCAL_SUPPORTED) -extern PNG_EXPORT(void,png_set_pCAL) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1, - int type, int nparams, png_charp units, png_charpp params)); -#endif - -#if defined(PNG_pHYs_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_pHYs) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); -#endif - -#if defined(PNG_pHYs_SUPPORTED) -extern PNG_EXPORT(void,png_set_pHYs) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type)); -#endif - -extern PNG_EXPORT(png_uint_32,png_get_PLTE) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_colorp *palette, int *num_palette)); - -extern PNG_EXPORT(void,png_set_PLTE) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_colorp palette, int num_palette)); - -#if defined(PNG_sBIT_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_sBIT) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_color_8p *sig_bit)); -#endif - -#if defined(PNG_sBIT_SUPPORTED) -extern PNG_EXPORT(void,png_set_sBIT) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_color_8p sig_bit)); -#endif - -#if defined(PNG_sRGB_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_sRGB) PNGARG((png_structp png_ptr, - png_infop info_ptr, int *intent)); -#endif - -#if defined(PNG_sRGB_SUPPORTED) -extern PNG_EXPORT(void,png_set_sRGB) PNGARG((png_structp png_ptr, - png_infop info_ptr, int intent)); -extern PNG_EXPORT(void,png_set_sRGB_gAMA_and_cHRM) PNGARG((png_structp png_ptr, - png_infop info_ptr, int intent)); -#endif - -#if defined(PNG_iCCP_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_charpp name, int *compression_type, - png_charpp profile, png_uint_32 *proflen)); - /* Note to maintainer: profile should be png_bytepp */ -#endif - -#if defined(PNG_iCCP_SUPPORTED) -extern PNG_EXPORT(void,png_set_iCCP) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_charp name, int compression_type, - png_charp profile, png_uint_32 proflen)); - /* Note to maintainer: profile should be png_bytep */ -#endif - -#if defined(PNG_sPLT_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_sPLT) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_sPLT_tpp entries)); -#endif - -#if defined(PNG_sPLT_SUPPORTED) -extern PNG_EXPORT(void,png_set_sPLT) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_sPLT_tp entries, int nentries)); -#endif - -#if defined(PNG_TEXT_SUPPORTED) -/* png_get_text also returns the number of text chunks in *num_text */ -extern PNG_EXPORT(png_uint_32,png_get_text) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_textp *text_ptr, int *num_text)); -#endif - -/* - * Note while png_set_text() will accept a structure whose text, - * language, and translated keywords are NULL pointers, the structure - * returned by png_get_text will always contain regular - * zero-terminated C strings. They might be empty strings but - * they will never be NULL pointers. - */ - -#if defined(PNG_TEXT_SUPPORTED) -extern PNG_EXPORT(void,png_set_text) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_textp text_ptr, int num_text)); -#endif - -#if defined(PNG_tIME_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_tIME) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_timep *mod_time)); -#endif - -#if defined(PNG_tIME_SUPPORTED) -extern PNG_EXPORT(void,png_set_tIME) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_timep mod_time)); -#endif - -#if defined(PNG_tRNS_SUPPORTED) -extern PNG_EXPORT(png_uint_32,png_get_tRNS) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_bytep *trans, int *num_trans, - png_color_16p *trans_values)); -#endif - -#if defined(PNG_tRNS_SUPPORTED) -extern PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_bytep trans, int num_trans, - png_color_16p trans_values)); -#endif - -#if defined(PNG_tRNS_SUPPORTED) -#endif - -#if defined(PNG_sCAL_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_sCAL) PNGARG((png_structp png_ptr, - png_infop info_ptr, int *unit, double *width, double *height)); -#else -#ifdef PNG_FIXED_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_sCAL_s) PNGARG((png_structp png_ptr, - png_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight)); -#endif -#endif -#endif /* PNG_sCAL_SUPPORTED */ - -#if defined(PNG_sCAL_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_sCAL) PNGARG((png_structp png_ptr, - png_infop info_ptr, int unit, double width, double height)); -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_sCAL_s) PNGARG((png_structp png_ptr, - png_infop info_ptr, int unit, png_charp swidth, png_charp sheight)); -#endif -#endif /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */ - -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) -/* provide a list of chunks and how they are to be handled, if the built-in - handling or default unknown chunk handling is not desired. Any chunks not - listed will be handled in the default manner. The IHDR and IEND chunks - must not be listed. - keep = 0: follow default behavour - = 1: do not keep - = 2: keep only if safe-to-copy - = 3: keep even if unsafe-to-copy -*/ -extern PNG_EXPORT(void, png_set_keep_unknown_chunks) PNGARG((png_structp - png_ptr, int keep, png_bytep chunk_list, int num_chunks)); -extern PNG_EXPORT(void, png_set_unknown_chunks) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns)); -extern PNG_EXPORT(void, png_set_unknown_chunk_location) - PNGARG((png_structp png_ptr, png_infop info_ptr, int chunk, int location)); -extern PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_structp - png_ptr, png_infop info_ptr, png_unknown_chunkpp entries)); -#endif -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep - chunk_name)); -#endif - -/* Png_free_data() will turn off the "valid" flag for anything it frees. - If you need to turn it off for a chunk that your application has freed, - you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); */ -extern PNG_EXPORT(void, png_set_invalid) PNGARG((png_structp png_ptr, - png_infop info_ptr, int mask)); - -#if defined(PNG_INFO_IMAGE_SUPPORTED) -/* The "params" pointer is currently not used and is for future expansion. */ -extern PNG_EXPORT(void, png_read_png) PNGARG((png_structp png_ptr, - png_infop info_ptr, - int transforms, - png_voidp params)); -extern PNG_EXPORT(void, png_write_png) PNGARG((png_structp png_ptr, - png_infop info_ptr, - int transforms, - png_voidp params)); -#endif - -/* Define PNG_DEBUG at compile time for debugging information. Higher - * numbers for PNG_DEBUG mean more debugging information. This has - * only been added since version 0.95 so it is not implemented throughout - * libpng yet, but more support will be added as needed. - */ -#ifdef PNG_DEBUG -#if (PNG_DEBUG > 0) -#if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER) -#include -#if (PNG_DEBUG > 1) -#define png_debug(l,m) _RPT0(_CRT_WARN,m) -#define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m,p1) -#define png_debug2(l,m,p1,p2) _RPT2(_CRT_WARN,m,p1,p2) -#endif -#else /* PNG_DEBUG_FILE || !_MSC_VER */ -#ifndef PNG_DEBUG_FILE -#define PNG_DEBUG_FILE stderr -#endif /* PNG_DEBUG_FILE */ -#if (PNG_DEBUG > 1) -#define png_debug(l,m) \ -{ \ - int num_tabs=l; \ - fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \ - (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \ -} -#define png_debug1(l,m,p1) \ -{ \ - int num_tabs=l; \ - fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \ - (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \ -} -#define png_debug2(l,m,p1,p2) \ -{ \ - int num_tabs=l; \ - fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \ - (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \ -} -#endif /* (PNG_DEBUG > 1) */ -#endif /* _MSC_VER */ -#endif /* (PNG_DEBUG > 0) */ -#endif /* PNG_DEBUG */ -#ifndef png_debug -#define png_debug(l, m) -#endif -#ifndef png_debug1 -#define png_debug1(l, m, p1) -#endif -#ifndef png_debug2 -#define png_debug2(l, m, p1, p2) -#endif - -extern PNG_EXPORT(png_bytep,png_sig_bytes) PNGARG((void)); - -extern PNG_EXPORT(png_charp,png_get_copyright) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(png_charp,png_get_header_ver) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(png_charp,png_get_header_version) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr)); - -#ifdef PNG_MNG_FEATURES_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp - png_ptr, png_uint_32 mng_features_permitted)); -#endif - -/* Added to version 1.2.0 */ -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) -#define PNG_ASM_FLAG_MMX_SUPPORT_COMPILED 0x01 /* not user-settable */ -#define PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU 0x02 /* not user-settable */ -#define PNG_ASM_FLAG_MMX_READ_COMBINE_ROW 0x04 -#define PNG_ASM_FLAG_MMX_READ_INTERLACE 0x08 -#define PNG_ASM_FLAG_MMX_READ_FILTER_SUB 0x10 -#define PNG_ASM_FLAG_MMX_READ_FILTER_UP 0x20 -#define PNG_ASM_FLAG_MMX_READ_FILTER_AVG 0x40 -#define PNG_ASM_FLAG_MMX_READ_FILTER_PAETH 0x80 -#define PNG_ASM_FLAGS_INITIALIZED 0x80000000 /* not user-settable */ - -#define PNG_MMX_READ_FLAGS ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \ - | PNG_ASM_FLAG_MMX_READ_INTERLACE \ - | PNG_ASM_FLAG_MMX_READ_FILTER_SUB \ - | PNG_ASM_FLAG_MMX_READ_FILTER_UP \ - | PNG_ASM_FLAG_MMX_READ_FILTER_AVG \ - | PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ) -#define PNG_MMX_WRITE_FLAGS ( 0 ) - -#define PNG_MMX_FLAGS ( PNG_ASM_FLAG_MMX_SUPPORT_COMPILED \ - | PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU \ - | PNG_MMX_READ_FLAGS \ - | PNG_MMX_WRITE_FLAGS ) - -#define PNG_SELECT_READ 1 -#define PNG_SELECT_WRITE 2 - - -#if !defined(PNG_1_0_X) -/* pngget.c */ -extern PNG_EXPORT(png_uint_32,png_get_mmx_flagmask) - PNGARG((int flag_select, int *compilerID)); - -/* pngget.c */ -extern PNG_EXPORT(png_uint_32,png_get_asm_flagmask) - PNGARG((int flag_select)); - -/* pngget.c */ -extern PNG_EXPORT(png_uint_32,png_get_asm_flags) - PNGARG((png_structp png_ptr)); - -/* pngget.c */ -extern PNG_EXPORT(png_byte,png_get_mmx_bitdepth_threshold) - PNGARG((png_structp png_ptr)); - -/* pngget.c */ -extern PNG_EXPORT(png_uint_32,png_get_mmx_rowbytes_threshold) - PNGARG((png_structp png_ptr)); - -/* pngset.c */ -extern PNG_EXPORT(void,png_set_asm_flags) - PNGARG((png_structp png_ptr, png_uint_32 asm_flags)); - -/* pngset.c */ -extern PNG_EXPORT(void,png_set_mmx_thresholds) - PNGARG((png_structp png_ptr, png_byte mmx_bitdepth_threshold, - png_uint_32 mmx_rowbytes_threshold)); - -#endif /* PNG_1_0_X */ -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ - -#if !defined(PNG_1_0_X) -/* png.c, pnggccrd.c, or pngvcrd.c */ -extern PNG_EXPORT(int,png_mmx_support) PNGARG((void)); - -/* Strip the prepended error numbers ("#nnn ") from error and warning - * messages before passing them to the error or warning handler. */ -#ifdef PNG_ERROR_NUMBERS_SUPPORTED -extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp - png_ptr, png_uint_32 strip_mode)); -#endif -#endif /* PNG_1_0_X */ - -/* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */ - -#define PNG_HEADER_VERSION_STRING \ - " libpng version 1.2.5 - October 3, 2002 (header)\n" - -#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED -/* With these routines we avoid an integer divide, which will be slower on - * most machines. However, it does take more operations than the corresponding - * divide method, so it may be slower on a few RISC systems. There are two - * shifts (by 8 or 16 bits) and an addition, versus a single integer divide. - * - * Note that the rounding factors are NOT supposed to be the same! 128 and - * 32768 are correct for the NODIV code; 127 and 32767 are correct for the - * standard method. - * - * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ] - */ - - /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */ - -# define png_composite(composite, fg, alpha, bg) \ - { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) * (png_uint_16)(alpha) \ - + (png_uint_16)(bg)*(png_uint_16)(255 - \ - (png_uint_16)(alpha)) + (png_uint_16)128); \ - (composite) = (png_byte)((temp + (temp >> 8)) >> 8); } - -# define png_composite_16(composite, fg, alpha, bg) \ - { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) * (png_uint_32)(alpha) \ - + (png_uint_32)(bg)*(png_uint_32)(65535L - \ - (png_uint_32)(alpha)) + (png_uint_32)32768L); \ - (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); } - -#else /* standard method using integer division */ - -# define png_composite(composite, fg, alpha, bg) \ - (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) + \ - (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ - (png_uint_16)127) / 255) - -# define png_composite_16(composite, fg, alpha, bg) \ - (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \ - (png_uint_32)(bg)*(png_uint_32)(65535L - (png_uint_32)(alpha)) + \ - (png_uint_32)32767) / (png_uint_32)65535L) - -#endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */ - -/* These next functions are used internally in the code. They generally - * shouldn't be used unless you are writing code to add or replace some - * functionality in libpng. More information about most functions can - * be found in the files where the functions are located. - */ - -#if defined(PNG_INTERNAL) - -/* Various modes of operation. Note that after an init, mode is set to - * zero automatically when the structure is created. - */ -#define PNG_HAVE_IHDR 0x01 -#define PNG_HAVE_PLTE 0x02 -#define PNG_HAVE_IDAT 0x04 -#define PNG_AFTER_IDAT 0x08 -#define PNG_HAVE_IEND 0x10 -#define PNG_HAVE_gAMA 0x20 -#define PNG_HAVE_cHRM 0x40 -#define PNG_HAVE_sRGB 0x80 -#define PNG_HAVE_CHUNK_HEADER 0x100 -#define PNG_WROTE_tIME 0x200 -#define PNG_WROTE_INFO_BEFORE_PLTE 0x400 -#define PNG_BACKGROUND_IS_GRAY 0x800 -#define PNG_HAVE_PNG_SIGNATURE 0x1000 - -/* flags for the transformations the PNG library does on the image data */ -#define PNG_BGR 0x0001 -#define PNG_INTERLACE 0x0002 -#define PNG_PACK 0x0004 -#define PNG_SHIFT 0x0008 -#define PNG_SWAP_BYTES 0x0010 -#define PNG_INVERT_MONO 0x0020 -#define PNG_DITHER 0x0040 -#define PNG_BACKGROUND 0x0080 -#define PNG_BACKGROUND_EXPAND 0x0100 - /* 0x0200 unused */ -#define PNG_16_TO_8 0x0400 -#define PNG_RGBA 0x0800 -#define PNG_EXPAND 0x1000 -#define PNG_GAMMA 0x2000 -#define PNG_GRAY_TO_RGB 0x4000 -#define PNG_FILLER 0x8000L -#define PNG_PACKSWAP 0x10000L -#define PNG_SWAP_ALPHA 0x20000L -#define PNG_STRIP_ALPHA 0x40000L -#define PNG_INVERT_ALPHA 0x80000L -#define PNG_USER_TRANSFORM 0x100000L -#define PNG_RGB_TO_GRAY_ERR 0x200000L -#define PNG_RGB_TO_GRAY_WARN 0x400000L -#define PNG_RGB_TO_GRAY 0x600000L /* two bits, RGB_TO_GRAY_ERR|WARN */ - -/* flags for png_create_struct */ -#define PNG_STRUCT_PNG 0x0001 -#define PNG_STRUCT_INFO 0x0002 - -/* Scaling factor for filter heuristic weighting calculations */ -#define PNG_WEIGHT_SHIFT 8 -#define PNG_WEIGHT_FACTOR (1<<(PNG_WEIGHT_SHIFT)) -#define PNG_COST_SHIFT 3 -#define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT)) - -/* flags for the png_ptr->flags rather than declaring a byte for each one */ -#define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001 -#define PNG_FLAG_ZLIB_CUSTOM_LEVEL 0x0002 -#define PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL 0x0004 -#define PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS 0x0008 -#define PNG_FLAG_ZLIB_CUSTOM_METHOD 0x0010 -#define PNG_FLAG_ZLIB_FINISHED 0x0020 -#define PNG_FLAG_ROW_INIT 0x0040 -#define PNG_FLAG_FILLER_AFTER 0x0080 -#define PNG_FLAG_CRC_ANCILLARY_USE 0x0100 -#define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200 -#define PNG_FLAG_CRC_CRITICAL_USE 0x0400 -#define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800 -#define PNG_FLAG_FREE_PLTE 0x1000 -#define PNG_FLAG_FREE_TRNS 0x2000 -#define PNG_FLAG_FREE_HIST 0x4000 -#define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000L -#define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000L -#define PNG_FLAG_LIBRARY_MISMATCH 0x20000L -#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000L -#define PNG_FLAG_STRIP_ERROR_TEXT 0x80000L -#define PNG_FLAG_MALLOC_NULL_MEM_OK 0x100000L - -/* For use in png_set_keep_unknown, png_handle_as_unknown */ -#define HANDLE_CHUNK_AS_DEFAULT 0 -#define HANDLE_CHUNK_NEVER 1 -#define HANDLE_CHUNK_IF_SAFE 2 -#define HANDLE_CHUNK_ALWAYS 3 - -#define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \ - PNG_FLAG_CRC_ANCILLARY_NOWARN) - -#define PNG_FLAG_CRC_CRITICAL_MASK (PNG_FLAG_CRC_CRITICAL_USE | \ - PNG_FLAG_CRC_CRITICAL_IGNORE) - -#define PNG_FLAG_CRC_MASK (PNG_FLAG_CRC_ANCILLARY_MASK | \ - PNG_FLAG_CRC_CRITICAL_MASK) - -/* save typing and make code easier to understand */ -#define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \ - abs((int)((c1).green) - (int)((c2).green)) + \ - abs((int)((c1).blue) - (int)((c2).blue))) - -/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */ -#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN) -/* place to hold the signature string for a PNG file. */ -#ifdef PNG_USE_GLOBAL_ARRAYS - PNG_EXPORT_VAR (const png_byte FARDATA) png_sig[8]; -#else -#define png_sig png_sig_bytes(NULL) -#endif -#endif /* PNG_NO_EXTERN */ - -/* Constant strings for known chunk types. If you need to add a chunk, - * define the name here, and add an invocation of the macro in png.c and - * wherever it's needed. - */ -#define PNG_IHDR const png_byte png_IHDR[5] = { 73, 72, 68, 82, '\0'} -#define PNG_IDAT const png_byte png_IDAT[5] = { 73, 68, 65, 84, '\0'} -#define PNG_IEND const png_byte png_IEND[5] = { 73, 69, 78, 68, '\0'} -#define PNG_PLTE const png_byte png_PLTE[5] = { 80, 76, 84, 69, '\0'} -#define PNG_bKGD const png_byte png_bKGD[5] = { 98, 75, 71, 68, '\0'} -#define PNG_cHRM const png_byte png_cHRM[5] = { 99, 72, 82, 77, '\0'} -#define PNG_gAMA const png_byte png_gAMA[5] = {103, 65, 77, 65, '\0'} -#define PNG_hIST const png_byte png_hIST[5] = {104, 73, 83, 84, '\0'} -#define PNG_iCCP const png_byte png_iCCP[5] = {105, 67, 67, 80, '\0'} -#define PNG_iTXt const png_byte png_iTXt[5] = {105, 84, 88, 116, '\0'} -#define PNG_oFFs const png_byte png_oFFs[5] = {111, 70, 70, 115, '\0'} -#define PNG_pCAL const png_byte png_pCAL[5] = {112, 67, 65, 76, '\0'} -#define PNG_sCAL const png_byte png_sCAL[5] = {115, 67, 65, 76, '\0'} -#define PNG_pHYs const png_byte png_pHYs[5] = {112, 72, 89, 115, '\0'} -#define PNG_sBIT const png_byte png_sBIT[5] = {115, 66, 73, 84, '\0'} -#define PNG_sPLT const png_byte png_sPLT[5] = {115, 80, 76, 84, '\0'} -#define PNG_sRGB const png_byte png_sRGB[5] = {115, 82, 71, 66, '\0'} -#define PNG_tEXt const png_byte png_tEXt[5] = {116, 69, 88, 116, '\0'} -#define PNG_tIME const png_byte png_tIME[5] = {116, 73, 77, 69, '\0'} -#define PNG_tRNS const png_byte png_tRNS[5] = {116, 82, 78, 83, '\0'} -#define PNG_zTXt const png_byte png_zTXt[5] = {122, 84, 88, 116, '\0'} - -#ifdef PNG_USE_GLOBAL_ARRAYS -PNG_EXPORT_VAR (const png_byte FARDATA) png_IHDR[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_IDAT[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_IEND[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_PLTE[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_bKGD[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_cHRM[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_gAMA[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_hIST[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_iCCP[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_iTXt[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_oFFs[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_pCAL[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_sCAL[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_pHYs[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_sBIT[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_sPLT[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_sRGB[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_tEXt[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_tIME[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_tRNS[5]; -PNG_EXPORT_VAR (const png_byte FARDATA) png_zTXt[5]; -#endif /* PNG_USE_GLOBAL_ARRAYS */ - - -/* Inline macros to do direct reads of bytes from the input buffer. These - * require that you are using an architecture that uses PNG byte ordering - * (MSB first) and supports unaligned data storage. I think that PowerPC - * in big-endian mode and 680x0 are the only ones that will support this. - * The x86 line of processors definitely do not. The png_get_int_32() - * routine also assumes we are using two's complement format for negative - * values, which is almost certainly true. - */ -#if defined(PNG_READ_BIG_ENDIAN_SUPPORTED) -# if defined(PNG_pCAL_SUPPORTED) || defined(PNG_oFFs_SUPPORTED) -# define png_get_int_32(buf) ( *((png_int_32p) (buf))) -# endif -# define png_get_uint_32(buf) ( *((png_uint_32p) (buf))) -# define png_get_uint_16(buf) ( *((png_uint_16p) (buf))) -#else -# if defined(PNG_pCAL_SUPPORTED) || defined(PNG_oFFs_SUPPORTED) -PNG_EXTERN png_int_32 png_get_int_32 PNGARG((png_bytep buf)); -# endif -PNG_EXTERN png_uint_32 png_get_uint_32 PNGARG((png_bytep buf)); -PNG_EXTERN png_uint_16 png_get_uint_16 PNGARG((png_bytep buf)); -#endif /* !PNG_READ_BIG_ENDIAN_SUPPORTED */ - -/* Initialize png_ptr struct for reading, and allocate any other memory. - * (old interface - DEPRECATED - use png_create_read_struct instead). - */ -extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr)); -#undef png_read_init -#define png_read_init(png_ptr) png_read_init_3(&png_ptr, \ - PNG_LIBPNG_VER_STRING, sizeof(png_struct)); -extern PNG_EXPORT(void,png_read_init_3) PNGARG((png_structpp ptr_ptr, - png_const_charp user_png_ver, png_size_t png_struct_size)); -extern PNG_EXPORT(void,png_read_init_2) PNGARG((png_structp png_ptr, - png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t - png_info_size)); - -/* Initialize png_ptr struct for writing, and allocate any other memory. - * (old interface - DEPRECATED - use png_create_write_struct instead). - */ -extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr)); -#undef png_write_init -#define png_write_init(png_ptr) png_write_init_3(&png_ptr, \ - PNG_LIBPNG_VER_STRING, sizeof(png_struct)); -extern PNG_EXPORT(void,png_write_init_3) PNGARG((png_structpp ptr_ptr, - png_const_charp user_png_ver, png_size_t png_struct_size)); -extern PNG_EXPORT(void,png_write_init_2) PNGARG((png_structp png_ptr, - png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t - png_info_size)); - -/* Allocate memory for an internal libpng struct */ -PNG_EXTERN png_voidp png_create_struct PNGARG((int type)); - -/* Free memory from internal libpng struct */ -PNG_EXTERN void png_destroy_struct PNGARG((png_voidp struct_ptr)); - -PNG_EXTERN png_voidp png_create_struct_2 PNGARG((int type, png_malloc_ptr - malloc_fn, png_voidp mem_ptr)); -PNG_EXTERN void png_destroy_struct_2 PNGARG((png_voidp struct_ptr, - png_free_ptr free_fn, png_voidp mem_ptr)); - -/* Free any memory that info_ptr points to and reset struct. */ -PNG_EXTERN void png_info_destroy PNGARG((png_structp png_ptr, - png_infop info_ptr)); - -#ifndef PNG_1_0_X -/* Function to allocate memory for zlib. */ -PNG_EXTERN voidpf png_zalloc PNGARG((voidpf png_ptr, uInt items, uInt size)); - -/* Function to free memory for zlib */ -PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr)); - -/* Next four functions are used internally as callbacks. PNGAPI is required - * but not PNG_EXPORT. PNGAPI added at libpng version 1.2.3. */ - -PNG_EXTERN void PNGAPI png_default_read_data PNGARG((png_structp png_ptr, - png_bytep data, png_size_t length)); - -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -PNG_EXTERN void PNGAPI png_push_fill_buffer PNGARG((png_structp png_ptr, - png_bytep buffer, png_size_t length)); -#endif - -PNG_EXTERN void PNGAPI png_default_write_data PNGARG((png_structp png_ptr, - png_bytep data, png_size_t length)); - -#if defined(PNG_WRITE_FLUSH_SUPPORTED) -#if !defined(PNG_NO_STDIO) -PNG_EXTERN void PNGAPI png_default_flush PNGARG((png_structp png_ptr)); -#endif -#endif -#else /* PNG_1_0_X */ -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -PNG_EXTERN void png_push_fill_buffer PNGARG((png_structp png_ptr, - png_bytep buffer, png_size_t length)); -#endif -#endif /* PNG_1_0_X */ - -/* Reset the CRC variable */ -PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr)); - -/* Write the "data" buffer to whatever output you are using. */ -PNG_EXTERN void png_write_data PNGARG((png_structp png_ptr, png_bytep data, - png_size_t length)); - -/* Read data from whatever input you are using into the "data" buffer */ -PNG_EXTERN void png_read_data PNGARG((png_structp png_ptr, png_bytep data, - png_size_t length)); - -/* Read bytes into buf, and update png_ptr->crc */ -PNG_EXTERN void png_crc_read PNGARG((png_structp png_ptr, png_bytep buf, - png_size_t length)); - -/* Decompress data in a chunk that uses compression */ -#if defined(PNG_zTXt_SUPPORTED) || defined(PNG_iTXt_SUPPORTED) || \ - defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) -PNG_EXTERN png_charp png_decompress_chunk PNGARG((png_structp png_ptr, - int comp_type, png_charp chunkdata, png_size_t chunklength, - png_size_t prefix_length, png_size_t *data_length)); -#endif - -/* Read "skip" bytes, read the file crc, and (optionally) verify png_ptr->crc */ -PNG_EXTERN int png_crc_finish PNGARG((png_structp png_ptr, png_uint_32 skip)); - -/* Read the CRC from the file and compare it to the libpng calculated CRC */ -PNG_EXTERN int png_crc_error PNGARG((png_structp png_ptr)); - -/* Calculate the CRC over a section of data. Note that we are only - * passing a maximum of 64K on systems that have this as a memory limit, - * since this is the maximum buffer size we can specify. - */ -PNG_EXTERN void png_calculate_crc PNGARG((png_structp png_ptr, png_bytep ptr, - png_size_t length)); - -#if defined(PNG_WRITE_FLUSH_SUPPORTED) -PNG_EXTERN void png_flush PNGARG((png_structp png_ptr)); -#endif - - -/* Place a 32-bit number into a buffer in PNG byte order (big-endian). - * The only currently known PNG chunks that use signed numbers are - * the ancillary extension chunks, oFFs and pCAL. - */ -PNG_EXTERN void png_save_uint_32 PNGARG((png_bytep buf, png_uint_32 i)); - -#if defined(PNG_WRITE_pCAL_SUPPORTED) || defined(PNG_WRITE_oFFs_SUPPORTED) -PNG_EXTERN void png_save_int_32 PNGARG((png_bytep buf, png_int_32 i)); -#endif - -/* Place a 16-bit number into a buffer in PNG byte order. - * The parameter is declared unsigned int, not png_uint_16, - * just to avoid potential problems on pre-ANSI C compilers. - */ -PNG_EXTERN void png_save_uint_16 PNGARG((png_bytep buf, unsigned int i)); - -/* simple function to write the signature */ -PNG_EXTERN void png_write_sig PNGARG((png_structp png_ptr)); - -/* write various chunks */ - -/* Write the IHDR chunk, and update the png_struct with the necessary - * information. - */ -PNG_EXTERN void png_write_IHDR PNGARG((png_structp png_ptr, png_uint_32 width, - png_uint_32 height, - int bit_depth, int color_type, int compression_method, int filter_method, - int interlace_method)); - -PNG_EXTERN void png_write_PLTE PNGARG((png_structp png_ptr, png_colorp palette, - png_uint_32 num_pal)); - -PNG_EXTERN void png_write_IDAT PNGARG((png_structp png_ptr, png_bytep data, - png_size_t length)); - -PNG_EXTERN void png_write_IEND PNGARG((png_structp png_ptr)); - -#if defined(PNG_WRITE_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -PNG_EXTERN void png_write_gAMA PNGARG((png_structp png_ptr, double file_gamma)); -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED -PNG_EXTERN void png_write_gAMA_fixed PNGARG((png_structp png_ptr, png_fixed_point - file_gamma)); -#endif -#endif - -#if defined(PNG_WRITE_sBIT_SUPPORTED) -PNG_EXTERN void png_write_sBIT PNGARG((png_structp png_ptr, png_color_8p sbit, - int color_type)); -#endif - -#if defined(PNG_WRITE_cHRM_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -PNG_EXTERN void png_write_cHRM PNGARG((png_structp png_ptr, - double white_x, double white_y, - double red_x, double red_y, double green_x, double green_y, - double blue_x, double blue_y)); -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED -PNG_EXTERN void png_write_cHRM_fixed PNGARG((png_structp png_ptr, - png_fixed_point int_white_x, png_fixed_point int_white_y, - png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point - int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, - png_fixed_point int_blue_y)); -#endif -#endif - -#if defined(PNG_WRITE_sRGB_SUPPORTED) -PNG_EXTERN void png_write_sRGB PNGARG((png_structp png_ptr, - int intent)); -#endif - -#if defined(PNG_WRITE_iCCP_SUPPORTED) -PNG_EXTERN void png_write_iCCP PNGARG((png_structp png_ptr, - png_charp name, int compression_type, - png_charp profile, int proflen)); - /* Note to maintainer: profile should be png_bytep */ -#endif - -#if defined(PNG_WRITE_sPLT_SUPPORTED) -PNG_EXTERN void png_write_sPLT PNGARG((png_structp png_ptr, - png_sPLT_tp palette)); -#endif - -#if defined(PNG_WRITE_tRNS_SUPPORTED) -PNG_EXTERN void png_write_tRNS PNGARG((png_structp png_ptr, png_bytep trans, - png_color_16p values, int number, int color_type)); -#endif - -#if defined(PNG_WRITE_bKGD_SUPPORTED) -PNG_EXTERN void png_write_bKGD PNGARG((png_structp png_ptr, - png_color_16p values, int color_type)); -#endif - -#if defined(PNG_WRITE_hIST_SUPPORTED) -PNG_EXTERN void png_write_hIST PNGARG((png_structp png_ptr, png_uint_16p hist, - int num_hist)); -#endif - -#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \ - defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED) -PNG_EXTERN png_size_t png_check_keyword PNGARG((png_structp png_ptr, - png_charp key, png_charpp new_key)); -#endif - -#if defined(PNG_WRITE_tEXt_SUPPORTED) -PNG_EXTERN void png_write_tEXt PNGARG((png_structp png_ptr, png_charp key, - png_charp text, png_size_t text_len)); -#endif - -#if defined(PNG_WRITE_zTXt_SUPPORTED) -PNG_EXTERN void png_write_zTXt PNGARG((png_structp png_ptr, png_charp key, - png_charp text, png_size_t text_len, int compression)); -#endif - -#if defined(PNG_WRITE_iTXt_SUPPORTED) -PNG_EXTERN void png_write_iTXt PNGARG((png_structp png_ptr, - int compression, png_charp key, png_charp lang, png_charp lang_key, - png_charp text)); -#endif - -#if defined(PNG_TEXT_SUPPORTED) /* Added at version 1.0.14 and 1.2.4 */ -PNG_EXTERN int png_set_text_2 PNGARG((png_structp png_ptr, - png_infop info_ptr, png_textp text_ptr, int num_text)); -#endif - -#if defined(PNG_WRITE_oFFs_SUPPORTED) -PNG_EXTERN void png_write_oFFs PNGARG((png_structp png_ptr, - png_int_32 x_offset, png_int_32 y_offset, int unit_type)); -#endif - -#if defined(PNG_WRITE_pCAL_SUPPORTED) -PNG_EXTERN void png_write_pCAL PNGARG((png_structp png_ptr, png_charp purpose, - png_int_32 X0, png_int_32 X1, int type, int nparams, - png_charp units, png_charpp params)); -#endif - -#if defined(PNG_WRITE_pHYs_SUPPORTED) -PNG_EXTERN void png_write_pHYs PNGARG((png_structp png_ptr, - png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit, - int unit_type)); -#endif - -#if defined(PNG_WRITE_tIME_SUPPORTED) -PNG_EXTERN void png_write_tIME PNGARG((png_structp png_ptr, - png_timep mod_time)); -#endif - -#if defined(PNG_WRITE_sCAL_SUPPORTED) -#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO) -PNG_EXTERN void png_write_sCAL PNGARG((png_structp png_ptr, - int unit, double width, double height)); -#else -#ifdef PNG_FIXED_POINT_SUPPORTED -PNG_EXTERN void png_write_sCAL_s PNGARG((png_structp png_ptr, - int unit, png_charp width, png_charp height)); -#endif -#endif -#endif - -/* Called when finished processing a row of data */ -PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr)); - -/* Internal use only. Called before first row of data */ -PNG_EXTERN void png_write_start_row PNGARG((png_structp png_ptr)); - -#if defined(PNG_READ_GAMMA_SUPPORTED) -PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr)); -#endif - -/* combine a row of data, dealing with alpha, etc. if requested */ -PNG_EXTERN void png_combine_row PNGARG((png_structp png_ptr, png_bytep row, - int mask)); - -#if defined(PNG_READ_INTERLACING_SUPPORTED) -/* expand an interlaced row */ -/* OLD pre-1.0.9 interface: -PNG_EXTERN void png_do_read_interlace PNGARG((png_row_infop row_info, - png_bytep row, int pass, png_uint_32 transformations)); - */ -PNG_EXTERN void png_do_read_interlace PNGARG((png_structp png_ptr)); -#endif - -/* GRR TO DO (2.0 or whenever): simplify other internal calling interfaces */ - -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) -/* grab pixels out of a row for an interlaced pass */ -PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info, - png_bytep row, int pass)); -#endif - -/* unfilter a row */ -PNG_EXTERN void png_read_filter_row PNGARG((png_structp png_ptr, - png_row_infop row_info, png_bytep row, png_bytep prev_row, int filter)); - -/* Choose the best filter to use and filter the row data */ -PNG_EXTERN void png_write_find_filter PNGARG((png_structp png_ptr, - png_row_infop row_info)); - -/* Write out the filtered row. */ -PNG_EXTERN void png_write_filtered_row PNGARG((png_structp png_ptr, - png_bytep filtered_row)); -/* finish a row while reading, dealing with interlacing passes, etc. */ -PNG_EXTERN void png_read_finish_row PNGARG((png_structp png_ptr)); - -/* initialize the row buffers, etc. */ -PNG_EXTERN void png_read_start_row PNGARG((png_structp png_ptr)); -/* optional call to update the users info structure */ -PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr, - png_infop info_ptr)); - -/* these are the functions that do the transformations */ -#if defined(PNG_READ_FILLER_SUPPORTED) -PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info, - png_bytep row, png_uint_32 filler, png_uint_32 flags)); -#endif - -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) -PNG_EXTERN void png_do_read_swap_alpha PNGARG((png_row_infop row_info, - png_bytep row)); -#endif - -#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) -PNG_EXTERN void png_do_write_swap_alpha PNGARG((png_row_infop row_info, - png_bytep row)); -#endif - -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) -PNG_EXTERN void png_do_read_invert_alpha PNGARG((png_row_infop row_info, - png_bytep row)); -#endif - -#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) -PNG_EXTERN void png_do_write_invert_alpha PNGARG((png_row_infop row_info, - png_bytep row)); -#endif - -#if defined(PNG_WRITE_FILLER_SUPPORTED) || \ - defined(PNG_READ_STRIP_ALPHA_SUPPORTED) -PNG_EXTERN void png_do_strip_filler PNGARG((png_row_infop row_info, - png_bytep row, png_uint_32 flags)); -#endif - -#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) -PNG_EXTERN void png_do_swap PNGARG((png_row_infop row_info, png_bytep row)); -#endif - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED) -PNG_EXTERN void png_do_packswap PNGARG((png_row_infop row_info, png_bytep row)); -#endif - -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) -PNG_EXTERN int png_do_rgb_to_gray PNGARG((png_structp png_ptr, png_row_infop - row_info, png_bytep row)); -#endif - -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) -PNG_EXTERN void png_do_gray_to_rgb PNGARG((png_row_infop row_info, - png_bytep row)); -#endif - -#if defined(PNG_READ_PACK_SUPPORTED) -PNG_EXTERN void png_do_unpack PNGARG((png_row_infop row_info, png_bytep row)); -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) -PNG_EXTERN void png_do_unshift PNGARG((png_row_infop row_info, png_bytep row, - png_color_8p sig_bits)); -#endif - -#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) -PNG_EXTERN void png_do_invert PNGARG((png_row_infop row_info, png_bytep row)); -#endif - -#if defined(PNG_READ_16_TO_8_SUPPORTED) -PNG_EXTERN void png_do_chop PNGARG((png_row_infop row_info, png_bytep row)); -#endif - -#if defined(PNG_READ_DITHER_SUPPORTED) -PNG_EXTERN void png_do_dither PNGARG((png_row_infop row_info, - png_bytep row, png_bytep palette_lookup, png_bytep dither_lookup)); - -# if defined(PNG_CORRECT_PALETTE_SUPPORTED) -PNG_EXTERN void png_correct_palette PNGARG((png_structp png_ptr, - png_colorp palette, int num_palette)); -# endif -#endif - -#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) -PNG_EXTERN void png_do_bgr PNGARG((png_row_infop row_info, png_bytep row)); -#endif - -#if defined(PNG_WRITE_PACK_SUPPORTED) -PNG_EXTERN void png_do_pack PNGARG((png_row_infop row_info, - png_bytep row, png_uint_32 bit_depth)); -#endif - -#if defined(PNG_WRITE_SHIFT_SUPPORTED) -PNG_EXTERN void png_do_shift PNGARG((png_row_infop row_info, png_bytep row, - png_color_8p bit_depth)); -#endif - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) -#if defined(PNG_READ_GAMMA_SUPPORTED) -PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row, - png_color_16p trans_values, png_color_16p background, - png_color_16p background_1, - png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1, - png_uint_16pp gamma_16, png_uint_16pp gamma_16_from_1, - png_uint_16pp gamma_16_to_1, int gamma_shift)); -#else -PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row, - png_color_16p trans_values, png_color_16p background)); -#endif -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) -PNG_EXTERN void png_do_gamma PNGARG((png_row_infop row_info, png_bytep row, - png_bytep gamma_table, png_uint_16pp gamma_16_table, - int gamma_shift)); -#endif - -#if defined(PNG_READ_EXPAND_SUPPORTED) -PNG_EXTERN void png_do_expand_palette PNGARG((png_row_infop row_info, - png_bytep row, png_colorp palette, png_bytep trans, int num_trans)); -PNG_EXTERN void png_do_expand PNGARG((png_row_infop row_info, - png_bytep row, png_color_16p trans_value)); -#endif - -/* The following decodes the appropriate chunks, and does error correction, - * then calls the appropriate callback for the chunk if it is valid. - */ - -/* decode the IHDR chunk */ -PNG_EXTERN void png_handle_IHDR PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -PNG_EXTERN void png_handle_PLTE PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -PNG_EXTERN void png_handle_IEND PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); - -#if defined(PNG_READ_bKGD_SUPPORTED) -PNG_EXTERN void png_handle_bKGD PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_cHRM_SUPPORTED) -PNG_EXTERN void png_handle_cHRM PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_gAMA_SUPPORTED) -PNG_EXTERN void png_handle_gAMA PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_hIST_SUPPORTED) -PNG_EXTERN void png_handle_hIST PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_iCCP_SUPPORTED) -extern void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif /* PNG_READ_iCCP_SUPPORTED */ - -#if defined(PNG_READ_iTXt_SUPPORTED) -PNG_EXTERN void png_handle_iTXt PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_oFFs_SUPPORTED) -PNG_EXTERN void png_handle_oFFs PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_pCAL_SUPPORTED) -PNG_EXTERN void png_handle_pCAL PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_pHYs_SUPPORTED) -PNG_EXTERN void png_handle_pHYs PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_sBIT_SUPPORTED) -PNG_EXTERN void png_handle_sBIT PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_sCAL_SUPPORTED) -PNG_EXTERN void png_handle_sCAL PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_sPLT_SUPPORTED) -extern void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif /* PNG_READ_sPLT_SUPPORTED */ - -#if defined(PNG_READ_sRGB_SUPPORTED) -PNG_EXTERN void png_handle_sRGB PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_tEXt_SUPPORTED) -PNG_EXTERN void png_handle_tEXt PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_tIME_SUPPORTED) -PNG_EXTERN void png_handle_tIME PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_tRNS_SUPPORTED) -PNG_EXTERN void png_handle_tRNS PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -#if defined(PNG_READ_zTXt_SUPPORTED) -PNG_EXTERN void png_handle_zTXt PNGARG((png_structp png_ptr, png_infop info_ptr, - png_uint_32 length)); -#endif - -PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 length)); - -PNG_EXTERN void png_check_chunk_name PNGARG((png_structp png_ptr, - png_bytep chunk_name)); - -/* handle the transformations for reading and writing */ -PNG_EXTERN void png_do_read_transformations PNGARG((png_structp png_ptr)); -PNG_EXTERN void png_do_write_transformations PNGARG((png_structp png_ptr)); - -PNG_EXTERN void png_init_read_transformations PNGARG((png_structp png_ptr)); - -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -PNG_EXTERN void png_push_read_chunk PNGARG((png_structp png_ptr, - png_infop info_ptr)); -PNG_EXTERN void png_push_read_sig PNGARG((png_structp png_ptr, - png_infop info_ptr)); -PNG_EXTERN void png_push_check_crc PNGARG((png_structp png_ptr)); -PNG_EXTERN void png_push_crc_skip PNGARG((png_structp png_ptr, - png_uint_32 length)); -PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr)); -PNG_EXTERN void png_push_save_buffer PNGARG((png_structp png_ptr)); -PNG_EXTERN void png_push_restore_buffer PNGARG((png_structp png_ptr, - png_bytep buffer, png_size_t buffer_length)); -PNG_EXTERN void png_push_read_IDAT PNGARG((png_structp png_ptr)); -PNG_EXTERN void png_process_IDAT_data PNGARG((png_structp png_ptr, - png_bytep buffer, png_size_t buffer_length)); -PNG_EXTERN void png_push_process_row PNGARG((png_structp png_ptr)); -PNG_EXTERN void png_push_handle_unknown PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 length)); -PNG_EXTERN void png_push_have_info PNGARG((png_structp png_ptr, - png_infop info_ptr)); -PNG_EXTERN void png_push_have_end PNGARG((png_structp png_ptr, - png_infop info_ptr)); -PNG_EXTERN void png_push_have_row PNGARG((png_structp png_ptr, png_bytep row)); -PNG_EXTERN void png_push_read_end PNGARG((png_structp png_ptr, - png_infop info_ptr)); -PNG_EXTERN void png_process_some_data PNGARG((png_structp png_ptr, - png_infop info_ptr)); -PNG_EXTERN void png_read_push_finish_row PNGARG((png_structp png_ptr)); -#if defined(PNG_READ_tEXt_SUPPORTED) -PNG_EXTERN void png_push_handle_tEXt PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 length)); -PNG_EXTERN void png_push_read_tEXt PNGARG((png_structp png_ptr, - png_infop info_ptr)); -#endif -#if defined(PNG_READ_zTXt_SUPPORTED) -PNG_EXTERN void png_push_handle_zTXt PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 length)); -PNG_EXTERN void png_push_read_zTXt PNGARG((png_structp png_ptr, - png_infop info_ptr)); -#endif -#if defined(PNG_READ_iTXt_SUPPORTED) -PNG_EXTERN void png_push_handle_iTXt PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 length)); -PNG_EXTERN void png_push_read_iTXt PNGARG((png_structp png_ptr, - png_infop info_ptr)); -#endif - -#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ - -#ifdef PNG_MNG_FEATURES_SUPPORTED -PNG_EXTERN void png_do_read_intrapixel PNGARG((png_row_infop row_info, - png_bytep row)); -PNG_EXTERN void png_do_write_intrapixel PNGARG((png_row_infop row_info, - png_bytep row)); -#endif - -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) -/* png.c */ /* PRIVATE */ -PNG_EXTERN void png_init_mmx_flags PNGARG((png_structp png_ptr)); -#endif -/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */ - -#endif /* PNG_INTERNAL */ - -#ifdef __cplusplus -} -#endif - -#endif /* PNG_VERSION_INFO_ONLY */ -/* do not put anything past this line */ -#endif /* PNG_H */ +/* png.h - header file for PNG reference library + * + * libpng version 1.2.5 - October 3, 2002 + * Copyright (c) 1998-2002 Glenn Randers-Pehrson + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * + * Authors and maintainers: + * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat + * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger + * libpng versions 0.97, January 1998, through 1.2.5 - October 3, 2002: Glenn + * See also "Contributing Authors", below. + * + * Note about libpng version numbers: + * + * Due to various miscommunications, unforeseen code incompatibilities + * and occasional factors outside the authors' control, version numbering + * on the library has not always been consistent and straightforward. + * The following table summarizes matters since version 0.89c, which was + * the first widely used release: + * + * source png.h png.h shared-lib + * version string int version + * ------- ------ ----- ---------- + * 0.89c "1.0 beta 3" 0.89 89 1.0.89 + * 0.90 "1.0 beta 4" 0.90 90 0.90 [should have been 2.0.90] + * 0.95 "1.0 beta 5" 0.95 95 0.95 [should have been 2.0.95] + * 0.96 "1.0 beta 6" 0.96 96 0.96 [should have been 2.0.96] + * 0.97b "1.00.97 beta 7" 1.00.97 97 1.0.1 [should have been 2.0.97] + * 0.97c 0.97 97 2.0.97 + * 0.98 0.98 98 2.0.98 + * 0.99 0.99 98 2.0.99 + * 0.99a-m 0.99 99 2.0.99 + * 1.00 1.00 100 2.1.0 [100 should be 10000] + * 1.0.0 (from here on, the 100 2.1.0 [100 should be 10000] + * 1.0.1 png.h string is 10001 2.1.0 + * 1.0.1a-e identical to the 10002 from here on, the shared library + * 1.0.2 source version) 10002 is 2.V where V is the source code + * 1.0.2a-b 10003 version, except as noted. + * 1.0.3 10003 + * 1.0.3a-d 10004 + * 1.0.4 10004 + * 1.0.4a-f 10005 + * 1.0.5 (+ 2 patches) 10005 + * 1.0.5a-d 10006 + * 1.0.5e-r 10100 (not source compatible) + * 1.0.5s-v 10006 (not binary compatible) + * 1.0.6 (+ 3 patches) 10006 (still binary incompatible) + * 1.0.6d-f 10007 (still binary incompatible) + * 1.0.6g 10007 + * 1.0.6h 10007 10.6h (testing xy.z so-numbering) + * 1.0.6i 10007 10.6i + * 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0) + * 1.0.7beta11-14 DLLNUM 10007 2.1.0.7beta11-14 (binary compatible) + * 1.0.7beta15-18 1 10007 2.1.0.7beta15-18 (binary compatible) + * 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible) + * 1.0.7 1 10007 (still compatible) + * 1.0.8beta1-4 1 10008 2.1.0.8beta1-4 + * 1.0.8rc1 1 10008 2.1.0.8rc1 + * 1.0.8 1 10008 2.1.0.8 + * 1.0.9beta1-6 1 10009 2.1.0.9beta1-6 + * 1.0.9rc1 1 10009 2.1.0.9rc1 + * 1.0.9beta7-10 1 10009 2.1.0.9beta7-10 + * 1.0.9rc2 1 10009 2.1.0.9rc2 + * 1.0.9 1 10009 2.1.0.9 + * 1.0.10beta1 1 10010 2.1.0.10beta1 + * 1.0.10rc1 1 10010 2.1.0.10rc1 + * 1.0.10 1 10010 2.1.0.10 + * 1.0.11beta1-3 1 10011 2.1.0.11beta1-3 + * 1.0.11rc1 1 10011 2.1.0.11rc1 + * 1.0.11 1 10011 2.1.0.11 + * 1.0.12beta1-2 2 10012 2.1.0.12beta1-2 + * 1.0.12rc1 2 10012 2.1.0.12rc1 + * 1.0.12 2 10012 2.1.0.12 + * 1.1.0a-f - 10100 2.1.1.0a-f (branch abandoned) + * 1.2.0beta1-2 2 10200 2.1.2.0beta1-2 + * 1.2.0beta3-5 3 10200 3.1.2.0beta3-5 + * 1.2.0rc1 3 10200 3.1.2.0rc1 + * 1.2.0 3 10200 3.1.2.0 + * 1.2.1beta1-4 3 10201 3.1.2.1beta1-4 + * 1.2.1rc1-2 3 10201 3.1.2.1rc1-2 + * 1.2.1 3 10201 3.1.2.1 + * 1.2.2beta1-6 12 10202 12.so.0.1.2.2beta1-6 + * 1.0.13beta1 10 10013 10.so.0.1.0.13beta1 + * 1.0.13rc1 10 10013 10.so.0.1.0.13rc1 + * 1.2.2rc1 12 10202 12.so.0.1.2.2rc1 + * 1.0.13 10 10013 10.so.0.1.0.13 + * 1.2.2 12 10202 12.so.0.1.2.2 + * 1.2.3rc1-6 12 10203 12.so.0.1.2.3rc1-6 + * 1.2.3 12 10203 12.so.0.1.2.3 + * 1.2.4beta1-3 13 10204 12.so.0.1.2.4beta1-3 + * 1.0.14rc1 13 10014 10.so.0.1.0.14rc1 + * 1.2.4rc1 13 10204 12.so.0.1.2.4rc1 + * 1.0.14 10 10014 10.so.0.1.0.14 + * 1.2.4 13 10204 12.so.0.1.2.4 + * 1.2.5beta1-2 13 10205 12.so.0.1.2.5beta1-2 + * 1.0.15rc1-3 10 10015 10.so.0.1.0.15rc1-3 + * 1.2.5rc1-3 13 10205 12.so.0.1.2.5rc1-3 + * 1.0.15 10 10015 10.so.0.1.0.15 + * 1.2.5 13 10205 12.so.0.1.2.5 + * + * Henceforth the source version will match the shared-library major + * and minor numbers; the shared-library major version number will be + * used for changes in backward compatibility, as it is intended. The + * PNG_LIBPNG_VER macro, which is not used within libpng but is available + * for applications, is an unsigned integer of the form xyyzz corresponding + * to the source version x.y.z (leading zeros in y and z). Beta versions + * were given the previous public release number plus a letter, until + * version 1.0.6j; from then on they were given the upcoming public + * release number plus "betaNN" or "rcN". + * + * Binary incompatibility exists only when applications make direct access + * to the info_ptr or png_ptr members through png.h, and the compiled + * application is loaded with a different version of the library. + * + * DLLNUM will change each time there are forward or backward changes + * in binary compatibility (e.g., when a new feature is added). + * + * See libpng.txt or libpng.3 for more information. The PNG specification + * is available as RFC 2083 + * and as a W3C Recommendation + */ + +/* + * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: + * + * If you modify libpng you may insert additional notices immediately following + * this sentence. + * + * libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are + * Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are + * distributed according to the same disclaimer and license as libpng-1.0.6 + * with the following individuals added to the list of Contributing Authors + * + * Simon-Pierre Cadieux + * Eric S. Raymond + * Gilles Vollant + * + * and with the following additions to the disclaimer: + * + * There is no warranty against interference with your enjoyment of the + * library or against infringement. There is no warranty that our + * efforts or the library will fulfill any of your particular purposes + * or needs. This library is provided with all faults, and the entire + * risk of satisfactory quality, performance, accuracy, and effort is with + * the user. + * + * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are + * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson + * Distributed according to the same disclaimer and license as libpng-0.96, + * with the following individuals added to the list of Contributing Authors: + * + * Tom Lane + * Glenn Randers-Pehrson + * Willem van Schaik + * + * libpng versions 0.89, June 1996, through 0.96, May 1997, are + * Copyright (c) 1996, 1997 Andreas Dilger + * Distributed according to the same disclaimer and license as libpng-0.88, + * with the following individuals added to the list of Contributing Authors: + * + * John Bowler + * Kevin Bracey + * Sam Bushell + * Magnus Holmgren + * Greg Roelofs + * Tom Tanner + * + * libpng versions 0.5, May 1995, through 0.88, January 1996, are + * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. + * + * For the purposes of this copyright and license, "Contributing Authors" + * is defined as the following set of individuals: + * + * Andreas Dilger + * Dave Martindale + * Guy Eric Schalnat + * Paul Schmidt + * Tim Wegner + * + * The PNG Reference Library is supplied "AS IS". The Contributing Authors + * and Group 42, Inc. disclaim all warranties, expressed or implied, + * including, without limitation, the warranties of merchantability and of + * fitness for any purpose. The Contributing Authors and Group 42, Inc. + * assume no liability for direct, indirect, incidental, special, exemplary, + * or consequential damages, which may result from the use of the PNG + * Reference Library, even if advised of the possibility of such damage. + * + * Permission is hereby granted to use, copy, modify, and distribute this + * source code, or portions hereof, for any purpose, without fee, subject + * to the following restrictions: + * + * 1. The origin of this source code must not be misrepresented. + * + * 2. Altered versions must be plainly marked as such and + * must not be misrepresented as being the original source. + * + * 3. This Copyright notice may not be removed or altered from + * any source or altered source distribution. + * + * The Contributing Authors and Group 42, Inc. specifically permit, without + * fee, and encourage the use of this source code as a component to + * supporting the PNG file format in commercial products. If you use this + * source code in a product, acknowledgment is not required but would be + * appreciated. + */ + +/* + * A "png_get_copyright" function is available, for convenient use in "about" + * boxes and the like: + * + * printf("%s",png_get_copyright(NULL)); + * + * Also, the PNG logo (in PNG format, of course) is supplied in the + * files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). + */ + +/* + * Libpng is OSI Certified Open Source Software. OSI Certified is a + * certification mark of the Open Source Initiative. + */ + +/* + * The contributing authors would like to thank all those who helped + * with testing, bug fixes, and patience. This wouldn't have been + * possible without all of you. + * + * Thanks to Frank J. T. Wojcik for helping with the documentation. + */ + +/* + * Y2K compliance in libpng: + * ========================= + * + * October 3, 2002 + * + * Since the PNG Development group is an ad-hoc body, we can't make + * an official declaration. + * + * This is your unofficial assurance that libpng from version 0.71 and + * upward through 1.2.5 are Y2K compliant. It is my belief that earlier + * versions were also Y2K compliant. + * + * Libpng only has three year fields. One is a 2-byte unsigned integer + * that will hold years up to 65535. The other two hold the date in text + * format, and will hold years up to 9999. + * + * The integer is + * "png_uint_16 year" in png_time_struct. + * + * The strings are + * "png_charp time_buffer" in png_struct and + * "near_time_buffer", which is a local character string in png.c. + * + * There are seven time-related functions: + * png.c: png_convert_to_rfc_1123() in png.c + * (formerly png_convert_to_rfc_1152() in error) + * png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c + * png_convert_from_time_t() in pngwrite.c + * png_get_tIME() in pngget.c + * png_handle_tIME() in pngrutil.c, called in pngread.c + * png_set_tIME() in pngset.c + * png_write_tIME() in pngwutil.c, called in pngwrite.c + * + * All handle dates properly in a Y2K environment. The + * png_convert_from_time_t() function calls gmtime() to convert from system + * clock time, which returns (year - 1900), which we properly convert to + * the full 4-digit year. There is a possibility that applications using + * libpng are not passing 4-digit years into the png_convert_to_rfc_1123() + * function, or that they are incorrectly passing only a 2-digit year + * instead of "year - 1900" into the png_convert_from_struct_tm() function, + * but this is not under our control. The libpng documentation has always + * stated that it works with 4-digit years, and the APIs have been + * documented as such. + * + * The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned + * integer to hold the year, and can hold years as large as 65535. + * + * zlib, upon which libpng depends, is also Y2K compliant. It contains + * no date-related code. + * + * Glenn Randers-Pehrson + * libpng maintainer + * PNG Development Group + */ + +#ifndef PNG_H +#define PNG_H + +/* This is not the place to learn how to use libpng. The file libpng.txt + * describes how to use libpng, and the file example.c summarizes it + * with some code on which to build. This file is useful for looking + * at the actual function definitions and structure components. + */ + +/* Version information for png.h - this should match the version in png.c */ +#define PNG_LIBPNG_VER_STRING "1.2.5" + +#define PNG_LIBPNG_VER_SONUM 0 +#define PNG_LIBPNG_VER_DLLNUM %DLLNUM% + +/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ +#define PNG_LIBPNG_VER_MAJOR 1 +#define PNG_LIBPNG_VER_MINOR 2 +#define PNG_LIBPNG_VER_RELEASE 5 +/* This should match the numeric part of the final component of + * PNG_LIBPNG_VER_STRING, omitting any leading zero: */ + +#define PNG_LIBPNG_VER_BUILD 0 + +#define PNG_LIBPNG_BUILD_ALPHA 1 +#define PNG_LIBPNG_BUILD_BETA 2 +#define PNG_LIBPNG_BUILD_RC 3 +#define PNG_LIBPNG_BUILD_STABLE 4 +#define PNG_LIBPNG_BUILD_TYPEMASK 7 +#define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with STABLE only */ +#define PNG_LIBPNG_BUILD_TYPE 4 + +/* Careful here. At one time, Guy wanted to use 082, but that would be octal. + * We must not include leading zeros. + * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only + * version 1.0.0 was mis-numbered 100 instead of 10000). From + * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */ +#define PNG_LIBPNG_VER 10205 /* 1.2.5 */ + +#ifndef PNG_VERSION_INFO_ONLY + +/* include the compression library's header */ +#include "zlib.h" + +/* include all user configurable info, including optional assembler routines */ +#include "pngconf.h" + +/* Inhibit C++ name-mangling for libpng functions but not for system calls. */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* This file is arranged in several sections. The first section contains + * structure and type definitions. The second section contains the external + * library functions, while the third has the internal library functions, + * which applications aren't expected to use directly. + */ + +#ifndef PNG_NO_TYPECAST_NULL +#define int_p_NULL (int *)NULL +#define png_bytep_NULL (png_bytep)NULL +#define png_bytepp_NULL (png_bytepp)NULL +#define png_doublep_NULL (png_doublep)NULL +#define png_error_ptr_NULL (png_error_ptr)NULL +#define png_flush_ptr_NULL (png_flush_ptr)NULL +#define png_free_ptr_NULL (png_free_ptr)NULL +#define png_infopp_NULL (png_infopp)NULL +#define png_malloc_ptr_NULL (png_malloc_ptr)NULL +#define png_read_status_ptr_NULL (png_read_status_ptr)NULL +#define png_rw_ptr_NULL (png_rw_ptr)NULL +#define png_structp_NULL (png_structp)NULL +#define png_uint_16p_NULL (png_uint_16p)NULL +#define png_voidp_NULL (png_voidp)NULL +#define png_write_status_ptr_NULL (png_write_status_ptr)NULL +#else +#define int_p_NULL NULL +#define png_bytep_NULL NULL +#define png_bytepp_NULL NULL +#define png_doublep_NULL NULL +#define png_error_ptr_NULL NULL +#define png_flush_ptr_NULL NULL +#define png_free_ptr_NULL NULL +#define png_infopp_NULL NULL +#define png_malloc_ptr_NULL NULL +#define png_read_status_ptr_NULL NULL +#define png_rw_ptr_NULL NULL +#define png_structp_NULL NULL +#define png_uint_16p_NULL NULL +#define png_voidp_NULL NULL +#define png_write_status_ptr_NULL NULL +#endif + +/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */ +#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN) +/* Version information for C files, stored in png.c. This had better match + * the version above. + */ +#ifdef PNG_USE_GLOBAL_ARRAYS +PNG_EXPORT_VAR (const char) png_libpng_ver[18]; + /* need room for 99.99.99beta99z */ +#else +#define png_libpng_ver png_get_header_ver(NULL) +#endif + +#ifdef PNG_USE_GLOBAL_ARRAYS +/* This was removed in version 1.0.5c */ +/* Structures to facilitate easy interlacing. See png.c for more details */ +PNG_EXPORT_VAR (const int FARDATA) png_pass_start[7]; +PNG_EXPORT_VAR (const int FARDATA) png_pass_inc[7]; +PNG_EXPORT_VAR (const int FARDATA) png_pass_ystart[7]; +PNG_EXPORT_VAR (const int FARDATA) png_pass_yinc[7]; +PNG_EXPORT_VAR (const int FARDATA) png_pass_mask[7]; +PNG_EXPORT_VAR (const int FARDATA) png_pass_dsp_mask[7]; +#ifdef PNG_HAVE_ASSEMBLER_COMBINE_ROW +PNG_EXPORT_VAR (const int FARDATA) png_pass_width[7]; +#endif +/* This isn't currently used. If you need it, see png.c for more details. +PNG_EXPORT_VAR (const int FARDATA) png_pass_height[7]; +*/ +#endif + +#endif /* PNG_NO_EXTERN */ + +/* Three color definitions. The order of the red, green, and blue, (and the + * exact size) is not important, although the size of the fields need to + * be png_byte or png_uint_16 (as defined below). + */ +typedef struct png_color_struct +{ + png_byte red; + png_byte green; + png_byte blue; +} png_color; +typedef png_color FAR * png_colorp; +typedef png_color FAR * FAR * png_colorpp; + +typedef struct png_color_16_struct +{ + png_byte index; /* used for palette files */ + png_uint_16 red; /* for use in red green blue files */ + png_uint_16 green; + png_uint_16 blue; + png_uint_16 gray; /* for use in grayscale files */ +} png_color_16; +typedef png_color_16 FAR * png_color_16p; +typedef png_color_16 FAR * FAR * png_color_16pp; + +typedef struct png_color_8_struct +{ + png_byte red; /* for use in red green blue files */ + png_byte green; + png_byte blue; + png_byte gray; /* for use in grayscale files */ + png_byte alpha; /* for alpha channel files */ +} png_color_8; +typedef png_color_8 FAR * png_color_8p; +typedef png_color_8 FAR * FAR * png_color_8pp; + +/* + * The following two structures are used for the in-core representation + * of sPLT chunks. + */ +typedef struct png_sPLT_entry_struct +{ + png_uint_16 red; + png_uint_16 green; + png_uint_16 blue; + png_uint_16 alpha; + png_uint_16 frequency; +} png_sPLT_entry; +typedef png_sPLT_entry FAR * png_sPLT_entryp; +typedef png_sPLT_entry FAR * FAR * png_sPLT_entrypp; + +/* When the depth of the sPLT palette is 8 bits, the color and alpha samples + * occupy the LSB of their respective members, and the MSB of each member + * is zero-filled. The frequency member always occupies the full 16 bits. + */ + +typedef struct png_sPLT_struct +{ + png_charp name; /* palette name */ + png_byte depth; /* depth of palette samples */ + png_sPLT_entryp entries; /* palette entries */ + png_int_32 nentries; /* number of palette entries */ +} png_sPLT_t; +typedef png_sPLT_t FAR * png_sPLT_tp; +typedef png_sPLT_t FAR * FAR * png_sPLT_tpp; + +#ifdef PNG_TEXT_SUPPORTED +/* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file, + * and whether that contents is compressed or not. The "key" field + * points to a regular zero-terminated C string. The "text", "lang", and + * "lang_key" fields can be regular C strings, empty strings, or NULL pointers. + * However, the * structure returned by png_get_text() will always contain + * regular zero-terminated C strings (possibly empty), never NULL pointers, + * so they can be safely used in printf() and other string-handling functions. + */ +typedef struct png_text_struct +{ + int compression; /* compression value: + -1: tEXt, none + 0: zTXt, deflate + 1: iTXt, none + 2: iTXt, deflate */ + png_charp key; /* keyword, 1-79 character description of "text" */ + png_charp text; /* comment, may be an empty string (ie "") + or a NULL pointer */ + png_size_t text_length; /* length of the text string */ +#ifdef PNG_iTXt_SUPPORTED + png_size_t itxt_length; /* length of the itxt string */ + png_charp lang; /* language code, 0-79 characters + or a NULL pointer */ + png_charp lang_key; /* keyword translated UTF-8 string, 0 or more + chars or a NULL pointer */ +#endif +} png_text; +typedef png_text FAR * png_textp; +typedef png_text FAR * FAR * png_textpp; +#endif + +/* Supported compression types for text in PNG files (tEXt, and zTXt). + * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. */ +#define PNG_TEXT_COMPRESSION_NONE_WR -3 +#define PNG_TEXT_COMPRESSION_zTXt_WR -2 +#define PNG_TEXT_COMPRESSION_NONE -1 +#define PNG_TEXT_COMPRESSION_zTXt 0 +#define PNG_ITXT_COMPRESSION_NONE 1 +#define PNG_ITXT_COMPRESSION_zTXt 2 +#define PNG_TEXT_COMPRESSION_LAST 3 /* Not a valid value */ + +/* png_time is a way to hold the time in an machine independent way. + * Two conversions are provided, both from time_t and struct tm. There + * is no portable way to convert to either of these structures, as far + * as I know. If you know of a portable way, send it to me. As a side + * note - PNG has always been Year 2000 compliant! + */ +typedef struct png_time_struct +{ + png_uint_16 year; /* full year, as in, 1995 */ + png_byte month; /* month of year, 1 - 12 */ + png_byte day; /* day of month, 1 - 31 */ + png_byte hour; /* hour of day, 0 - 23 */ + png_byte minute; /* minute of hour, 0 - 59 */ + png_byte second; /* second of minute, 0 - 60 (for leap seconds) */ +} png_time; +typedef png_time FAR * png_timep; +typedef png_time FAR * FAR * png_timepp; + +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) +/* png_unknown_chunk is a structure to hold queued chunks for which there is + * no specific support. The idea is that we can use this to queue + * up private chunks for output even though the library doesn't actually + * know about their semantics. + */ +typedef struct png_unknown_chunk_t +{ + png_byte name[5]; + png_byte *data; + png_size_t size; + + /* libpng-using applications should NOT directly modify this byte. */ + png_byte location; /* mode of operation at read time */ +} +png_unknown_chunk; +typedef png_unknown_chunk FAR * png_unknown_chunkp; +typedef png_unknown_chunk FAR * FAR * png_unknown_chunkpp; +#endif + +/* png_info is a structure that holds the information in a PNG file so + * that the application can find out the characteristics of the image. + * If you are reading the file, this structure will tell you what is + * in the PNG file. If you are writing the file, fill in the information + * you want to put into the PNG file, then call png_write_info(). + * The names chosen should be very close to the PNG specification, so + * consult that document for information about the meaning of each field. + * + * With libpng < 0.95, it was only possible to directly set and read the + * the values in the png_info_struct, which meant that the contents and + * order of the values had to remain fixed. With libpng 0.95 and later, + * however, there are now functions that abstract the contents of + * png_info_struct from the application, so this makes it easier to use + * libpng with dynamic libraries, and even makes it possible to use + * libraries that don't have all of the libpng ancillary chunk-handing + * functionality. + * + * In any case, the order of the parameters in png_info_struct should NOT + * be changed for as long as possible to keep compatibility with applications + * that use the old direct-access method with png_info_struct. + * + * The following members may have allocated storage attached that should be + * cleaned up before the structure is discarded: palette, trans, text, + * pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile, + * splt_palettes, scal_unit, row_pointers, and unknowns. By default, these + * are automatically freed when the info structure is deallocated, if they were + * allocated internally by libpng. This behavior can be changed by means + * of the png_data_freer() function. + * + * More allocation details: all the chunk-reading functions that + * change these members go through the corresponding png_set_* + * functions. A function to clear these members is available: see + * png_free_data(). The png_set_* functions do not depend on being + * able to point info structure members to any of the storage they are + * passed (they make their own copies), EXCEPT that the png_set_text + * functions use the same storage passed to them in the text_ptr or + * itxt_ptr structure argument, and the png_set_rows and png_set_unknowns + * functions do not make their own copies. + */ +typedef struct png_info_struct +{ + /* the following are necessary for every PNG file */ + png_uint_32 width; /* width of image in pixels (from IHDR) */ + png_uint_32 height; /* height of image in pixels (from IHDR) */ + png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */ + png_uint_32 rowbytes; /* bytes needed to hold an untransformed row */ + png_colorp palette; /* array of color values (valid & PNG_INFO_PLTE) */ + png_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */ + png_uint_16 num_trans; /* number of transparent palette color (tRNS) */ + png_byte bit_depth; /* 1, 2, 4, 8, or 16 bits/channel (from IHDR) */ + png_byte color_type; /* see PNG_COLOR_TYPE_ below (from IHDR) */ + /* The following three should have been named *_method not *_type */ + png_byte compression_type; /* must be PNG_COMPRESSION_TYPE_BASE (IHDR) */ + png_byte filter_type; /* must be PNG_FILTER_TYPE_BASE (from IHDR) */ + png_byte interlace_type; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ + + /* The following is informational only on read, and not used on writes. */ + png_byte channels; /* number of data channels per pixel (1, 2, 3, 4) */ + png_byte pixel_depth; /* number of bits per pixel */ + png_byte spare_byte; /* to align the data, and for future use */ + png_byte signature[8]; /* magic bytes read by libpng from start of file */ + + /* The rest of the data is optional. If you are reading, check the + * valid field to see if the information in these are valid. If you + * are writing, set the valid field to those chunks you want written, + * and initialize the appropriate fields below. + */ + +#if defined(PNG_gAMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) + /* The gAMA chunk describes the gamma characteristics of the system + * on which the image was created, normally in the range [1.0, 2.5]. + * Data is valid if (valid & PNG_INFO_gAMA) is non-zero. + */ + float gamma; /* gamma value of image, if (valid & PNG_INFO_gAMA) */ +#endif + +#if defined(PNG_sRGB_SUPPORTED) + /* GR-P, 0.96a */ + /* Data valid if (valid & PNG_INFO_sRGB) non-zero. */ + png_byte srgb_intent; /* sRGB rendering intent [0, 1, 2, or 3] */ +#endif + +#if defined(PNG_TEXT_SUPPORTED) + /* The tEXt, and zTXt chunks contain human-readable textual data in + * uncompressed, compressed, and optionally compressed forms, respectively. + * The data in "text" is an array of pointers to uncompressed, + * null-terminated C strings. Each chunk has a keyword that describes the + * textual data contained in that chunk. Keywords are not required to be + * unique, and the text string may be empty. Any number of text chunks may + * be in an image. + */ + int num_text; /* number of comments read/to write */ + int max_text; /* current size of text array */ + png_textp text; /* array of comments read/to write */ +#endif /* PNG_TEXT_SUPPORTED */ + +#if defined(PNG_tIME_SUPPORTED) + /* The tIME chunk holds the last time the displayed image data was + * modified. See the png_time struct for the contents of this struct. + */ + png_time mod_time; +#endif + +#if defined(PNG_sBIT_SUPPORTED) + /* The sBIT chunk specifies the number of significant high-order bits + * in the pixel data. Values are in the range [1, bit_depth], and are + * only specified for the channels in the pixel data. The contents of + * the low-order bits is not specified. Data is valid if + * (valid & PNG_INFO_sBIT) is non-zero. + */ + png_color_8 sig_bit; /* significant bits in color channels */ +#endif + +#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_EXPAND_SUPPORTED) || \ +defined(PNG_READ_BACKGROUND_SUPPORTED) + /* The tRNS chunk supplies transparency data for paletted images and + * other image types that don't need a full alpha channel. There are + * "num_trans" transparency values for a paletted image, stored in the + * same order as the palette colors, starting from index 0. Values + * for the data are in the range [0, 255], ranging from fully transparent + * to fully opaque, respectively. For non-paletted images, there is a + * single color specified that should be treated as fully transparent. + * Data is valid if (valid & PNG_INFO_tRNS) is non-zero. + */ + png_bytep trans; /* transparent values for paletted image */ + png_color_16 trans_values; /* transparent color for non-palette image */ +#endif + +#if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + /* The bKGD chunk gives the suggested image background color if the + * display program does not have its own background color and the image + * is needs to composited onto a background before display. The colors + * in "background" are normally in the same color space/depth as the + * pixel data. Data is valid if (valid & PNG_INFO_bKGD) is non-zero. + */ + png_color_16 background; +#endif + +#if defined(PNG_oFFs_SUPPORTED) + /* The oFFs chunk gives the offset in "offset_unit_type" units rightwards + * and downwards from the top-left corner of the display, page, or other + * application-specific co-ordinate space. See the PNG_OFFSET_ defines + * below for the unit types. Valid if (valid & PNG_INFO_oFFs) non-zero. + */ + png_int_32 x_offset; /* x offset on page */ + png_int_32 y_offset; /* y offset on page */ + png_byte offset_unit_type; /* offset units type */ +#endif + +#if defined(PNG_pHYs_SUPPORTED) + /* The pHYs chunk gives the physical pixel density of the image for + * display or printing in "phys_unit_type" units (see PNG_RESOLUTION_ + * defines below). Data is valid if (valid & PNG_INFO_pHYs) is non-zero. + */ + png_uint_32 x_pixels_per_unit; /* horizontal pixel density */ + png_uint_32 y_pixels_per_unit; /* vertical pixel density */ + png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */ +#endif + +#if defined(PNG_hIST_SUPPORTED) + /* The hIST chunk contains the relative frequency or importance of the + * various palette entries, so that a viewer can intelligently select a + * reduced-color palette, if required. Data is an array of "num_palette" + * values in the range [0,65535]. Data valid if (valid & PNG_INFO_hIST) + * is non-zero. + */ + png_uint_16p hist; +#endif + +#ifdef PNG_cHRM_SUPPORTED + /* The cHRM chunk describes the CIE color characteristics of the monitor + * on which the PNG was created. This data allows the viewer to do gamut + * mapping of the input image to ensure that the viewer sees the same + * colors in the image as the creator. Values are in the range + * [0.0, 0.8]. Data valid if (valid & PNG_INFO_cHRM) non-zero. + */ +#ifdef PNG_FLOATING_POINT_SUPPORTED + float x_white; + float y_white; + float x_red; + float y_red; + float x_green; + float y_green; + float x_blue; + float y_blue; +#endif +#endif + +#if defined(PNG_pCAL_SUPPORTED) + /* The pCAL chunk describes a transformation between the stored pixel + * values and original physical data values used to create the image. + * The integer range [0, 2^bit_depth - 1] maps to the floating-point + * range given by [pcal_X0, pcal_X1], and are further transformed by a + * (possibly non-linear) transformation function given by "pcal_type" + * and "pcal_params" into "pcal_units". Please see the PNG_EQUATION_ + * defines below, and the PNG-Group's PNG extensions document for a + * complete description of the transformations and how they should be + * implemented, and for a description of the ASCII parameter strings. + * Data values are valid if (valid & PNG_INFO_pCAL) non-zero. + */ + png_charp pcal_purpose; /* pCAL chunk description string */ + png_int_32 pcal_X0; /* minimum value */ + png_int_32 pcal_X1; /* maximum value */ + png_charp pcal_units; /* Latin-1 string giving physical units */ + png_charpp pcal_params; /* ASCII strings containing parameter values */ + png_byte pcal_type; /* equation type (see PNG_EQUATION_ below) */ + png_byte pcal_nparams; /* number of parameters given in pcal_params */ +#endif + +/* New members added in libpng-1.0.6 */ +#ifdef PNG_FREE_ME_SUPPORTED + png_uint_32 free_me; /* flags items libpng is responsible for freeing */ +#endif + +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) + /* storage for unknown chunks that the library doesn't recognize. */ + png_unknown_chunkp unknown_chunks; + png_size_t unknown_chunks_num; +#endif + +#if defined(PNG_iCCP_SUPPORTED) + /* iCCP chunk data. */ + png_charp iccp_name; /* profile name */ + png_charp iccp_profile; /* International Color Consortium profile data */ + /* Note to maintainer: should be png_bytep */ + png_uint_32 iccp_proflen; /* ICC profile data length */ + png_byte iccp_compression; /* Always zero */ +#endif + +#if defined(PNG_sPLT_SUPPORTED) + /* data on sPLT chunks (there may be more than one). */ + png_sPLT_tp splt_palettes; + png_uint_32 splt_palettes_num; +#endif + +#if defined(PNG_sCAL_SUPPORTED) + /* The sCAL chunk describes the actual physical dimensions of the + * subject matter of the graphic. The chunk contains a unit specification + * a byte value, and two ASCII strings representing floating-point + * values. The values are width and height corresponsing to one pixel + * in the image. This external representation is converted to double + * here. Data values are valid if (valid & PNG_INFO_sCAL) is non-zero. + */ + png_byte scal_unit; /* unit of physical scale */ +#ifdef PNG_FLOATING_POINT_SUPPORTED + double scal_pixel_width; /* width of one pixel */ + double scal_pixel_height; /* height of one pixel */ +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED + png_charp scal_s_width; /* string containing height */ + png_charp scal_s_height; /* string containing width */ +#endif +#endif + +#if defined(PNG_INFO_IMAGE_SUPPORTED) + /* Memory has been allocated if (valid & PNG_ALLOCATED_INFO_ROWS) non-zero */ + /* Data valid if (valid & PNG_INFO_IDAT) non-zero */ + png_bytepp row_pointers; /* the image bits */ +#endif + +#if defined(PNG_FIXED_POINT_SUPPORTED) && defined(PNG_gAMA_SUPPORTED) + png_fixed_point int_gamma; /* gamma of image, if (valid & PNG_INFO_gAMA) */ +#endif + +#if defined(PNG_cHRM_SUPPORTED) && defined(PNG_FIXED_POINT_SUPPORTED) + png_fixed_point int_x_white; + png_fixed_point int_y_white; + png_fixed_point int_x_red; + png_fixed_point int_y_red; + png_fixed_point int_x_green; + png_fixed_point int_y_green; + png_fixed_point int_x_blue; + png_fixed_point int_y_blue; +#endif + +} png_info; + +typedef png_info FAR * png_infop; +typedef png_info FAR * FAR * png_infopp; + +/* Maximum positive integer used in PNG is (2^31)-1 */ +#define PNG_MAX_UINT ((png_uint_32)0x7fffffffL) + +/* These describe the color_type field in png_info. */ +/* color type masks */ +#define PNG_COLOR_MASK_PALETTE 1 +#define PNG_COLOR_MASK_COLOR 2 +#define PNG_COLOR_MASK_ALPHA 4 + +/* color types. Note that not all combinations are legal */ +#define PNG_COLOR_TYPE_GRAY 0 +#define PNG_COLOR_TYPE_PALETTE (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE) +#define PNG_COLOR_TYPE_RGB (PNG_COLOR_MASK_COLOR) +#define PNG_COLOR_TYPE_RGB_ALPHA (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA) +#define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA) +/* aliases */ +#define PNG_COLOR_TYPE_RGBA PNG_COLOR_TYPE_RGB_ALPHA +#define PNG_COLOR_TYPE_GA PNG_COLOR_TYPE_GRAY_ALPHA + +/* This is for compression type. PNG 1.0-1.2 only define the single type. */ +#define PNG_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */ +#define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE + +/* This is for filter type. PNG 1.0-1.2 only define the single type. */ +#define PNG_FILTER_TYPE_BASE 0 /* Single row per-byte filtering */ +#define PNG_INTRAPIXEL_DIFFERENCING 64 /* Used only in MNG datastreams */ +#define PNG_FILTER_TYPE_DEFAULT PNG_FILTER_TYPE_BASE + +/* These are for the interlacing type. These values should NOT be changed. */ +#define PNG_INTERLACE_NONE 0 /* Non-interlaced image */ +#define PNG_INTERLACE_ADAM7 1 /* Adam7 interlacing */ +#define PNG_INTERLACE_LAST 2 /* Not a valid value */ + +/* These are for the oFFs chunk. These values should NOT be changed. */ +#define PNG_OFFSET_PIXEL 0 /* Offset in pixels */ +#define PNG_OFFSET_MICROMETER 1 /* Offset in micrometers (1/10^6 meter) */ +#define PNG_OFFSET_LAST 2 /* Not a valid value */ + +/* These are for the pCAL chunk. These values should NOT be changed. */ +#define PNG_EQUATION_LINEAR 0 /* Linear transformation */ +#define PNG_EQUATION_BASE_E 1 /* Exponential base e transform */ +#define PNG_EQUATION_ARBITRARY 2 /* Arbitrary base exponential transform */ +#define PNG_EQUATION_HYPERBOLIC 3 /* Hyperbolic sine transformation */ +#define PNG_EQUATION_LAST 4 /* Not a valid value */ + +/* These are for the sCAL chunk. These values should NOT be changed. */ +#define PNG_SCALE_UNKNOWN 0 /* unknown unit (image scale) */ +#define PNG_SCALE_METER 1 /* meters per pixel */ +#define PNG_SCALE_RADIAN 2 /* radians per pixel */ +#define PNG_SCALE_LAST 3 /* Not a valid value */ + +/* These are for the pHYs chunk. These values should NOT be changed. */ +#define PNG_RESOLUTION_UNKNOWN 0 /* pixels/unknown unit (aspect ratio) */ +#define PNG_RESOLUTION_METER 1 /* pixels/meter */ +#define PNG_RESOLUTION_LAST 2 /* Not a valid value */ + +/* These are for the sRGB chunk. These values should NOT be changed. */ +#define PNG_sRGB_INTENT_PERCEPTUAL 0 +#define PNG_sRGB_INTENT_RELATIVE 1 +#define PNG_sRGB_INTENT_SATURATION 2 +#define PNG_sRGB_INTENT_ABSOLUTE 3 +#define PNG_sRGB_INTENT_LAST 4 /* Not a valid value */ + +/* This is for text chunks */ +#define PNG_KEYWORD_MAX_LENGTH 79 + +/* Maximum number of entries in PLTE/sPLT/tRNS arrays */ +#define PNG_MAX_PALETTE_LENGTH 256 + +/* These determine if an ancillary chunk's data has been successfully read + * from the PNG header, or if the application has filled in the corresponding + * data in the info_struct to be written into the output file. The values + * of the PNG_INFO_ defines should NOT be changed. + */ +#define PNG_INFO_gAMA 0x0001 +#define PNG_INFO_sBIT 0x0002 +#define PNG_INFO_cHRM 0x0004 +#define PNG_INFO_PLTE 0x0008 +#define PNG_INFO_tRNS 0x0010 +#define PNG_INFO_bKGD 0x0020 +#define PNG_INFO_hIST 0x0040 +#define PNG_INFO_pHYs 0x0080 +#define PNG_INFO_oFFs 0x0100 +#define PNG_INFO_tIME 0x0200 +#define PNG_INFO_pCAL 0x0400 +#define PNG_INFO_sRGB 0x0800 /* GR-P, 0.96a */ +#define PNG_INFO_iCCP 0x1000 /* ESR, 1.0.6 */ +#define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ +#define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ +#define PNG_INFO_IDAT 0x8000L /* ESR, 1.0.6 */ + +/* This is used for the transformation routines, as some of them + * change these values for the row. It also should enable using + * the routines for other purposes. + */ +typedef struct png_row_info_struct +{ + png_uint_32 width; /* width of row */ + png_uint_32 rowbytes; /* number of bytes in row */ + png_byte color_type; /* color type of row */ + png_byte bit_depth; /* bit depth of row */ + png_byte channels; /* number of channels (1, 2, 3, or 4) */ + png_byte pixel_depth; /* bits per pixel (depth * channels) */ +} png_row_info; + +typedef png_row_info FAR * png_row_infop; +typedef png_row_info FAR * FAR * png_row_infopp; + +/* These are the function types for the I/O functions and for the functions + * that allow the user to override the default I/O functions with his or her + * own. The png_error_ptr type should match that of user-supplied warning + * and error functions, while the png_rw_ptr type should match that of the + * user read/write data functions. + */ +typedef struct png_struct_def png_struct; +typedef png_struct FAR * png_structp; + +typedef void (PNGAPI *png_error_ptr) PNGARG((png_structp, png_const_charp)); +typedef void (PNGAPI *png_rw_ptr) PNGARG((png_structp, png_bytep, png_size_t)); +typedef void (PNGAPI *png_flush_ptr) PNGARG((png_structp)); +typedef void (PNGAPI *png_read_status_ptr) PNGARG((png_structp, png_uint_32, + int)); +typedef void (PNGAPI *png_write_status_ptr) PNGARG((png_structp, png_uint_32, + int)); + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +typedef void (PNGAPI *png_progressive_info_ptr) PNGARG((png_structp, png_infop)); +typedef void (PNGAPI *png_progressive_end_ptr) PNGARG((png_structp, png_infop)); +typedef void (PNGAPI *png_progressive_row_ptr) PNGARG((png_structp, png_bytep, + png_uint_32, int)); +#endif + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_LEGACY_SUPPORTED) +typedef void (PNGAPI *png_user_transform_ptr) PNGARG((png_structp, + png_row_infop, png_bytep)); +#endif + +#if defined(PNG_USER_CHUNKS_SUPPORTED) +typedef int (PNGAPI *png_user_chunk_ptr) PNGARG((png_structp, png_unknown_chunkp)); +#endif +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) +typedef void (PNGAPI *png_unknown_chunk_ptr) PNGARG((png_structp)); +#endif + +/* Transform masks for the high-level interface */ +#define PNG_TRANSFORM_IDENTITY 0x0000 /* read and write */ +#define PNG_TRANSFORM_STRIP_16 0x0001 /* read only */ +#define PNG_TRANSFORM_STRIP_ALPHA 0x0002 /* read only */ +#define PNG_TRANSFORM_PACKING 0x0004 /* read and write */ +#define PNG_TRANSFORM_PACKSWAP 0x0008 /* read and write */ +#define PNG_TRANSFORM_EXPAND 0x0010 /* read only */ +#define PNG_TRANSFORM_INVERT_MONO 0x0020 /* read and write */ +#define PNG_TRANSFORM_SHIFT 0x0040 /* read and write */ +#define PNG_TRANSFORM_BGR 0x0080 /* read and write */ +#define PNG_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */ +#define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ +#define PNG_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */ +#define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* WRITE only */ + +/* Flags for MNG supported features */ +#define PNG_FLAG_MNG_EMPTY_PLTE 0x01 +#define PNG_FLAG_MNG_FILTER_64 0x04 +#define PNG_ALL_MNG_FEATURES 0x05 + +typedef png_voidp (*png_malloc_ptr) PNGARG((png_structp, png_size_t)); +typedef void (*png_free_ptr) PNGARG((png_structp, png_voidp)); + +/* The structure that holds the information to read and write PNG files. + * The only people who need to care about what is inside of this are the + * people who will be modifying the library for their own special needs. + * It should NOT be accessed directly by an application, except to store + * the jmp_buf. + */ + +struct png_struct_def +{ +#ifdef PNG_SETJMP_SUPPORTED + jmp_buf jmpbuf; /* used in png_error */ +#endif + png_error_ptr error_fn; /* function for printing errors and aborting */ + png_error_ptr warning_fn; /* function for printing warnings */ + png_voidp error_ptr; /* user supplied struct for error functions */ + png_rw_ptr write_data_fn; /* function for writing output data */ + png_rw_ptr read_data_fn; /* function for reading input data */ + png_voidp io_ptr; /* ptr to application struct for I/O functions */ + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) + png_user_transform_ptr read_user_transform_fn; /* user read transform */ +#endif + +#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) + png_user_transform_ptr write_user_transform_fn; /* user write transform */ +#endif + +/* These were added in libpng-1.0.2 */ +#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) + png_voidp user_transform_ptr; /* user supplied struct for user transform */ + png_byte user_transform_depth; /* bit depth of user transformed pixels */ + png_byte user_transform_channels; /* channels in user transformed pixels */ +#endif +#endif + + png_uint_32 mode; /* tells us where we are in the PNG file */ + png_uint_32 flags; /* flags indicating various things to libpng */ + png_uint_32 transformations; /* which transformations to perform */ + + z_stream zstream; /* pointer to decompression structure (below) */ + png_bytep zbuf; /* buffer for zlib */ + png_size_t zbuf_size; /* size of zbuf */ + int zlib_level; /* holds zlib compression level */ + int zlib_method; /* holds zlib compression method */ + int zlib_window_bits; /* holds zlib compression window bits */ + int zlib_mem_level; /* holds zlib compression memory level */ + int zlib_strategy; /* holds zlib compression strategy */ + + png_uint_32 width; /* width of image in pixels */ + png_uint_32 height; /* height of image in pixels */ + png_uint_32 num_rows; /* number of rows in current pass */ + png_uint_32 usr_width; /* width of row at start of write */ + png_uint_32 rowbytes; /* size of row in bytes */ + png_uint_32 irowbytes; /* size of current interlaced row in bytes */ + png_uint_32 iwidth; /* width of current interlaced row in pixels */ + png_uint_32 row_number; /* current row in interlace pass */ + png_bytep prev_row; /* buffer to save previous (unfiltered) row */ + png_bytep row_buf; /* buffer to save current (unfiltered) row */ + png_bytep sub_row; /* buffer to save "sub" row when filtering */ + png_bytep up_row; /* buffer to save "up" row when filtering */ + png_bytep avg_row; /* buffer to save "avg" row when filtering */ + png_bytep paeth_row; /* buffer to save "Paeth" row when filtering */ + png_row_info row_info; /* used for transformation routines */ + + png_uint_32 idat_size; /* current IDAT size for read */ + png_uint_32 crc; /* current chunk CRC value */ + png_colorp palette; /* palette from the input file */ + png_uint_16 num_palette; /* number of color entries in palette */ + png_uint_16 num_trans; /* number of transparency values */ + png_byte chunk_name[5]; /* null-terminated name of current chunk */ + png_byte compression; /* file compression type (always 0) */ + png_byte filter; /* file filter type (always 0) */ + png_byte interlaced; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ + png_byte pass; /* current interlace pass (0 - 6) */ + png_byte do_filter; /* row filter flags (see PNG_FILTER_ below ) */ + png_byte color_type; /* color type of file */ + png_byte bit_depth; /* bit depth of file */ + png_byte usr_bit_depth; /* bit depth of users row */ + png_byte pixel_depth; /* number of bits per pixel */ + png_byte channels; /* number of channels in file */ + png_byte usr_channels; /* channels at start of write */ + png_byte sig_bytes; /* magic bytes read/written from start of file */ + +#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) +#ifdef PNG_LEGACY_SUPPORTED + png_byte filler; /* filler byte for pixel expansion */ +#else + png_uint_16 filler; /* filler bytes for pixel expansion */ +#endif +#endif + +#if defined(PNG_bKGD_SUPPORTED) + png_byte background_gamma_type; +# ifdef PNG_FLOATING_POINT_SUPPORTED + float background_gamma; +# endif + png_color_16 background; /* background color in screen gamma space */ +#if defined(PNG_READ_GAMMA_SUPPORTED) + png_color_16 background_1; /* background normalized to gamma 1.0 */ +#endif +#endif /* PNG_bKGD_SUPPORTED */ + +#if defined(PNG_WRITE_FLUSH_SUPPORTED) + png_flush_ptr output_flush_fn;/* Function for flushing output */ + png_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */ + png_uint_32 flush_rows; /* number of rows written since last flush */ +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + int gamma_shift; /* number of "insignificant" bits 16-bit gamma */ +#ifdef PNG_FLOATING_POINT_SUPPORTED + float gamma; /* file gamma value */ + float screen_gamma; /* screen gamma value (display_exponent) */ +#endif +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + png_bytep gamma_table; /* gamma table for 8-bit depth files */ + png_bytep gamma_from_1; /* converts from 1.0 to screen */ + png_bytep gamma_to_1; /* converts from file to 1.0 */ + png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */ + png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */ + png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */ +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED) + png_color_8 sig_bit; /* significant bits in each available channel */ +#endif + +#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) + png_color_8 shift; /* shift for significant bit tranformation */ +#endif + +#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \ + || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + png_bytep trans; /* transparency values for paletted files */ + png_color_16 trans_values; /* transparency values for non-paletted files */ +#endif + + png_read_status_ptr read_row_fn; /* called after each row is decoded */ + png_write_status_ptr write_row_fn; /* called after each row is encoded */ +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED + png_progressive_info_ptr info_fn; /* called after header data fully read */ + png_progressive_row_ptr row_fn; /* called after each prog. row is decoded */ + png_progressive_end_ptr end_fn; /* called after image is complete */ + png_bytep save_buffer_ptr; /* current location in save_buffer */ + png_bytep save_buffer; /* buffer for previously read data */ + png_bytep current_buffer_ptr; /* current location in current_buffer */ + png_bytep current_buffer; /* buffer for recently used data */ + png_uint_32 push_length; /* size of current input chunk */ + png_uint_32 skip_length; /* bytes to skip in input data */ + png_size_t save_buffer_size; /* amount of data now in save_buffer */ + png_size_t save_buffer_max; /* total size of save_buffer */ + png_size_t buffer_size; /* total amount of available input data */ + png_size_t current_buffer_size; /* amount of data now in current_buffer */ + int process_mode; /* what push library is currently doing */ + int cur_palette; /* current push library palette index */ + +# if defined(PNG_TEXT_SUPPORTED) + png_size_t current_text_size; /* current size of text input data */ + png_size_t current_text_left; /* how much text left to read in input */ + png_charp current_text; /* current text chunk buffer */ + png_charp current_text_ptr; /* current location in current_text */ +# endif /* PNG_PROGRESSIVE_READ_SUPPORTED && PNG_TEXT_SUPPORTED */ + +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ + +#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) +/* for the Borland special 64K segment handler */ + png_bytepp offset_table_ptr; + png_bytep offset_table; + png_uint_16 offset_table_number; + png_uint_16 offset_table_count; + png_uint_16 offset_table_count_free; +#endif + +#if defined(PNG_READ_DITHER_SUPPORTED) + png_bytep palette_lookup; /* lookup table for dithering */ + png_bytep dither_index; /* index translation for palette files */ +#endif + +#if defined(PNG_READ_DITHER_SUPPORTED) || defined(PNG_hIST_SUPPORTED) + png_uint_16p hist; /* histogram */ +#endif + +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) + png_byte heuristic_method; /* heuristic for row filter selection */ + png_byte num_prev_filters; /* number of weights for previous rows */ + png_bytep prev_filters; /* filter type(s) of previous row(s) */ + png_uint_16p filter_weights; /* weight(s) for previous line(s) */ + png_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */ + png_uint_16p filter_costs; /* relative filter calculation cost */ + png_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */ +#endif + +#if defined(PNG_TIME_RFC1123_SUPPORTED) + png_charp time_buffer; /* String to hold RFC 1123 time text */ +#endif + +/* New members added in libpng-1.0.6 */ + +#ifdef PNG_FREE_ME_SUPPORTED + png_uint_32 free_me; /* flags items libpng is responsible for freeing */ +#endif + +#if defined(PNG_USER_CHUNKS_SUPPORTED) + png_voidp user_chunk_ptr; + png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */ +#endif + +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) + int num_chunk_list; + png_bytep chunk_list; +#endif + +/* New members added in libpng-1.0.3 */ +#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) + png_byte rgb_to_gray_status; + /* These were changed from png_byte in libpng-1.0.6 */ + png_uint_16 rgb_to_gray_red_coeff; + png_uint_16 rgb_to_gray_green_coeff; + png_uint_16 rgb_to_gray_blue_coeff; +#endif + +/* New member added in libpng-1.0.4 (renamed in 1.0.9) */ +#if defined(PNG_MNG_FEATURES_SUPPORTED) || \ + defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ + defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) +/* changed from png_byte to png_uint_32 at version 1.2.0 */ +#ifdef PNG_1_0_X + png_byte mng_features_permitted; +#else + png_uint_32 mng_features_permitted; +#endif /* PNG_1_0_X */ +#endif + +/* New member added in libpng-1.0.7 */ +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + png_fixed_point int_gamma; +#endif + +/* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */ +#if defined(PNG_MNG_FEATURES_SUPPORTED) + png_byte filter_type; +#endif + +#if defined(PNG_1_0_X) || (defined(PNG_DEBUG) && defined(PNG_USE_PNGGCCRD)) +/* New member added in libpng-1.0.10, ifdef'ed out in 1.2.0 */ + png_uint_32 row_buf_size; +#endif + +/* New members added in libpng-1.2.0 */ +#if !defined(PNG_1_0_X) && defined(PNG_ASSEMBLER_CODE_SUPPORTED) + png_byte mmx_bitdepth_threshold; + png_uint_32 mmx_rowbytes_threshold; + png_uint_32 asm_flags; +#endif + +/* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ +#ifdef PNG_USER_MEM_SUPPORTED + png_voidp mem_ptr; /* user supplied struct for mem functions */ + png_malloc_ptr malloc_fn; /* function for allocating memory */ + png_free_ptr free_fn; /* function for freeing memory */ +#endif + +/* New member added in libpng-1.0.13 and 1.2.0 */ + png_bytep big_row_buf; /* buffer to save current (unfiltered) row */ + +#if defined(PNG_READ_DITHER_SUPPORTED) +/* The following three members were added at version 1.0.14 and 1.2.4 */ + png_bytep dither_sort; /* working sort array */ + png_bytep index_to_palette; /* where the original index currently is */ + /* in the palette */ + png_bytep palette_to_index; /* which original index points to this */ + /* palette color */ +#endif + +}; + + +/* This prevents a compiler error in png.c if png.c and png.h are both at + version 1.2.5 + */ +typedef png_structp version_1_2_5; + +typedef png_struct FAR * FAR * png_structpp; + +/* Here are the function definitions most commonly used. This is not + * the place to find out how to use libpng. See libpng.txt for the + * full explanation, see example.c for the summary. This just provides + * a simple one line description of the use of each function. + */ + +/* Returns the version number of the library */ +extern PNG_EXPORT(png_uint_32,png_access_version_number) PNGARG((void)); + +/* Tell lib we have already handled the first magic bytes. + * Handling more than 8 bytes from the beginning of the file is an error. + */ +extern PNG_EXPORT(void,png_set_sig_bytes) PNGARG((png_structp png_ptr, + int num_bytes)); + +/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a + * PNG file. Returns zero if the supplied bytes match the 8-byte PNG + * signature, and non-zero otherwise. Having num_to_check == 0 or + * start > 7 will always fail (ie return non-zero). + */ +extern PNG_EXPORT(int,png_sig_cmp) PNGARG((png_bytep sig, png_size_t start, + png_size_t num_to_check)); + +/* Simple signature checking function. This is the same as calling + * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n). + */ +extern PNG_EXPORT(int,png_check_sig) PNGARG((png_bytep sig, int num)); + +/* Allocate and initialize png_ptr struct for reading, and any other memory. */ +extern PNG_EXPORT(png_structp,png_create_read_struct) + PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, + png_error_ptr error_fn, png_error_ptr warn_fn)); + +/* Allocate and initialize png_ptr struct for writing, and any other memory */ +extern PNG_EXPORT(png_structp,png_create_write_struct) + PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, + png_error_ptr error_fn, png_error_ptr warn_fn)); + +extern PNG_EXPORT(png_uint_32,png_get_compression_buffer_size) + PNGARG((png_structp png_ptr)); + +extern PNG_EXPORT(void,png_set_compression_buffer_size) + PNGARG((png_structp png_ptr, png_uint_32 size)); + +/* Reset the compression stream */ +extern PNG_EXPORT(int,png_reset_zstream) PNGARG((png_structp png_ptr)); + +/* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */ +#ifdef PNG_USER_MEM_SUPPORTED +extern PNG_EXPORT(png_structp,png_create_read_struct_2) + PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, + png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, + png_malloc_ptr malloc_fn, png_free_ptr free_fn)); +extern PNG_EXPORT(png_structp,png_create_write_struct_2) + PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, + png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, + png_malloc_ptr malloc_fn, png_free_ptr free_fn)); +#endif + +/* Write a PNG chunk - size, type, (optional) data, CRC. */ +extern PNG_EXPORT(void,png_write_chunk) PNGARG((png_structp png_ptr, + png_bytep chunk_name, png_bytep data, png_size_t length)); + +/* Write the start of a PNG chunk - length and chunk name. */ +extern PNG_EXPORT(void,png_write_chunk_start) PNGARG((png_structp png_ptr, + png_bytep chunk_name, png_uint_32 length)); + +/* Write the data of a PNG chunk started with png_write_chunk_start(). */ +extern PNG_EXPORT(void,png_write_chunk_data) PNGARG((png_structp png_ptr, + png_bytep data, png_size_t length)); + +/* Finish a chunk started with png_write_chunk_start() (includes CRC). */ +extern PNG_EXPORT(void,png_write_chunk_end) PNGARG((png_structp png_ptr)); + +/* Allocate and initialize the info structure */ +extern PNG_EXPORT(png_infop,png_create_info_struct) + PNGARG((png_structp png_ptr)); + +/* Initialize the info structure (old interface - DEPRECATED) */ +extern PNG_EXPORT(void,png_info_init) PNGARG((png_infop info_ptr)); +#undef png_info_init +#define png_info_init(info_ptr) png_info_init_3(&info_ptr, sizeof(png_info)); +extern PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr, + png_size_t png_info_struct_size)); + +/* Writes all the PNG information before the image. */ +extern PNG_EXPORT(void,png_write_info_before_PLTE) PNGARG((png_structp png_ptr, + png_infop info_ptr)); +extern PNG_EXPORT(void,png_write_info) PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +/* read the information before the actual image data. */ +extern PNG_EXPORT(void,png_read_info) PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +#if defined(PNG_TIME_RFC1123_SUPPORTED) +extern PNG_EXPORT(png_charp,png_convert_to_rfc1123) + PNGARG((png_structp png_ptr, png_timep ptime)); +#endif + +#if !defined(_WIN32_WCE) +/* "time.h" functions are not supported on WindowsCE */ +#if defined(PNG_WRITE_tIME_SUPPORTED) +/* convert from a struct tm to png_time */ +extern PNG_EXPORT(void,png_convert_from_struct_tm) PNGARG((png_timep ptime, + struct tm FAR * ttime)); + +/* convert from time_t to png_time. Uses gmtime() */ +extern PNG_EXPORT(void,png_convert_from_time_t) PNGARG((png_timep ptime, + time_t ttime)); +#endif /* PNG_WRITE_tIME_SUPPORTED */ +#endif /* _WIN32_WCE */ + +#if defined(PNG_READ_EXPAND_SUPPORTED) +/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */ +extern PNG_EXPORT(void,png_set_expand) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_set_gray_1_2_4_to_8) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_set_palette_to_rgb) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_set_tRNS_to_alpha) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) +/* Use blue, green, red order for pixels. */ +extern PNG_EXPORT(void,png_set_bgr) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) +/* Expand the grayscale to 24-bit RGB if necessary. */ +extern PNG_EXPORT(void,png_set_gray_to_rgb) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) +/* Reduce RGB to grayscale. */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_rgb_to_gray) PNGARG((png_structp png_ptr, + int error_action, double red, double green )); +#endif +extern PNG_EXPORT(void,png_set_rgb_to_gray_fixed) PNGARG((png_structp png_ptr, + int error_action, png_fixed_point red, png_fixed_point green )); +extern PNG_EXPORT(png_byte,png_get_rgb_to_gray_status) PNGARG((png_structp + png_ptr)); +#endif + +extern PNG_EXPORT(void,png_build_grayscale_palette) PNGARG((int bit_depth, + png_colorp palette)); + +#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) +extern PNG_EXPORT(void,png_set_strip_alpha) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ + defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) +extern PNG_EXPORT(void,png_set_swap_alpha) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ + defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) +extern PNG_EXPORT(void,png_set_invert_alpha) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) +/* Add a filler byte to 24-bit RGB images. */ +extern PNG_EXPORT(void,png_set_filler) PNGARG((png_structp png_ptr, + png_uint_32 filler, int flags)); +/* The values of the PNG_FILLER_ defines should NOT be changed */ +#define PNG_FILLER_BEFORE 0 +#define PNG_FILLER_AFTER 1 +#endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */ + +#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) +/* Swap bytes in 16-bit depth files. */ +extern PNG_EXPORT(void,png_set_swap) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) +/* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */ +extern PNG_EXPORT(void,png_set_packing) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED) +/* Swap packing order of pixels in bytes. */ +extern PNG_EXPORT(void,png_set_packswap) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) +/* Converts files to legal bit depths. */ +extern PNG_EXPORT(void,png_set_shift) PNGARG((png_structp png_ptr, + png_color_8p true_bits)); +#endif + +#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ + defined(PNG_WRITE_INTERLACING_SUPPORTED) +/* Have the code handle the interlacing. Returns the number of passes. */ +extern PNG_EXPORT(int,png_set_interlace_handling) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) +/* Invert monochrome files */ +extern PNG_EXPORT(void,png_set_invert_mono) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_BACKGROUND_SUPPORTED) +/* Handle alpha and tRNS by replacing with a background color. */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_background) PNGARG((png_structp png_ptr, + png_color_16p background_color, int background_gamma_code, + int need_expand, double background_gamma)); +#endif +#define PNG_BACKGROUND_GAMMA_UNKNOWN 0 +#define PNG_BACKGROUND_GAMMA_SCREEN 1 +#define PNG_BACKGROUND_GAMMA_FILE 2 +#define PNG_BACKGROUND_GAMMA_UNIQUE 3 +#endif + +#if defined(PNG_READ_16_TO_8_SUPPORTED) +/* strip the second byte of information from a 16-bit depth file. */ +extern PNG_EXPORT(void,png_set_strip_16) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_DITHER_SUPPORTED) +/* Turn on dithering, and reduce the palette to the number of colors available. */ +extern PNG_EXPORT(void,png_set_dither) PNGARG((png_structp png_ptr, + png_colorp palette, int num_palette, int maximum_colors, + png_uint_16p histogram, int full_dither)); +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) +/* Handle gamma correction. Screen_gamma=(display_exponent) */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_gamma) PNGARG((png_structp png_ptr, + double screen_gamma, double default_file_gamma)); +#endif +#endif + +#if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ + defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) +/* Permit or disallow empty PLTE (0: not permitted, 1: permitted) */ +/* Deprecated and will be removed. Use png_permit_mng_features() instead. */ +extern PNG_EXPORT(void,png_permit_empty_plte) PNGARG((png_structp png_ptr, + int empty_plte_permitted)); +#endif + +#if defined(PNG_WRITE_FLUSH_SUPPORTED) +/* Set how many lines between output flushes - 0 for no flushing */ +extern PNG_EXPORT(void,png_set_flush) PNGARG((png_structp png_ptr, int nrows)); +/* Flush the current PNG output buffer */ +extern PNG_EXPORT(void,png_write_flush) PNGARG((png_structp png_ptr)); +#endif + +/* optional update palette with requested transformations */ +extern PNG_EXPORT(void,png_start_read_image) PNGARG((png_structp png_ptr)); + +/* optional call to update the users info structure */ +extern PNG_EXPORT(void,png_read_update_info) PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +/* read one or more rows of image data. */ +extern PNG_EXPORT(void,png_read_rows) PNGARG((png_structp png_ptr, + png_bytepp row, png_bytepp display_row, png_uint_32 num_rows)); + +/* read a row of data. */ +extern PNG_EXPORT(void,png_read_row) PNGARG((png_structp png_ptr, + png_bytep row, + png_bytep display_row)); + +/* read the whole image into memory at once. */ +extern PNG_EXPORT(void,png_read_image) PNGARG((png_structp png_ptr, + png_bytepp image)); + +/* write a row of image data */ +extern PNG_EXPORT(void,png_write_row) PNGARG((png_structp png_ptr, + png_bytep row)); + +/* write a few rows of image data */ +extern PNG_EXPORT(void,png_write_rows) PNGARG((png_structp png_ptr, + png_bytepp row, png_uint_32 num_rows)); + +/* write the image data */ +extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr, + png_bytepp image)); + +/* writes the end of the PNG file. */ +extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +/* read the end of the PNG file. */ +extern PNG_EXPORT(void,png_read_end) PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +/* free any memory associated with the png_info_struct */ +extern PNG_EXPORT(void,png_destroy_info_struct) PNGARG((png_structp png_ptr, + png_infopp info_ptr_ptr)); + +/* free any memory associated with the png_struct and the png_info_structs */ +extern PNG_EXPORT(void,png_destroy_read_struct) PNGARG((png_structpp + png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)); + +/* free all memory used by the read (old method - NOT DLL EXPORTED) */ +extern void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr, + png_infop end_info_ptr)); + +/* free any memory associated with the png_struct and the png_info_structs */ +extern PNG_EXPORT(void,png_destroy_write_struct) + PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)); + +/* free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */ +extern void png_write_destroy PNGARG((png_structp png_ptr)); + +/* set the libpng method of handling chunk CRC errors */ +extern PNG_EXPORT(void,png_set_crc_action) PNGARG((png_structp png_ptr, + int crit_action, int ancil_action)); + +/* Values for png_set_crc_action() to say how to handle CRC errors in + * ancillary and critical chunks, and whether to use the data contained + * therein. Note that it is impossible to "discard" data in a critical + * chunk. For versions prior to 0.90, the action was always error/quit, + * whereas in version 0.90 and later, the action for CRC errors in ancillary + * chunks is warn/discard. These values should NOT be changed. + * + * value action:critical action:ancillary + */ +#define PNG_CRC_DEFAULT 0 /* error/quit warn/discard data */ +#define PNG_CRC_ERROR_QUIT 1 /* error/quit error/quit */ +#define PNG_CRC_WARN_DISCARD 2 /* (INVALID) warn/discard data */ +#define PNG_CRC_WARN_USE 3 /* warn/use data warn/use data */ +#define PNG_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */ +#define PNG_CRC_NO_CHANGE 5 /* use current value use current value */ + +/* These functions give the user control over the scan-line filtering in + * libpng and the compression methods used by zlib. These functions are + * mainly useful for testing, as the defaults should work with most users. + * Those users who are tight on memory or want faster performance at the + * expense of compression can modify them. See the compression library + * header file (zlib.h) for an explination of the compression functions. + */ + +/* set the filtering method(s) used by libpng. Currently, the only valid + * value for "method" is 0. + */ +extern PNG_EXPORT(void,png_set_filter) PNGARG((png_structp png_ptr, int method, + int filters)); + +/* Flags for png_set_filter() to say which filters to use. The flags + * are chosen so that they don't conflict with real filter types + * below, in case they are supplied instead of the #defined constants. + * These values should NOT be changed. + */ +#define PNG_NO_FILTERS 0x00 +#define PNG_FILTER_NONE 0x08 +#define PNG_FILTER_SUB 0x10 +#define PNG_FILTER_UP 0x20 +#define PNG_FILTER_AVG 0x40 +#define PNG_FILTER_PAETH 0x80 +#define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \ + PNG_FILTER_AVG | PNG_FILTER_PAETH) + +/* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now. + * These defines should NOT be changed. + */ +#define PNG_FILTER_VALUE_NONE 0 +#define PNG_FILTER_VALUE_SUB 1 +#define PNG_FILTER_VALUE_UP 2 +#define PNG_FILTER_VALUE_AVG 3 +#define PNG_FILTER_VALUE_PAETH 4 +#define PNG_FILTER_VALUE_LAST 5 + +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) /* EXPERIMENTAL */ +/* The "heuristic_method" is given by one of the PNG_FILTER_HEURISTIC_ + * defines, either the default (minimum-sum-of-absolute-differences), or + * the experimental method (weighted-minimum-sum-of-absolute-differences). + * + * Weights are factors >= 1.0, indicating how important it is to keep the + * filter type consistent between rows. Larger numbers mean the current + * filter is that many times as likely to be the same as the "num_weights" + * previous filters. This is cumulative for each previous row with a weight. + * There needs to be "num_weights" values in "filter_weights", or it can be + * NULL if the weights aren't being specified. Weights have no influence on + * the selection of the first row filter. Well chosen weights can (in theory) + * improve the compression for a given image. + * + * Costs are factors >= 1.0 indicating the relative decoding costs of a + * filter type. Higher costs indicate more decoding expense, and are + * therefore less likely to be selected over a filter with lower computational + * costs. There needs to be a value in "filter_costs" for each valid filter + * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't + * setting the costs. Costs try to improve the speed of decompression without + * unduly increasing the compressed image size. + * + * A negative weight or cost indicates the default value is to be used, and + * values in the range [0.0, 1.0) indicate the value is to remain unchanged. + * The default values for both weights and costs are currently 1.0, but may + * change if good general weighting/cost heuristics can be found. If both + * the weights and costs are set to 1.0, this degenerates the WEIGHTED method + * to the UNWEIGHTED method, but with added encoding time/computation. + */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_filter_heuristics) PNGARG((png_structp png_ptr, + int heuristic_method, int num_weights, png_doublep filter_weights, + png_doublep filter_costs)); +#endif +#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */ + +/* Heuristic used for row filter selection. These defines should NOT be + * changed. + */ +#define PNG_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */ +#define PNG_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libpng < 0.95 */ +#define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */ +#define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */ + +/* Set the library compression level. Currently, valid values range from + * 0 - 9, corresponding directly to the zlib compression levels 0 - 9 + * (0 - no compression, 9 - "maximal" compression). Note that tests have + * shown that zlib compression levels 3-6 usually perform as well as level 9 + * for PNG images, and do considerably fewer caclulations. In the future, + * these values may not correspond directly to the zlib compression levels. + */ +extern PNG_EXPORT(void,png_set_compression_level) PNGARG((png_structp png_ptr, + int level)); + +extern PNG_EXPORT(void,png_set_compression_mem_level) + PNGARG((png_structp png_ptr, int mem_level)); + +extern PNG_EXPORT(void,png_set_compression_strategy) + PNGARG((png_structp png_ptr, int strategy)); + +extern PNG_EXPORT(void,png_set_compression_window_bits) + PNGARG((png_structp png_ptr, int window_bits)); + +extern PNG_EXPORT(void,png_set_compression_method) PNGARG((png_structp png_ptr, + int method)); + +/* These next functions are called for input/output, memory, and error + * handling. They are in the file pngrio.c, pngwio.c, and pngerror.c, + * and call standard C I/O routines such as fread(), fwrite(), and + * fprintf(). These functions can be made to use other I/O routines + * at run time for those applications that need to handle I/O in a + * different manner by calling png_set_???_fn(). See libpng.txt for + * more information. + */ + +#if !defined(PNG_NO_STDIO) +/* Initialize the input/output for the PNG file to the default functions. */ +extern PNG_EXPORT(void,png_init_io) PNGARG((png_structp png_ptr, png_FILE_p fp)); +#endif + +/* Replace the (error and abort), and warning functions with user + * supplied functions. If no messages are to be printed you must still + * write and use replacement functions. The replacement error_fn should + * still do a longjmp to the last setjmp location if you are using this + * method of error handling. If error_fn or warning_fn is NULL, the + * default function will be used. + */ + +extern PNG_EXPORT(void,png_set_error_fn) PNGARG((png_structp png_ptr, + png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)); + +/* Return the user pointer associated with the error functions */ +extern PNG_EXPORT(png_voidp,png_get_error_ptr) PNGARG((png_structp png_ptr)); + +/* Replace the default data output functions with a user supplied one(s). + * If buffered output is not used, then output_flush_fn can be set to NULL. + * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time + * output_flush_fn will be ignored (and thus can be NULL). + */ +extern PNG_EXPORT(void,png_set_write_fn) PNGARG((png_structp png_ptr, + png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)); + +/* Replace the default data input function with a user supplied one. */ +extern PNG_EXPORT(void,png_set_read_fn) PNGARG((png_structp png_ptr, + png_voidp io_ptr, png_rw_ptr read_data_fn)); + +/* Return the user pointer associated with the I/O functions */ +extern PNG_EXPORT(png_voidp,png_get_io_ptr) PNGARG((png_structp png_ptr)); + +extern PNG_EXPORT(void,png_set_read_status_fn) PNGARG((png_structp png_ptr, + png_read_status_ptr read_row_fn)); + +extern PNG_EXPORT(void,png_set_write_status_fn) PNGARG((png_structp png_ptr, + png_write_status_ptr write_row_fn)); + +#ifdef PNG_USER_MEM_SUPPORTED +/* Replace the default memory allocation functions with user supplied one(s). */ +extern PNG_EXPORT(void,png_set_mem_fn) PNGARG((png_structp png_ptr, + png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)); +/* Return the user pointer associated with the memory functions */ +extern PNG_EXPORT(png_voidp,png_get_mem_ptr) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_LEGACY_SUPPORTED) +extern PNG_EXPORT(void,png_set_read_user_transform_fn) PNGARG((png_structp + png_ptr, png_user_transform_ptr read_user_transform_fn)); +#endif + +#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_LEGACY_SUPPORTED) +extern PNG_EXPORT(void,png_set_write_user_transform_fn) PNGARG((png_structp + png_ptr, png_user_transform_ptr write_user_transform_fn)); +#endif + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_LEGACY_SUPPORTED) +extern PNG_EXPORT(void,png_set_user_transform_info) PNGARG((png_structp + png_ptr, png_voidp user_transform_ptr, int user_transform_depth, + int user_transform_channels)); +/* Return the user pointer associated with the user transform functions */ +extern PNG_EXPORT(png_voidp,png_get_user_transform_ptr) + PNGARG((png_structp png_ptr)); +#endif + +#ifdef PNG_USER_CHUNKS_SUPPORTED +extern PNG_EXPORT(void,png_set_read_user_chunk_fn) PNGARG((png_structp png_ptr, + png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)); +extern PNG_EXPORT(png_voidp,png_get_user_chunk_ptr) PNGARG((png_structp + png_ptr)); +#endif + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +/* Sets the function callbacks for the push reader, and a pointer to a + * user-defined structure available to the callback functions. + */ +extern PNG_EXPORT(void,png_set_progressive_read_fn) PNGARG((png_structp png_ptr, + png_voidp progressive_ptr, + png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, + png_progressive_end_ptr end_fn)); + +/* returns the user pointer associated with the push read functions */ +extern PNG_EXPORT(png_voidp,png_get_progressive_ptr) + PNGARG((png_structp png_ptr)); + +/* function to be called when data becomes available */ +extern PNG_EXPORT(void,png_process_data) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_bytep buffer, png_size_t buffer_size)); + +/* function that combines rows. Not very much different than the + * png_combine_row() call. Is this even used????? + */ +extern PNG_EXPORT(void,png_progressive_combine_row) PNGARG((png_structp png_ptr, + png_bytep old_row, png_bytep new_row)); +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ + +extern PNG_EXPORT(png_voidp,png_malloc) PNGARG((png_structp png_ptr, + png_uint_32 size)); + +#if defined(PNG_1_0_X) +# define png_malloc_warn png_malloc +#else +/* Added at libpng version 1.2.4 */ +extern PNG_EXPORT(png_voidp,png_malloc_warn) PNGARG((png_structp png_ptr, + png_uint_32 size)); +#endif + +/* frees a pointer allocated by png_malloc() */ +extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr)); + +#if defined(PNG_1_0_X) +/* Function to allocate memory for zlib. */ +extern PNG_EXPORT(voidpf,png_zalloc) PNGARG((voidpf png_ptr, uInt items, + uInt size)); + +/* Function to free memory for zlib */ +extern PNG_EXPORT(void,png_zfree) PNGARG((voidpf png_ptr, voidpf ptr)); +#endif + +/* Free data that was allocated internally */ +extern PNG_EXPORT(void,png_free_data) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 free_me, int num)); +#ifdef PNG_FREE_ME_SUPPORTED +/* Reassign responsibility for freeing existing data, whether allocated + * by libpng or by the application */ +extern PNG_EXPORT(void,png_data_freer) PNGARG((png_structp png_ptr, + png_infop info_ptr, int freer, png_uint_32 mask)); +#endif +/* assignments for png_data_freer */ +#define PNG_DESTROY_WILL_FREE_DATA 1 +#define PNG_SET_WILL_FREE_DATA 1 +#define PNG_USER_WILL_FREE_DATA 2 +/* Flags for png_ptr->free_me and info_ptr->free_me */ +#define PNG_FREE_HIST 0x0008 +#define PNG_FREE_ICCP 0x0010 +#define PNG_FREE_SPLT 0x0020 +#define PNG_FREE_ROWS 0x0040 +#define PNG_FREE_PCAL 0x0080 +#define PNG_FREE_SCAL 0x0100 +#define PNG_FREE_UNKN 0x0200 +#define PNG_FREE_LIST 0x0400 +#define PNG_FREE_PLTE 0x1000 +#define PNG_FREE_TRNS 0x2000 +#define PNG_FREE_TEXT 0x4000 +#define PNG_FREE_ALL 0x7fff +#define PNG_FREE_MUL 0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */ + +#ifdef PNG_USER_MEM_SUPPORTED +extern PNG_EXPORT(png_voidp,png_malloc_default) PNGARG((png_structp png_ptr, + png_uint_32 size)); +extern PNG_EXPORT(void,png_free_default) PNGARG((png_structp png_ptr, + png_voidp ptr)); +#endif + +extern PNG_EXPORT(png_voidp,png_memcpy_check) PNGARG((png_structp png_ptr, + png_voidp s1, png_voidp s2, png_uint_32 size)); + +extern PNG_EXPORT(png_voidp,png_memset_check) PNGARG((png_structp png_ptr, + png_voidp s1, int value, png_uint_32 size)); + +#if defined(USE_FAR_KEYWORD) /* memory model conversion function */ +extern void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr, + int check)); +#endif /* USE_FAR_KEYWORD */ + +/* Fatal error in PNG image of libpng - can't continue */ +extern PNG_EXPORT(void,png_error) PNGARG((png_structp png_ptr, + png_const_charp error_message)); + +/* The same, but the chunk name is prepended to the error string. */ +extern PNG_EXPORT(void,png_chunk_error) PNGARG((png_structp png_ptr, + png_const_charp error_message)); + +/* Non-fatal error in libpng. Can continue, but may have a problem. */ +extern PNG_EXPORT(void,png_warning) PNGARG((png_structp png_ptr, + png_const_charp warning_message)); + +/* Non-fatal error in libpng, chunk name is prepended to message. */ +extern PNG_EXPORT(void,png_chunk_warning) PNGARG((png_structp png_ptr, + png_const_charp warning_message)); + +/* The png_set_ functions are for storing values in the png_info_struct. + * Similarly, the png_get_ calls are used to read values from the + * png_info_struct, either storing the parameters in the passed variables, or + * setting pointers into the png_info_struct where the data is stored. The + * png_get_ functions return a non-zero value if the data was available + * in info_ptr, or return zero and do not change any of the parameters if the + * data was not available. + * + * These functions should be used instead of directly accessing png_info + * to avoid problems with future changes in the size and internal layout of + * png_info_struct. + */ +/* Returns "flag" if chunk data is valid in info_ptr. */ +extern PNG_EXPORT(png_uint_32,png_get_valid) PNGARG((png_structp png_ptr, +png_infop info_ptr, png_uint_32 flag)); + +/* Returns number of bytes needed to hold a transformed row. */ +extern PNG_EXPORT(png_uint_32,png_get_rowbytes) PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +#if defined(PNG_INFO_IMAGE_SUPPORTED) +/* Returns row_pointers, which is an array of pointers to scanlines that was +returned from png_read_png(). */ +extern PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((png_structp png_ptr, +png_infop info_ptr)); +/* Set row_pointers, which is an array of pointers to scanlines for use +by png_write_png(). */ +extern PNG_EXPORT(void,png_set_rows) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_bytepp row_pointers)); +#endif + +/* Returns number of color channels in image. */ +extern PNG_EXPORT(png_byte,png_get_channels) PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +#ifdef PNG_EASY_ACCESS_SUPPORTED +/* Returns image width in pixels. */ +extern PNG_EXPORT(png_uint_32, png_get_image_width) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image height in pixels. */ +extern PNG_EXPORT(png_uint_32, png_get_image_height) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image bit_depth. */ +extern PNG_EXPORT(png_byte, png_get_bit_depth) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image color_type. */ +extern PNG_EXPORT(png_byte, png_get_color_type) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image filter_type. */ +extern PNG_EXPORT(png_byte, png_get_filter_type) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image interlace_type. */ +extern PNG_EXPORT(png_byte, png_get_interlace_type) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image compression_type. */ +extern PNG_EXPORT(png_byte, png_get_compression_type) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image resolution in pixels per meter, from pHYs chunk data. */ +extern PNG_EXPORT(png_uint_32, png_get_pixels_per_meter) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_uint_32, png_get_x_pixels_per_meter) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_uint_32, png_get_y_pixels_per_meter) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns pixel aspect ratio, computed from pHYs chunk data. */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(float, png_get_pixel_aspect_ratio) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +#endif + +/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */ +extern PNG_EXPORT(png_int_32, png_get_x_offset_pixels) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_int_32, png_get_y_offset_pixels) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_int_32, png_get_x_offset_microns) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_int_32, png_get_y_offset_microns) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +#endif /* PNG_EASY_ACCESS_SUPPORTED */ + +/* Returns pointer to signature string read from PNG header */ +extern PNG_EXPORT(png_bytep,png_get_signature) PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +#if defined(PNG_bKGD_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_bKGD) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_color_16p *background)); +#endif + +#if defined(PNG_bKGD_SUPPORTED) +extern PNG_EXPORT(void,png_set_bKGD) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_color_16p background)); +#endif + +#if defined(PNG_cHRM_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_cHRM) PNGARG((png_structp png_ptr, + png_infop info_ptr, double *white_x, double *white_y, double *red_x, + double *red_y, double *green_x, double *green_y, double *blue_x, + double *blue_y)); +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_cHRM_fixed) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_fixed_point *int_white_x, png_fixed_point + *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y, + png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point + *int_blue_x, png_fixed_point *int_blue_y)); +#endif +#endif + +#if defined(PNG_cHRM_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_cHRM) PNGARG((png_structp png_ptr, + png_infop info_ptr, double white_x, double white_y, double red_x, + double red_y, double green_x, double green_y, double blue_x, double blue_y)); +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_cHRM_fixed) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y, + png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point + int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, + png_fixed_point int_blue_y)); +#endif +#endif + +#if defined(PNG_gAMA_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_gAMA) PNGARG((png_structp png_ptr, + png_infop info_ptr, double *file_gamma)); +#endif +extern PNG_EXPORT(png_uint_32,png_get_gAMA_fixed) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_fixed_point *int_file_gamma)); +#endif + +#if defined(PNG_gAMA_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_gAMA) PNGARG((png_structp png_ptr, + png_infop info_ptr, double file_gamma)); +#endif +extern PNG_EXPORT(void,png_set_gAMA_fixed) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_fixed_point int_file_gamma)); +#endif + +#if defined(PNG_hIST_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_hIST) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_16p *hist)); +#endif + +#if defined(PNG_hIST_SUPPORTED) +extern PNG_EXPORT(void,png_set_hIST) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_16p hist)); +#endif + +extern PNG_EXPORT(png_uint_32,png_get_IHDR) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 *width, png_uint_32 *height, + int *bit_depth, int *color_type, int *interlace_method, + int *compression_method, int *filter_method)); + +extern PNG_EXPORT(void,png_set_IHDR) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, + int color_type, int interlace_method, int compression_method, + int filter_method)); + +#if defined(PNG_oFFs_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_oFFs) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, + int *unit_type)); +#endif + +#if defined(PNG_oFFs_SUPPORTED) +extern PNG_EXPORT(void,png_set_oFFs) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_int_32 offset_x, png_int_32 offset_y, + int unit_type)); +#endif + +#if defined(PNG_pCAL_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_pCAL) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1, + int *type, int *nparams, png_charp *units, png_charpp *params)); +#endif + +#if defined(PNG_pCAL_SUPPORTED) +extern PNG_EXPORT(void,png_set_pCAL) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1, + int type, int nparams, png_charp units, png_charpp params)); +#endif + +#if defined(PNG_pHYs_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_pHYs) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); +#endif + +#if defined(PNG_pHYs_SUPPORTED) +extern PNG_EXPORT(void,png_set_pHYs) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type)); +#endif + +extern PNG_EXPORT(png_uint_32,png_get_PLTE) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_colorp *palette, int *num_palette)); + +extern PNG_EXPORT(void,png_set_PLTE) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_colorp palette, int num_palette)); + +#if defined(PNG_sBIT_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_sBIT) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_color_8p *sig_bit)); +#endif + +#if defined(PNG_sBIT_SUPPORTED) +extern PNG_EXPORT(void,png_set_sBIT) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_color_8p sig_bit)); +#endif + +#if defined(PNG_sRGB_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_sRGB) PNGARG((png_structp png_ptr, + png_infop info_ptr, int *intent)); +#endif + +#if defined(PNG_sRGB_SUPPORTED) +extern PNG_EXPORT(void,png_set_sRGB) PNGARG((png_structp png_ptr, + png_infop info_ptr, int intent)); +extern PNG_EXPORT(void,png_set_sRGB_gAMA_and_cHRM) PNGARG((png_structp png_ptr, + png_infop info_ptr, int intent)); +#endif + +#if defined(PNG_iCCP_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_charpp name, int *compression_type, + png_charpp profile, png_uint_32 *proflen)); + /* Note to maintainer: profile should be png_bytepp */ +#endif + +#if defined(PNG_iCCP_SUPPORTED) +extern PNG_EXPORT(void,png_set_iCCP) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_charp name, int compression_type, + png_charp profile, png_uint_32 proflen)); + /* Note to maintainer: profile should be png_bytep */ +#endif + +#if defined(PNG_sPLT_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_sPLT) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_sPLT_tpp entries)); +#endif + +#if defined(PNG_sPLT_SUPPORTED) +extern PNG_EXPORT(void,png_set_sPLT) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_sPLT_tp entries, int nentries)); +#endif + +#if defined(PNG_TEXT_SUPPORTED) +/* png_get_text also returns the number of text chunks in *num_text */ +extern PNG_EXPORT(png_uint_32,png_get_text) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_textp *text_ptr, int *num_text)); +#endif + +/* + * Note while png_set_text() will accept a structure whose text, + * language, and translated keywords are NULL pointers, the structure + * returned by png_get_text will always contain regular + * zero-terminated C strings. They might be empty strings but + * they will never be NULL pointers. + */ + +#if defined(PNG_TEXT_SUPPORTED) +extern PNG_EXPORT(void,png_set_text) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_textp text_ptr, int num_text)); +#endif + +#if defined(PNG_tIME_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_tIME) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_timep *mod_time)); +#endif + +#if defined(PNG_tIME_SUPPORTED) +extern PNG_EXPORT(void,png_set_tIME) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_timep mod_time)); +#endif + +#if defined(PNG_tRNS_SUPPORTED) +extern PNG_EXPORT(png_uint_32,png_get_tRNS) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_bytep *trans, int *num_trans, + png_color_16p *trans_values)); +#endif + +#if defined(PNG_tRNS_SUPPORTED) +extern PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_bytep trans, int num_trans, + png_color_16p trans_values)); +#endif + +#if defined(PNG_tRNS_SUPPORTED) +#endif + +#if defined(PNG_sCAL_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_sCAL) PNGARG((png_structp png_ptr, + png_infop info_ptr, int *unit, double *width, double *height)); +#else +#ifdef PNG_FIXED_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_sCAL_s) PNGARG((png_structp png_ptr, + png_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight)); +#endif +#endif +#endif /* PNG_sCAL_SUPPORTED */ + +#if defined(PNG_sCAL_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_sCAL) PNGARG((png_structp png_ptr, + png_infop info_ptr, int unit, double width, double height)); +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_sCAL_s) PNGARG((png_structp png_ptr, + png_infop info_ptr, int unit, png_charp swidth, png_charp sheight)); +#endif +#endif /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */ + +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) +/* provide a list of chunks and how they are to be handled, if the built-in + handling or default unknown chunk handling is not desired. Any chunks not + listed will be handled in the default manner. The IHDR and IEND chunks + must not be listed. + keep = 0: follow default behavour + = 1: do not keep + = 2: keep only if safe-to-copy + = 3: keep even if unsafe-to-copy +*/ +extern PNG_EXPORT(void, png_set_keep_unknown_chunks) PNGARG((png_structp + png_ptr, int keep, png_bytep chunk_list, int num_chunks)); +extern PNG_EXPORT(void, png_set_unknown_chunks) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns)); +extern PNG_EXPORT(void, png_set_unknown_chunk_location) + PNGARG((png_structp png_ptr, png_infop info_ptr, int chunk, int location)); +extern PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_structp + png_ptr, png_infop info_ptr, png_unknown_chunkpp entries)); +#endif +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED +PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep + chunk_name)); +#endif + +/* Png_free_data() will turn off the "valid" flag for anything it frees. + If you need to turn it off for a chunk that your application has freed, + you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); */ +extern PNG_EXPORT(void, png_set_invalid) PNGARG((png_structp png_ptr, + png_infop info_ptr, int mask)); + +#if defined(PNG_INFO_IMAGE_SUPPORTED) +/* The "params" pointer is currently not used and is for future expansion. */ +extern PNG_EXPORT(void, png_read_png) PNGARG((png_structp png_ptr, + png_infop info_ptr, + int transforms, + png_voidp params)); +extern PNG_EXPORT(void, png_write_png) PNGARG((png_structp png_ptr, + png_infop info_ptr, + int transforms, + png_voidp params)); +#endif + +/* Define PNG_DEBUG at compile time for debugging information. Higher + * numbers for PNG_DEBUG mean more debugging information. This has + * only been added since version 0.95 so it is not implemented throughout + * libpng yet, but more support will be added as needed. + */ +#ifdef PNG_DEBUG +#if (PNG_DEBUG > 0) +#if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER) +#include +#if (PNG_DEBUG > 1) +#define png_debug(l,m) _RPT0(_CRT_WARN,m) +#define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m,p1) +#define png_debug2(l,m,p1,p2) _RPT2(_CRT_WARN,m,p1,p2) +#endif +#else /* PNG_DEBUG_FILE || !_MSC_VER */ +#ifndef PNG_DEBUG_FILE +#define PNG_DEBUG_FILE stderr +#endif /* PNG_DEBUG_FILE */ +#if (PNG_DEBUG > 1) +#define png_debug(l,m) \ +{ \ + int num_tabs=l; \ + fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \ +} +#define png_debug1(l,m,p1) \ +{ \ + int num_tabs=l; \ + fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \ +} +#define png_debug2(l,m,p1,p2) \ +{ \ + int num_tabs=l; \ + fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \ +} +#endif /* (PNG_DEBUG > 1) */ +#endif /* _MSC_VER */ +#endif /* (PNG_DEBUG > 0) */ +#endif /* PNG_DEBUG */ +#ifndef png_debug +#define png_debug(l, m) +#endif +#ifndef png_debug1 +#define png_debug1(l, m, p1) +#endif +#ifndef png_debug2 +#define png_debug2(l, m, p1, p2) +#endif + +extern PNG_EXPORT(png_bytep,png_sig_bytes) PNGARG((void)); + +extern PNG_EXPORT(png_charp,png_get_copyright) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_charp,png_get_header_ver) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_charp,png_get_header_version) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr)); + +#ifdef PNG_MNG_FEATURES_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp + png_ptr, png_uint_32 mng_features_permitted)); +#endif + +/* Added to version 1.2.0 */ +#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) +#define PNG_ASM_FLAG_MMX_SUPPORT_COMPILED 0x01 /* not user-settable */ +#define PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU 0x02 /* not user-settable */ +#define PNG_ASM_FLAG_MMX_READ_COMBINE_ROW 0x04 +#define PNG_ASM_FLAG_MMX_READ_INTERLACE 0x08 +#define PNG_ASM_FLAG_MMX_READ_FILTER_SUB 0x10 +#define PNG_ASM_FLAG_MMX_READ_FILTER_UP 0x20 +#define PNG_ASM_FLAG_MMX_READ_FILTER_AVG 0x40 +#define PNG_ASM_FLAG_MMX_READ_FILTER_PAETH 0x80 +#define PNG_ASM_FLAGS_INITIALIZED 0x80000000 /* not user-settable */ + +#define PNG_MMX_READ_FLAGS ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \ + | PNG_ASM_FLAG_MMX_READ_INTERLACE \ + | PNG_ASM_FLAG_MMX_READ_FILTER_SUB \ + | PNG_ASM_FLAG_MMX_READ_FILTER_UP \ + | PNG_ASM_FLAG_MMX_READ_FILTER_AVG \ + | PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ) +#define PNG_MMX_WRITE_FLAGS ( 0 ) + +#define PNG_MMX_FLAGS ( PNG_ASM_FLAG_MMX_SUPPORT_COMPILED \ + | PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU \ + | PNG_MMX_READ_FLAGS \ + | PNG_MMX_WRITE_FLAGS ) + +#define PNG_SELECT_READ 1 +#define PNG_SELECT_WRITE 2 + + +#if !defined(PNG_1_0_X) +/* pngget.c */ +extern PNG_EXPORT(png_uint_32,png_get_mmx_flagmask) + PNGARG((int flag_select, int *compilerID)); + +/* pngget.c */ +extern PNG_EXPORT(png_uint_32,png_get_asm_flagmask) + PNGARG((int flag_select)); + +/* pngget.c */ +extern PNG_EXPORT(png_uint_32,png_get_asm_flags) + PNGARG((png_structp png_ptr)); + +/* pngget.c */ +extern PNG_EXPORT(png_byte,png_get_mmx_bitdepth_threshold) + PNGARG((png_structp png_ptr)); + +/* pngget.c */ +extern PNG_EXPORT(png_uint_32,png_get_mmx_rowbytes_threshold) + PNGARG((png_structp png_ptr)); + +/* pngset.c */ +extern PNG_EXPORT(void,png_set_asm_flags) + PNGARG((png_structp png_ptr, png_uint_32 asm_flags)); + +/* pngset.c */ +extern PNG_EXPORT(void,png_set_mmx_thresholds) + PNGARG((png_structp png_ptr, png_byte mmx_bitdepth_threshold, + png_uint_32 mmx_rowbytes_threshold)); + +#endif /* PNG_1_0_X */ +#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ + +#if !defined(PNG_1_0_X) +/* png.c, pnggccrd.c, or pngvcrd.c */ +extern PNG_EXPORT(int,png_mmx_support) PNGARG((void)); + +/* Strip the prepended error numbers ("#nnn ") from error and warning + * messages before passing them to the error or warning handler. */ +#ifdef PNG_ERROR_NUMBERS_SUPPORTED +extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp + png_ptr, png_uint_32 strip_mode)); +#endif +#endif /* PNG_1_0_X */ + +/* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */ + +#define PNG_HEADER_VERSION_STRING \ + " libpng version 1.2.5 - October 3, 2002 (header)\n" + +#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED +/* With these routines we avoid an integer divide, which will be slower on + * most machines. However, it does take more operations than the corresponding + * divide method, so it may be slower on a few RISC systems. There are two + * shifts (by 8 or 16 bits) and an addition, versus a single integer divide. + * + * Note that the rounding factors are NOT supposed to be the same! 128 and + * 32768 are correct for the NODIV code; 127 and 32767 are correct for the + * standard method. + * + * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ] + */ + + /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */ + +# define png_composite(composite, fg, alpha, bg) \ + { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) * (png_uint_16)(alpha) \ + + (png_uint_16)(bg)*(png_uint_16)(255 - \ + (png_uint_16)(alpha)) + (png_uint_16)128); \ + (composite) = (png_byte)((temp + (temp >> 8)) >> 8); } + +# define png_composite_16(composite, fg, alpha, bg) \ + { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) * (png_uint_32)(alpha) \ + + (png_uint_32)(bg)*(png_uint_32)(65535L - \ + (png_uint_32)(alpha)) + (png_uint_32)32768L); \ + (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); } + +#else /* standard method using integer division */ + +# define png_composite(composite, fg, alpha, bg) \ + (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) + \ + (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ + (png_uint_16)127) / 255) + +# define png_composite_16(composite, fg, alpha, bg) \ + (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \ + (png_uint_32)(bg)*(png_uint_32)(65535L - (png_uint_32)(alpha)) + \ + (png_uint_32)32767) / (png_uint_32)65535L) + +#endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */ + +/* These next functions are used internally in the code. They generally + * shouldn't be used unless you are writing code to add or replace some + * functionality in libpng. More information about most functions can + * be found in the files where the functions are located. + */ + +#if defined(PNG_INTERNAL) + +/* Various modes of operation. Note that after an init, mode is set to + * zero automatically when the structure is created. + */ +#define PNG_HAVE_IHDR 0x01 +#define PNG_HAVE_PLTE 0x02 +#define PNG_HAVE_IDAT 0x04 +#define PNG_AFTER_IDAT 0x08 +#define PNG_HAVE_IEND 0x10 +#define PNG_HAVE_gAMA 0x20 +#define PNG_HAVE_cHRM 0x40 +#define PNG_HAVE_sRGB 0x80 +#define PNG_HAVE_CHUNK_HEADER 0x100 +#define PNG_WROTE_tIME 0x200 +#define PNG_WROTE_INFO_BEFORE_PLTE 0x400 +#define PNG_BACKGROUND_IS_GRAY 0x800 +#define PNG_HAVE_PNG_SIGNATURE 0x1000 + +/* flags for the transformations the PNG library does on the image data */ +#define PNG_BGR 0x0001 +#define PNG_INTERLACE 0x0002 +#define PNG_PACK 0x0004 +#define PNG_SHIFT 0x0008 +#define PNG_SWAP_BYTES 0x0010 +#define PNG_INVERT_MONO 0x0020 +#define PNG_DITHER 0x0040 +#define PNG_BACKGROUND 0x0080 +#define PNG_BACKGROUND_EXPAND 0x0100 + /* 0x0200 unused */ +#define PNG_16_TO_8 0x0400 +#define PNG_RGBA 0x0800 +#define PNG_EXPAND 0x1000 +#define PNG_GAMMA 0x2000 +#define PNG_GRAY_TO_RGB 0x4000 +#define PNG_FILLER 0x8000L +#define PNG_PACKSWAP 0x10000L +#define PNG_SWAP_ALPHA 0x20000L +#define PNG_STRIP_ALPHA 0x40000L +#define PNG_INVERT_ALPHA 0x80000L +#define PNG_USER_TRANSFORM 0x100000L +#define PNG_RGB_TO_GRAY_ERR 0x200000L +#define PNG_RGB_TO_GRAY_WARN 0x400000L +#define PNG_RGB_TO_GRAY 0x600000L /* two bits, RGB_TO_GRAY_ERR|WARN */ + +/* flags for png_create_struct */ +#define PNG_STRUCT_PNG 0x0001 +#define PNG_STRUCT_INFO 0x0002 + +/* Scaling factor for filter heuristic weighting calculations */ +#define PNG_WEIGHT_SHIFT 8 +#define PNG_WEIGHT_FACTOR (1<<(PNG_WEIGHT_SHIFT)) +#define PNG_COST_SHIFT 3 +#define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT)) + +/* flags for the png_ptr->flags rather than declaring a byte for each one */ +#define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001 +#define PNG_FLAG_ZLIB_CUSTOM_LEVEL 0x0002 +#define PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL 0x0004 +#define PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS 0x0008 +#define PNG_FLAG_ZLIB_CUSTOM_METHOD 0x0010 +#define PNG_FLAG_ZLIB_FINISHED 0x0020 +#define PNG_FLAG_ROW_INIT 0x0040 +#define PNG_FLAG_FILLER_AFTER 0x0080 +#define PNG_FLAG_CRC_ANCILLARY_USE 0x0100 +#define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200 +#define PNG_FLAG_CRC_CRITICAL_USE 0x0400 +#define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800 +#define PNG_FLAG_FREE_PLTE 0x1000 +#define PNG_FLAG_FREE_TRNS 0x2000 +#define PNG_FLAG_FREE_HIST 0x4000 +#define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000L +#define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000L +#define PNG_FLAG_LIBRARY_MISMATCH 0x20000L +#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000L +#define PNG_FLAG_STRIP_ERROR_TEXT 0x80000L +#define PNG_FLAG_MALLOC_NULL_MEM_OK 0x100000L + +/* For use in png_set_keep_unknown, png_handle_as_unknown */ +#define HANDLE_CHUNK_AS_DEFAULT 0 +#define HANDLE_CHUNK_NEVER 1 +#define HANDLE_CHUNK_IF_SAFE 2 +#define HANDLE_CHUNK_ALWAYS 3 + +#define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \ + PNG_FLAG_CRC_ANCILLARY_NOWARN) + +#define PNG_FLAG_CRC_CRITICAL_MASK (PNG_FLAG_CRC_CRITICAL_USE | \ + PNG_FLAG_CRC_CRITICAL_IGNORE) + +#define PNG_FLAG_CRC_MASK (PNG_FLAG_CRC_ANCILLARY_MASK | \ + PNG_FLAG_CRC_CRITICAL_MASK) + +/* save typing and make code easier to understand */ +#define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \ + abs((int)((c1).green) - (int)((c2).green)) + \ + abs((int)((c1).blue) - (int)((c2).blue))) + +/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */ +#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN) +/* place to hold the signature string for a PNG file. */ +#ifdef PNG_USE_GLOBAL_ARRAYS + PNG_EXPORT_VAR (const png_byte FARDATA) png_sig[8]; +#else +#define png_sig png_sig_bytes(NULL) +#endif +#endif /* PNG_NO_EXTERN */ + +/* Constant strings for known chunk types. If you need to add a chunk, + * define the name here, and add an invocation of the macro in png.c and + * wherever it's needed. + */ +#define PNG_IHDR const png_byte png_IHDR[5] = { 73, 72, 68, 82, '\0'} +#define PNG_IDAT const png_byte png_IDAT[5] = { 73, 68, 65, 84, '\0'} +#define PNG_IEND const png_byte png_IEND[5] = { 73, 69, 78, 68, '\0'} +#define PNG_PLTE const png_byte png_PLTE[5] = { 80, 76, 84, 69, '\0'} +#define PNG_bKGD const png_byte png_bKGD[5] = { 98, 75, 71, 68, '\0'} +#define PNG_cHRM const png_byte png_cHRM[5] = { 99, 72, 82, 77, '\0'} +#define PNG_gAMA const png_byte png_gAMA[5] = {103, 65, 77, 65, '\0'} +#define PNG_hIST const png_byte png_hIST[5] = {104, 73, 83, 84, '\0'} +#define PNG_iCCP const png_byte png_iCCP[5] = {105, 67, 67, 80, '\0'} +#define PNG_iTXt const png_byte png_iTXt[5] = {105, 84, 88, 116, '\0'} +#define PNG_oFFs const png_byte png_oFFs[5] = {111, 70, 70, 115, '\0'} +#define PNG_pCAL const png_byte png_pCAL[5] = {112, 67, 65, 76, '\0'} +#define PNG_sCAL const png_byte png_sCAL[5] = {115, 67, 65, 76, '\0'} +#define PNG_pHYs const png_byte png_pHYs[5] = {112, 72, 89, 115, '\0'} +#define PNG_sBIT const png_byte png_sBIT[5] = {115, 66, 73, 84, '\0'} +#define PNG_sPLT const png_byte png_sPLT[5] = {115, 80, 76, 84, '\0'} +#define PNG_sRGB const png_byte png_sRGB[5] = {115, 82, 71, 66, '\0'} +#define PNG_tEXt const png_byte png_tEXt[5] = {116, 69, 88, 116, '\0'} +#define PNG_tIME const png_byte png_tIME[5] = {116, 73, 77, 69, '\0'} +#define PNG_tRNS const png_byte png_tRNS[5] = {116, 82, 78, 83, '\0'} +#define PNG_zTXt const png_byte png_zTXt[5] = {122, 84, 88, 116, '\0'} + +#ifdef PNG_USE_GLOBAL_ARRAYS +PNG_EXPORT_VAR (const png_byte FARDATA) png_IHDR[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_IDAT[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_IEND[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_PLTE[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_bKGD[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_cHRM[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_gAMA[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_hIST[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_iCCP[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_iTXt[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_oFFs[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_pCAL[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_sCAL[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_pHYs[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_sBIT[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_sPLT[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_sRGB[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_tEXt[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_tIME[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_tRNS[5]; +PNG_EXPORT_VAR (const png_byte FARDATA) png_zTXt[5]; +#endif /* PNG_USE_GLOBAL_ARRAYS */ + + +/* Inline macros to do direct reads of bytes from the input buffer. These + * require that you are using an architecture that uses PNG byte ordering + * (MSB first) and supports unaligned data storage. I think that PowerPC + * in big-endian mode and 680x0 are the only ones that will support this. + * The x86 line of processors definitely do not. The png_get_int_32() + * routine also assumes we are using two's complement format for negative + * values, which is almost certainly true. + */ +#if defined(PNG_READ_BIG_ENDIAN_SUPPORTED) +# if defined(PNG_pCAL_SUPPORTED) || defined(PNG_oFFs_SUPPORTED) +# define png_get_int_32(buf) ( *((png_int_32p) (buf))) +# endif +# define png_get_uint_32(buf) ( *((png_uint_32p) (buf))) +# define png_get_uint_16(buf) ( *((png_uint_16p) (buf))) +#else +# if defined(PNG_pCAL_SUPPORTED) || defined(PNG_oFFs_SUPPORTED) +PNG_EXTERN png_int_32 png_get_int_32 PNGARG((png_bytep buf)); +# endif +PNG_EXTERN png_uint_32 png_get_uint_32 PNGARG((png_bytep buf)); +PNG_EXTERN png_uint_16 png_get_uint_16 PNGARG((png_bytep buf)); +#endif /* !PNG_READ_BIG_ENDIAN_SUPPORTED */ + +/* Initialize png_ptr struct for reading, and allocate any other memory. + * (old interface - DEPRECATED - use png_create_read_struct instead). + */ +extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr)); +#undef png_read_init +#define png_read_init(png_ptr) png_read_init_3(&png_ptr, \ + PNG_LIBPNG_VER_STRING, sizeof(png_struct)); +extern PNG_EXPORT(void,png_read_init_3) PNGARG((png_structpp ptr_ptr, + png_const_charp user_png_ver, png_size_t png_struct_size)); +extern PNG_EXPORT(void,png_read_init_2) PNGARG((png_structp png_ptr, + png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t + png_info_size)); + +/* Initialize png_ptr struct for writing, and allocate any other memory. + * (old interface - DEPRECATED - use png_create_write_struct instead). + */ +extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr)); +#undef png_write_init +#define png_write_init(png_ptr) png_write_init_3(&png_ptr, \ + PNG_LIBPNG_VER_STRING, sizeof(png_struct)); +extern PNG_EXPORT(void,png_write_init_3) PNGARG((png_structpp ptr_ptr, + png_const_charp user_png_ver, png_size_t png_struct_size)); +extern PNG_EXPORT(void,png_write_init_2) PNGARG((png_structp png_ptr, + png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t + png_info_size)); + +/* Allocate memory for an internal libpng struct */ +PNG_EXTERN png_voidp png_create_struct PNGARG((int type)); + +/* Free memory from internal libpng struct */ +PNG_EXTERN void png_destroy_struct PNGARG((png_voidp struct_ptr)); + +PNG_EXTERN png_voidp png_create_struct_2 PNGARG((int type, png_malloc_ptr + malloc_fn, png_voidp mem_ptr)); +PNG_EXTERN void png_destroy_struct_2 PNGARG((png_voidp struct_ptr, + png_free_ptr free_fn, png_voidp mem_ptr)); + +/* Free any memory that info_ptr points to and reset struct. */ +PNG_EXTERN void png_info_destroy PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +#ifndef PNG_1_0_X +/* Function to allocate memory for zlib. */ +PNG_EXTERN voidpf png_zalloc PNGARG((voidpf png_ptr, uInt items, uInt size)); + +/* Function to free memory for zlib */ +PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr)); + +/* Next four functions are used internally as callbacks. PNGAPI is required + * but not PNG_EXPORT. PNGAPI added at libpng version 1.2.3. */ + +PNG_EXTERN void PNGAPI png_default_read_data PNGARG((png_structp png_ptr, + png_bytep data, png_size_t length)); + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +PNG_EXTERN void PNGAPI png_push_fill_buffer PNGARG((png_structp png_ptr, + png_bytep buffer, png_size_t length)); +#endif + +PNG_EXTERN void PNGAPI png_default_write_data PNGARG((png_structp png_ptr, + png_bytep data, png_size_t length)); + +#if defined(PNG_WRITE_FLUSH_SUPPORTED) +#if !defined(PNG_NO_STDIO) +PNG_EXTERN void PNGAPI png_default_flush PNGARG((png_structp png_ptr)); +#endif +#endif +#else /* PNG_1_0_X */ +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +PNG_EXTERN void png_push_fill_buffer PNGARG((png_structp png_ptr, + png_bytep buffer, png_size_t length)); +#endif +#endif /* PNG_1_0_X */ + +/* Reset the CRC variable */ +PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr)); + +/* Write the "data" buffer to whatever output you are using. */ +PNG_EXTERN void png_write_data PNGARG((png_structp png_ptr, png_bytep data, + png_size_t length)); + +/* Read data from whatever input you are using into the "data" buffer */ +PNG_EXTERN void png_read_data PNGARG((png_structp png_ptr, png_bytep data, + png_size_t length)); + +/* Read bytes into buf, and update png_ptr->crc */ +PNG_EXTERN void png_crc_read PNGARG((png_structp png_ptr, png_bytep buf, + png_size_t length)); + +/* Decompress data in a chunk that uses compression */ +#if defined(PNG_zTXt_SUPPORTED) || defined(PNG_iTXt_SUPPORTED) || \ + defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) +PNG_EXTERN png_charp png_decompress_chunk PNGARG((png_structp png_ptr, + int comp_type, png_charp chunkdata, png_size_t chunklength, + png_size_t prefix_length, png_size_t *data_length)); +#endif + +/* Read "skip" bytes, read the file crc, and (optionally) verify png_ptr->crc */ +PNG_EXTERN int png_crc_finish PNGARG((png_structp png_ptr, png_uint_32 skip)); + +/* Read the CRC from the file and compare it to the libpng calculated CRC */ +PNG_EXTERN int png_crc_error PNGARG((png_structp png_ptr)); + +/* Calculate the CRC over a section of data. Note that we are only + * passing a maximum of 64K on systems that have this as a memory limit, + * since this is the maximum buffer size we can specify. + */ +PNG_EXTERN void png_calculate_crc PNGARG((png_structp png_ptr, png_bytep ptr, + png_size_t length)); + +#if defined(PNG_WRITE_FLUSH_SUPPORTED) +PNG_EXTERN void png_flush PNGARG((png_structp png_ptr)); +#endif + + +/* Place a 32-bit number into a buffer in PNG byte order (big-endian). + * The only currently known PNG chunks that use signed numbers are + * the ancillary extension chunks, oFFs and pCAL. + */ +PNG_EXTERN void png_save_uint_32 PNGARG((png_bytep buf, png_uint_32 i)); + +#if defined(PNG_WRITE_pCAL_SUPPORTED) || defined(PNG_WRITE_oFFs_SUPPORTED) +PNG_EXTERN void png_save_int_32 PNGARG((png_bytep buf, png_int_32 i)); +#endif + +/* Place a 16-bit number into a buffer in PNG byte order. + * The parameter is declared unsigned int, not png_uint_16, + * just to avoid potential problems on pre-ANSI C compilers. + */ +PNG_EXTERN void png_save_uint_16 PNGARG((png_bytep buf, unsigned int i)); + +/* simple function to write the signature */ +PNG_EXTERN void png_write_sig PNGARG((png_structp png_ptr)); + +/* write various chunks */ + +/* Write the IHDR chunk, and update the png_struct with the necessary + * information. + */ +PNG_EXTERN void png_write_IHDR PNGARG((png_structp png_ptr, png_uint_32 width, + png_uint_32 height, + int bit_depth, int color_type, int compression_method, int filter_method, + int interlace_method)); + +PNG_EXTERN void png_write_PLTE PNGARG((png_structp png_ptr, png_colorp palette, + png_uint_32 num_pal)); + +PNG_EXTERN void png_write_IDAT PNGARG((png_structp png_ptr, png_bytep data, + png_size_t length)); + +PNG_EXTERN void png_write_IEND PNGARG((png_structp png_ptr)); + +#if defined(PNG_WRITE_gAMA_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +PNG_EXTERN void png_write_gAMA PNGARG((png_structp png_ptr, double file_gamma)); +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED +PNG_EXTERN void png_write_gAMA_fixed PNGARG((png_structp png_ptr, png_fixed_point + file_gamma)); +#endif +#endif + +#if defined(PNG_WRITE_sBIT_SUPPORTED) +PNG_EXTERN void png_write_sBIT PNGARG((png_structp png_ptr, png_color_8p sbit, + int color_type)); +#endif + +#if defined(PNG_WRITE_cHRM_SUPPORTED) +#ifdef PNG_FLOATING_POINT_SUPPORTED +PNG_EXTERN void png_write_cHRM PNGARG((png_structp png_ptr, + double white_x, double white_y, + double red_x, double red_y, double green_x, double green_y, + double blue_x, double blue_y)); +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED +PNG_EXTERN void png_write_cHRM_fixed PNGARG((png_structp png_ptr, + png_fixed_point int_white_x, png_fixed_point int_white_y, + png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point + int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, + png_fixed_point int_blue_y)); +#endif +#endif + +#if defined(PNG_WRITE_sRGB_SUPPORTED) +PNG_EXTERN void png_write_sRGB PNGARG((png_structp png_ptr, + int intent)); +#endif + +#if defined(PNG_WRITE_iCCP_SUPPORTED) +PNG_EXTERN void png_write_iCCP PNGARG((png_structp png_ptr, + png_charp name, int compression_type, + png_charp profile, int proflen)); + /* Note to maintainer: profile should be png_bytep */ +#endif + +#if defined(PNG_WRITE_sPLT_SUPPORTED) +PNG_EXTERN void png_write_sPLT PNGARG((png_structp png_ptr, + png_sPLT_tp palette)); +#endif + +#if defined(PNG_WRITE_tRNS_SUPPORTED) +PNG_EXTERN void png_write_tRNS PNGARG((png_structp png_ptr, png_bytep trans, + png_color_16p values, int number, int color_type)); +#endif + +#if defined(PNG_WRITE_bKGD_SUPPORTED) +PNG_EXTERN void png_write_bKGD PNGARG((png_structp png_ptr, + png_color_16p values, int color_type)); +#endif + +#if defined(PNG_WRITE_hIST_SUPPORTED) +PNG_EXTERN void png_write_hIST PNGARG((png_structp png_ptr, png_uint_16p hist, + int num_hist)); +#endif + +#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \ + defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED) +PNG_EXTERN png_size_t png_check_keyword PNGARG((png_structp png_ptr, + png_charp key, png_charpp new_key)); +#endif + +#if defined(PNG_WRITE_tEXt_SUPPORTED) +PNG_EXTERN void png_write_tEXt PNGARG((png_structp png_ptr, png_charp key, + png_charp text, png_size_t text_len)); +#endif + +#if defined(PNG_WRITE_zTXt_SUPPORTED) +PNG_EXTERN void png_write_zTXt PNGARG((png_structp png_ptr, png_charp key, + png_charp text, png_size_t text_len, int compression)); +#endif + +#if defined(PNG_WRITE_iTXt_SUPPORTED) +PNG_EXTERN void png_write_iTXt PNGARG((png_structp png_ptr, + int compression, png_charp key, png_charp lang, png_charp lang_key, + png_charp text)); +#endif + +#if defined(PNG_TEXT_SUPPORTED) /* Added at version 1.0.14 and 1.2.4 */ +PNG_EXTERN int png_set_text_2 PNGARG((png_structp png_ptr, + png_infop info_ptr, png_textp text_ptr, int num_text)); +#endif + +#if defined(PNG_WRITE_oFFs_SUPPORTED) +PNG_EXTERN void png_write_oFFs PNGARG((png_structp png_ptr, + png_int_32 x_offset, png_int_32 y_offset, int unit_type)); +#endif + +#if defined(PNG_WRITE_pCAL_SUPPORTED) +PNG_EXTERN void png_write_pCAL PNGARG((png_structp png_ptr, png_charp purpose, + png_int_32 X0, png_int_32 X1, int type, int nparams, + png_charp units, png_charpp params)); +#endif + +#if defined(PNG_WRITE_pHYs_SUPPORTED) +PNG_EXTERN void png_write_pHYs PNGARG((png_structp png_ptr, + png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit, + int unit_type)); +#endif + +#if defined(PNG_WRITE_tIME_SUPPORTED) +PNG_EXTERN void png_write_tIME PNGARG((png_structp png_ptr, + png_timep mod_time)); +#endif + +#if defined(PNG_WRITE_sCAL_SUPPORTED) +#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO) +PNG_EXTERN void png_write_sCAL PNGARG((png_structp png_ptr, + int unit, double width, double height)); +#else +#ifdef PNG_FIXED_POINT_SUPPORTED +PNG_EXTERN void png_write_sCAL_s PNGARG((png_structp png_ptr, + int unit, png_charp width, png_charp height)); +#endif +#endif +#endif + +/* Called when finished processing a row of data */ +PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr)); + +/* Internal use only. Called before first row of data */ +PNG_EXTERN void png_write_start_row PNGARG((png_structp png_ptr)); + +#if defined(PNG_READ_GAMMA_SUPPORTED) +PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr)); +#endif + +/* combine a row of data, dealing with alpha, etc. if requested */ +PNG_EXTERN void png_combine_row PNGARG((png_structp png_ptr, png_bytep row, + int mask)); + +#if defined(PNG_READ_INTERLACING_SUPPORTED) +/* expand an interlaced row */ +/* OLD pre-1.0.9 interface: +PNG_EXTERN void png_do_read_interlace PNGARG((png_row_infop row_info, + png_bytep row, int pass, png_uint_32 transformations)); + */ +PNG_EXTERN void png_do_read_interlace PNGARG((png_structp png_ptr)); +#endif + +/* GRR TO DO (2.0 or whenever): simplify other internal calling interfaces */ + +#if defined(PNG_WRITE_INTERLACING_SUPPORTED) +/* grab pixels out of a row for an interlaced pass */ +PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info, + png_bytep row, int pass)); +#endif + +/* unfilter a row */ +PNG_EXTERN void png_read_filter_row PNGARG((png_structp png_ptr, + png_row_infop row_info, png_bytep row, png_bytep prev_row, int filter)); + +/* Choose the best filter to use and filter the row data */ +PNG_EXTERN void png_write_find_filter PNGARG((png_structp png_ptr, + png_row_infop row_info)); + +/* Write out the filtered row. */ +PNG_EXTERN void png_write_filtered_row PNGARG((png_structp png_ptr, + png_bytep filtered_row)); +/* finish a row while reading, dealing with interlacing passes, etc. */ +PNG_EXTERN void png_read_finish_row PNGARG((png_structp png_ptr)); + +/* initialize the row buffers, etc. */ +PNG_EXTERN void png_read_start_row PNGARG((png_structp png_ptr)); +/* optional call to update the users info structure */ +PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +/* these are the functions that do the transformations */ +#if defined(PNG_READ_FILLER_SUPPORTED) +PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info, + png_bytep row, png_uint_32 filler, png_uint_32 flags)); +#endif + +#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) +PNG_EXTERN void png_do_read_swap_alpha PNGARG((png_row_infop row_info, + png_bytep row)); +#endif + +#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) +PNG_EXTERN void png_do_write_swap_alpha PNGARG((png_row_infop row_info, + png_bytep row)); +#endif + +#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) +PNG_EXTERN void png_do_read_invert_alpha PNGARG((png_row_infop row_info, + png_bytep row)); +#endif + +#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) +PNG_EXTERN void png_do_write_invert_alpha PNGARG((png_row_infop row_info, + png_bytep row)); +#endif + +#if defined(PNG_WRITE_FILLER_SUPPORTED) || \ + defined(PNG_READ_STRIP_ALPHA_SUPPORTED) +PNG_EXTERN void png_do_strip_filler PNGARG((png_row_infop row_info, + png_bytep row, png_uint_32 flags)); +#endif + +#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) +PNG_EXTERN void png_do_swap PNGARG((png_row_infop row_info, png_bytep row)); +#endif + +#if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED) +PNG_EXTERN void png_do_packswap PNGARG((png_row_infop row_info, png_bytep row)); +#endif + +#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) +PNG_EXTERN int png_do_rgb_to_gray PNGARG((png_structp png_ptr, png_row_infop + row_info, png_bytep row)); +#endif + +#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) +PNG_EXTERN void png_do_gray_to_rgb PNGARG((png_row_infop row_info, + png_bytep row)); +#endif + +#if defined(PNG_READ_PACK_SUPPORTED) +PNG_EXTERN void png_do_unpack PNGARG((png_row_infop row_info, png_bytep row)); +#endif + +#if defined(PNG_READ_SHIFT_SUPPORTED) +PNG_EXTERN void png_do_unshift PNGARG((png_row_infop row_info, png_bytep row, + png_color_8p sig_bits)); +#endif + +#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) +PNG_EXTERN void png_do_invert PNGARG((png_row_infop row_info, png_bytep row)); +#endif + +#if defined(PNG_READ_16_TO_8_SUPPORTED) +PNG_EXTERN void png_do_chop PNGARG((png_row_infop row_info, png_bytep row)); +#endif + +#if defined(PNG_READ_DITHER_SUPPORTED) +PNG_EXTERN void png_do_dither PNGARG((png_row_infop row_info, + png_bytep row, png_bytep palette_lookup, png_bytep dither_lookup)); + +# if defined(PNG_CORRECT_PALETTE_SUPPORTED) +PNG_EXTERN void png_correct_palette PNGARG((png_structp png_ptr, + png_colorp palette, int num_palette)); +# endif +#endif + +#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) +PNG_EXTERN void png_do_bgr PNGARG((png_row_infop row_info, png_bytep row)); +#endif + +#if defined(PNG_WRITE_PACK_SUPPORTED) +PNG_EXTERN void png_do_pack PNGARG((png_row_infop row_info, + png_bytep row, png_uint_32 bit_depth)); +#endif + +#if defined(PNG_WRITE_SHIFT_SUPPORTED) +PNG_EXTERN void png_do_shift PNGARG((png_row_infop row_info, png_bytep row, + png_color_8p bit_depth)); +#endif + +#if defined(PNG_READ_BACKGROUND_SUPPORTED) +#if defined(PNG_READ_GAMMA_SUPPORTED) +PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row, + png_color_16p trans_values, png_color_16p background, + png_color_16p background_1, + png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1, + png_uint_16pp gamma_16, png_uint_16pp gamma_16_from_1, + png_uint_16pp gamma_16_to_1, int gamma_shift)); +#else +PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row, + png_color_16p trans_values, png_color_16p background)); +#endif +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) +PNG_EXTERN void png_do_gamma PNGARG((png_row_infop row_info, png_bytep row, + png_bytep gamma_table, png_uint_16pp gamma_16_table, + int gamma_shift)); +#endif + +#if defined(PNG_READ_EXPAND_SUPPORTED) +PNG_EXTERN void png_do_expand_palette PNGARG((png_row_infop row_info, + png_bytep row, png_colorp palette, png_bytep trans, int num_trans)); +PNG_EXTERN void png_do_expand PNGARG((png_row_infop row_info, + png_bytep row, png_color_16p trans_value)); +#endif + +/* The following decodes the appropriate chunks, and does error correction, + * then calls the appropriate callback for the chunk if it is valid. + */ + +/* decode the IHDR chunk */ +PNG_EXTERN void png_handle_IHDR PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +PNG_EXTERN void png_handle_PLTE PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +PNG_EXTERN void png_handle_IEND PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); + +#if defined(PNG_READ_bKGD_SUPPORTED) +PNG_EXTERN void png_handle_bKGD PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_cHRM_SUPPORTED) +PNG_EXTERN void png_handle_cHRM PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_gAMA_SUPPORTED) +PNG_EXTERN void png_handle_gAMA PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_hIST_SUPPORTED) +PNG_EXTERN void png_handle_hIST PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_iCCP_SUPPORTED) +extern void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif /* PNG_READ_iCCP_SUPPORTED */ + +#if defined(PNG_READ_iTXt_SUPPORTED) +PNG_EXTERN void png_handle_iTXt PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_oFFs_SUPPORTED) +PNG_EXTERN void png_handle_oFFs PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_pCAL_SUPPORTED) +PNG_EXTERN void png_handle_pCAL PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_pHYs_SUPPORTED) +PNG_EXTERN void png_handle_pHYs PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_sBIT_SUPPORTED) +PNG_EXTERN void png_handle_sBIT PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_sCAL_SUPPORTED) +PNG_EXTERN void png_handle_sCAL PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_sPLT_SUPPORTED) +extern void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif /* PNG_READ_sPLT_SUPPORTED */ + +#if defined(PNG_READ_sRGB_SUPPORTED) +PNG_EXTERN void png_handle_sRGB PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_tEXt_SUPPORTED) +PNG_EXTERN void png_handle_tEXt PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_tIME_SUPPORTED) +PNG_EXTERN void png_handle_tIME PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_tRNS_SUPPORTED) +PNG_EXTERN void png_handle_tRNS PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +#if defined(PNG_READ_zTXt_SUPPORTED) +PNG_EXTERN void png_handle_zTXt PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif + +PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)); + +PNG_EXTERN void png_check_chunk_name PNGARG((png_structp png_ptr, + png_bytep chunk_name)); + +/* handle the transformations for reading and writing */ +PNG_EXTERN void png_do_read_transformations PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_do_write_transformations PNGARG((png_structp png_ptr)); + +PNG_EXTERN void png_init_read_transformations PNGARG((png_structp png_ptr)); + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +PNG_EXTERN void png_push_read_chunk PNGARG((png_structp png_ptr, + png_infop info_ptr)); +PNG_EXTERN void png_push_read_sig PNGARG((png_structp png_ptr, + png_infop info_ptr)); +PNG_EXTERN void png_push_check_crc PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_push_crc_skip PNGARG((png_structp png_ptr, + png_uint_32 length)); +PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_push_save_buffer PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_push_restore_buffer PNGARG((png_structp png_ptr, + png_bytep buffer, png_size_t buffer_length)); +PNG_EXTERN void png_push_read_IDAT PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_process_IDAT_data PNGARG((png_structp png_ptr, + png_bytep buffer, png_size_t buffer_length)); +PNG_EXTERN void png_push_process_row PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_push_handle_unknown PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)); +PNG_EXTERN void png_push_have_info PNGARG((png_structp png_ptr, + png_infop info_ptr)); +PNG_EXTERN void png_push_have_end PNGARG((png_structp png_ptr, + png_infop info_ptr)); +PNG_EXTERN void png_push_have_row PNGARG((png_structp png_ptr, png_bytep row)); +PNG_EXTERN void png_push_read_end PNGARG((png_structp png_ptr, + png_infop info_ptr)); +PNG_EXTERN void png_process_some_data PNGARG((png_structp png_ptr, + png_infop info_ptr)); +PNG_EXTERN void png_read_push_finish_row PNGARG((png_structp png_ptr)); +#if defined(PNG_READ_tEXt_SUPPORTED) +PNG_EXTERN void png_push_handle_tEXt PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)); +PNG_EXTERN void png_push_read_tEXt PNGARG((png_structp png_ptr, + png_infop info_ptr)); +#endif +#if defined(PNG_READ_zTXt_SUPPORTED) +PNG_EXTERN void png_push_handle_zTXt PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)); +PNG_EXTERN void png_push_read_zTXt PNGARG((png_structp png_ptr, + png_infop info_ptr)); +#endif +#if defined(PNG_READ_iTXt_SUPPORTED) +PNG_EXTERN void png_push_handle_iTXt PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)); +PNG_EXTERN void png_push_read_iTXt PNGARG((png_structp png_ptr, + png_infop info_ptr)); +#endif + +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ + +#ifdef PNG_MNG_FEATURES_SUPPORTED +PNG_EXTERN void png_do_read_intrapixel PNGARG((png_row_infop row_info, + png_bytep row)); +PNG_EXTERN void png_do_write_intrapixel PNGARG((png_row_infop row_info, + png_bytep row)); +#endif + +#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) +/* png.c */ /* PRIVATE */ +PNG_EXTERN void png_init_mmx_flags PNGARG((png_structp png_ptr)); +#endif +/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */ + +#endif /* PNG_INTERNAL */ + +#ifdef __cplusplus +} +#endif + +#endif /* PNG_VERSION_INFO_ONLY */ +/* do not put anything past this line */ +#endif /* PNG_H */ diff --git a/winclude/pngasmrd.h b/winclude/pngasmrd.h index ca4c12bcc..d086d8c4d 100755 --- a/winclude/pngasmrd.h +++ b/winclude/pngasmrd.h @@ -1,11 +1,11 @@ -/* pngasmrd.h - assembler version of utilities to read a PNG file - * - * libpng 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 2002 Glenn Randers-Pehrson - * - */ - -/* This file is obsolete in libpng-1.0.9 and later; its contents now appear - * at the end of pngconf.h. - */ +/* pngasmrd.h - assembler version of utilities to read a PNG file + * + * libpng 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in png.h + * Copyright (c) 2002 Glenn Randers-Pehrson + * + */ + +/* This file is obsolete in libpng-1.0.9 and later; its contents now appear + * at the end of pngconf.h. + */ diff --git a/winclude/pngconf.h b/winclude/pngconf.h index e17202968..4a425dd1a 100755 --- a/winclude/pngconf.h +++ b/winclude/pngconf.h @@ -1,1348 +1,1348 @@ -/* pngconf.h - machine configurable file for libpng - * - * libpng 1.2.5 - October 3, 2002 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2002 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - */ - -/* Any machine specific code is near the front of this file, so if you - * are configuring libpng for a machine, you may want to read the section - * starting here down to where it starts to typedef png_color, png_text, - * and png_info. - */ - -#ifndef PNGCONF_H -#define PNGCONF_H - -/* This is the size of the compression buffer, and thus the size of - * an IDAT chunk. Make this whatever size you feel is best for your - * machine. One of these will be allocated per png_struct. When this - * is full, it writes the data to the disk, and does some other - * calculations. Making this an extremely small size will slow - * the library down, but you may want to experiment to determine - * where it becomes significant, if you are concerned with memory - * usage. Note that zlib allocates at least 32Kb also. For readers, - * this describes the size of the buffer available to read the data in. - * Unless this gets smaller than the size of a row (compressed), - * it should not make much difference how big this is. - */ - -#ifndef PNG_ZBUF_SIZE -# define PNG_ZBUF_SIZE 8192 -#endif - -/* Enable if you want a write-only libpng */ - -#ifndef PNG_NO_READ_SUPPORTED -# define PNG_READ_SUPPORTED -#endif - -/* Enable if you want a read-only libpng */ - -#ifndef PNG_NO_WRITE_SUPPORTED -# define PNG_WRITE_SUPPORTED -#endif - -/* Enabled by default in 1.2.0. You can disable this if you don't need to - support PNGs that are embedded in MNG datastreams */ -#if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES) -# ifndef PNG_MNG_FEATURES_SUPPORTED -# define PNG_MNG_FEATURES_SUPPORTED -# endif -#endif - -#ifndef PNG_NO_FLOATING_POINT_SUPPORTED -# ifndef PNG_FLOATING_POINT_SUPPORTED -# define PNG_FLOATING_POINT_SUPPORTED -# endif -#endif - -/* If you are running on a machine where you cannot allocate more - * than 64K of memory at once, uncomment this. While libpng will not - * normally need that much memory in a chunk (unless you load up a very - * large file), zlib needs to know how big of a chunk it can use, and - * libpng thus makes sure to check any memory allocation to verify it - * will fit into memory. -#define PNG_MAX_MALLOC_64K - */ -#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) -# define PNG_MAX_MALLOC_64K -#endif - -/* Special munging to support doing things the 'cygwin' way: - * 'Normal' png-on-win32 defines/defaults: - * PNG_BUILD_DLL -- building dll - * PNG_USE_DLL -- building an application, linking to dll - * (no define) -- building static library, or building an - * application and linking to the static lib - * 'Cygwin' defines/defaults: - * PNG_BUILD_DLL -- (ignored) building the dll - * (no define) -- (ignored) building an application, linking to the dll - * PNG_STATIC -- (ignored) building the static lib, or building an - * application that links to the static lib. - * ALL_STATIC -- (ignored) building various static libs, or building an - * application that links to the static libs. - * Thus, - * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and - * this bit of #ifdefs will define the 'correct' config variables based on - * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but - * unnecessary. - * - * Also, the precedence order is: - * ALL_STATIC (since we can't #undef something outside our namespace) - * PNG_BUILD_DLL - * PNG_STATIC - * (nothing) == PNG_USE_DLL - * - * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent - * of auto-import in binutils, we no longer need to worry about - * __declspec(dllexport) / __declspec(dllimport) and friends. Therefore, - * we don't need to worry about PNG_STATIC or ALL_STATIC when it comes - * to __declspec() stuff. However, we DO need to worry about - * PNG_BUILD_DLL and PNG_STATIC because those change some defaults - * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed. - */ -#if defined(__CYGWIN__) -# if defined(ALL_STATIC) -# if defined(PNG_BUILD_DLL) -# undef PNG_BUILD_DLL -# endif -# if defined(PNG_USE_DLL) -# undef PNG_USE_DLL -# endif -# if defined(PNG_DLL) -# undef PNG_DLL -# endif -# if !defined(PNG_STATIC) -# define PNG_STATIC -# endif -# else -# if defined (PNG_BUILD_DLL) -# if defined(PNG_STATIC) -# undef PNG_STATIC -# endif -# if defined(PNG_USE_DLL) -# undef PNG_USE_DLL -# endif -# if !defined(PNG_DLL) -# define PNG_DLL -# endif -# else -# if defined(PNG_STATIC) -# if defined(PNG_USE_DLL) -# undef PNG_USE_DLL -# endif -# if defined(PNG_DLL) -# undef PNG_DLL -# endif -# else -# if !defined(PNG_USE_DLL) -# define PNG_USE_DLL -# endif -# if !defined(PNG_DLL) -# define PNG_DLL -# endif -# endif -# endif -# endif -#endif - -/* This protects us against compilers that run on a windowing system - * and thus don't have or would rather us not use the stdio types: - * stdin, stdout, and stderr. The only one currently used is stderr - * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will - * prevent these from being compiled and used. #defining PNG_NO_STDIO - * will also prevent these, plus will prevent the entire set of stdio - * macros and functions (FILE *, printf, etc.) from being compiled and used, - * unless (PNG_DEBUG > 0) has been #defined. - * - * #define PNG_NO_CONSOLE_IO - * #define PNG_NO_STDIO - */ - -#if defined(_WIN32_WCE) -# include - /* Console I/O functions are not supported on WindowsCE */ -# define PNG_NO_CONSOLE_IO -# ifdef PNG_DEBUG -# undef PNG_DEBUG -# endif -#endif - -#ifdef PNG_BUILD_DLL -# ifndef PNG_CONSOLE_IO_SUPPORTED -# ifndef PNG_NO_CONSOLE_IO -# define PNG_NO_CONSOLE_IO -# endif -# endif -#endif - -# ifdef PNG_NO_STDIO -# ifndef PNG_NO_CONSOLE_IO -# define PNG_NO_CONSOLE_IO -# endif -# ifdef PNG_DEBUG -# if (PNG_DEBUG > 0) -# include -# endif -# endif -# else -# if !defined(_WIN32_WCE) -/* "stdio.h" functions are not supported on WindowsCE */ -# include -# endif -# endif - -/* This macro protects us against machines that don't have function - * prototypes (ie K&R style headers). If your compiler does not handle - * function prototypes, define this macro and use the included ansi2knr. - * I've always been able to use _NO_PROTO as the indicator, but you may - * need to drag the empty declaration out in front of here, or change the - * ifdef to suit your own needs. - */ -#ifndef PNGARG - -#ifdef OF /* zlib prototype munger */ -# define PNGARG(arglist) OF(arglist) -#else - -#ifdef _NO_PROTO -# define PNGARG(arglist) () -# ifndef PNG_TYPECAST_NULL -# define PNG_TYPECAST_NULL -# endif -#else -# define PNGARG(arglist) arglist -#endif /* _NO_PROTO */ - -#endif /* OF */ - -#endif /* PNGARG */ - -/* Try to determine if we are compiling on a Mac. Note that testing for - * just __MWERKS__ is not good enough, because the Codewarrior is now used - * on non-Mac platforms. - */ -#ifndef MACOS -# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ - defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) -# define MACOS -# endif -#endif - -/* enough people need this for various reasons to include it here */ -#if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE) -# include -#endif - -#if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED) -# define PNG_SETJMP_SUPPORTED -#endif - -#ifdef PNG_SETJMP_SUPPORTED -/* This is an attempt to force a single setjmp behaviour on Linux. If - * the X config stuff didn't define _BSD_SOURCE we wouldn't need this. - */ - -# ifdef __linux__ -# ifdef _BSD_SOURCE -# define PNG_SAVE_BSD_SOURCE -# undef _BSD_SOURCE -# endif -# ifdef _SETJMP_H - __png.h__ already includes setjmp.h; - __dont__ include it again.; -# endif -# endif /* __linux__ */ - - /* include setjmp.h for error handling */ -# include - -# ifdef __linux__ -# ifdef PNG_SAVE_BSD_SOURCE -# define _BSD_SOURCE -# undef PNG_SAVE_BSD_SOURCE -# endif -# endif /* __linux__ */ -#endif /* PNG_SETJMP_SUPPORTED */ - -#ifdef BSD -# include -#else -# include -#endif - -/* Other defines for things like memory and the like can go here. */ -#ifdef PNG_INTERNAL - -#include - -/* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which - * aren't usually used outside the library (as far as I know), so it is - * debatable if they should be exported at all. In the future, when it is - * possible to have run-time registry of chunk-handling functions, some of - * these will be made available again. -#define PNG_EXTERN extern - */ -#define PNG_EXTERN - -/* Other defines specific to compilers can go here. Try to keep - * them inside an appropriate ifdef/endif pair for portability. - */ - -#if defined(PNG_FLOATING_POINT_SUPPORTED) -# if defined(MACOS) - /* We need to check that hasn't already been included earlier - * as it seems it doesn't agree with , yet we should really use - * if possible. - */ -# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) -# include -# endif -# else -# include -# endif -# if defined(_AMIGA) && defined(__SASC) && defined(_M68881) - /* Amiga SAS/C: We must include builtin FPU functions when compiling using - * MATH=68881 - */ -# include -# endif -#endif - -/* Codewarrior on NT has linking problems without this. */ -#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__) -# define PNG_ALWAYS_EXTERN -#endif - -/* For some reason, Borland C++ defines memcmp, etc. in mem.h, not - * stdlib.h like it should (I think). Or perhaps this is a C++ - * "feature"? - */ -#ifdef __TURBOC__ -# include -# include "alloc.h" -#endif - -#if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \ - defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__)) -# include -#endif - -/* This controls how fine the dithering gets. As this allocates - * a largish chunk of memory (32K), those who are not as concerned - * with dithering quality can decrease some or all of these. - */ -#ifndef PNG_DITHER_RED_BITS -# define PNG_DITHER_RED_BITS 5 -#endif -#ifndef PNG_DITHER_GREEN_BITS -# define PNG_DITHER_GREEN_BITS 5 -#endif -#ifndef PNG_DITHER_BLUE_BITS -# define PNG_DITHER_BLUE_BITS 5 -#endif - -/* This controls how fine the gamma correction becomes when you - * are only interested in 8 bits anyway. Increasing this value - * results in more memory being used, and more pow() functions - * being called to fill in the gamma tables. Don't set this value - * less then 8, and even that may not work (I haven't tested it). - */ - -#ifndef PNG_MAX_GAMMA_8 -# define PNG_MAX_GAMMA_8 11 -#endif - -/* This controls how much a difference in gamma we can tolerate before - * we actually start doing gamma conversion. - */ -#ifndef PNG_GAMMA_THRESHOLD -# define PNG_GAMMA_THRESHOLD 0.05 -#endif - -#endif /* PNG_INTERNAL */ - -/* The following uses const char * instead of char * for error - * and warning message functions, so some compilers won't complain. - * If you do not want to use const, define PNG_NO_CONST here. - */ - -#ifndef PNG_NO_CONST -# define PNG_CONST const -#else -# define PNG_CONST -#endif - -/* The following defines give you the ability to remove code from the - * library that you will not be using. I wish I could figure out how to - * automate this, but I can't do that without making it seriously hard - * on the users. So if you are not using an ability, change the #define - * to and #undef, and that part of the library will not be compiled. If - * your linker can't find a function, you may want to make sure the - * ability is defined here. Some of these depend upon some others being - * defined. I haven't figured out all the interactions here, so you may - * have to experiment awhile to get everything to compile. If you are - * creating or using a shared library, you probably shouldn't touch this, - * as it will affect the size of the structures, and this will cause bad - * things to happen if the library and/or application ever change. - */ - -/* Any features you will not be using can be undef'ed here */ - -/* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user - * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS - * on the compile line, then pick and choose which ones to define without - * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED - * if you only want to have a png-compliant reader/writer but don't need - * any of the extra transformations. This saves about 80 kbytes in a - * typical installation of the library. (PNG_NO_* form added in version - * 1.0.1c, for consistency) - */ - -/* The size of the png_text structure changed in libpng-1.0.6 when - * iTXt is supported. It is turned off by default, to support old apps - * that malloc the png_text structure instead of calling png_set_text() - * and letting libpng malloc it. It will be turned on by default in - * libpng-1.3.0. - */ - -#ifndef PNG_iTXt_SUPPORTED -# if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt) -# define PNG_NO_READ_iTXt -# endif -# if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt) -# define PNG_NO_WRITE_iTXt -# endif -#endif - -/* The following support, added after version 1.0.0, can be turned off here en - * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility - * with old applications that require the length of png_struct and png_info - * to remain unchanged. - */ - -#ifdef PNG_LEGACY_SUPPORTED -# define PNG_NO_FREE_ME -# define PNG_NO_READ_UNKNOWN_CHUNKS -# define PNG_NO_WRITE_UNKNOWN_CHUNKS -# define PNG_NO_READ_USER_CHUNKS -# define PNG_NO_READ_iCCP -# define PNG_NO_WRITE_iCCP -# define PNG_NO_READ_iTXt -# define PNG_NO_WRITE_iTXt -# define PNG_NO_READ_sCAL -# define PNG_NO_WRITE_sCAL -# define PNG_NO_READ_sPLT -# define PNG_NO_WRITE_sPLT -# define PNG_NO_INFO_IMAGE -# define PNG_NO_READ_RGB_TO_GRAY -# define PNG_NO_READ_USER_TRANSFORM -# define PNG_NO_WRITE_USER_TRANSFORM -# define PNG_NO_USER_MEM -# define PNG_NO_READ_EMPTY_PLTE -# define PNG_NO_MNG_FEATURES -# define PNG_NO_FIXED_POINT_SUPPORTED -#endif - -/* Ignore attempt to turn off both floating and fixed point support */ -#if !defined(PNG_FLOATING_POINT_SUPPORTED) || \ - !defined(PNG_NO_FIXED_POINT_SUPPORTED) -# define PNG_FIXED_POINT_SUPPORTED -#endif - -#ifndef PNG_NO_FREE_ME -# define PNG_FREE_ME_SUPPORTED -#endif - -#if defined(PNG_READ_SUPPORTED) - -#if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \ - !defined(PNG_NO_READ_TRANSFORMS) -# define PNG_READ_TRANSFORMS_SUPPORTED -#endif - -#ifdef PNG_READ_TRANSFORMS_SUPPORTED -# ifndef PNG_NO_READ_EXPAND -# define PNG_READ_EXPAND_SUPPORTED -# endif -# ifndef PNG_NO_READ_SHIFT -# define PNG_READ_SHIFT_SUPPORTED -# endif -# ifndef PNG_NO_READ_PACK -# define PNG_READ_PACK_SUPPORTED -# endif -# ifndef PNG_NO_READ_BGR -# define PNG_READ_BGR_SUPPORTED -# endif -# ifndef PNG_NO_READ_SWAP -# define PNG_READ_SWAP_SUPPORTED -# endif -# ifndef PNG_NO_READ_PACKSWAP -# define PNG_READ_PACKSWAP_SUPPORTED -# endif -# ifndef PNG_NO_READ_INVERT -# define PNG_READ_INVERT_SUPPORTED -# endif -# ifndef PNG_NO_READ_DITHER -# define PNG_READ_DITHER_SUPPORTED -# endif -# ifndef PNG_NO_READ_BACKGROUND -# define PNG_READ_BACKGROUND_SUPPORTED -# endif -# ifndef PNG_NO_READ_16_TO_8 -# define PNG_READ_16_TO_8_SUPPORTED -# endif -# ifndef PNG_NO_READ_FILLER -# define PNG_READ_FILLER_SUPPORTED -# endif -# ifndef PNG_NO_READ_GAMMA -# define PNG_READ_GAMMA_SUPPORTED -# endif -# ifndef PNG_NO_READ_GRAY_TO_RGB -# define PNG_READ_GRAY_TO_RGB_SUPPORTED -# endif -# ifndef PNG_NO_READ_SWAP_ALPHA -# define PNG_READ_SWAP_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_INVERT_ALPHA -# define PNG_READ_INVERT_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_STRIP_ALPHA -# define PNG_READ_STRIP_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_USER_TRANSFORM -# define PNG_READ_USER_TRANSFORM_SUPPORTED -# endif -# ifndef PNG_NO_READ_RGB_TO_GRAY -# define PNG_READ_RGB_TO_GRAY_SUPPORTED -# endif -#endif /* PNG_READ_TRANSFORMS_SUPPORTED */ - -#if !defined(PNG_NO_PROGRESSIVE_READ) && \ - !defined(PNG_PROGRESSIVE_READ_NOT_SUPPORTED) /* if you don't do progressive */ -# define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ -#endif /* about interlacing capability! You'll */ - /* still have interlacing unless you change the following line: */ - -#define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */ - -#ifndef PNG_NO_READ_COMPOSITE_NODIV -# ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */ -# define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */ -# endif -#endif - -/* Deprecated, will be removed from version 2.0.0. - Use PNG_MNG_FEATURES_SUPPORTED instead. */ -#ifndef PNG_NO_READ_EMPTY_PLTE -# define PNG_READ_EMPTY_PLTE_SUPPORTED -#endif - -#endif /* PNG_READ_SUPPORTED */ - -#if defined(PNG_WRITE_SUPPORTED) - -# if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ - !defined(PNG_NO_WRITE_TRANSFORMS) -# define PNG_WRITE_TRANSFORMS_SUPPORTED -#endif - -#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED -# ifndef PNG_NO_WRITE_SHIFT -# define PNG_WRITE_SHIFT_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_PACK -# define PNG_WRITE_PACK_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_BGR -# define PNG_WRITE_BGR_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_SWAP -# define PNG_WRITE_SWAP_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_PACKSWAP -# define PNG_WRITE_PACKSWAP_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_INVERT -# define PNG_WRITE_INVERT_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_FILLER -# define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */ -# endif -# ifndef PNG_NO_WRITE_SWAP_ALPHA -# define PNG_WRITE_SWAP_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_INVERT_ALPHA -# define PNG_WRITE_INVERT_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_USER_TRANSFORM -# define PNG_WRITE_USER_TRANSFORM_SUPPORTED -# endif -#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */ - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) -# ifndef PNG_NO_USER_TRANSFORM_PTR -# define PNG_USER_TRANSFORM_PTR_SUPPORTED -# endif -#endif - -#define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant - encoders, but can cause trouble - if left undefined */ - -#if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \ - defined(PNG_FLOATING_POINT_SUPPORTED) -# define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED -#endif - -#ifndef PNG_1_0_X -#ifndef PNG_NO_ERROR_NUMBERS -#define PNG_ERROR_NUMBERS_SUPPORTED -#endif -#endif /* PNG_1_0_X */ - -#ifndef PNG_NO_WRITE_FLUSH -# define PNG_WRITE_FLUSH_SUPPORTED -#endif - -/* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */ -#ifndef PNG_NO_WRITE_EMPTY_PLTE -# define PNG_WRITE_EMPTY_PLTE_SUPPORTED -#endif - -#endif /* PNG_WRITE_SUPPORTED */ - -#ifndef PNG_NO_STDIO -# define PNG_TIME_RFC1123_SUPPORTED -#endif - -/* This adds extra functions in pngget.c for accessing data from the - * info pointer (added in version 0.99) - * png_get_image_width() - * png_get_image_height() - * png_get_bit_depth() - * png_get_color_type() - * png_get_compression_type() - * png_get_filter_type() - * png_get_interlace_type() - * png_get_pixel_aspect_ratio() - * png_get_pixels_per_meter() - * png_get_x_offset_pixels() - * png_get_y_offset_pixels() - * png_get_x_offset_microns() - * png_get_y_offset_microns() - */ -#if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED) -# define PNG_EASY_ACCESS_SUPPORTED -#endif - -/* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0 - even when PNG_USE_PNGVCRD or PNG_USE_PNGGCCRD is not defined */ -#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE) -# ifndef PNG_ASSEMBLER_CODE_SUPPORTED -# define PNG_ASSEMBLER_CODE_SUPPORTED -# endif -# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) -# define PNG_MMX_CODE_SUPPORTED -# endif -#endif - -/* If you are sure that you don't need thread safety and you are compiling - with PNG_USE_PNGCCRD for an MMX application, you can define this for - faster execution. See pnggccrd.c. -#define PNG_THREAD_UNSAFE_OK -*/ - -#if !defined(PNG_1_0_X) -#if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED) -# define PNG_USER_MEM_SUPPORTED -#endif -#endif /* PNG_1_0_X */ - -/* These are currently experimental features, define them if you want */ - -/* very little testing */ -/* -#ifdef PNG_READ_SUPPORTED -# ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED -# define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED -# endif -#endif -*/ - -/* This is only for PowerPC big-endian and 680x0 systems */ -/* some testing */ -/* -#ifdef PNG_READ_SUPPORTED -# ifndef PNG_PNG_READ_BIG_ENDIAN_SUPPORTED -# define PNG_READ_BIG_ENDIAN_SUPPORTED -# endif -#endif -*/ - -/* Buggy compilers (e.g., gcc 2.7.2.2) need this */ -/* -#define PNG_NO_POINTER_INDEXING -*/ - -/* These functions are turned off by default, as they will be phased out. */ -/* -#define PNG_USELESS_TESTS_SUPPORTED -#define PNG_CORRECT_PALETTE_SUPPORTED -*/ - -/* Any chunks you are not interested in, you can undef here. The - * ones that allocate memory may be expecially important (hIST, - * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info - * a bit smaller. - */ - -#if defined(PNG_READ_SUPPORTED) && \ - !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ - !defined(PNG_NO_READ_ANCILLARY_CHUNKS) -# define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED -#endif - -#if defined(PNG_WRITE_SUPPORTED) && \ - !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ - !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS) -# define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED -#endif - -#ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED - -#ifdef PNG_NO_READ_TEXT -# define PNG_NO_READ_iTXt -# define PNG_NO_READ_tEXt -# define PNG_NO_READ_zTXt -#endif -#ifndef PNG_NO_READ_bKGD -# define PNG_READ_bKGD_SUPPORTED -# define PNG_bKGD_SUPPORTED -#endif -#ifndef PNG_NO_READ_cHRM -# define PNG_READ_cHRM_SUPPORTED -# define PNG_cHRM_SUPPORTED -#endif -#ifndef PNG_NO_READ_gAMA -# define PNG_READ_gAMA_SUPPORTED -# define PNG_gAMA_SUPPORTED -#endif -#ifndef PNG_NO_READ_hIST -# define PNG_READ_hIST_SUPPORTED -# define PNG_hIST_SUPPORTED -#endif -#ifndef PNG_NO_READ_iCCP -# define PNG_READ_iCCP_SUPPORTED -# define PNG_iCCP_SUPPORTED -#endif -#ifndef PNG_NO_READ_iTXt -# ifndef PNG_READ_iTXt_SUPPORTED -# define PNG_READ_iTXt_SUPPORTED -# endif -# ifndef PNG_iTXt_SUPPORTED -# define PNG_iTXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_READ_oFFs -# define PNG_READ_oFFs_SUPPORTED -# define PNG_oFFs_SUPPORTED -#endif -#ifndef PNG_NO_READ_pCAL -# define PNG_READ_pCAL_SUPPORTED -# define PNG_pCAL_SUPPORTED -#endif -#ifndef PNG_NO_READ_sCAL -# define PNG_READ_sCAL_SUPPORTED -# define PNG_sCAL_SUPPORTED -#endif -#ifndef PNG_NO_READ_pHYs -# define PNG_READ_pHYs_SUPPORTED -# define PNG_pHYs_SUPPORTED -#endif -#ifndef PNG_NO_READ_sBIT -# define PNG_READ_sBIT_SUPPORTED -# define PNG_sBIT_SUPPORTED -#endif -#ifndef PNG_NO_READ_sPLT -# define PNG_READ_sPLT_SUPPORTED -# define PNG_sPLT_SUPPORTED -#endif -#ifndef PNG_NO_READ_sRGB -# define PNG_READ_sRGB_SUPPORTED -# define PNG_sRGB_SUPPORTED -#endif -#ifndef PNG_NO_READ_tEXt -# define PNG_READ_tEXt_SUPPORTED -# define PNG_tEXt_SUPPORTED -#endif -#ifndef PNG_NO_READ_tIME -# define PNG_READ_tIME_SUPPORTED -# define PNG_tIME_SUPPORTED -#endif -#ifndef PNG_NO_READ_tRNS -# define PNG_READ_tRNS_SUPPORTED -# define PNG_tRNS_SUPPORTED -#endif -#ifndef PNG_NO_READ_zTXt -# define PNG_READ_zTXt_SUPPORTED -# define PNG_zTXt_SUPPORTED -#endif -#ifndef PNG_NO_READ_UNKNOWN_CHUNKS -# define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED -# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_UNKNOWN_CHUNKS_SUPPORTED -# endif -# ifndef PNG_NO_HANDLE_AS_UNKNOWN -# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# endif -#endif -#if !defined(PNG_NO_READ_USER_CHUNKS) && \ - defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) -# define PNG_READ_USER_CHUNKS_SUPPORTED -# define PNG_USER_CHUNKS_SUPPORTED -# ifdef PNG_NO_READ_UNKNOWN_CHUNKS -# undef PNG_NO_READ_UNKNOWN_CHUNKS -# endif -# ifdef PNG_NO_HANDLE_AS_UNKNOWN -# undef PNG_NO_HANDLE_AS_UNKNOWN -# endif -#endif -#ifndef PNG_NO_READ_OPT_PLTE -# define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */ -#endif /* optional PLTE chunk in RGB and RGBA images */ -#if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \ - defined(PNG_READ_zTXt_SUPPORTED) -# define PNG_READ_TEXT_SUPPORTED -# define PNG_TEXT_SUPPORTED -#endif - -#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */ - -#ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED - -#ifdef PNG_NO_WRITE_TEXT -# define PNG_NO_WRITE_iTXt -# define PNG_NO_WRITE_tEXt -# define PNG_NO_WRITE_zTXt -#endif -#ifndef PNG_NO_WRITE_bKGD -# define PNG_WRITE_bKGD_SUPPORTED -# ifndef PNG_bKGD_SUPPORTED -# define PNG_bKGD_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_cHRM -# define PNG_WRITE_cHRM_SUPPORTED -# ifndef PNG_cHRM_SUPPORTED -# define PNG_cHRM_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_gAMA -# define PNG_WRITE_gAMA_SUPPORTED -# ifndef PNG_gAMA_SUPPORTED -# define PNG_gAMA_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_hIST -# define PNG_WRITE_hIST_SUPPORTED -# ifndef PNG_hIST_SUPPORTED -# define PNG_hIST_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_iCCP -# define PNG_WRITE_iCCP_SUPPORTED -# ifndef PNG_iCCP_SUPPORTED -# define PNG_iCCP_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_iTXt -# ifndef PNG_WRITE_iTXt_SUPPORTED -# define PNG_WRITE_iTXt_SUPPORTED -# endif -# ifndef PNG_iTXt_SUPPORTED -# define PNG_iTXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_oFFs -# define PNG_WRITE_oFFs_SUPPORTED -# ifndef PNG_oFFs_SUPPORTED -# define PNG_oFFs_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_pCAL -# define PNG_WRITE_pCAL_SUPPORTED -# ifndef PNG_pCAL_SUPPORTED -# define PNG_pCAL_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sCAL -# define PNG_WRITE_sCAL_SUPPORTED -# ifndef PNG_sCAL_SUPPORTED -# define PNG_sCAL_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_pHYs -# define PNG_WRITE_pHYs_SUPPORTED -# ifndef PNG_pHYs_SUPPORTED -# define PNG_pHYs_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sBIT -# define PNG_WRITE_sBIT_SUPPORTED -# ifndef PNG_sBIT_SUPPORTED -# define PNG_sBIT_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sPLT -# define PNG_WRITE_sPLT_SUPPORTED -# ifndef PNG_sPLT_SUPPORTED -# define PNG_sPLT_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sRGB -# define PNG_WRITE_sRGB_SUPPORTED -# ifndef PNG_sRGB_SUPPORTED -# define PNG_sRGB_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tEXt -# define PNG_WRITE_tEXt_SUPPORTED -# ifndef PNG_tEXt_SUPPORTED -# define PNG_tEXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tIME -# define PNG_WRITE_tIME_SUPPORTED -# ifndef PNG_tIME_SUPPORTED -# define PNG_tIME_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tRNS -# define PNG_WRITE_tRNS_SUPPORTED -# ifndef PNG_tRNS_SUPPORTED -# define PNG_tRNS_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_zTXt -# define PNG_WRITE_zTXt_SUPPORTED -# ifndef PNG_zTXt_SUPPORTED -# define PNG_zTXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS -# define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED -# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_UNKNOWN_CHUNKS_SUPPORTED -# endif -# ifndef PNG_NO_HANDLE_AS_UNKNOWN -# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# endif -# endif -#endif -#if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \ - defined(PNG_WRITE_zTXt_SUPPORTED) -# define PNG_WRITE_TEXT_SUPPORTED -# ifndef PNG_TEXT_SUPPORTED -# define PNG_TEXT_SUPPORTED -# endif -#endif - -#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ - -/* Turn this off to disable png_read_png() and - * png_write_png() and leave the row_pointers member - * out of the info structure. - */ -#ifndef PNG_NO_INFO_IMAGE -# define PNG_INFO_IMAGE_SUPPORTED -#endif - -/* need the time information for reading tIME chunks */ -#if defined(PNG_tIME_SUPPORTED) -# if !defined(_WIN32_WCE) - /* "time.h" functions are not supported on WindowsCE */ -# include -# endif -#endif - -/* Some typedefs to get us started. These should be safe on most of the - * common platforms. The typedefs should be at least as large as the - * numbers suggest (a png_uint_32 must be at least 32 bits long), but they - * don't have to be exactly that size. Some compilers dislike passing - * unsigned shorts as function parameters, so you may be better off using - * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may - * want to have unsigned int for png_uint_32 instead of unsigned long. - */ - -typedef unsigned long png_uint_32; -typedef long png_int_32; -typedef unsigned short png_uint_16; -typedef short png_int_16; -typedef unsigned char png_byte; - -/* This is usually size_t. It is typedef'ed just in case you need it to - change (I'm not sure if you will or not, so I thought I'd be safe) */ -typedef size_t png_size_t; - -/* The following is needed for medium model support. It cannot be in the - * PNG_INTERNAL section. Needs modification for other compilers besides - * MSC. Model independent support declares all arrays and pointers to be - * large using the far keyword. The zlib version used must also support - * model independent data. As of version zlib 1.0.4, the necessary changes - * have been made in zlib. The USE_FAR_KEYWORD define triggers other - * changes that are needed. (Tim Wegner) - */ - -/* Separate compiler dependencies (problem here is that zlib.h always - defines FAR. (SJT) */ -#ifdef __BORLANDC__ -# if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__) -# define LDATA 1 -# else -# define LDATA 0 -# endif - /* GRR: why is Cygwin in here? Cygwin is not Borland C... */ -# if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__) -# define PNG_MAX_MALLOC_64K -# if (LDATA != 1) -# ifndef FAR -# define FAR __far -# endif -# define USE_FAR_KEYWORD -# endif /* LDATA != 1 */ - /* Possibly useful for moving data out of default segment. - * Uncomment it if you want. Could also define FARDATA as - * const if your compiler supports it. (SJT) -# define FARDATA FAR - */ -# endif /* __WIN32__, __FLAT__, __CYGWIN__ */ -#endif /* __BORLANDC__ */ - - -/* Suggest testing for specific compiler first before testing for - * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM, - * making reliance oncertain keywords suspect. (SJT) - */ - -/* MSC Medium model */ -#if defined(FAR) -# if defined(M_I86MM) -# define USE_FAR_KEYWORD -# define FARDATA FAR -# include -# endif -#endif - -/* SJT: default case */ -#ifndef FAR -# define FAR -#endif - -/* At this point FAR is always defined */ -#ifndef FARDATA -# define FARDATA -#endif - -/* Typedef for floating-point numbers that are converted - to fixed-point with a multiple of 100,000, e.g., int_gamma */ -typedef png_int_32 png_fixed_point; - -/* Add typedefs for pointers */ -typedef void FAR * png_voidp; -typedef png_byte FAR * png_bytep; -typedef png_uint_32 FAR * png_uint_32p; -typedef png_int_32 FAR * png_int_32p; -typedef png_uint_16 FAR * png_uint_16p; -typedef png_int_16 FAR * png_int_16p; -typedef PNG_CONST char FAR * png_const_charp; -typedef char FAR * png_charp; -typedef png_fixed_point FAR * png_fixed_point_p; - -#ifndef PNG_NO_STDIO -#if defined(_WIN32_WCE) -typedef HANDLE png_FILE_p; -#else -typedef FILE * png_FILE_p; -#endif -#endif - -#ifdef PNG_FLOATING_POINT_SUPPORTED -typedef double FAR * png_doublep; -#endif - -/* Pointers to pointers; i.e. arrays */ -typedef png_byte FAR * FAR * png_bytepp; -typedef png_uint_32 FAR * FAR * png_uint_32pp; -typedef png_int_32 FAR * FAR * png_int_32pp; -typedef png_uint_16 FAR * FAR * png_uint_16pp; -typedef png_int_16 FAR * FAR * png_int_16pp; -typedef PNG_CONST char FAR * FAR * png_const_charpp; -typedef char FAR * FAR * png_charpp; -typedef png_fixed_point FAR * FAR * png_fixed_point_pp; -#ifdef PNG_FLOATING_POINT_SUPPORTED -typedef double FAR * FAR * png_doublepp; -#endif - -/* Pointers to pointers to pointers; i.e., pointer to array */ -typedef char FAR * FAR * FAR * png_charppp; - -/* libpng typedefs for types in zlib. If zlib changes - * or another compression library is used, then change these. - * Eliminates need to change all the source files. - */ -typedef charf * png_zcharp; -typedef charf * FAR * png_zcharpp; -typedef z_stream FAR * png_zstreamp; - -/* - * Define PNG_BUILD_DLL if the module being built is a Windows - * LIBPNG DLL. - * - * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL. - * It is equivalent to Microsoft predefined macro _DLL that is - * automatically defined when you compile using the share - * version of the CRT (C Run-Time library) - * - * The cygwin mods make this behavior a little different: - * Define PNG_BUILD_DLL if you are building a dll for use with cygwin - * Define PNG_STATIC if you are building a static library for use with cygwin, - * -or- if you are building an application that you want to link to the - * static library. - * PNG_USE_DLL is defined by default (no user action needed) unless one of - * the other flags is defined. - */ - -#if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL)) -# define PNG_DLL -#endif -/* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib. - * When building a static lib, default to no GLOBAL ARRAYS, but allow - * command-line override - */ -#if defined(__CYGWIN__) -# if !defined(PNG_STATIC) -# if defined(PNG_USE_GLOBAL_ARRAYS) -# undef PNG_USE_GLOBAL_ARRAYS -# endif -# if !defined(PNG_USE_LOCAL_ARRAYS) -# define PNG_USE_LOCAL_ARRAYS -# endif -# else -# if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS) -# if defined(PNG_USE_GLOBAL_ARRAYS) -# undef PNG_USE_GLOBAL_ARRAYS -# endif -# endif -# endif -# if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) -# define PNG_USE_LOCAL_ARRAYS -# endif -#endif - -/* Do not use global arrays (helps with building DLL's) - * They are no longer used in libpng itself, since version 1.0.5c, - * but might be required for some pre-1.0.5c applications. - */ -#if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) -# if defined(PNG_NO_GLOBAL_ARRAYS) || (defined(__GNUC__) && defined(PNG_DLL)) -# define PNG_USE_LOCAL_ARRAYS -# else -# define PNG_USE_GLOBAL_ARRAYS -# endif -#endif - -#if defined(__CYGWIN__) -# undef PNGAPI -# define PNGAPI __cdecl -# undef PNG_IMPEXP -# define PNG_IMPEXP -#endif - -/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall", - * you may get warnings regarding the linkage of png_zalloc and png_zfree. - * Don't ignore those warnings; you must also reset the default calling - * convention in your compiler to match your PNGAPI, and you must build - * zlib and your applications the same way you build libpng. - */ - -#ifndef PNGAPI - -#if defined(__MINGW32__) && !defined(PNG_MODULEDEF) -# ifndef PNG_NO_MODULEDEF -# define PNG_NO_MODULEDEF -# endif -#endif - -#if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF) -# define PNG_IMPEXP -#endif - -#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \ - (( defined(_Windows) || defined(_WINDOWS) || \ - defined(WIN32) || defined(_WIN32) || defined(__WIN32__) )) - -# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) -# define PNGAPI __cdecl -# else -# define PNGAPI _cdecl -# endif - -# if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \ - 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */) -# define PNG_IMPEXP -# endif - -# if !defined(PNG_IMPEXP) - -# define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol -# define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol - - /* Borland/Microsoft */ -# if defined(_MSC_VER) || defined(__BORLANDC__) -# if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500) -# define PNG_EXPORT PNG_EXPORT_TYPE1 -# else -# define PNG_EXPORT PNG_EXPORT_TYPE2 -# if defined(PNG_BUILD_DLL) -# define PNG_IMPEXP __export -# else -# define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in - VC++ */ -# endif /* Exists in Borland C++ for - C++ classes (== huge) */ -# endif -# endif - -# if !defined(PNG_IMPEXP) -# if defined(PNG_BUILD_DLL) -# define PNG_IMPEXP __declspec(dllexport) -# else -# define PNG_IMPEXP __declspec(dllimport) -# endif -# endif -# endif /* PNG_IMPEXP */ -#else /* !(DLL || non-cygwin WINDOWS) */ -# if (defined(__IBMC__) || defined(IBMCPP__)) && defined(__OS2__) -# define PNGAPI _System -# define PNG_IMPEXP -# else -# if 0 /* ... other platforms, with other meanings */ -# else -# define PNGAPI -# define PNG_IMPEXP -# endif -# endif -#endif -#endif - -#ifndef PNGAPI -# define PNGAPI -#endif -#ifndef PNG_IMPEXP -# define PNG_IMPEXP -#endif - -#ifndef PNG_EXPORT -# define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol -#endif - -#ifdef PNG_USE_GLOBAL_ARRAYS -# ifndef PNG_EXPORT_VAR -# define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type -# endif -#endif - -/* User may want to use these so they are not in PNG_INTERNAL. Any library - * functions that are passed far data must be model independent. - */ - -#ifndef PNG_ABORT -# define PNG_ABORT() abort() -#endif - -#ifdef PNG_SETJMP_SUPPORTED -# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) -#else -# define png_jmpbuf(png_ptr) \ - (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED) -#endif - -#if defined(USE_FAR_KEYWORD) /* memory model independent fns */ -/* use this to make far-to-near assignments */ -# define CHECK 1 -# define NOCHECK 0 -# define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK)) -# define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK)) -# define png_strcpy _fstrcpy -# define png_strlen _fstrlen -# define png_memcmp _fmemcmp /* SJT: added */ -# define png_memcpy _fmemcpy -# define png_memset _fmemset -#else /* use the usual functions */ -# define CVT_PTR(ptr) (ptr) -# define CVT_PTR_NOCHECK(ptr) (ptr) -# define png_strcpy strcpy -# define png_strlen strlen -# define png_memcmp memcmp /* SJT: added */ -# define png_memcpy memcpy -# define png_memset memset -#endif -/* End of memory model independent support */ - -/* Just a little check that someone hasn't tried to define something - * contradictory. - */ -#if (PNG_ZBUF_SIZE > 65536) && defined(PNG_MAX_MALLOC_64K) -# undef PNG_ZBUF_SIZE -# define PNG_ZBUF_SIZE 65536 -#endif - -#ifdef PNG_READ_SUPPORTED -/* Prior to libpng-1.0.9, this block was in pngasmrd.h */ -#if defined(PNG_INTERNAL) - -/* These are the default thresholds before the MMX code kicks in; if either - * rowbytes or bitdepth is below the threshold, plain C code is used. These - * can be overridden at runtime via the png_set_mmx_thresholds() call in - * libpng 1.2.0 and later. The values below were chosen by Intel. - */ - -#ifndef PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT -# define PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT 128 /* >= */ -#endif -#ifndef PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT -# define PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT 9 /* >= */ -#endif - -/* Set this in the makefile for VC++ on Pentium, not here. */ -/* Platform must be Pentium. Makefile must assemble and load pngvcrd.c . - * MMX will be detected at run time and used if present. - */ -#ifdef PNG_USE_PNGVCRD -# define PNG_HAVE_ASSEMBLER_COMBINE_ROW -# define PNG_HAVE_ASSEMBLER_READ_INTERLACE -# define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW -#endif - -/* Set this in the makefile for gcc/as on Pentium, not here. */ -/* Platform must be Pentium. Makefile must assemble and load pnggccrd.c . - * MMX will be detected at run time and used if present. - */ -#ifdef PNG_USE_PNGGCCRD -# define PNG_HAVE_ASSEMBLER_COMBINE_ROW -# define PNG_HAVE_ASSEMBLER_READ_INTERLACE -# define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW -#endif -/* - see pnggccrd.c for info about what is currently enabled */ - -#endif /* PNG_INTERNAL */ -#endif /* PNG_READ_SUPPORTED */ - -#endif /* PNGCONF_H */ - +/* pngconf.h - machine configurable file for libpng + * + * libpng 1.2.5 - October 3, 2002 + * For conditions of distribution and use, see copyright notice in png.h + * Copyright (c) 1998-2002 Glenn Randers-Pehrson + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + */ + +/* Any machine specific code is near the front of this file, so if you + * are configuring libpng for a machine, you may want to read the section + * starting here down to where it starts to typedef png_color, png_text, + * and png_info. + */ + +#ifndef PNGCONF_H +#define PNGCONF_H + +/* This is the size of the compression buffer, and thus the size of + * an IDAT chunk. Make this whatever size you feel is best for your + * machine. One of these will be allocated per png_struct. When this + * is full, it writes the data to the disk, and does some other + * calculations. Making this an extremely small size will slow + * the library down, but you may want to experiment to determine + * where it becomes significant, if you are concerned with memory + * usage. Note that zlib allocates at least 32Kb also. For readers, + * this describes the size of the buffer available to read the data in. + * Unless this gets smaller than the size of a row (compressed), + * it should not make much difference how big this is. + */ + +#ifndef PNG_ZBUF_SIZE +# define PNG_ZBUF_SIZE 8192 +#endif + +/* Enable if you want a write-only libpng */ + +#ifndef PNG_NO_READ_SUPPORTED +# define PNG_READ_SUPPORTED +#endif + +/* Enable if you want a read-only libpng */ + +#ifndef PNG_NO_WRITE_SUPPORTED +# define PNG_WRITE_SUPPORTED +#endif + +/* Enabled by default in 1.2.0. You can disable this if you don't need to + support PNGs that are embedded in MNG datastreams */ +#if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES) +# ifndef PNG_MNG_FEATURES_SUPPORTED +# define PNG_MNG_FEATURES_SUPPORTED +# endif +#endif + +#ifndef PNG_NO_FLOATING_POINT_SUPPORTED +# ifndef PNG_FLOATING_POINT_SUPPORTED +# define PNG_FLOATING_POINT_SUPPORTED +# endif +#endif + +/* If you are running on a machine where you cannot allocate more + * than 64K of memory at once, uncomment this. While libpng will not + * normally need that much memory in a chunk (unless you load up a very + * large file), zlib needs to know how big of a chunk it can use, and + * libpng thus makes sure to check any memory allocation to verify it + * will fit into memory. +#define PNG_MAX_MALLOC_64K + */ +#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) +# define PNG_MAX_MALLOC_64K +#endif + +/* Special munging to support doing things the 'cygwin' way: + * 'Normal' png-on-win32 defines/defaults: + * PNG_BUILD_DLL -- building dll + * PNG_USE_DLL -- building an application, linking to dll + * (no define) -- building static library, or building an + * application and linking to the static lib + * 'Cygwin' defines/defaults: + * PNG_BUILD_DLL -- (ignored) building the dll + * (no define) -- (ignored) building an application, linking to the dll + * PNG_STATIC -- (ignored) building the static lib, or building an + * application that links to the static lib. + * ALL_STATIC -- (ignored) building various static libs, or building an + * application that links to the static libs. + * Thus, + * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and + * this bit of #ifdefs will define the 'correct' config variables based on + * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but + * unnecessary. + * + * Also, the precedence order is: + * ALL_STATIC (since we can't #undef something outside our namespace) + * PNG_BUILD_DLL + * PNG_STATIC + * (nothing) == PNG_USE_DLL + * + * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent + * of auto-import in binutils, we no longer need to worry about + * __declspec(dllexport) / __declspec(dllimport) and friends. Therefore, + * we don't need to worry about PNG_STATIC or ALL_STATIC when it comes + * to __declspec() stuff. However, we DO need to worry about + * PNG_BUILD_DLL and PNG_STATIC because those change some defaults + * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed. + */ +#if defined(__CYGWIN__) +# if defined(ALL_STATIC) +# if defined(PNG_BUILD_DLL) +# undef PNG_BUILD_DLL +# endif +# if defined(PNG_USE_DLL) +# undef PNG_USE_DLL +# endif +# if defined(PNG_DLL) +# undef PNG_DLL +# endif +# if !defined(PNG_STATIC) +# define PNG_STATIC +# endif +# else +# if defined (PNG_BUILD_DLL) +# if defined(PNG_STATIC) +# undef PNG_STATIC +# endif +# if defined(PNG_USE_DLL) +# undef PNG_USE_DLL +# endif +# if !defined(PNG_DLL) +# define PNG_DLL +# endif +# else +# if defined(PNG_STATIC) +# if defined(PNG_USE_DLL) +# undef PNG_USE_DLL +# endif +# if defined(PNG_DLL) +# undef PNG_DLL +# endif +# else +# if !defined(PNG_USE_DLL) +# define PNG_USE_DLL +# endif +# if !defined(PNG_DLL) +# define PNG_DLL +# endif +# endif +# endif +# endif +#endif + +/* This protects us against compilers that run on a windowing system + * and thus don't have or would rather us not use the stdio types: + * stdin, stdout, and stderr. The only one currently used is stderr + * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will + * prevent these from being compiled and used. #defining PNG_NO_STDIO + * will also prevent these, plus will prevent the entire set of stdio + * macros and functions (FILE *, printf, etc.) from being compiled and used, + * unless (PNG_DEBUG > 0) has been #defined. + * + * #define PNG_NO_CONSOLE_IO + * #define PNG_NO_STDIO + */ + +#if defined(_WIN32_WCE) +# include + /* Console I/O functions are not supported on WindowsCE */ +# define PNG_NO_CONSOLE_IO +# ifdef PNG_DEBUG +# undef PNG_DEBUG +# endif +#endif + +#ifdef PNG_BUILD_DLL +# ifndef PNG_CONSOLE_IO_SUPPORTED +# ifndef PNG_NO_CONSOLE_IO +# define PNG_NO_CONSOLE_IO +# endif +# endif +#endif + +# ifdef PNG_NO_STDIO +# ifndef PNG_NO_CONSOLE_IO +# define PNG_NO_CONSOLE_IO +# endif +# ifdef PNG_DEBUG +# if (PNG_DEBUG > 0) +# include +# endif +# endif +# else +# if !defined(_WIN32_WCE) +/* "stdio.h" functions are not supported on WindowsCE */ +# include +# endif +# endif + +/* This macro protects us against machines that don't have function + * prototypes (ie K&R style headers). If your compiler does not handle + * function prototypes, define this macro and use the included ansi2knr. + * I've always been able to use _NO_PROTO as the indicator, but you may + * need to drag the empty declaration out in front of here, or change the + * ifdef to suit your own needs. + */ +#ifndef PNGARG + +#ifdef OF /* zlib prototype munger */ +# define PNGARG(arglist) OF(arglist) +#else + +#ifdef _NO_PROTO +# define PNGARG(arglist) () +# ifndef PNG_TYPECAST_NULL +# define PNG_TYPECAST_NULL +# endif +#else +# define PNGARG(arglist) arglist +#endif /* _NO_PROTO */ + +#endif /* OF */ + +#endif /* PNGARG */ + +/* Try to determine if we are compiling on a Mac. Note that testing for + * just __MWERKS__ is not good enough, because the Codewarrior is now used + * on non-Mac platforms. + */ +#ifndef MACOS +# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ + defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) +# define MACOS +# endif +#endif + +/* enough people need this for various reasons to include it here */ +#if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE) +# include +#endif + +#if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED) +# define PNG_SETJMP_SUPPORTED +#endif + +#ifdef PNG_SETJMP_SUPPORTED +/* This is an attempt to force a single setjmp behaviour on Linux. If + * the X config stuff didn't define _BSD_SOURCE we wouldn't need this. + */ + +# ifdef __linux__ +# ifdef _BSD_SOURCE +# define PNG_SAVE_BSD_SOURCE +# undef _BSD_SOURCE +# endif +# ifdef _SETJMP_H + __png.h__ already includes setjmp.h; + __dont__ include it again.; +# endif +# endif /* __linux__ */ + + /* include setjmp.h for error handling */ +# include + +# ifdef __linux__ +# ifdef PNG_SAVE_BSD_SOURCE +# define _BSD_SOURCE +# undef PNG_SAVE_BSD_SOURCE +# endif +# endif /* __linux__ */ +#endif /* PNG_SETJMP_SUPPORTED */ + +#ifdef BSD +# include +#else +# include +#endif + +/* Other defines for things like memory and the like can go here. */ +#ifdef PNG_INTERNAL + +#include + +/* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which + * aren't usually used outside the library (as far as I know), so it is + * debatable if they should be exported at all. In the future, when it is + * possible to have run-time registry of chunk-handling functions, some of + * these will be made available again. +#define PNG_EXTERN extern + */ +#define PNG_EXTERN + +/* Other defines specific to compilers can go here. Try to keep + * them inside an appropriate ifdef/endif pair for portability. + */ + +#if defined(PNG_FLOATING_POINT_SUPPORTED) +# if defined(MACOS) + /* We need to check that hasn't already been included earlier + * as it seems it doesn't agree with , yet we should really use + * if possible. + */ +# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) +# include +# endif +# else +# include +# endif +# if defined(_AMIGA) && defined(__SASC) && defined(_M68881) + /* Amiga SAS/C: We must include builtin FPU functions when compiling using + * MATH=68881 + */ +# include +# endif +#endif + +/* Codewarrior on NT has linking problems without this. */ +#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__) +# define PNG_ALWAYS_EXTERN +#endif + +/* For some reason, Borland C++ defines memcmp, etc. in mem.h, not + * stdlib.h like it should (I think). Or perhaps this is a C++ + * "feature"? + */ +#ifdef __TURBOC__ +# include +# include "alloc.h" +#endif + +#if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \ + defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__)) +# include +#endif + +/* This controls how fine the dithering gets. As this allocates + * a largish chunk of memory (32K), those who are not as concerned + * with dithering quality can decrease some or all of these. + */ +#ifndef PNG_DITHER_RED_BITS +# define PNG_DITHER_RED_BITS 5 +#endif +#ifndef PNG_DITHER_GREEN_BITS +# define PNG_DITHER_GREEN_BITS 5 +#endif +#ifndef PNG_DITHER_BLUE_BITS +# define PNG_DITHER_BLUE_BITS 5 +#endif + +/* This controls how fine the gamma correction becomes when you + * are only interested in 8 bits anyway. Increasing this value + * results in more memory being used, and more pow() functions + * being called to fill in the gamma tables. Don't set this value + * less then 8, and even that may not work (I haven't tested it). + */ + +#ifndef PNG_MAX_GAMMA_8 +# define PNG_MAX_GAMMA_8 11 +#endif + +/* This controls how much a difference in gamma we can tolerate before + * we actually start doing gamma conversion. + */ +#ifndef PNG_GAMMA_THRESHOLD +# define PNG_GAMMA_THRESHOLD 0.05 +#endif + +#endif /* PNG_INTERNAL */ + +/* The following uses const char * instead of char * for error + * and warning message functions, so some compilers won't complain. + * If you do not want to use const, define PNG_NO_CONST here. + */ + +#ifndef PNG_NO_CONST +# define PNG_CONST const +#else +# define PNG_CONST +#endif + +/* The following defines give you the ability to remove code from the + * library that you will not be using. I wish I could figure out how to + * automate this, but I can't do that without making it seriously hard + * on the users. So if you are not using an ability, change the #define + * to and #undef, and that part of the library will not be compiled. If + * your linker can't find a function, you may want to make sure the + * ability is defined here. Some of these depend upon some others being + * defined. I haven't figured out all the interactions here, so you may + * have to experiment awhile to get everything to compile. If you are + * creating or using a shared library, you probably shouldn't touch this, + * as it will affect the size of the structures, and this will cause bad + * things to happen if the library and/or application ever change. + */ + +/* Any features you will not be using can be undef'ed here */ + +/* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user + * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS + * on the compile line, then pick and choose which ones to define without + * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED + * if you only want to have a png-compliant reader/writer but don't need + * any of the extra transformations. This saves about 80 kbytes in a + * typical installation of the library. (PNG_NO_* form added in version + * 1.0.1c, for consistency) + */ + +/* The size of the png_text structure changed in libpng-1.0.6 when + * iTXt is supported. It is turned off by default, to support old apps + * that malloc the png_text structure instead of calling png_set_text() + * and letting libpng malloc it. It will be turned on by default in + * libpng-1.3.0. + */ + +#ifndef PNG_iTXt_SUPPORTED +# if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt) +# define PNG_NO_READ_iTXt +# endif +# if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt) +# define PNG_NO_WRITE_iTXt +# endif +#endif + +/* The following support, added after version 1.0.0, can be turned off here en + * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility + * with old applications that require the length of png_struct and png_info + * to remain unchanged. + */ + +#ifdef PNG_LEGACY_SUPPORTED +# define PNG_NO_FREE_ME +# define PNG_NO_READ_UNKNOWN_CHUNKS +# define PNG_NO_WRITE_UNKNOWN_CHUNKS +# define PNG_NO_READ_USER_CHUNKS +# define PNG_NO_READ_iCCP +# define PNG_NO_WRITE_iCCP +# define PNG_NO_READ_iTXt +# define PNG_NO_WRITE_iTXt +# define PNG_NO_READ_sCAL +# define PNG_NO_WRITE_sCAL +# define PNG_NO_READ_sPLT +# define PNG_NO_WRITE_sPLT +# define PNG_NO_INFO_IMAGE +# define PNG_NO_READ_RGB_TO_GRAY +# define PNG_NO_READ_USER_TRANSFORM +# define PNG_NO_WRITE_USER_TRANSFORM +# define PNG_NO_USER_MEM +# define PNG_NO_READ_EMPTY_PLTE +# define PNG_NO_MNG_FEATURES +# define PNG_NO_FIXED_POINT_SUPPORTED +#endif + +/* Ignore attempt to turn off both floating and fixed point support */ +#if !defined(PNG_FLOATING_POINT_SUPPORTED) || \ + !defined(PNG_NO_FIXED_POINT_SUPPORTED) +# define PNG_FIXED_POINT_SUPPORTED +#endif + +#ifndef PNG_NO_FREE_ME +# define PNG_FREE_ME_SUPPORTED +#endif + +#if defined(PNG_READ_SUPPORTED) + +#if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \ + !defined(PNG_NO_READ_TRANSFORMS) +# define PNG_READ_TRANSFORMS_SUPPORTED +#endif + +#ifdef PNG_READ_TRANSFORMS_SUPPORTED +# ifndef PNG_NO_READ_EXPAND +# define PNG_READ_EXPAND_SUPPORTED +# endif +# ifndef PNG_NO_READ_SHIFT +# define PNG_READ_SHIFT_SUPPORTED +# endif +# ifndef PNG_NO_READ_PACK +# define PNG_READ_PACK_SUPPORTED +# endif +# ifndef PNG_NO_READ_BGR +# define PNG_READ_BGR_SUPPORTED +# endif +# ifndef PNG_NO_READ_SWAP +# define PNG_READ_SWAP_SUPPORTED +# endif +# ifndef PNG_NO_READ_PACKSWAP +# define PNG_READ_PACKSWAP_SUPPORTED +# endif +# ifndef PNG_NO_READ_INVERT +# define PNG_READ_INVERT_SUPPORTED +# endif +# ifndef PNG_NO_READ_DITHER +# define PNG_READ_DITHER_SUPPORTED +# endif +# ifndef PNG_NO_READ_BACKGROUND +# define PNG_READ_BACKGROUND_SUPPORTED +# endif +# ifndef PNG_NO_READ_16_TO_8 +# define PNG_READ_16_TO_8_SUPPORTED +# endif +# ifndef PNG_NO_READ_FILLER +# define PNG_READ_FILLER_SUPPORTED +# endif +# ifndef PNG_NO_READ_GAMMA +# define PNG_READ_GAMMA_SUPPORTED +# endif +# ifndef PNG_NO_READ_GRAY_TO_RGB +# define PNG_READ_GRAY_TO_RGB_SUPPORTED +# endif +# ifndef PNG_NO_READ_SWAP_ALPHA +# define PNG_READ_SWAP_ALPHA_SUPPORTED +# endif +# ifndef PNG_NO_READ_INVERT_ALPHA +# define PNG_READ_INVERT_ALPHA_SUPPORTED +# endif +# ifndef PNG_NO_READ_STRIP_ALPHA +# define PNG_READ_STRIP_ALPHA_SUPPORTED +# endif +# ifndef PNG_NO_READ_USER_TRANSFORM +# define PNG_READ_USER_TRANSFORM_SUPPORTED +# endif +# ifndef PNG_NO_READ_RGB_TO_GRAY +# define PNG_READ_RGB_TO_GRAY_SUPPORTED +# endif +#endif /* PNG_READ_TRANSFORMS_SUPPORTED */ + +#if !defined(PNG_NO_PROGRESSIVE_READ) && \ + !defined(PNG_PROGRESSIVE_READ_NOT_SUPPORTED) /* if you don't do progressive */ +# define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ +#endif /* about interlacing capability! You'll */ + /* still have interlacing unless you change the following line: */ + +#define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */ + +#ifndef PNG_NO_READ_COMPOSITE_NODIV +# ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */ +# define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */ +# endif +#endif + +/* Deprecated, will be removed from version 2.0.0. + Use PNG_MNG_FEATURES_SUPPORTED instead. */ +#ifndef PNG_NO_READ_EMPTY_PLTE +# define PNG_READ_EMPTY_PLTE_SUPPORTED +#endif + +#endif /* PNG_READ_SUPPORTED */ + +#if defined(PNG_WRITE_SUPPORTED) + +# if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ + !defined(PNG_NO_WRITE_TRANSFORMS) +# define PNG_WRITE_TRANSFORMS_SUPPORTED +#endif + +#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED +# ifndef PNG_NO_WRITE_SHIFT +# define PNG_WRITE_SHIFT_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_PACK +# define PNG_WRITE_PACK_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_BGR +# define PNG_WRITE_BGR_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_SWAP +# define PNG_WRITE_SWAP_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_PACKSWAP +# define PNG_WRITE_PACKSWAP_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_INVERT +# define PNG_WRITE_INVERT_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_FILLER +# define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */ +# endif +# ifndef PNG_NO_WRITE_SWAP_ALPHA +# define PNG_WRITE_SWAP_ALPHA_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_INVERT_ALPHA +# define PNG_WRITE_INVERT_ALPHA_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_USER_TRANSFORM +# define PNG_WRITE_USER_TRANSFORM_SUPPORTED +# endif +#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */ + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) +# ifndef PNG_NO_USER_TRANSFORM_PTR +# define PNG_USER_TRANSFORM_PTR_SUPPORTED +# endif +#endif + +#define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant + encoders, but can cause trouble + if left undefined */ + +#if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \ + defined(PNG_FLOATING_POINT_SUPPORTED) +# define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED +#endif + +#ifndef PNG_1_0_X +#ifndef PNG_NO_ERROR_NUMBERS +#define PNG_ERROR_NUMBERS_SUPPORTED +#endif +#endif /* PNG_1_0_X */ + +#ifndef PNG_NO_WRITE_FLUSH +# define PNG_WRITE_FLUSH_SUPPORTED +#endif + +/* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */ +#ifndef PNG_NO_WRITE_EMPTY_PLTE +# define PNG_WRITE_EMPTY_PLTE_SUPPORTED +#endif + +#endif /* PNG_WRITE_SUPPORTED */ + +#ifndef PNG_NO_STDIO +# define PNG_TIME_RFC1123_SUPPORTED +#endif + +/* This adds extra functions in pngget.c for accessing data from the + * info pointer (added in version 0.99) + * png_get_image_width() + * png_get_image_height() + * png_get_bit_depth() + * png_get_color_type() + * png_get_compression_type() + * png_get_filter_type() + * png_get_interlace_type() + * png_get_pixel_aspect_ratio() + * png_get_pixels_per_meter() + * png_get_x_offset_pixels() + * png_get_y_offset_pixels() + * png_get_x_offset_microns() + * png_get_y_offset_microns() + */ +#if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED) +# define PNG_EASY_ACCESS_SUPPORTED +#endif + +/* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0 + even when PNG_USE_PNGVCRD or PNG_USE_PNGGCCRD is not defined */ +#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE) +# ifndef PNG_ASSEMBLER_CODE_SUPPORTED +# define PNG_ASSEMBLER_CODE_SUPPORTED +# endif +# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) +# define PNG_MMX_CODE_SUPPORTED +# endif +#endif + +/* If you are sure that you don't need thread safety and you are compiling + with PNG_USE_PNGCCRD for an MMX application, you can define this for + faster execution. See pnggccrd.c. +#define PNG_THREAD_UNSAFE_OK +*/ + +#if !defined(PNG_1_0_X) +#if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED) +# define PNG_USER_MEM_SUPPORTED +#endif +#endif /* PNG_1_0_X */ + +/* These are currently experimental features, define them if you want */ + +/* very little testing */ +/* +#ifdef PNG_READ_SUPPORTED +# ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED +# define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED +# endif +#endif +*/ + +/* This is only for PowerPC big-endian and 680x0 systems */ +/* some testing */ +/* +#ifdef PNG_READ_SUPPORTED +# ifndef PNG_PNG_READ_BIG_ENDIAN_SUPPORTED +# define PNG_READ_BIG_ENDIAN_SUPPORTED +# endif +#endif +*/ + +/* Buggy compilers (e.g., gcc 2.7.2.2) need this */ +/* +#define PNG_NO_POINTER_INDEXING +*/ + +/* These functions are turned off by default, as they will be phased out. */ +/* +#define PNG_USELESS_TESTS_SUPPORTED +#define PNG_CORRECT_PALETTE_SUPPORTED +*/ + +/* Any chunks you are not interested in, you can undef here. The + * ones that allocate memory may be expecially important (hIST, + * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info + * a bit smaller. + */ + +#if defined(PNG_READ_SUPPORTED) && \ + !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ + !defined(PNG_NO_READ_ANCILLARY_CHUNKS) +# define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED +#endif + +#if defined(PNG_WRITE_SUPPORTED) && \ + !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ + !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS) +# define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED +#endif + +#ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED + +#ifdef PNG_NO_READ_TEXT +# define PNG_NO_READ_iTXt +# define PNG_NO_READ_tEXt +# define PNG_NO_READ_zTXt +#endif +#ifndef PNG_NO_READ_bKGD +# define PNG_READ_bKGD_SUPPORTED +# define PNG_bKGD_SUPPORTED +#endif +#ifndef PNG_NO_READ_cHRM +# define PNG_READ_cHRM_SUPPORTED +# define PNG_cHRM_SUPPORTED +#endif +#ifndef PNG_NO_READ_gAMA +# define PNG_READ_gAMA_SUPPORTED +# define PNG_gAMA_SUPPORTED +#endif +#ifndef PNG_NO_READ_hIST +# define PNG_READ_hIST_SUPPORTED +# define PNG_hIST_SUPPORTED +#endif +#ifndef PNG_NO_READ_iCCP +# define PNG_READ_iCCP_SUPPORTED +# define PNG_iCCP_SUPPORTED +#endif +#ifndef PNG_NO_READ_iTXt +# ifndef PNG_READ_iTXt_SUPPORTED +# define PNG_READ_iTXt_SUPPORTED +# endif +# ifndef PNG_iTXt_SUPPORTED +# define PNG_iTXt_SUPPORTED +# endif +#endif +#ifndef PNG_NO_READ_oFFs +# define PNG_READ_oFFs_SUPPORTED +# define PNG_oFFs_SUPPORTED +#endif +#ifndef PNG_NO_READ_pCAL +# define PNG_READ_pCAL_SUPPORTED +# define PNG_pCAL_SUPPORTED +#endif +#ifndef PNG_NO_READ_sCAL +# define PNG_READ_sCAL_SUPPORTED +# define PNG_sCAL_SUPPORTED +#endif +#ifndef PNG_NO_READ_pHYs +# define PNG_READ_pHYs_SUPPORTED +# define PNG_pHYs_SUPPORTED +#endif +#ifndef PNG_NO_READ_sBIT +# define PNG_READ_sBIT_SUPPORTED +# define PNG_sBIT_SUPPORTED +#endif +#ifndef PNG_NO_READ_sPLT +# define PNG_READ_sPLT_SUPPORTED +# define PNG_sPLT_SUPPORTED +#endif +#ifndef PNG_NO_READ_sRGB +# define PNG_READ_sRGB_SUPPORTED +# define PNG_sRGB_SUPPORTED +#endif +#ifndef PNG_NO_READ_tEXt +# define PNG_READ_tEXt_SUPPORTED +# define PNG_tEXt_SUPPORTED +#endif +#ifndef PNG_NO_READ_tIME +# define PNG_READ_tIME_SUPPORTED +# define PNG_tIME_SUPPORTED +#endif +#ifndef PNG_NO_READ_tRNS +# define PNG_READ_tRNS_SUPPORTED +# define PNG_tRNS_SUPPORTED +#endif +#ifndef PNG_NO_READ_zTXt +# define PNG_READ_zTXt_SUPPORTED +# define PNG_zTXt_SUPPORTED +#endif +#ifndef PNG_NO_READ_UNKNOWN_CHUNKS +# define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED +# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED +# define PNG_UNKNOWN_CHUNKS_SUPPORTED +# endif +# ifndef PNG_NO_HANDLE_AS_UNKNOWN +# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED +# endif +#endif +#if !defined(PNG_NO_READ_USER_CHUNKS) && \ + defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) +# define PNG_READ_USER_CHUNKS_SUPPORTED +# define PNG_USER_CHUNKS_SUPPORTED +# ifdef PNG_NO_READ_UNKNOWN_CHUNKS +# undef PNG_NO_READ_UNKNOWN_CHUNKS +# endif +# ifdef PNG_NO_HANDLE_AS_UNKNOWN +# undef PNG_NO_HANDLE_AS_UNKNOWN +# endif +#endif +#ifndef PNG_NO_READ_OPT_PLTE +# define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */ +#endif /* optional PLTE chunk in RGB and RGBA images */ +#if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \ + defined(PNG_READ_zTXt_SUPPORTED) +# define PNG_READ_TEXT_SUPPORTED +# define PNG_TEXT_SUPPORTED +#endif + +#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */ + +#ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED + +#ifdef PNG_NO_WRITE_TEXT +# define PNG_NO_WRITE_iTXt +# define PNG_NO_WRITE_tEXt +# define PNG_NO_WRITE_zTXt +#endif +#ifndef PNG_NO_WRITE_bKGD +# define PNG_WRITE_bKGD_SUPPORTED +# ifndef PNG_bKGD_SUPPORTED +# define PNG_bKGD_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_cHRM +# define PNG_WRITE_cHRM_SUPPORTED +# ifndef PNG_cHRM_SUPPORTED +# define PNG_cHRM_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_gAMA +# define PNG_WRITE_gAMA_SUPPORTED +# ifndef PNG_gAMA_SUPPORTED +# define PNG_gAMA_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_hIST +# define PNG_WRITE_hIST_SUPPORTED +# ifndef PNG_hIST_SUPPORTED +# define PNG_hIST_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_iCCP +# define PNG_WRITE_iCCP_SUPPORTED +# ifndef PNG_iCCP_SUPPORTED +# define PNG_iCCP_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_iTXt +# ifndef PNG_WRITE_iTXt_SUPPORTED +# define PNG_WRITE_iTXt_SUPPORTED +# endif +# ifndef PNG_iTXt_SUPPORTED +# define PNG_iTXt_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_oFFs +# define PNG_WRITE_oFFs_SUPPORTED +# ifndef PNG_oFFs_SUPPORTED +# define PNG_oFFs_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_pCAL +# define PNG_WRITE_pCAL_SUPPORTED +# ifndef PNG_pCAL_SUPPORTED +# define PNG_pCAL_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_sCAL +# define PNG_WRITE_sCAL_SUPPORTED +# ifndef PNG_sCAL_SUPPORTED +# define PNG_sCAL_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_pHYs +# define PNG_WRITE_pHYs_SUPPORTED +# ifndef PNG_pHYs_SUPPORTED +# define PNG_pHYs_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_sBIT +# define PNG_WRITE_sBIT_SUPPORTED +# ifndef PNG_sBIT_SUPPORTED +# define PNG_sBIT_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_sPLT +# define PNG_WRITE_sPLT_SUPPORTED +# ifndef PNG_sPLT_SUPPORTED +# define PNG_sPLT_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_sRGB +# define PNG_WRITE_sRGB_SUPPORTED +# ifndef PNG_sRGB_SUPPORTED +# define PNG_sRGB_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_tEXt +# define PNG_WRITE_tEXt_SUPPORTED +# ifndef PNG_tEXt_SUPPORTED +# define PNG_tEXt_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_tIME +# define PNG_WRITE_tIME_SUPPORTED +# ifndef PNG_tIME_SUPPORTED +# define PNG_tIME_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_tRNS +# define PNG_WRITE_tRNS_SUPPORTED +# ifndef PNG_tRNS_SUPPORTED +# define PNG_tRNS_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_zTXt +# define PNG_WRITE_zTXt_SUPPORTED +# ifndef PNG_zTXt_SUPPORTED +# define PNG_zTXt_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS +# define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED +# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED +# define PNG_UNKNOWN_CHUNKS_SUPPORTED +# endif +# ifndef PNG_NO_HANDLE_AS_UNKNOWN +# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED +# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED +# endif +# endif +#endif +#if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \ + defined(PNG_WRITE_zTXt_SUPPORTED) +# define PNG_WRITE_TEXT_SUPPORTED +# ifndef PNG_TEXT_SUPPORTED +# define PNG_TEXT_SUPPORTED +# endif +#endif + +#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ + +/* Turn this off to disable png_read_png() and + * png_write_png() and leave the row_pointers member + * out of the info structure. + */ +#ifndef PNG_NO_INFO_IMAGE +# define PNG_INFO_IMAGE_SUPPORTED +#endif + +/* need the time information for reading tIME chunks */ +#if defined(PNG_tIME_SUPPORTED) +# if !defined(_WIN32_WCE) + /* "time.h" functions are not supported on WindowsCE */ +# include +# endif +#endif + +/* Some typedefs to get us started. These should be safe on most of the + * common platforms. The typedefs should be at least as large as the + * numbers suggest (a png_uint_32 must be at least 32 bits long), but they + * don't have to be exactly that size. Some compilers dislike passing + * unsigned shorts as function parameters, so you may be better off using + * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may + * want to have unsigned int for png_uint_32 instead of unsigned long. + */ + +typedef unsigned long png_uint_32; +typedef long png_int_32; +typedef unsigned short png_uint_16; +typedef short png_int_16; +typedef unsigned char png_byte; + +/* This is usually size_t. It is typedef'ed just in case you need it to + change (I'm not sure if you will or not, so I thought I'd be safe) */ +typedef size_t png_size_t; + +/* The following is needed for medium model support. It cannot be in the + * PNG_INTERNAL section. Needs modification for other compilers besides + * MSC. Model independent support declares all arrays and pointers to be + * large using the far keyword. The zlib version used must also support + * model independent data. As of version zlib 1.0.4, the necessary changes + * have been made in zlib. The USE_FAR_KEYWORD define triggers other + * changes that are needed. (Tim Wegner) + */ + +/* Separate compiler dependencies (problem here is that zlib.h always + defines FAR. (SJT) */ +#ifdef __BORLANDC__ +# if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__) +# define LDATA 1 +# else +# define LDATA 0 +# endif + /* GRR: why is Cygwin in here? Cygwin is not Borland C... */ +# if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__) +# define PNG_MAX_MALLOC_64K +# if (LDATA != 1) +# ifndef FAR +# define FAR __far +# endif +# define USE_FAR_KEYWORD +# endif /* LDATA != 1 */ + /* Possibly useful for moving data out of default segment. + * Uncomment it if you want. Could also define FARDATA as + * const if your compiler supports it. (SJT) +# define FARDATA FAR + */ +# endif /* __WIN32__, __FLAT__, __CYGWIN__ */ +#endif /* __BORLANDC__ */ + + +/* Suggest testing for specific compiler first before testing for + * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM, + * making reliance oncertain keywords suspect. (SJT) + */ + +/* MSC Medium model */ +#if defined(FAR) +# if defined(M_I86MM) +# define USE_FAR_KEYWORD +# define FARDATA FAR +# include +# endif +#endif + +/* SJT: default case */ +#ifndef FAR +# define FAR +#endif + +/* At this point FAR is always defined */ +#ifndef FARDATA +# define FARDATA +#endif + +/* Typedef for floating-point numbers that are converted + to fixed-point with a multiple of 100,000, e.g., int_gamma */ +typedef png_int_32 png_fixed_point; + +/* Add typedefs for pointers */ +typedef void FAR * png_voidp; +typedef png_byte FAR * png_bytep; +typedef png_uint_32 FAR * png_uint_32p; +typedef png_int_32 FAR * png_int_32p; +typedef png_uint_16 FAR * png_uint_16p; +typedef png_int_16 FAR * png_int_16p; +typedef PNG_CONST char FAR * png_const_charp; +typedef char FAR * png_charp; +typedef png_fixed_point FAR * png_fixed_point_p; + +#ifndef PNG_NO_STDIO +#if defined(_WIN32_WCE) +typedef HANDLE png_FILE_p; +#else +typedef FILE * png_FILE_p; +#endif +#endif + +#ifdef PNG_FLOATING_POINT_SUPPORTED +typedef double FAR * png_doublep; +#endif + +/* Pointers to pointers; i.e. arrays */ +typedef png_byte FAR * FAR * png_bytepp; +typedef png_uint_32 FAR * FAR * png_uint_32pp; +typedef png_int_32 FAR * FAR * png_int_32pp; +typedef png_uint_16 FAR * FAR * png_uint_16pp; +typedef png_int_16 FAR * FAR * png_int_16pp; +typedef PNG_CONST char FAR * FAR * png_const_charpp; +typedef char FAR * FAR * png_charpp; +typedef png_fixed_point FAR * FAR * png_fixed_point_pp; +#ifdef PNG_FLOATING_POINT_SUPPORTED +typedef double FAR * FAR * png_doublepp; +#endif + +/* Pointers to pointers to pointers; i.e., pointer to array */ +typedef char FAR * FAR * FAR * png_charppp; + +/* libpng typedefs for types in zlib. If zlib changes + * or another compression library is used, then change these. + * Eliminates need to change all the source files. + */ +typedef charf * png_zcharp; +typedef charf * FAR * png_zcharpp; +typedef z_stream FAR * png_zstreamp; + +/* + * Define PNG_BUILD_DLL if the module being built is a Windows + * LIBPNG DLL. + * + * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL. + * It is equivalent to Microsoft predefined macro _DLL that is + * automatically defined when you compile using the share + * version of the CRT (C Run-Time library) + * + * The cygwin mods make this behavior a little different: + * Define PNG_BUILD_DLL if you are building a dll for use with cygwin + * Define PNG_STATIC if you are building a static library for use with cygwin, + * -or- if you are building an application that you want to link to the + * static library. + * PNG_USE_DLL is defined by default (no user action needed) unless one of + * the other flags is defined. + */ + +#if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL)) +# define PNG_DLL +#endif +/* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib. + * When building a static lib, default to no GLOBAL ARRAYS, but allow + * command-line override + */ +#if defined(__CYGWIN__) +# if !defined(PNG_STATIC) +# if defined(PNG_USE_GLOBAL_ARRAYS) +# undef PNG_USE_GLOBAL_ARRAYS +# endif +# if !defined(PNG_USE_LOCAL_ARRAYS) +# define PNG_USE_LOCAL_ARRAYS +# endif +# else +# if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS) +# if defined(PNG_USE_GLOBAL_ARRAYS) +# undef PNG_USE_GLOBAL_ARRAYS +# endif +# endif +# endif +# if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) +# define PNG_USE_LOCAL_ARRAYS +# endif +#endif + +/* Do not use global arrays (helps with building DLL's) + * They are no longer used in libpng itself, since version 1.0.5c, + * but might be required for some pre-1.0.5c applications. + */ +#if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) +# if defined(PNG_NO_GLOBAL_ARRAYS) || (defined(__GNUC__) && defined(PNG_DLL)) +# define PNG_USE_LOCAL_ARRAYS +# else +# define PNG_USE_GLOBAL_ARRAYS +# endif +#endif + +#if defined(__CYGWIN__) +# undef PNGAPI +# define PNGAPI __cdecl +# undef PNG_IMPEXP +# define PNG_IMPEXP +#endif + +/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall", + * you may get warnings regarding the linkage of png_zalloc and png_zfree. + * Don't ignore those warnings; you must also reset the default calling + * convention in your compiler to match your PNGAPI, and you must build + * zlib and your applications the same way you build libpng. + */ + +#ifndef PNGAPI + +#if defined(__MINGW32__) && !defined(PNG_MODULEDEF) +# ifndef PNG_NO_MODULEDEF +# define PNG_NO_MODULEDEF +# endif +#endif + +#if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF) +# define PNG_IMPEXP +#endif + +#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \ + (( defined(_Windows) || defined(_WINDOWS) || \ + defined(WIN32) || defined(_WIN32) || defined(__WIN32__) )) + +# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) +# define PNGAPI __cdecl +# else +# define PNGAPI _cdecl +# endif + +# if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \ + 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */) +# define PNG_IMPEXP +# endif + +# if !defined(PNG_IMPEXP) + +# define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol +# define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol + + /* Borland/Microsoft */ +# if defined(_MSC_VER) || defined(__BORLANDC__) +# if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500) +# define PNG_EXPORT PNG_EXPORT_TYPE1 +# else +# define PNG_EXPORT PNG_EXPORT_TYPE2 +# if defined(PNG_BUILD_DLL) +# define PNG_IMPEXP __export +# else +# define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in + VC++ */ +# endif /* Exists in Borland C++ for + C++ classes (== huge) */ +# endif +# endif + +# if !defined(PNG_IMPEXP) +# if defined(PNG_BUILD_DLL) +# define PNG_IMPEXP __declspec(dllexport) +# else +# define PNG_IMPEXP __declspec(dllimport) +# endif +# endif +# endif /* PNG_IMPEXP */ +#else /* !(DLL || non-cygwin WINDOWS) */ +# if (defined(__IBMC__) || defined(IBMCPP__)) && defined(__OS2__) +# define PNGAPI _System +# define PNG_IMPEXP +# else +# if 0 /* ... other platforms, with other meanings */ +# else +# define PNGAPI +# define PNG_IMPEXP +# endif +# endif +#endif +#endif + +#ifndef PNGAPI +# define PNGAPI +#endif +#ifndef PNG_IMPEXP +# define PNG_IMPEXP +#endif + +#ifndef PNG_EXPORT +# define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol +#endif + +#ifdef PNG_USE_GLOBAL_ARRAYS +# ifndef PNG_EXPORT_VAR +# define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type +# endif +#endif + +/* User may want to use these so they are not in PNG_INTERNAL. Any library + * functions that are passed far data must be model independent. + */ + +#ifndef PNG_ABORT +# define PNG_ABORT() abort() +#endif + +#ifdef PNG_SETJMP_SUPPORTED +# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) +#else +# define png_jmpbuf(png_ptr) \ + (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED) +#endif + +#if defined(USE_FAR_KEYWORD) /* memory model independent fns */ +/* use this to make far-to-near assignments */ +# define CHECK 1 +# define NOCHECK 0 +# define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK)) +# define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK)) +# define png_strcpy _fstrcpy +# define png_strlen _fstrlen +# define png_memcmp _fmemcmp /* SJT: added */ +# define png_memcpy _fmemcpy +# define png_memset _fmemset +#else /* use the usual functions */ +# define CVT_PTR(ptr) (ptr) +# define CVT_PTR_NOCHECK(ptr) (ptr) +# define png_strcpy strcpy +# define png_strlen strlen +# define png_memcmp memcmp /* SJT: added */ +# define png_memcpy memcpy +# define png_memset memset +#endif +/* End of memory model independent support */ + +/* Just a little check that someone hasn't tried to define something + * contradictory. + */ +#if (PNG_ZBUF_SIZE > 65536) && defined(PNG_MAX_MALLOC_64K) +# undef PNG_ZBUF_SIZE +# define PNG_ZBUF_SIZE 65536 +#endif + +#ifdef PNG_READ_SUPPORTED +/* Prior to libpng-1.0.9, this block was in pngasmrd.h */ +#if defined(PNG_INTERNAL) + +/* These are the default thresholds before the MMX code kicks in; if either + * rowbytes or bitdepth is below the threshold, plain C code is used. These + * can be overridden at runtime via the png_set_mmx_thresholds() call in + * libpng 1.2.0 and later. The values below were chosen by Intel. + */ + +#ifndef PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT +# define PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT 128 /* >= */ +#endif +#ifndef PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT +# define PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT 9 /* >= */ +#endif + +/* Set this in the makefile for VC++ on Pentium, not here. */ +/* Platform must be Pentium. Makefile must assemble and load pngvcrd.c . + * MMX will be detected at run time and used if present. + */ +#ifdef PNG_USE_PNGVCRD +# define PNG_HAVE_ASSEMBLER_COMBINE_ROW +# define PNG_HAVE_ASSEMBLER_READ_INTERLACE +# define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW +#endif + +/* Set this in the makefile for gcc/as on Pentium, not here. */ +/* Platform must be Pentium. Makefile must assemble and load pnggccrd.c . + * MMX will be detected at run time and used if present. + */ +#ifdef PNG_USE_PNGGCCRD +# define PNG_HAVE_ASSEMBLER_COMBINE_ROW +# define PNG_HAVE_ASSEMBLER_READ_INTERLACE +# define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW +#endif +/* - see pnggccrd.c for info about what is currently enabled */ + +#endif /* PNG_INTERNAL */ +#endif /* PNG_READ_SUPPORTED */ + +#endif /* PNGCONF_H */ + diff --git a/winclude/trees.h b/winclude/trees.h index 1ca868b84..72facf900 100755 --- a/winclude/trees.h +++ b/winclude/trees.h @@ -1,128 +1,128 @@ -/* header created automatically with -DGEN_TREES_H */ - -local const ct_data static_ltree[L_CODES+2] = { -{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}}, -{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}}, -{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}}, -{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}}, -{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}}, -{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}}, -{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}}, -{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}}, -{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}}, -{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}}, -{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}}, -{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}}, -{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}}, -{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}}, -{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}}, -{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}}, -{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}}, -{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}}, -{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}}, -{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}}, -{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}}, -{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}}, -{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}}, -{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}}, -{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}}, -{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}}, -{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}}, -{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}}, -{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}}, -{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}}, -{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}}, -{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}}, -{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}}, -{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}}, -{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}}, -{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}}, -{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}}, -{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}}, -{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}}, -{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}}, -{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}}, -{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}}, -{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}}, -{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}}, -{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}}, -{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}}, -{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}}, -{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}}, -{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}}, -{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}}, -{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}}, -{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}}, -{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}}, -{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}}, -{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}}, -{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}}, -{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}}, -{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}} -}; - -local const ct_data static_dtree[D_CODES] = { -{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}}, -{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}}, -{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}}, -{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}}, -{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}}, -{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}} -}; - -const uch _dist_code[DIST_CODE_LEN] = { - 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, - 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, -10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, -11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, -12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, -13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, -13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, -15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, -15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, -15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, -18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, -23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, -26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, -26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, -27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, -27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 -}; - -const uch _length_code[MAX_MATCH-MIN_MATCH+1]= { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, -13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, -17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, -19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, -21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, -22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, -23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, -25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, -26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, -26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, -27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28 -}; - -local const int base_length[LENGTH_CODES] = { -0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, -64, 80, 96, 112, 128, 160, 192, 224, 0 -}; - -local const int base_dist[D_CODES] = { - 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, - 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, - 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576 -}; - +/* header created automatically with -DGEN_TREES_H */ + +local const ct_data static_ltree[L_CODES+2] = { +{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}}, +{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}}, +{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}}, +{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}}, +{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}}, +{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}}, +{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}}, +{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}}, +{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}}, +{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}}, +{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}}, +{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}}, +{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}}, +{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}}, +{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}}, +{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}}, +{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}}, +{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}}, +{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}}, +{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}}, +{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}}, +{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}}, +{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}}, +{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}}, +{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}}, +{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}}, +{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}}, +{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}}, +{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}}, +{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}}, +{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}}, +{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}}, +{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}}, +{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}}, +{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}}, +{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}}, +{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}}, +{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}}, +{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}}, +{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}}, +{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}}, +{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}}, +{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}}, +{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}}, +{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}}, +{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}}, +{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}}, +{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}}, +{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}}, +{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}}, +{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}}, +{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}}, +{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}}, +{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}}, +{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}}, +{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}}, +{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}}, +{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}} +}; + +local const ct_data static_dtree[D_CODES] = { +{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}}, +{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}}, +{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}}, +{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}}, +{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}}, +{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}} +}; + +const uch _dist_code[DIST_CODE_LEN] = { + 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, + 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, +10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, +11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, +12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, +13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, +13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, +18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, +23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, +24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, +26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, +26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, +27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, +27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, +28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, +28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, +28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 +}; + +const uch _length_code[MAX_MATCH-MIN_MATCH+1]= { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, +13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, +17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, +19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, +21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, +22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, +23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, +24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, +25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, +25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, +26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, +26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, +27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28 +}; + +local const int base_length[LENGTH_CODES] = { +0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, +64, 80, 96, 112, 128, 160, 192, 224, 0 +}; + +local const int base_dist[D_CODES] = { + 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, + 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, + 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576 +}; + diff --git a/winclude/zconf.h b/winclude/zconf.h index f404cefa8..eb0ae2e1a 100755 --- a/winclude/zconf.h +++ b/winclude/zconf.h @@ -1,279 +1,279 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2002 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#ifndef _ZCONF_H -#define _ZCONF_H - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - */ -#ifdef Z_PREFIX -# define deflateInit_ z_deflateInit_ -# define deflate z_deflate -# define deflateEnd z_deflateEnd -# define inflateInit_ z_inflateInit_ -# define inflate z_inflate -# define inflateEnd z_inflateEnd -# define deflateInit2_ z_deflateInit2_ -# define deflateSetDictionary z_deflateSetDictionary -# define deflateCopy z_deflateCopy -# define deflateReset z_deflateReset -# define deflateParams z_deflateParams -# define inflateInit2_ z_inflateInit2_ -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateReset z_inflateReset -# define compress z_compress -# define compress2 z_compress2 -# define uncompress z_uncompress -# define adler32 z_adler32 -# define crc32 z_crc32 -# define get_crc_table z_get_crc_table - -# define Byte z_Byte -# define uInt z_uInt -# define uLong z_uLong -# define Bytef z_Bytef -# define charf z_charf -# define intf z_intf -# define uIntf z_uIntf -# define uLongf z_uLongf -# define voidpf z_voidpf -# define voidp z_voidp -#endif - -#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) -# define WIN32 -#endif -#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386) -# ifndef __32BIT__ -# define __32BIT__ -# endif -#endif -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#if defined(MSDOS) && !defined(__32BIT__) -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC) -# define STDC -#endif -#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__) -# ifndef STDC -# define STDC -# endif -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const -# endif -#endif - -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__) -# define NO_DUMMY_DECL -#endif - -/* Old Borland C incorrectly complains about missing returns: */ -#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) -# define NEED_DUMMY_RETURN -#endif - - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -#endif -#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__)) -# ifndef __32BIT__ -# define SMALL_MEDIUM -# define FAR _far -# endif -#endif - -/* Compile with -DZLIB_DLL for Windows DLL support */ -#if defined(ZLIB_DLL) -# if defined(_WINDOWS) || defined(WINDOWS) -# ifdef FAR -# undef FAR -# endif -# include -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR _cdecl _export -# endif -# endif -# if defined (__BORLANDC__) -# if (__BORLANDC__ >= 0x0500) && defined (WIN32) -# include -# define ZEXPORT __declspec(dllexport) WINAPI -# define ZEXPORTRVA __declspec(dllexport) WINAPIV -# else -# if defined (_Windows) && defined (__DLL__) -# define ZEXPORT _export -# define ZEXPORTVA _export -# endif -# endif -# endif -#endif - -#if defined (__BEOS__) -# if defined (ZLIB_DLL) -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -#endif - -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif -#ifndef ZEXTERN -# define ZEXTERN extern -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(MACOS) && !defined(TARGET_OS_MAC) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -#ifdef HAVE_UNISTD_H -# include /* for off_t */ -# include /* for SEEK_* and off_t */ -# define z_off_t off_t -#endif -#ifndef SEEK_SET -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif -#ifndef z_off_t -# define z_off_t long -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) -# pragma map(deflateInit_,"DEIN") -# pragma map(deflateInit2_,"DEIN2") -# pragma map(deflateEnd,"DEEND") -# pragma map(inflateInit_,"ININ") -# pragma map(inflateInit2_,"ININ2") -# pragma map(inflateEnd,"INEND") -# pragma map(inflateSync,"INSY") -# pragma map(inflateSetDictionary,"INSEDI") -# pragma map(inflate_blocks,"INBL") -# pragma map(inflate_blocks_new,"INBLNE") -# pragma map(inflate_blocks_free,"INBLFR") -# pragma map(inflate_blocks_reset,"INBLRE") -# pragma map(inflate_codes_free,"INCOFR") -# pragma map(inflate_codes,"INCO") -# pragma map(inflate_fast,"INFA") -# pragma map(inflate_flush,"INFLU") -# pragma map(inflate_mask,"INMA") -# pragma map(inflate_set_dictionary,"INSEDI2") -# pragma map(inflate_copyright,"INCOPY") -# pragma map(inflate_trees_bits,"INTRBI") -# pragma map(inflate_trees_dynamic,"INTRDY") -# pragma map(inflate_trees_fixed,"INTRFI") -# pragma map(inflate_trees_free,"INTRFR") -#endif - -#endif /* _ZCONF_H */ +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-2002 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#ifndef _ZCONF_H +#define _ZCONF_H + +/* + * If you *really* need a unique prefix for all types and library functions, + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. + */ +#ifdef Z_PREFIX +# define deflateInit_ z_deflateInit_ +# define deflate z_deflate +# define deflateEnd z_deflateEnd +# define inflateInit_ z_inflateInit_ +# define inflate z_inflate +# define inflateEnd z_inflateEnd +# define deflateInit2_ z_deflateInit2_ +# define deflateSetDictionary z_deflateSetDictionary +# define deflateCopy z_deflateCopy +# define deflateReset z_deflateReset +# define deflateParams z_deflateParams +# define inflateInit2_ z_inflateInit2_ +# define inflateSetDictionary z_inflateSetDictionary +# define inflateSync z_inflateSync +# define inflateSyncPoint z_inflateSyncPoint +# define inflateReset z_inflateReset +# define compress z_compress +# define compress2 z_compress2 +# define uncompress z_uncompress +# define adler32 z_adler32 +# define crc32 z_crc32 +# define get_crc_table z_get_crc_table + +# define Byte z_Byte +# define uInt z_uInt +# define uLong z_uLong +# define Bytef z_Bytef +# define charf z_charf +# define intf z_intf +# define uIntf z_uIntf +# define uLongf z_uLongf +# define voidpf z_voidpf +# define voidp z_voidp +#endif + +#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) +# define WIN32 +#endif +#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386) +# ifndef __32BIT__ +# define __32BIT__ +# endif +#endif +#if defined(__MSDOS__) && !defined(MSDOS) +# define MSDOS +#endif + +/* + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more + * than 64k bytes at a time (needed on systems with 16-bit int). + */ +#if defined(MSDOS) && !defined(__32BIT__) +# define MAXSEG_64K +#endif +#ifdef MSDOS +# define UNALIGNED_OK +#endif + +#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC) +# define STDC +#endif +#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__) +# ifndef STDC +# define STDC +# endif +#endif + +#ifndef STDC +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +# define const +# endif +#endif + +/* Some Mac compilers merge all .h files incorrectly: */ +#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__) +# define NO_DUMMY_DECL +#endif + +/* Old Borland C incorrectly complains about missing returns: */ +#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) +# define NEED_DUMMY_RETURN +#endif + + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus a few kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +/* The following definitions for FAR are needed only for MSDOS mixed + * model programming (small or medium model with some far allocations). + * This was tested only with MSC; for other MSDOS compilers you may have + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, + * just define FAR to be empty. + */ +#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__) + /* MSC small or medium model */ +# define SMALL_MEDIUM +# ifdef _MSC_VER +# define FAR _far +# else +# define FAR far +# endif +#endif +#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__)) +# ifndef __32BIT__ +# define SMALL_MEDIUM +# define FAR _far +# endif +#endif + +/* Compile with -DZLIB_DLL for Windows DLL support */ +#if defined(ZLIB_DLL) +# if defined(_WINDOWS) || defined(WINDOWS) +# ifdef FAR +# undef FAR +# endif +# include +# define ZEXPORT WINAPI +# ifdef WIN32 +# define ZEXPORTVA WINAPIV +# else +# define ZEXPORTVA FAR _cdecl _export +# endif +# endif +# if defined (__BORLANDC__) +# if (__BORLANDC__ >= 0x0500) && defined (WIN32) +# include +# define ZEXPORT __declspec(dllexport) WINAPI +# define ZEXPORTRVA __declspec(dllexport) WINAPIV +# else +# if defined (_Windows) && defined (__DLL__) +# define ZEXPORT _export +# define ZEXPORTVA _export +# endif +# endif +# endif +#endif + +#if defined (__BEOS__) +# if defined (ZLIB_DLL) +# define ZEXTERN extern __declspec(dllexport) +# else +# define ZEXTERN extern __declspec(dllimport) +# endif +#endif + +#ifndef ZEXPORT +# define ZEXPORT +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA +#endif +#ifndef ZEXTERN +# define ZEXTERN extern +#endif + +#ifndef FAR +# define FAR +#endif + +#if !defined(MACOS) && !defined(TARGET_OS_MAC) +typedef unsigned char Byte; /* 8 bits */ +#endif +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +#ifdef SMALL_MEDIUM + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +# define Bytef Byte FAR +#else + typedef Byte FAR Bytef; +#endif +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +#ifdef STDC + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif + +#ifdef HAVE_UNISTD_H +# include /* for off_t */ +# include /* for SEEK_* and off_t */ +# define z_off_t off_t +#endif +#ifndef SEEK_SET +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif +#ifndef z_off_t +# define z_off_t long +#endif + +/* MVS linker does not support external names larger than 8 bytes */ +#if defined(__MVS__) +# pragma map(deflateInit_,"DEIN") +# pragma map(deflateInit2_,"DEIN2") +# pragma map(deflateEnd,"DEEND") +# pragma map(inflateInit_,"ININ") +# pragma map(inflateInit2_,"ININ2") +# pragma map(inflateEnd,"INEND") +# pragma map(inflateSync,"INSY") +# pragma map(inflateSetDictionary,"INSEDI") +# pragma map(inflate_blocks,"INBL") +# pragma map(inflate_blocks_new,"INBLNE") +# pragma map(inflate_blocks_free,"INBLFR") +# pragma map(inflate_blocks_reset,"INBLRE") +# pragma map(inflate_codes_free,"INCOFR") +# pragma map(inflate_codes,"INCO") +# pragma map(inflate_fast,"INFA") +# pragma map(inflate_flush,"INFLU") +# pragma map(inflate_mask,"INMA") +# pragma map(inflate_set_dictionary,"INSEDI2") +# pragma map(inflate_copyright,"INCOPY") +# pragma map(inflate_trees_bits,"INTRBI") +# pragma map(inflate_trees_dynamic,"INTRDY") +# pragma map(inflate_trees_fixed,"INTRFI") +# pragma map(inflate_trees_free,"INTRFR") +#endif + +#endif /* _ZCONF_H */ diff --git a/winclude/zlib.h b/winclude/zlib.h index 5979f040c..52cb529f6 100755 --- a/winclude/zlib.h +++ b/winclude/zlib.h @@ -1,893 +1,893 @@ -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.1.4, March 11th, 2002 - - Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt - (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). -*/ - -#ifndef _ZLIB_H -#define _ZLIB_H - -#include "zconf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ZLIB_VERSION "1.1.4" - -/* - The 'zlib' compression library provides in-memory compression and - decompression functions, including integrity checks of the uncompressed - data. This version of the library supports only one compression method - (deflation) but other algorithms will be added later and will have the same - stream interface. - - Compression can be done in a single step if the buffers are large - enough (for example if an input file is mmap'ed), or can be done by - repeated calls of the compression function. In the latter case, the - application must provide more input and/or consume the output - (providing more output space) before each call. - - The library also supports reading and writing files in gzip (.gz) format - with an interface similar to that of stdio. - - The library does not install any signal handler. The decoder checks - the consistency of the compressed data, so the library should never - crash even in case of corrupted input. -*/ - -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); - -struct internal_state; - -typedef struct z_stream_s { - Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total nb of input bytes read so far */ - - Bytef *next_out; /* next output byte should be put there */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total nb of bytes output so far */ - - char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ - - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ - voidpf opaque; /* private data object passed to zalloc and zfree */ - - int data_type; /* best guess about the data type: ascii or binary */ - uLong adler; /* adler32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ -} z_stream; - -typedef z_stream FAR *z_streamp; - -/* - The application must update next_in and avail_in when avail_in has - dropped to zero. It must update next_out and avail_out when avail_out - has dropped to zero. The application must initialize zalloc, zfree and - opaque before calling the init function. All other fields are set by the - compression library and must not be updated by the application. - - The opaque value provided by the application will be passed as the first - parameter for calls of zalloc and zfree. This can be useful for custom - memory management. The compression library attaches no meaning to the - opaque value. - - zalloc must return Z_NULL if there is not enough memory for the object. - If zlib is used in a multi-threaded application, zalloc and zfree must be - thread safe. - - On 16-bit systems, the functions zalloc and zfree must be able to allocate - exactly 65536 bytes, but will not be required to allocate more than this - if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, - pointers returned by zalloc for objects of exactly 65536 bytes *must* - have their offset normalized to zero. The default allocation function - provided by this library ensures this (see zutil.c). To reduce memory - requirements and avoid any allocation of 64K objects, at the expense of - compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). - - The fields total_in and total_out can be used for statistics or - progress reports. After compression, total_in holds the total size of - the uncompressed data and may be saved for use in the decompressor - (particularly if the decompressor wants to decompress everything in - a single step). -*/ - - /* constants */ - -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -/* Allowed flush values; see deflate() below for details */ - -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) -/* Return codes for the compression/decompression functions. Negative - * values are errors, positive values are used for special but normal events. - */ - -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) -/* compression levels */ - -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_DEFAULT_STRATEGY 0 -/* compression strategy; see deflateInit2() below for details */ - -#define Z_BINARY 0 -#define Z_ASCII 1 -#define Z_UNKNOWN 2 -/* Possible values of the data_type field */ - -#define Z_DEFLATED 8 -/* The deflate compression method (the only one supported in this version) */ - -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ - -#define zlib_version zlibVersion() -/* for compatibility with versions < 1.0.2 */ - - /* basic functions */ - -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); -/* The application can compare zlibVersion and ZLIB_VERSION for consistency. - If the first character differs, the library code actually used is - not compatible with the zlib.h header file used by the application. - This check is automatically made by deflateInit and inflateInit. - */ - -/* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); - - Initializes the internal stream state for compression. The fields - zalloc, zfree and opaque must be initialized before by the caller. - If zalloc and zfree are set to Z_NULL, deflateInit updates them to - use default allocation functions. - - The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: - 1 gives best speed, 9 gives best compression, 0 gives no compression at - all (the input data is simply copied a block at a time). - Z_DEFAULT_COMPRESSION requests a default compromise between speed and - compression (currently equivalent to level 6). - - deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if level is not a valid compression level, - Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible - with the version assumed by the caller (ZLIB_VERSION). - msg is set to null if there is no error message. deflateInit does not - perform any compression: this will be done by deflate(). -*/ - - -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); -/* - deflate compresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce some - output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. deflate performs one or both of the - following actions: - - - Compress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in and avail_in are updated and - processing will resume at this point for the next call of deflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. This action is forced if the parameter flush is non zero. - Forcing flush frequently degrades the compression ratio, so this parameter - should be set only when necessary (in interactive applications). - Some output may be provided even if flush is not set. - - Before the call of deflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating avail_in or avail_out accordingly; avail_out - should never be zero before the call. The application can consume the - compressed output when it wants, for example when the output buffer is full - (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK - and with zero avail_out, it must be called again after making room in the - output buffer because there might be more output pending. - - If the parameter flush is set to Z_SYNC_FLUSH, all pending output is - flushed to the output buffer and the output is aligned on a byte boundary, so - that the decompressor can get all input data available so far. (In particular - avail_in is zero after the call if enough output space has been provided - before the call.) Flushing may degrade compression for some compression - algorithms and so it should be used only when necessary. - - If flush is set to Z_FULL_FLUSH, all output is flushed as with - Z_SYNC_FLUSH, and the compression state is reset so that decompression can - restart from this point if previous compressed data has been damaged or if - random access is desired. Using Z_FULL_FLUSH too often can seriously degrade - the compression. - - If deflate returns with avail_out == 0, this function must be called again - with the same value of the flush parameter and more output space (updated - avail_out), until the flush is complete (deflate returns with non-zero - avail_out). - - If the parameter flush is set to Z_FINISH, pending input is processed, - pending output is flushed and deflate returns with Z_STREAM_END if there - was enough output space; if deflate returns with Z_OK, this function must be - called again with Z_FINISH and more output space (updated avail_out) but no - more input data, until it returns with Z_STREAM_END or an error. After - deflate has returned Z_STREAM_END, the only possible operations on the - stream are deflateReset or deflateEnd. - - Z_FINISH can be used immediately after deflateInit if all the compression - is to be done in a single step. In this case, avail_out must be at least - 0.1% larger than avail_in plus 12 bytes. If deflate does not return - Z_STREAM_END, then it must be called again as described above. - - deflate() sets strm->adler to the adler32 checksum of all input read - so far (that is, total_in bytes). - - deflate() may update data_type if it can make a good guess about - the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered - binary. This field is only for information purposes and does not affect - the compression algorithm in any manner. - - deflate() returns Z_OK if some progress has been made (more input - processed or more output produced), Z_STREAM_END if all input has been - consumed and all output has been produced (only when flush is set to - Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible - (for example avail_in or avail_out was zero). -*/ - - -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the - stream state was inconsistent, Z_DATA_ERROR if the stream was freed - prematurely (some input or output was discarded). In the error case, - msg may be set but then points to a static string (which must not be - deallocated). -*/ - - -/* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); - - Initializes the internal stream state for decompression. The fields - next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. If next_in is not Z_NULL and avail_in is large enough (the exact - value depends on the compression method), inflateInit determines the - compression method from the zlib header and allocates all data structures - accordingly; otherwise the allocation will be deferred to the first call of - inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to - use default allocation functions. - - inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller. msg is set to null if there is no error - message. inflateInit does not perform any decompression apart from reading - the zlib header if present: this will be done by inflate(). (So next_in and - avail_in may be modified, but next_out and avail_out are unchanged.) -*/ - - -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); -/* - inflate decompresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may some - introduce some output latency (reading input without producing any output) - except when forced to flush. - - The detailed semantics are as follows. inflate performs one or both of the - following actions: - - - Decompress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in is updated and processing - will resume at this point for the next call of inflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. inflate() provides as much output as possible, until there - is no more input data or no more space in the output buffer (see below - about the flush parameter). - - Before the call of inflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating the next_* and avail_* values accordingly. - The application can consume the uncompressed output when it wants, for - example when the output buffer is full (avail_out == 0), or after each - call of inflate(). If inflate returns Z_OK and with zero avail_out, it - must be called again after making room in the output buffer because there - might be more output pending. - - If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much - output as possible to the output buffer. The flushing behavior of inflate is - not specified for values of the flush parameter other than Z_SYNC_FLUSH - and Z_FINISH, but the current implementation actually flushes as much output - as possible anyway. - - inflate() should normally be called until it returns Z_STREAM_END or an - error. However if all decompression is to be performed in a single step - (a single call of inflate), the parameter flush should be set to - Z_FINISH. In this case all pending input is processed and all pending - output is flushed; avail_out must be large enough to hold all the - uncompressed data. (The size of the uncompressed data may have been saved - by the compressor for this purpose.) The next operation on this stream must - be inflateEnd to deallocate the decompression state. The use of Z_FINISH - is never required, but can be used to inform inflate that a faster routine - may be used for the single inflate() call. - - If a preset dictionary is needed at this point (see inflateSetDictionary - below), inflate sets strm-adler to the adler32 checksum of the - dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise - it sets strm->adler to the adler32 checksum of all output produced - so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or - an error code as described below. At the end of the stream, inflate() - checks that its computed adler32 checksum is equal to that saved by the - compressor and returns Z_STREAM_END only if the checksum is correct. - - inflate() returns Z_OK if some progress has been made (more input processed - or more output produced), Z_STREAM_END if the end of the compressed data has - been reached and all uncompressed output has been produced, Z_NEED_DICT if a - preset dictionary is needed at this point, Z_DATA_ERROR if the input data was - corrupted (input stream not conforming to the zlib format or incorrect - adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent - (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if no progress is possible or if there was not - enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR - case, the application may then call inflateSync to look for a good - compression block. -*/ - - -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state - was inconsistent. In the error case, msg may be set but then points to a - static string (which must not be deallocated). -*/ - - /* Advanced functions */ - -/* - The following functions are needed only in some special applications. -*/ - -/* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); - - This is another version of deflateInit with more compression options. The - fields next_in, zalloc, zfree and opaque must be initialized before by - the caller. - - The method parameter is the compression method. It must be Z_DEFLATED in - this version of the library. - - The windowBits parameter is the base two logarithm of the window size - (the size of the history buffer). It should be in the range 8..15 for this - version of the library. Larger values of this parameter result in better - compression at the expense of memory usage. The default value is 15 if - deflateInit is used instead. - - The memLevel parameter specifies how much memory should be allocated - for the internal compression state. memLevel=1 uses minimum memory but - is slow and reduces compression ratio; memLevel=9 uses maximum memory - for optimal speed. The default value is 8. See zconf.h for total memory - usage as a function of windowBits and memLevel. - - The strategy parameter is used to tune the compression algorithm. Use the - value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a - filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no - string match). Filtered data consists mostly of small values with a - somewhat random distribution. In this case, the compression algorithm is - tuned to compress them better. The effect of Z_FILTERED is to force more - Huffman coding and less string matching; it is somewhat intermediate - between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects - the compression ratio but not the correctness of the compressed output even - if it is not set appropriately. - - deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid - method). msg is set to null if there is no error message. deflateInit2 does - not perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the compression dictionary from the given byte sequence - without producing any compressed output. This function must be called - immediately after deflateInit, deflateInit2 or deflateReset, before any - call of deflate. The compressor and decompressor must use exactly the same - dictionary (see inflateSetDictionary). - - The dictionary should consist of strings (byte sequences) that are likely - to be encountered later in the data to be compressed, with the most commonly - used strings preferably put towards the end of the dictionary. Using a - dictionary is most useful when the data to be compressed is short and can be - predicted with good accuracy; the data can then be compressed better than - with the default empty dictionary. - - Depending on the size of the compression data structures selected by - deflateInit or deflateInit2, a part of the dictionary may in effect be - discarded, for example if the dictionary is larger than the window size in - deflate or deflate2. Thus the strings most likely to be useful should be - put at the end of the dictionary, not at the front. - - Upon return of this function, strm->adler is set to the Adler32 value - of the dictionary; the decompressor may later use this value to determine - which dictionary has been used by the compressor. (The Adler32 value - applies to the whole dictionary even if only a subset of the dictionary is - actually used by the compressor.) - - deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent (for example if deflate has already been called for this stream - or if the compression method is bsort). deflateSetDictionary does not - perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when several compression strategies will be - tried, for example when there are several ways of pre-processing the input - data with a filter. The streams that will be discarded should then be freed - by calling deflateEnd. Note that deflateCopy duplicates the internal - compression state which can be quite large, so this strategy is slow and - can consume lots of memory. - - deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); -/* - This function is equivalent to deflateEnd followed by deflateInit, - but does not free and reallocate all the internal compression state. - The stream will keep the same compression level and any other attributes - that may have been set by deflateInit2. - - deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - int level, - int strategy)); -/* - Dynamically update the compression level and compression strategy. The - interpretation of level and strategy is as in deflateInit2. This can be - used to switch between compression and straight copy of the input data, or - to switch to a different kind of input data requiring a different - strategy. If the compression level is changed, the input available so far - is compressed with the old level (and may be flushed); the new level will - take effect only at the next call of deflate(). - - Before the call of deflateParams, the stream state must be set as for - a call of deflate(), since the currently available input may have to - be compressed and flushed. In particular, strm->avail_out must be non-zero. - - deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source - stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR - if strm->avail_out was zero. -*/ - -/* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, - int windowBits)); - - This is another version of inflateInit with an extra parameter. The - fields next_in, avail_in, zalloc, zfree and opaque must be initialized - before by the caller. - - The windowBits parameter is the base two logarithm of the maximum window - size (the size of the history buffer). It should be in the range 8..15 for - this version of the library. The default value is 15 if inflateInit is used - instead. If a compressed stream with a larger window size is given as - input, inflate() will return with the error code Z_DATA_ERROR instead of - trying to allocate a larger window. - - inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative - memLevel). msg is set to null if there is no error message. inflateInit2 - does not perform any decompression apart from reading the zlib header if - present: this will be done by inflate(). (So next_in and avail_in may be - modified, but next_out and avail_out are unchanged.) -*/ - -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the decompression dictionary from the given uncompressed byte - sequence. This function must be called immediately after a call of inflate - if this call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the Adler32 value returned by this call of - inflate. The compressor and decompressor must use exactly the same - dictionary (see deflateSetDictionary). - - inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the - expected one (incorrect Adler32 value). inflateSetDictionary does not - perform any decompression: this will be done by subsequent calls of - inflate(). -*/ - -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); -/* - Skips invalid compressed data until a full flush point (see above the - description of deflate with Z_FULL_FLUSH) can be found, or until all - available input is skipped. No output is provided. - - inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR - if no more input was provided, Z_DATA_ERROR if no flush point has been found, - or Z_STREAM_ERROR if the stream structure was inconsistent. In the success - case, the application may save the current current value of total_in which - indicates where valid compressed data was found. In the error case, the - application may repeatedly call inflateSync, providing more input each time, - until success or end of the input data. -*/ - -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); -/* - This function is equivalent to inflateEnd followed by inflateInit, - but does not free and reallocate all the internal decompression state. - The stream will keep attributes that may have been set by inflateInit2. - - inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - - - /* utility functions */ - -/* - The following utility functions are implemented on top of the - basic stream-oriented functions. To simplify the interface, some - default options are assumed (compression level and memory usage, - standard memory allocation functions). The source code of these - utility functions can easily be modified if you need special options. -*/ - -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be at least 0.1% larger than - sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the - compressed buffer. - This function can be used to compress a whole file at once if the - input file is mmap'ed. - compress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer. -*/ - -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); -/* - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least 0.1% larger than sourceLen plus - 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ - -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be large enough to hold the - entire uncompressed data. (The size of the uncompressed data must have - been saved previously by the compressor and transmitted to the decompressor - by some mechanism outside the scope of this compression library.) - Upon exit, destLen is the actual size of the compressed buffer. - This function can be used to decompress a whole file at once if the - input file is mmap'ed. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted. -*/ - - -typedef voidp gzFile; - -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); -/* - Opens a gzip (.gz) file for reading or writing. The mode parameter - is as in fopen ("rb" or "wb") but can also include a compression level - ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for - Huffman only compression as in "wb1h". (See the description - of deflateInit2 for more information about the strategy parameter.) - - gzopen can be used to read a file which is not in gzip format; in this - case gzread will directly read from the file without decompression. - - gzopen returns NULL if the file could not be opened or if there was - insufficient memory to allocate the (de)compression state; errno - can be checked to distinguish the two cases (if errno is zero, the - zlib error is Z_MEM_ERROR). */ - -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); -/* - gzdopen() associates a gzFile with the file descriptor fd. File - descriptors are obtained from calls like open, dup, creat, pipe or - fileno (in the file has been previously opened with fopen). - The mode parameter is as in gzopen. - The next call of gzclose on the returned gzFile will also close the - file descriptor fd, just like fclose(fdopen(fd), mode) closes the file - descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). - gzdopen returns NULL if there was insufficient memory to allocate - the (de)compression state. -*/ - -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); -/* - Dynamically update the compression level or strategy. See the description - of deflateInit2 for the meaning of these parameters. - gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not - opened for writing. -*/ - -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); -/* - Reads the given number of uncompressed bytes from the compressed file. - If the input file was not in gzip format, gzread copies the given number - of bytes into the buffer. - gzread returns the number of uncompressed bytes actually read (0 for - end of file, -1 for error). */ - -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, - const voidp buf, unsigned len)); -/* - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of uncompressed bytes actually written - (0 in case of error). -*/ - -ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); -/* - Converts, formats, and writes the args to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written (0 in case of error). -*/ - -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); -/* - Writes the given null-terminated string to the compressed file, excluding - the terminating null character. - gzputs returns the number of characters written, or -1 in case of error. -*/ - -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); -/* - Reads bytes from the compressed file until len-1 characters are read, or - a newline character is read and transferred to buf, or an end-of-file - condition is encountered. The string is then terminated with a null - character. - gzgets returns buf, or Z_NULL in case of error. -*/ - -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); -/* - Writes c, converted to an unsigned char, into the compressed file. - gzputc returns the value that was written, or -1 in case of error. -*/ - -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); -/* - Reads one byte from the compressed file. gzgetc returns this byte - or -1 in case of end of file or error. -*/ - -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); -/* - Flushes all pending output into the compressed file. The parameter - flush is as in the deflate() function. The return value is the zlib - error number (see function gzerror below). gzflush returns Z_OK if - the flush parameter is Z_FINISH and all output could be flushed. - gzflush should be called only when strictly necessary because it can - degrade compression. -*/ - -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, - z_off_t offset, int whence)); -/* - Sets the starting position for the next gzread or gzwrite on the - given compressed file. The offset represents a number of bytes in the - uncompressed data stream. The whence parameter is defined as in lseek(2); - the value SEEK_END is not supported. - If the file is opened for reading, this function is emulated but can be - extremely slow. If the file is opened for writing, only forward seeks are - supported; gzseek then compresses a sequence of zeroes up to the new - starting position. - - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error, in - particular if the file is opened for writing and the new starting position - would be before the current position. -*/ - -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); -/* - Rewinds the given file. This function is supported only for reading. - - gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) -*/ - -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); -/* - Returns the starting position for the next gzread or gzwrite on the - given compressed file. This position represents a number of bytes in the - uncompressed data stream. - - gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) -*/ - -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); -/* - Returns 1 when EOF has previously been detected reading the given - input stream, otherwise zero. -*/ - -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); -/* - Flushes all pending output if necessary, closes the compressed file - and deallocates all the (de)compression state. The return value is the zlib - error number (see function gzerror below). -*/ - -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); -/* - Returns the error message for the last error which occurred on the - given compressed file. errnum is set to zlib error number. If an - error occurred in the file system and not in the compression library, - errnum is set to Z_ERRNO and the application may consult errno - to get the exact error code. -*/ - - /* checksum functions */ - -/* - These functions are not related to compression but are exported - anyway because they might be useful in applications using the - compression library. -*/ - -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); - -/* - Update a running Adler-32 checksum with the bytes buf[0..len-1] and - return the updated checksum. If buf is NULL, this function returns - the required initial value for the checksum. - An Adler-32 checksum is almost as reliable as a CRC32 but can be computed - much faster. Usage example: - - uLong adler = adler32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - adler = adler32(adler, buffer, length); - } - if (adler != original_adler) error(); -*/ - -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); -/* - Update a running crc with the bytes buf[0..len-1] and return the updated - crc. If buf is NULL, this function returns the required initial value - for the crc. Pre- and post-conditioning (one's complement) is performed - within this function so it shouldn't be done by the application. - Usage example: - - uLong crc = crc32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - crc = crc32(crc, buffer, length); - } - if (crc != original_crc) error(); -*/ - - - /* various hacks, don't look :) */ - -/* deflateInit and inflateInit are macros to allow checking the zlib version - * and the compiler's view of z_stream: - */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -#define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) -#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) - - -#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL) - struct internal_state {int dummy;}; /* hack for buggy compilers */ -#endif - -ZEXTERN const char * ZEXPORT zError OF((int err)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); -ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); - -#ifdef __cplusplus -} -#endif - -#endif /* _ZLIB_H */ +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.1.4, March 11th, 2002 + + Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt + (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). +*/ + +#ifndef _ZLIB_H +#define _ZLIB_H + +#include "zconf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ZLIB_VERSION "1.1.4" + +/* + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed + data. This version of the library supports only one compression method + (deflation) but other algorithms will be added later and will have the same + stream interface. + + Compression can be done in a single step if the buffers are large + enough (for example if an input file is mmap'ed), or can be done by + repeated calls of the compression function. In the latter case, the + application must provide more input and/or consume the output + (providing more output space) before each call. + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio. + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never + crash even in case of corrupted input. +*/ + +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); +typedef void (*free_func) OF((voidpf opaque, voidpf address)); + +struct internal_state; + +typedef struct z_stream_s { + Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total nb of input bytes read so far */ + + Bytef *next_out; /* next output byte should be put there */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total nb of bytes output so far */ + + char *msg; /* last error message, NULL if no error */ + struct internal_state FAR *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + voidpf opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: ascii or binary */ + uLong adler; /* adler32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream FAR *z_streamp; + +/* + The application must update next_in and avail_in when avail_in has + dropped to zero. It must update next_out and avail_out when avail_out + has dropped to zero. The application must initialize zalloc, zfree and + opaque before calling the init function. All other fields are set by the + compression library and must not be updated by the application. + + The opaque value provided by the application will be passed as the first + parameter for calls of zalloc and zfree. This can be useful for custom + memory management. The compression library attaches no meaning to the + opaque value. + + zalloc must return Z_NULL if there is not enough memory for the object. + If zlib is used in a multi-threaded application, zalloc and zfree must be + thread safe. + + On 16-bit systems, the functions zalloc and zfree must be able to allocate + exactly 65536 bytes, but will not be required to allocate more than this + if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, + pointers returned by zalloc for objects of exactly 65536 bytes *must* + have their offset normalized to zero. The default allocation function + provided by this library ensures this (see zutil.c). To reduce memory + requirements and avoid any allocation of 64K objects, at the expense of + compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). + + The fields total_in and total_out can be used for statistics or + progress reports. After compression, total_in holds the total size of + the uncompressed data and may be saved for use in the decompressor + (particularly if the decompressor wants to decompress everything in + a single step). +*/ + + /* constants */ + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +/* Allowed flush values; see deflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative + * values are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_ASCII 1 +#define Z_UNKNOWN 2 +/* Possible values of the data_type field */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + +#define zlib_version zlibVersion() +/* for compatibility with versions < 1.0.2 */ + + /* basic functions */ + +ZEXTERN const char * ZEXPORT zlibVersion OF((void)); +/* The application can compare zlibVersion and ZLIB_VERSION for consistency. + If the first character differs, the library code actually used is + not compatible with the zlib.h header file used by the application. + This check is automatically made by deflateInit and inflateInit. + */ + +/* +ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); + + Initializes the internal stream state for compression. The fields + zalloc, zfree and opaque must be initialized before by the caller. + If zalloc and zfree are set to Z_NULL, deflateInit updates them to + use default allocation functions. + + The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: + 1 gives best speed, 9 gives best compression, 0 gives no compression at + all (the input data is simply copied a block at a time). + Z_DEFAULT_COMPRESSION requests a default compromise between speed and + compression (currently equivalent to level 6). + + deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if level is not a valid compression level, + Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible + with the version assumed by the caller (ZLIB_VERSION). + msg is set to null if there is no error message. deflateInit does not + perform any compression: this will be done by deflate(). +*/ + + +ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); +/* + deflate compresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce some + output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. deflate performs one or both of the + following actions: + + - Compress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in and avail_in are updated and + processing will resume at this point for the next call of deflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. This action is forced if the parameter flush is non zero. + Forcing flush frequently degrades the compression ratio, so this parameter + should be set only when necessary (in interactive applications). + Some output may be provided even if flush is not set. + + Before the call of deflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating avail_in or avail_out accordingly; avail_out + should never be zero before the call. The application can consume the + compressed output when it wants, for example when the output buffer is full + (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK + and with zero avail_out, it must be called again after making room in the + output buffer because there might be more output pending. + + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is + flushed to the output buffer and the output is aligned on a byte boundary, so + that the decompressor can get all input data available so far. (In particular + avail_in is zero after the call if enough output space has been provided + before the call.) Flushing may degrade compression for some compression + algorithms and so it should be used only when necessary. + + If flush is set to Z_FULL_FLUSH, all output is flushed as with + Z_SYNC_FLUSH, and the compression state is reset so that decompression can + restart from this point if previous compressed data has been damaged or if + random access is desired. Using Z_FULL_FLUSH too often can seriously degrade + the compression. + + If deflate returns with avail_out == 0, this function must be called again + with the same value of the flush parameter and more output space (updated + avail_out), until the flush is complete (deflate returns with non-zero + avail_out). + + If the parameter flush is set to Z_FINISH, pending input is processed, + pending output is flushed and deflate returns with Z_STREAM_END if there + was enough output space; if deflate returns with Z_OK, this function must be + called again with Z_FINISH and more output space (updated avail_out) but no + more input data, until it returns with Z_STREAM_END or an error. After + deflate has returned Z_STREAM_END, the only possible operations on the + stream are deflateReset or deflateEnd. + + Z_FINISH can be used immediately after deflateInit if all the compression + is to be done in a single step. In this case, avail_out must be at least + 0.1% larger than avail_in plus 12 bytes. If deflate does not return + Z_STREAM_END, then it must be called again as described above. + + deflate() sets strm->adler to the adler32 checksum of all input read + so far (that is, total_in bytes). + + deflate() may update data_type if it can make a good guess about + the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered + binary. This field is only for information purposes and does not affect + the compression algorithm in any manner. + + deflate() returns Z_OK if some progress has been made (more input + processed or more output produced), Z_STREAM_END if all input has been + consumed and all output has been produced (only when flush is set to + Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example + if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible + (for example avail_in or avail_out was zero). +*/ + + +ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the + stream state was inconsistent, Z_DATA_ERROR if the stream was freed + prematurely (some input or output was discarded). In the error case, + msg may be set but then points to a static string (which must not be + deallocated). +*/ + + +/* +ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); + + Initializes the internal stream state for decompression. The fields + next_in, avail_in, zalloc, zfree and opaque must be initialized before by + the caller. If next_in is not Z_NULL and avail_in is large enough (the exact + value depends on the compression method), inflateInit determines the + compression method from the zlib header and allocates all data structures + accordingly; otherwise the allocation will be deferred to the first call of + inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to + use default allocation functions. + + inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller. msg is set to null if there is no error + message. inflateInit does not perform any decompression apart from reading + the zlib header if present: this will be done by inflate(). (So next_in and + avail_in may be modified, but next_out and avail_out are unchanged.) +*/ + + +ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); +/* + inflate decompresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may some + introduce some output latency (reading input without producing any output) + except when forced to flush. + + The detailed semantics are as follows. inflate performs one or both of the + following actions: + + - Decompress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in is updated and processing + will resume at this point for the next call of inflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. inflate() provides as much output as possible, until there + is no more input data or no more space in the output buffer (see below + about the flush parameter). + + Before the call of inflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating the next_* and avail_* values accordingly. + The application can consume the uncompressed output when it wants, for + example when the output buffer is full (avail_out == 0), or after each + call of inflate(). If inflate returns Z_OK and with zero avail_out, it + must be called again after making room in the output buffer because there + might be more output pending. + + If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much + output as possible to the output buffer. The flushing behavior of inflate is + not specified for values of the flush parameter other than Z_SYNC_FLUSH + and Z_FINISH, but the current implementation actually flushes as much output + as possible anyway. + + inflate() should normally be called until it returns Z_STREAM_END or an + error. However if all decompression is to be performed in a single step + (a single call of inflate), the parameter flush should be set to + Z_FINISH. In this case all pending input is processed and all pending + output is flushed; avail_out must be large enough to hold all the + uncompressed data. (The size of the uncompressed data may have been saved + by the compressor for this purpose.) The next operation on this stream must + be inflateEnd to deallocate the decompression state. The use of Z_FINISH + is never required, but can be used to inform inflate that a faster routine + may be used for the single inflate() call. + + If a preset dictionary is needed at this point (see inflateSetDictionary + below), inflate sets strm-adler to the adler32 checksum of the + dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise + it sets strm->adler to the adler32 checksum of all output produced + so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or + an error code as described below. At the end of the stream, inflate() + checks that its computed adler32 checksum is equal to that saved by the + compressor and returns Z_STREAM_END only if the checksum is correct. + + inflate() returns Z_OK if some progress has been made (more input processed + or more output produced), Z_STREAM_END if the end of the compressed data has + been reached and all uncompressed output has been produced, Z_NEED_DICT if a + preset dictionary is needed at this point, Z_DATA_ERROR if the input data was + corrupted (input stream not conforming to the zlib format or incorrect + adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent + (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if no progress is possible or if there was not + enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR + case, the application may then call inflateSync to look for a good + compression block. +*/ + + +ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state + was inconsistent. In the error case, msg may be set but then points to a + static string (which must not be deallocated). +*/ + + /* Advanced functions */ + +/* + The following functions are needed only in some special applications. +*/ + +/* +ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy)); + + This is another version of deflateInit with more compression options. The + fields next_in, zalloc, zfree and opaque must be initialized before by + the caller. + + The method parameter is the compression method. It must be Z_DEFLATED in + this version of the library. + + The windowBits parameter is the base two logarithm of the window size + (the size of the history buffer). It should be in the range 8..15 for this + version of the library. Larger values of this parameter result in better + compression at the expense of memory usage. The default value is 15 if + deflateInit is used instead. + + The memLevel parameter specifies how much memory should be allocated + for the internal compression state. memLevel=1 uses minimum memory but + is slow and reduces compression ratio; memLevel=9 uses maximum memory + for optimal speed. The default value is 8. See zconf.h for total memory + usage as a function of windowBits and memLevel. + + The strategy parameter is used to tune the compression algorithm. Use the + value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a + filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no + string match). Filtered data consists mostly of small values with a + somewhat random distribution. In this case, the compression algorithm is + tuned to compress them better. The effect of Z_FILTERED is to force more + Huffman coding and less string matching; it is somewhat intermediate + between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects + the compression ratio but not the correctness of the compressed output even + if it is not set appropriately. + + deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid + method). msg is set to null if there is no error message. deflateInit2 does + not perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the compression dictionary from the given byte sequence + without producing any compressed output. This function must be called + immediately after deflateInit, deflateInit2 or deflateReset, before any + call of deflate. The compressor and decompressor must use exactly the same + dictionary (see inflateSetDictionary). + + The dictionary should consist of strings (byte sequences) that are likely + to be encountered later in the data to be compressed, with the most commonly + used strings preferably put towards the end of the dictionary. Using a + dictionary is most useful when the data to be compressed is short and can be + predicted with good accuracy; the data can then be compressed better than + with the default empty dictionary. + + Depending on the size of the compression data structures selected by + deflateInit or deflateInit2, a part of the dictionary may in effect be + discarded, for example if the dictionary is larger than the window size in + deflate or deflate2. Thus the strings most likely to be useful should be + put at the end of the dictionary, not at the front. + + Upon return of this function, strm->adler is set to the Adler32 value + of the dictionary; the decompressor may later use this value to determine + which dictionary has been used by the compressor. (The Adler32 value + applies to the whole dictionary even if only a subset of the dictionary is + actually used by the compressor.) + + deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent (for example if deflate has already been called for this stream + or if the compression method is bsort). deflateSetDictionary does not + perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when several compression strategies will be + tried, for example when there are several ways of pre-processing the input + data with a filter. The streams that will be discarded should then be freed + by calling deflateEnd. Note that deflateCopy duplicates the internal + compression state which can be quite large, so this strategy is slow and + can consume lots of memory. + + deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); +/* + This function is equivalent to deflateEnd followed by deflateInit, + but does not free and reallocate all the internal compression state. + The stream will keep the same compression level and any other attributes + that may have been set by deflateInit2. + + deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + +ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, + int level, + int strategy)); +/* + Dynamically update the compression level and compression strategy. The + interpretation of level and strategy is as in deflateInit2. This can be + used to switch between compression and straight copy of the input data, or + to switch to a different kind of input data requiring a different + strategy. If the compression level is changed, the input available so far + is compressed with the old level (and may be flushed); the new level will + take effect only at the next call of deflate(). + + Before the call of deflateParams, the stream state must be set as for + a call of deflate(), since the currently available input may have to + be compressed and flushed. In particular, strm->avail_out must be non-zero. + + deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source + stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR + if strm->avail_out was zero. +*/ + +/* +ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, + int windowBits)); + + This is another version of inflateInit with an extra parameter. The + fields next_in, avail_in, zalloc, zfree and opaque must be initialized + before by the caller. + + The windowBits parameter is the base two logarithm of the maximum window + size (the size of the history buffer). It should be in the range 8..15 for + this version of the library. The default value is 15 if inflateInit is used + instead. If a compressed stream with a larger window size is given as + input, inflate() will return with the error code Z_DATA_ERROR instead of + trying to allocate a larger window. + + inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative + memLevel). msg is set to null if there is no error message. inflateInit2 + does not perform any decompression apart from reading the zlib header if + present: this will be done by inflate(). (So next_in and avail_in may be + modified, but next_out and avail_out are unchanged.) +*/ + +ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the decompression dictionary from the given uncompressed byte + sequence. This function must be called immediately after a call of inflate + if this call returned Z_NEED_DICT. The dictionary chosen by the compressor + can be determined from the Adler32 value returned by this call of + inflate. The compressor and decompressor must use exactly the same + dictionary (see deflateSetDictionary). + + inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the + expected one (incorrect Adler32 value). inflateSetDictionary does not + perform any decompression: this will be done by subsequent calls of + inflate(). +*/ + +ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); +/* + Skips invalid compressed data until a full flush point (see above the + description of deflate with Z_FULL_FLUSH) can be found, or until all + available input is skipped. No output is provided. + + inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR + if no more input was provided, Z_DATA_ERROR if no flush point has been found, + or Z_STREAM_ERROR if the stream structure was inconsistent. In the success + case, the application may save the current current value of total_in which + indicates where valid compressed data was found. In the error case, the + application may repeatedly call inflateSync, providing more input each time, + until success or end of the input data. +*/ + +ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); +/* + This function is equivalent to inflateEnd followed by inflateInit, + but does not free and reallocate all the internal decompression state. + The stream will keep attributes that may have been set by inflateInit2. + + inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + + + /* utility functions */ + +/* + The following utility functions are implemented on top of the + basic stream-oriented functions. To simplify the interface, some + default options are assumed (compression level and memory usage, + standard memory allocation functions). The source code of these + utility functions can easily be modified if you need special options. +*/ + +ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Compresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be at least 0.1% larger than + sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the + compressed buffer. + This function can be used to compress a whole file at once if the + input file is mmap'ed. + compress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer. +*/ + +ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int level)); +/* + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least 0.1% larger than sourceLen plus + 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +*/ + +ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be large enough to hold the + entire uncompressed data. (The size of the uncompressed data must have + been saved previously by the compressor and transmitted to the decompressor + by some mechanism outside the scope of this compression library.) + Upon exit, destLen is the actual size of the compressed buffer. + This function can be used to decompress a whole file at once if the + input file is mmap'ed. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted. +*/ + + +typedef voidp gzFile; + +ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); +/* + Opens a gzip (.gz) file for reading or writing. The mode parameter + is as in fopen ("rb" or "wb") but can also include a compression level + ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for + Huffman only compression as in "wb1h". (See the description + of deflateInit2 for more information about the strategy parameter.) + + gzopen can be used to read a file which is not in gzip format; in this + case gzread will directly read from the file without decompression. + + gzopen returns NULL if the file could not be opened or if there was + insufficient memory to allocate the (de)compression state; errno + can be checked to distinguish the two cases (if errno is zero, the + zlib error is Z_MEM_ERROR). */ + +ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); +/* + gzdopen() associates a gzFile with the file descriptor fd. File + descriptors are obtained from calls like open, dup, creat, pipe or + fileno (in the file has been previously opened with fopen). + The mode parameter is as in gzopen. + The next call of gzclose on the returned gzFile will also close the + file descriptor fd, just like fclose(fdopen(fd), mode) closes the file + descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). + gzdopen returns NULL if there was insufficient memory to allocate + the (de)compression state. +*/ + +ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); +/* + Dynamically update the compression level or strategy. See the description + of deflateInit2 for the meaning of these parameters. + gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not + opened for writing. +*/ + +ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); +/* + Reads the given number of uncompressed bytes from the compressed file. + If the input file was not in gzip format, gzread copies the given number + of bytes into the buffer. + gzread returns the number of uncompressed bytes actually read (0 for + end of file, -1 for error). */ + +ZEXTERN int ZEXPORT gzwrite OF((gzFile file, + const voidp buf, unsigned len)); +/* + Writes the given number of uncompressed bytes into the compressed file. + gzwrite returns the number of uncompressed bytes actually written + (0 in case of error). +*/ + +ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); +/* + Converts, formats, and writes the args to the compressed file under + control of the format string, as in fprintf. gzprintf returns the number of + uncompressed bytes actually written (0 in case of error). +*/ + +ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); +/* + Writes the given null-terminated string to the compressed file, excluding + the terminating null character. + gzputs returns the number of characters written, or -1 in case of error. +*/ + +ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); +/* + Reads bytes from the compressed file until len-1 characters are read, or + a newline character is read and transferred to buf, or an end-of-file + condition is encountered. The string is then terminated with a null + character. + gzgets returns buf, or Z_NULL in case of error. +*/ + +ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); +/* + Writes c, converted to an unsigned char, into the compressed file. + gzputc returns the value that was written, or -1 in case of error. +*/ + +ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); +/* + Reads one byte from the compressed file. gzgetc returns this byte + or -1 in case of end of file or error. +*/ + +ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); +/* + Flushes all pending output into the compressed file. The parameter + flush is as in the deflate() function. The return value is the zlib + error number (see function gzerror below). gzflush returns Z_OK if + the flush parameter is Z_FINISH and all output could be flushed. + gzflush should be called only when strictly necessary because it can + degrade compression. +*/ + +ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, + z_off_t offset, int whence)); +/* + Sets the starting position for the next gzread or gzwrite on the + given compressed file. The offset represents a number of bytes in the + uncompressed data stream. The whence parameter is defined as in lseek(2); + the value SEEK_END is not supported. + If the file is opened for reading, this function is emulated but can be + extremely slow. If the file is opened for writing, only forward seeks are + supported; gzseek then compresses a sequence of zeroes up to the new + starting position. + + gzseek returns the resulting offset location as measured in bytes from + the beginning of the uncompressed stream, or -1 in case of error, in + particular if the file is opened for writing and the new starting position + would be before the current position. +*/ + +ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); +/* + Rewinds the given file. This function is supported only for reading. + + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) +*/ + +ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); +/* + Returns the starting position for the next gzread or gzwrite on the + given compressed file. This position represents a number of bytes in the + uncompressed data stream. + + gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) +*/ + +ZEXTERN int ZEXPORT gzeof OF((gzFile file)); +/* + Returns 1 when EOF has previously been detected reading the given + input stream, otherwise zero. +*/ + +ZEXTERN int ZEXPORT gzclose OF((gzFile file)); +/* + Flushes all pending output if necessary, closes the compressed file + and deallocates all the (de)compression state. The return value is the zlib + error number (see function gzerror below). +*/ + +ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); +/* + Returns the error message for the last error which occurred on the + given compressed file. errnum is set to zlib error number. If an + error occurred in the file system and not in the compression library, + errnum is set to Z_ERRNO and the application may consult errno + to get the exact error code. +*/ + + /* checksum functions */ + +/* + These functions are not related to compression but are exported + anyway because they might be useful in applications using the + compression library. +*/ + +ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); + +/* + Update a running Adler-32 checksum with the bytes buf[0..len-1] and + return the updated checksum. If buf is NULL, this function returns + the required initial value for the checksum. + An Adler-32 checksum is almost as reliable as a CRC32 but can be computed + much faster. Usage example: + + uLong adler = adler32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + adler = adler32(adler, buffer, length); + } + if (adler != original_adler) error(); +*/ + +ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); +/* + Update a running crc with the bytes buf[0..len-1] and return the updated + crc. If buf is NULL, this function returns the required initial value + for the crc. Pre- and post-conditioning (one's complement) is performed + within this function so it shouldn't be done by the application. + Usage example: + + uLong crc = crc32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + crc = crc32(crc, buffer, length); + } + if (crc != original_crc) error(); +*/ + + + /* various hacks, don't look :) */ + +/* deflateInit and inflateInit are macros to allow checking the zlib version + * and the compiler's view of z_stream: + */ +ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, + int windowBits, int memLevel, + int strategy, const char *version, + int stream_size)); +ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, + const char *version, int stream_size)); +#define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) +#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) + + +#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL) + struct internal_state {int dummy;}; /* hack for buggy compilers */ +#endif + +ZEXTERN const char * ZEXPORT zError OF((int err)); +ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); +ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); + +#ifdef __cplusplus +} +#endif + +#endif /* _ZLIB_H */ diff --git a/winclude/zutil.h b/winclude/zutil.h index 2e06fcfd3..718ebc15b 100755 --- a/winclude/zutil.h +++ b/winclude/zutil.h @@ -1,220 +1,220 @@ -/* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-2002 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* @(#) $Id$ */ - -#ifndef _Z_UTIL_H -#define _Z_UTIL_H - -#include "zlib.h" - -#ifdef STDC -# include -# include -# include -#endif -#ifdef NO_ERRNO_H - extern int errno; -#else -# include -#endif - -#ifndef local -# define local static -#endif -/* compile with -Dlocal if your debugger can't find static symbols */ - -typedef unsigned char uch; -typedef uch FAR uchf; -typedef unsigned short ush; -typedef ush FAR ushf; -typedef unsigned long ulg; - -extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */ -/* (size given to avoid silly warnings with Visual C++) */ - -#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] - -#define ERR_RETURN(strm,err) \ - return (strm->msg = (char*)ERR_MSG(err), (err)) -/* To be used only when the state is known to be valid */ - - /* common constants */ - -#ifndef DEF_WBITS -# define DEF_WBITS MAX_WBITS -#endif -/* default windowBits for decompression. MAX_WBITS is for compression only */ - -#if MAX_MEM_LEVEL >= 8 -# define DEF_MEM_LEVEL 8 -#else -# define DEF_MEM_LEVEL MAX_MEM_LEVEL -#endif -/* default memLevel */ - -#define STORED_BLOCK 0 -#define STATIC_TREES 1 -#define DYN_TREES 2 -/* The three kinds of block type */ - -#define MIN_MATCH 3 -#define MAX_MATCH 258 -/* The minimum and maximum match lengths */ - -#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ - - /* target dependencies */ - -#ifdef MSDOS -# define OS_CODE 0x00 -# if defined(__TURBOC__) || defined(__BORLANDC__) -# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) - /* Allow compilation with ANSI keywords only enabled */ - void _Cdecl farfree( void *block ); - void *_Cdecl farmalloc( unsigned long nbytes ); -# else -# include -# endif -# else /* MSC or DJGPP */ -# include -# endif -#endif - -#ifdef OS2 -# define OS_CODE 0x06 -#endif - -#ifdef WIN32 /* Window 95 & Windows NT */ -# define OS_CODE 0x0b -#endif - -#if defined(VAXC) || defined(VMS) -# define OS_CODE 0x02 -# define F_OPEN(name, mode) \ - fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") -#endif - -#ifdef AMIGA -# define OS_CODE 0x01 -#endif - -#if defined(ATARI) || defined(atarist) -# define OS_CODE 0x05 -#endif - -#if defined(MACOS) || defined(TARGET_OS_MAC) -# define OS_CODE 0x07 -# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os -# include /* for fdopen */ -# else -# ifndef fdopen -# define fdopen(fd,mode) NULL /* No fdopen() */ -# endif -# endif -#endif - -#ifdef __50SERIES /* Prime/PRIMOS */ -# define OS_CODE 0x0F -#endif - -#ifdef TOPS20 -# define OS_CODE 0x0a -#endif - -#if defined(_BEOS_) || defined(RISCOS) -# define fdopen(fd,mode) NULL /* No fdopen() */ -#endif - -#if (defined(_MSC_VER) && (_MSC_VER > 600)) -# define fdopen(fd,type) _fdopen(fd,type) -#endif - - - /* Common defaults */ - -#ifndef OS_CODE -# define OS_CODE 0x03 /* assume Unix */ -#endif - -#ifndef F_OPEN -# define F_OPEN(name, mode) fopen((name), (mode)) -#endif - - /* functions */ - -#ifdef HAVE_STRERROR - extern char *strerror OF((int)); -# define zstrerror(errnum) strerror(errnum) -#else -# define zstrerror(errnum) "" -#endif - -#if defined(pyr) -# define NO_MEMCPY -#endif -#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) - /* Use our own functions for small and medium model with MSC <= 5.0. - * You may have to use the same strategy for Borland C (untested). - * The __SC__ check is for Symantec. - */ -# define NO_MEMCPY -#endif -#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) -# define HAVE_MEMCPY -#endif -#ifdef HAVE_MEMCPY -# ifdef SMALL_MEDIUM /* MSDOS small or medium model */ -# define zmemcpy _fmemcpy -# define zmemcmp _fmemcmp -# define zmemzero(dest, len) _fmemset(dest, 0, len) -# else -# define zmemcpy memcpy -# define zmemcmp memcmp -# define zmemzero(dest, len) memset(dest, 0, len) -# endif -#else - extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); - extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); - extern void zmemzero OF((Bytef* dest, uInt len)); -#endif - -/* Diagnostic functions */ -#ifdef DEBUG -# include - extern int z_verbose; - extern void z_error OF((char *m)); -# define Assert(cond,msg) {if(!(cond)) z_error(msg);} -# define Trace(x) {if (z_verbose>=0) fprintf x ;} -# define Tracev(x) {if (z_verbose>0) fprintf x ;} -# define Tracevv(x) {if (z_verbose>1) fprintf x ;} -# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} -# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} -#else -# define Assert(cond,msg) -# define Trace(x) -# define Tracev(x) -# define Tracevv(x) -# define Tracec(c,x) -# define Tracecv(c,x) -#endif - - -typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf, - uInt len)); -voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); -void zcfree OF((voidpf opaque, voidpf ptr)); - -#define ZALLOC(strm, items, size) \ - (*((strm)->zalloc))((strm)->opaque, (items), (size)) -#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) -#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} - -#endif /* _Z_UTIL_H */ +/* zutil.h -- internal interface and configuration of the compression library + * Copyright (C) 1995-2002 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* @(#) $Id$ */ + +#ifndef _Z_UTIL_H +#define _Z_UTIL_H + +#include "zlib.h" + +#ifdef STDC +# include +# include +# include +#endif +#ifdef NO_ERRNO_H + extern int errno; +#else +# include +#endif + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + +typedef unsigned char uch; +typedef uch FAR uchf; +typedef unsigned short ush; +typedef ush FAR ushf; +typedef unsigned long ulg; + +extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */ +/* (size given to avoid silly warnings with Visual C++) */ + +#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] + +#define ERR_RETURN(strm,err) \ + return (strm->msg = (char*)ERR_MSG(err), (err)) +/* To be used only when the state is known to be valid */ + + /* common constants */ + +#ifndef DEF_WBITS +# define DEF_WBITS MAX_WBITS +#endif +/* default windowBits for decompression. MAX_WBITS is for compression only */ + +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif +/* default memLevel */ + +#define STORED_BLOCK 0 +#define STATIC_TREES 1 +#define DYN_TREES 2 +/* The three kinds of block type */ + +#define MIN_MATCH 3 +#define MAX_MATCH 258 +/* The minimum and maximum match lengths */ + +#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ + + /* target dependencies */ + +#ifdef MSDOS +# define OS_CODE 0x00 +# if defined(__TURBOC__) || defined(__BORLANDC__) +# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) + /* Allow compilation with ANSI keywords only enabled */ + void _Cdecl farfree( void *block ); + void *_Cdecl farmalloc( unsigned long nbytes ); +# else +# include +# endif +# else /* MSC or DJGPP */ +# include +# endif +#endif + +#ifdef OS2 +# define OS_CODE 0x06 +#endif + +#ifdef WIN32 /* Window 95 & Windows NT */ +# define OS_CODE 0x0b +#endif + +#if defined(VAXC) || defined(VMS) +# define OS_CODE 0x02 +# define F_OPEN(name, mode) \ + fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") +#endif + +#ifdef AMIGA +# define OS_CODE 0x01 +#endif + +#if defined(ATARI) || defined(atarist) +# define OS_CODE 0x05 +#endif + +#if defined(MACOS) || defined(TARGET_OS_MAC) +# define OS_CODE 0x07 +# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os +# include /* for fdopen */ +# else +# ifndef fdopen +# define fdopen(fd,mode) NULL /* No fdopen() */ +# endif +# endif +#endif + +#ifdef __50SERIES /* Prime/PRIMOS */ +# define OS_CODE 0x0F +#endif + +#ifdef TOPS20 +# define OS_CODE 0x0a +#endif + +#if defined(_BEOS_) || defined(RISCOS) +# define fdopen(fd,mode) NULL /* No fdopen() */ +#endif + +#if (defined(_MSC_VER) && (_MSC_VER > 600)) +# define fdopen(fd,type) _fdopen(fd,type) +#endif + + + /* Common defaults */ + +#ifndef OS_CODE +# define OS_CODE 0x03 /* assume Unix */ +#endif + +#ifndef F_OPEN +# define F_OPEN(name, mode) fopen((name), (mode)) +#endif + + /* functions */ + +#ifdef HAVE_STRERROR + extern char *strerror OF((int)); +# define zstrerror(errnum) strerror(errnum) +#else +# define zstrerror(errnum) "" +#endif + +#if defined(pyr) +# define NO_MEMCPY +#endif +#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) + /* Use our own functions for small and medium model with MSC <= 5.0. + * You may have to use the same strategy for Borland C (untested). + * The __SC__ check is for Symantec. + */ +# define NO_MEMCPY +#endif +#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) +# define HAVE_MEMCPY +#endif +#ifdef HAVE_MEMCPY +# ifdef SMALL_MEDIUM /* MSDOS small or medium model */ +# define zmemcpy _fmemcpy +# define zmemcmp _fmemcmp +# define zmemzero(dest, len) _fmemset(dest, 0, len) +# else +# define zmemcpy memcpy +# define zmemcmp memcmp +# define zmemzero(dest, len) memset(dest, 0, len) +# endif +#else + extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); + extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); + extern void zmemzero OF((Bytef* dest, uInt len)); +#endif + +/* Diagnostic functions */ +#ifdef DEBUG +# include + extern int z_verbose; + extern void z_error OF((char *m)); +# define Assert(cond,msg) {if(!(cond)) z_error(msg);} +# define Trace(x) {if (z_verbose>=0) fprintf x ;} +# define Tracev(x) {if (z_verbose>0) fprintf x ;} +# define Tracevv(x) {if (z_verbose>1) fprintf x ;} +# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} +# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} +#else +# define Assert(cond,msg) +# define Trace(x) +# define Tracev(x) +# define Tracevv(x) +# define Tracec(c,x) +# define Tracecv(c,x) +#endif + + +typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf, + uInt len)); +voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); +void zcfree OF((voidpf opaque, voidpf ptr)); + +#define ZALLOC(strm, items, size) \ + (*((strm)->zalloc))((strm)->opaque, (items), (size)) +#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) +#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} + +#endif /* _Z_UTIL_H */