
    Dh                         d dl Z d dlZd dlmZmZmZmZmZmZ  e j                  e	      Z
 G d dej                        ZdgZy)    N)ffivips_libgobject_libError	_to_bytes
_to_stringc                   d     e Zd ZdZdZi Z fdZed        Zd Z	d Z
d Zd Zd	 Zd
 Zd Z xZS )
VipsObjectzManage a VipsObject.)vobjectgobjectc                     t         t        |   |       t        j                  d|      | _        t        j                  d|      | _        y )NzVipsObject*zGObject*)superr
   __init__r   castr   r   )selfpointer	__class__s     p/var/www/fastuser/data/www/generator.snapmosaic.io/flask_app/venv/lib/python3.12/site-packages/pyvips/vobject.pyr   zVipsObject.__init__   s6    j$(1xxw7xx
G4    c                  ,    t        j                          y)zgPrint all objects.

        Print a table of all active libvips objects. Handy for debugging.

        N)r   vips_object_print_all r   r   	print_allzVipsObject.print_all   s     	&&(r   c                    | j                   j                  j                  }t        j                  }||vri ||<   |||   vr|t        j                  d      }t        j                  d      }t        j                  d      }t        j                  | j                  t        |      |||      }|dk7  ry |d   ||   |<   ||   |   S )NzGParamSpec **zVipsArgumentClass **zVipsArgumentInstance **r   )r   g_type_instanceg_classr
   _pspec_cacher   newr   vips_object_get_argumentr   r   )r   nameclass_pointercachepspecargument_classargument_instanceresults           r   
_get_pspeczVipsObject._get_pspec   s     44<<''%#%E- u]++GGO,E WW%;<N #(A B66t||7@7<n7HJF
 {).qE- &]#D))r   c                 X    | j                  |      }|t        d       y|j                  S )zoGet the GType of a GObject property.

        This function returns 0 if the property does not exist.

         r   )r'   r   
value_type)r   r    r#   s      r   
get_typeofzVipsObject.get_typeof9   s-     %="Ir   c                 `    t        j                  | j                  |            }t        |      S )z%Get the blurb for a GObject property.)r   g_param_spec_get_blurbr'   r   )r   r    c_strs      r   	get_blurbzVipsObject.get_blurbK   s(     224??43HI%  r   c                    t         j                  d|       | j                  |      }|t        d      |j                  }t        j                         }|j                  |       t        j                  d| j                        }t        j                  |t        |      |j                         |j                         S )zdGet a GObject property.

        The value of the property is converted to a Python value.

        zVipsObject.get: name = %szProperty not found.	GObject *)loggerdebugr'   r   r*   pyvipsGValueset_typer   r   r   r   g_object_get_propertyr   get)r   r    r#   gtypegvgos         r   r8   zVipsObject.getQ   s     	0$7%=-..  ]]_
EXXk4<<0))"iorzzJvvxr   c                 T   t         j                  d||       | j                  |      }t        j                         }|j                  |       |j                  |       t        j                  d| j                        }t        j                  |t        |      |j                         y)zdSet a GObject property.

        The value is converted to the property type, if possible.

        z%VipsObject.set: name = %s, value = %sr1   N)r2   r3   r+   r4   r5   r6   setr   r   r   r   g_object_set_propertyr   )r   r    valuer9   r:   r;   s         r   r=   zVipsObject.setf   ss     	<dEJ%]]_
E
uXXk4<<0))"iorzzJr   c                 b    t        |      }t        j                  | j                  |      }|dk(  S )zSet a series of properties using a string.

        For example::

            'fred=12, tile'
            '[fred=12]'

        r   )r   r   vips_object_set_from_stringr   )r   string_optionscstrr&   s       r   
set_stringzVipsObject.set_stringw   s.     (55dllDI{r   c                 R    t        t        j                  | j                              S )z!Get the description of a GObject.)r   r   vips_object_get_descriptionr   )r   s    r   get_descriptionzVipsObject.get_description   s     (>>t||LMMr   )__name__
__module____qualname____doc__	__slots__r   r   staticmethodr   r'   r+   r/   r8   r=   rD   rG   __classcell__)r   s   @r   r
   r
      sN    &IL5 ) )*4 $!*K"Nr   r
   )loggingr4   r   r   r   r   r   r   	getLoggerrH   r2   GObjectr
   __all__r   r   r   <module>rS      sC      K K			8	$~N ~NB .r   