logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

asimage - internal structures and methods used for image manipulation in libAfterImage

Author

       Sasha Vasko <sasha at aftercode dot net>
       libAfterImage/ASAltImFormats

Description

       This function will translate contents of selected channel (usually alpha)  into  a  list  of  rectangles,
       ecompasing  regions with values above the threshold. This is useful to generate shape of the window to be
       used with X Shape extension.

3rd Berkeley Distribution                      AfterStep v.2.2.12                                    asimage(3x)

Example

       asview.c: ASView.5
       libAfterImage/asimage/asimage_replace()

Function

       This are flags that define what should be printed by asimage_print_line():
           VRB_LINE_SUMMARY    - print only summary for each scanline
           VRB_LINE_CONTENT    - print summary and data for each scanline
           VRB_CTRL_EXPLAIN    - print summary, data and control codes for each
                                 scanline

Inputs

       src    - ASImage which will donate its channel to dst;

       channel
              - what source image channel to copy data from;

       threshold
              - threshold to compare channel values against;

       rects_count_ret
              - returns count of generated rectangles.

Name

asimage -   internal   structures   and   methods   used   for   image   manipulation   in  libAfterImage
       libAfterImage/asimage.h

Nameasaltimformats

       identifies  what output format should be used for storing the transformation result. Also identifies what
       data is currently stored in alt member of ASImage structure.

Nameasgradient

       describes how gradient is to be drawn.

Nameasim_Compression_None

       defined  as  0 - disables compression.  ASIM_COMPRESSION_FULL defined as 100 - highest compression level.
       Anything in between 0 and 100 will cause only part of the scanline to be compressed.  This  is  obsolete.
       Now all images are compressed if possible.  libAfterImage/asimage/asimage_init()

Nameasimage

       is the main structure to hold image data.

Nameasimage_Add_Line()

Nameasimage_Add_Line_Mono()

Nameasimage_Init()

       frees datamembers of the supplied ASImage structure, and initializes it to all 0.

Nameasimage_Print_Line()

Nameasimage_Replace()

       will replace ASImage's data using data from another ASImage

Nameasimage_Start()

       Allocates memory needed to store scanline of the image of supplied size. Assigns  all  the  data  members
       valid values. Makes sure that ASImage structure is ready to store image data.

Nameasimagelayer

       specifies parameters of the image superimposition.

Nameasimagemanager

       structure to be used to maintain list of loaded images for given set of search paths  and  gamma.  Images
       are named and reference counted.

Nameasvectorpalette

       contains palette allowing us to map double values in vector image data into actuall ARGB values.

Nameclone_Asimage()

Namecopy_Asimage_Channel()

Namecopy_Asimage_Lines()

Namecreate_Asimage()

       Performs  memory  allocation  for  the  new  ASImage  structure,  as  well as initialization of allocated
       structure based on supplied parameters.

Namecreate_Image_Layers()

       - allocate and initialize set of ASImageLayer's.

Namecreate_Image_Manager()

       create ASImage management and reference counting object.

Namedestroy_Asgradient()

       -      destroy      ASGradient      structure,       deallocating       all       associated       memory
       libAfterImage/asimage/init_image_layers()

Namedestroy_Asimage()

       frees all the memory allocated for specified ASImage.

Namedestroy_Image_Layers()

       - destroy set of ASImageLayer structures.

Namedestroy_Image_Manager()

       destroy management obejct.

Namedup_Asimage()

       increment reference count of stored ASImage.

Namefetch_Asimage()

       query_asimage()

Nameflip_Gradient()

       - rotates gradient in 90 degree increments.

Nameflip_Vertical

       defines  rotation  of  90  degrees  counterclockwise.   FLIP_UPSIDEDOWN  defines  rotation of 180 degrees
       counterclockwise. combined they define rotation of 270 degrees counterclockwise.

Nameflush_Asimage_Cache()

       destroys XImage and mask XImage kept from previous conversions to/from X Pixmap.

Nameforget_Asimage()

       remove  ASImage  from  ASImageManager's  hash  by  pointer.   forget_asimage_name()  remove  ASImage from
       ASImageManager's hash by its name.

Nameget_Asimage_Chanmask()

Nameget_Asimage_Channel_Rects()

       - translate image into a list of rectangles.

Namegradient_Left2Right

       normal  left-to-right  gradient.   GRADIENT_TopLeft2BottomRight  diagonal   top-left   to   bottom-right.
       GRADIENT_Top2Bottom  vertical  top to bottom gradient.  GRADIENT_BottomLeft2TopRight diagonal bottom-left
       to top-right.

Namegradient_Type_Diag

       when  set  it  will cause gradient's direction to be rotated by 45 degrees GRADIENT_TYPE_ORIENTATION will
       cause gradient direction to be rotated by 90 degrees. When combined  with  GRADIENT_TYPE_DIAG  -  rotates
       gradient direction by 135 degrees.

Nameinit_Image_Layers()

       - initialize set of ASImageLayer structures.

Namemax_Import_Image_Size

       effectively  limits  size  of  the  allowed  images to be loaded from files. That is needed to be able to
       filter out corrupt files.  MAX_BEVEL_OUTLINE Limit on  bevel  outline  to  be  drawn  around  the  image.
       MAX_SEARCH_PATHS Number of search paths to be used while loading images from files.

           #define  MAX_IMPORT_IMAGE_SIZE    8000  #define  MAX_BEVEL_OUTLINE       100 #define MAX_SEARCH_PATHS
           8      /* prudently limiting ourselfs */

       libAfterImage/ASVectorPalette

Namemove_Asimage_Channel()

Nameprint_Asimage_Manager()

       prints      list      of      images      referenced      in      given     ASImageManager     structure.
       libAfterImage/asimage/destroy_asgradient()

Namerelease_Asimage()

       decrement reference count for given ASImage.  release_asimage_by_name()  decrement  reference  count  for
       ASImage identifyed by its name.

Namerelocate_Asimage()

       relocate ASImage into a different image manager.

Namesafe_Asimage_Destroy()

       either release or destroy asimage, checking if it is attached to ASImageManager.

Nameset_Asimage_Vector()

       This function replaces contents of the vector member of ASImage structure with new double precision data.

Namestore_Asimage()

       add ASImage to the reference.

Nametint_None

       special value that disables tinting TINT_LEAVE_SAME also disables tinting.

Namevectorize_Asimage()

       This function replaces contents of the vector member of ASImage structure with new double precision data,
       generated  from  native  ARGB32 image contents. Color palette is generated by indexing color values using
       max_colors, dither and opaque_threshold parameters.

Notes

       Source  image (donor) will loose its channel data, as it will be moved to destination ASImage. Also there
       is a condition that both images must be of the same width -  otherwise  function  returns  without  doing
       anything. If height is different - the minimum of two will be used.
       libAfterImage/asimage/copy_asimage_channel()

Return Value

       amount of memory used by this particular channel of specified scanline.

See Also

       make_gradient()

Source

           #define  VRB_LINE_SUMMARY    (0x01<<0) #define VRB_LINE_CONTENT    (0x01<<1) #define VRB_CTRL_EXPLAIN
           (0x01<<2) #define VRB_EVERYTHING      (VRB_LINE_SUMMARY|VRB_CTRL_EXPLAIN| \
                                        VRB_LINE_CONTENT)

       libAfterImage/asimage/asimage_print_line()

Synopsis

       XRectangle*
           get_asimage_channel_rects( ASImage *src, int channel,
                                      unsigned int threshold,
                                      unsigned int *rects_count_ret );

See Also