Esempio n. 1
0
static void
gegl_op_class_init (GeglOpClass *klass)
{
  GeglOperationClass       *operation_class;
  GeglOperationSourceClass *source_class;

  init_luts();

  operation_class = GEGL_OPERATION_CLASS (klass);
  source_class    = GEGL_OPERATION_SOURCE_CLASS (klass);

  source_class->process = process;
  operation_class->get_bounding_box = get_bounding_box;
  operation_class->prepare = prepare;
  operation_class->opencl_support = TRUE;

  gegl_operation_class_set_keys (operation_class,
    "name",               "gegl:diffraction-patterns",
    "title",              _("Diffraction Patterns"),
    "categories",         "render",
    "position-dependent", "true",
    "reference-hash",     "0d0ecea7371357c8ee6dcb6b0cd063ff",
    "license",            "GPL3+",
    "description",        _("Generate diffraction patterns"),
    NULL);
}
Esempio n. 2
0
void en_encoder (bool state,PUCHAR encBaseAddr)
#endif
{
#ifndef WINDOWS_NT
 word indexPort, dataPort;
#else
    PUCHAR indexPort, dataPort;
#endif

 byte colorTab[256][3];
 word i, j;
 if (state)
   init_luts(); 
 else
 {
   for (i = 0; i < 256; i++)
      for (j = 0; j < 3; j++)
            colorTab[i][j] = 0;

   indexPort = encBaseAddr + 0x10 + 0x00;
   dataPort  = encBaseAddr + 0x10 + 0x01;

   outp (indexPort, 0);
   for (i = 0; i < 256; i++)
      for (j = 0; j < 3; j++)
         outp (dataPort, colorTab[i][j]);

   for (i = 0; i < 256; i++)
      for (j = 0; j < 3; j++)
         {
         colorTab[i][j] =  (byte)TO_INT((colorTab[i][j] * TO_FLOAT(220) / 256)
                                  +  TO_FLOAT(16) + (TO_FLOAT(1) / 2)
                                 );

// ((double)(colorTab[i][j]*220.0/256.0)+ 16.0 + 0.5) );
         }



   indexPort = encBaseAddr + 0x04 + 0x00;
   dataPort  = encBaseAddr + 0x04 + 0x01;

   outp (indexPort, 0);
   for (i = 0; i < 256; i++)
      for (j = 0; j < 3; j++)
         outp (dataPort, colorTab[i][j]);

#ifndef WINDOWS_NT
   inp (encBaseAddr + 0x04 + 0x03);     /* To activate the CLUT */
#else
        inp ((PUCHAR)(encBaseAddr + 0x04 + 0x03));  /* To activate the CLUT */
#endif
 }
}
Esempio n. 3
0
bool initVideoMode(word mode, byte pwidth)
{
   int dacAdjust = 0;

   if ( !(encBaseAddr = detectVideoBoard()) ) 
      return mtxFAIL;

   gain = 10000;
   if ( (inp(encBaseAddr + 2) & 0x7) > 0 ) 
      {
      switch (mode)
         {
         case NTSC_STD: 
            ptrEncReg = &ntsca_1;
            gain = 14100;
            break;
         case PAL_STD:  
            ptrEncReg = &pala_1;  
            gain = 14100;
            break;
         case NTSC_STD | VAFC:
            ptrEncReg = &ntsc_1;
            break;

         case PAL_STD | VAFC:
            ptrEncReg = &pal_1;
            break;
         }
      if ( mode & VAFC )
         {
         switch( pwidth )
            {
            case  8:
               dacAdjust = 4;
               break;

            case 16:
               dacAdjust = 2;
               break;

            case 32:
               dacAdjust = 0;
               break;
            }
         }
      else
         {
	      switch(Hw[iBoard].DacType)
            {
		      case BT482:
		      case BT485: 
               switch( pwidth )
                  {
                  case  8:
                     dacAdjust = 0;
                     break;

                  case 16:
                  case 32:
                     dacAdjust = 1;
                     break;
                  }
               break;
            
		      case VIEWPOINT: 
               dacAdjust = 5;
               break;


            case TVP3026:   
               switch( pwidth )
                  {
                  case  8:
                     dacAdjust = 18;
                     break;

                  case 16:
                     dacAdjust = 22;
                     break;

                  case 32:
                     dacAdjust = 26;
                     break;
                  }
               break;
            }

         }

      }
   else
      switch (mode)
         {
         case NTSC_STD: 
            ptrEncReg = &ntsca_0;
            break;
         case PAL_STD:  
            ptrEncReg = &pala_0;  
            break;
         case NTSC_STD | VAFC: 
            switch (pwidth)
               {
               case  8: ptrEncReg = &ntsc8_0;  break;
               case 16: ptrEncReg = &ntsc16_0; break;
               case 32: ptrEncReg = &ntsc32_0; break;
               }
            break;
         case PAL_STD | VAFC: 
            switch (pwidth)
               {
               case  8: ptrEncReg = &pal8_0;  break;
               case 16: ptrEncReg = &pal16_0; break;
               case 32: ptrEncReg = &pal32_0; break;
               }
            break;
         }


   init_denc();
   init_dac();
   init_adc();
   init_psg( dacAdjust );
   init_ctrl();
   init_luts(); 

   return mtxOK;
}