Página principal | Jerarquía de la clase | Lista alfabética | Lista de componentes | Lista de archivos | Miembros de las clases | Archivos de los miembros | Páginas relacionadas

jed_img.h

Ir a la documentación de este archivo.
00001 //===========================================================================
00002 //= jed_img.h                                                 Abril de 1998 =
00003 //=-------------------------------------------------------------------------=
00004 //= Clases de representacion y procesamiento basico de imagenes digitales   =
00005 //=-------------------------------------------------------------------------=
00006 //= ADVERTENCIA: ESTE SOFTWARE NO ESTA CONCEBIDO NI DISENNADO PARA EL USO   =
00007 //= EN EQUIPO DE CONTROL EN LINEA EN ENTORNOS PELIGROSOS QUE REQUIERAN UN   =
00008 //= DESEMPENNO LIBRE DE FALLAS, COMO LA OPERACION DE PLANTAS NUCLEARES,     = 
00009 //= SISTEMAS DE NAVEGACION O COMUNICACION EN AVIONES, TRAFICO AEREO,        =
00010 //= EQUIPO MEDICO DEL CUAL DEPENDAN VIDAS HUMANAS O SISTEMAS DE ARMAMENTO,  =
00011 //= EN LOS CUALES UNA FALLA EN EL SOFTWARE PUEDA IMPLICAR DIRECTAMENTE LA   =
00012 //= MUERTE, DANNOS PERSONALES O DANNOS FISICOS Y/O AMBIENTALES GRAVES       =
00013 //= ("ACTIVIDADES DE ALGO RIESGO").                                         =
00014 //=-------------------------------------------------------------------------=
00015 //= Autor original: Oscar J. Chavarro G.  A.K.A. JEDILINK. Copyright (c),   =
00016 //= 1997 - 2003, oscarchavarro@hotmail.com                                  =
00017 //= AQUYNZA es software libre, y se rige bajo los terminos de la licencia   =
00018 //= LGPL de GNU (http://www.gnu.org). Para mayor informacion respecto a la  =
00019 //= licencia de uso, consulte el archivo ./doc/LICENCIA en la distribucion. =
00020 //===========================================================================
00021 
00022 #include "jed_defs.h"
00023 #include "jed_gl.h"
00024 
00025 #ifdef GL_VERSION_1_1
00026 #define GL_COMPLETO /* Esto no canciona */
00027 #endif
00028 
00029 #ifndef __JEDILINK_IMG__
00030 #define __JEDILINK_IMG__
00031 
00032 #include "toolkits/media/jed_pal.h"
00033 
00034 #define MAX_LINE 1024
00035 
00036 extern "C" BYTE *IMAGEN_importar_jpeg(FILE *fd, int *, int *, int *,char *);
00037 #ifdef GL_ENABLED
00038 extern "C" void IMAGEN_exportar_jpeg(FILE *fd, int, int, int, BYTE *);
00039 #endif
00040 
00041 enum ENUM_MODOS_STEREO {
00042     STEREO_NULL = 0,
00043     STEREO_BLUE_RED = 1,
00044     STEREO_INTERLACED = 2,
00045     STEREO_END = 3
00046 };
00047 
00048 //===========================================================================
00049 //= Clases centrales de representacion y procesamiento de imagenes          =
00050 //===========================================================================
00051 
00052 class IMAGEN {
00053   protected:
00054     //- Esquema basico de representacion ------------------------------------
00055     int x_tam;
00056     int y_tam;
00057 
00058     //- Valores extras de soporte a OpenGL ----------------------------------
00059   #ifdef GL_COMPLETO
00060     BOOLEAN con_lista;
00061     GLuint lista_gl;
00062   #endif
00063 
00064     //- Servicios internos --------------------------------------------------
00065     inline BYTE nivel_de_gris(BYTE r, BYTE g, BYTE b);
00066 
00067   public:
00068     //- Operaciones basicas -------------------------------------------------
00069     IMAGEN();
00070     virtual ~IMAGEN();
00071 
00072     int xtam(void);
00073     int ytam(void);
00074     virtual BOOLEAN init(int width, int height) = 0;
00075     virtual void elim(void) = 0;
00076 
00077   #ifdef GL_ENABLED
00078     virtual void pintar_gl(void) = 0;
00079     virtual void activar_gl(void) = 0;
00080   #endif
00081 
00082 // DUMMY!
00083     IMAGEN *copie(void) {return NULL;};
00084 // 
00085 
00086 #ifdef NNN
00087     virtual IMAGEN *copie(void) = 0;
00088 
00089     //- Operaciones de procesamiento de imagenes ----------------------------
00090     virtual IMAGEN_PAL *exportar_a_grises(PALETA *Pal) = 0;
00091 #endif // NNN
00092 
00093 };
00094 
00095 //- Definicion de metodos inline de la clase IMAGEN -------------------------
00096 
00097 inline int IMAGEN::xtam(void){return x_tam;}
00098 inline int IMAGEN::ytam(void){return y_tam;}
00099 inline BYTE
00100 IMAGEN::nivel_de_gris(BYTE r, BYTE g, BYTE b)
00105 {
00106     return (BYTE)((r + g + b)/3); // OJO!
00107 }
00108 
00109 //===========================================================================
00110 //= Clases adicionales                                                      =
00111 //===========================================================================
00112 #ifdef NNN
00113 
00114 class IM_HISTOGRAMA 
00119 {
00120   private:
00121     long data[256];
00122 
00123     double otsu_u(double *p, int k);      // Procedimientos auxiliares usados en
00124     double otsu_w(double *p, int k);      // el metodo generar_umbral_otsu
00125     double otsu_nu(double *p, int k, double ut, double vt); 
00126 
00127   public:
00128     IM_HISTOGRAMA();
00129 
00130     void calcule(IMAGEN_PAL &imagen_grises);
00131     BYTE generar_umbral_seleccion_iterativa(void);
00132     BYTE generar_umbral_otsu(void);
00133 #ifdef GL_ENABLED
00134     void pintar_gl(BYTE umbral);
00135 #endif
00136     void imprima(void);
00137 };
00138 
00139 #endif // NNN
00140 
00141 extern void calcular_funcion_gamma(BYTE funcion_gamma[256], double factor);
00142 
00143 #ifndef VEL_ROSITA
00144     #include "toolkits/media/img_pal.h"
00145     #include "toolkits/media/img_rgb.h"
00146     #include "toolkits/media/img_rgba.h"
00147 #endif
00148 
00149 #endif
00150 
00151 //===========================================================================
00152 //= EOF                                                                     =
00153 //===========================================================================
00154 

Este archivo HTML ha sido generado automáticamente a partir del código fuente AQUYNZA. NO LO EDITE. Para mayor información contacte al autor.