XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
glimpse.h File Reference
#include <chitralekha.h>
#include <widgets/base.h>
#include <widgets/window.h>
Include dependency graph for glimpse.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _thumbox_
 
struct  _glimparea_
 

Macros

#define __GLIPMSE_H__
 
#define THUMB_W   200
 
#define THUMB_H   200
 

Typedefs

typedef struct _thumbox_ thumbnail_t
 
typedef struct _glimparea_ GlimpBox
 

Functions

void GlimpseWindowPaint (ChWindow *win)
 GlimpseWindowPaint – paint the glimpse window.
 
void compute_thumb_size (int src_w, int src_h, int max_w, int max_h, int *out_w, int *out_h)
 compute_thumb_size – computes the best possible thumbnail size out of given image width and height
 
void thumbnail_box (ChCanvas *canvas, uint8_t *src, int src_w, int src_h, uint8_t *dst, int dst_x, int dst_y, int dst_w, int dst_h)
 thumbnail_box – calculate and prepare the thumbnail using box_filter algorithm
 
void _Glimpse_draw_thumb (ChCanvas *canv, char *path, int dst_x, int dst_y, int max_w, int max_h)
 _Glimpse_draw_thumb – load and draw thumbnail to canvas
 
GlimpBox_Glimpse_create_glimbox (int xloc, int yloc, int width, int height)
 
thumbnail_t_Glimpse_create_thumbnail (int xloc, int yloc, int width, int height)
 
void _Glimpse_add_thumbnail (GlimpBox *box, thumbnail_t *thumb)
 _Glimpse_add_thumbnail – adds thumbnail box to glimpbox list
 
void _Glimpse_box_repaint (GlimpBox *box, ChWindow *win)
 _Glimpse_box_repaint – repaint glimpse area
 
GlimpBox_Glimpse_get_main_glimp ()
 _Glimpse_get_main_glimp – return main glimp area
 

Macro Definition Documentation

◆ __GLIPMSE_H__

#define __GLIPMSE_H__

BSD 2-Clause License

Copyright (c) 2022, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

◆ THUMB_H

#define THUMB_H   200

◆ THUMB_W

#define THUMB_W   200

Typedef Documentation

◆ GlimpBox

typedef struct _glimparea_ GlimpBox

◆ thumbnail_t

typedef struct _thumbox_ thumbnail_t

Function Documentation

◆ _Glimpse_add_thumbnail()

void _Glimpse_add_thumbnail ( GlimpBox box,
thumbnail_t thumb 
)
extern

_Glimpse_add_thumbnail – adds thumbnail box to glimpbox list

Parameters
box– Pointer to glimpse box
thumb– pointer to thumnail data

◆ _Glimpse_box_repaint()

void _Glimpse_box_repaint ( GlimpBox box,
ChWindow win 
)
extern

_Glimpse_box_repaint – repaint glimpse area

Parameters
box– Pointer to glimps box
win– Pointer to main window

◆ _Glimpse_create_glimbox()

GlimpBox * _Glimpse_create_glimbox ( int  xloc,
int  yloc,
int  width,
int  height 
)
extern

_Glimpse_create_glimbox – creates a glimbox bounding area

Parameters
xloc– x location within glimpse
yloc– y location within glimpse
width– width of the box area
height– height of the box area

◆ _Glimpse_create_thumbnail()

thumbnail_t * _Glimpse_create_thumbnail ( int  xloc,
int  yloc,
int  width,
int  height 
)
extern

_Glimpse_create_thumbnail – create a thumbox

Parameters
xloc– x location within glimpse thumb area
yloc– y location within glimpse thumb area
width– width of the thumb box
height– height of thumb box

◆ _Glimpse_draw_thumb()

void _Glimpse_draw_thumb ( ChCanvas canv,
char *  path,
int  dst_x,
int  dst_y,
int  max_w,
int  max_h 
)
extern

_Glimpse_draw_thumb – load and draw thumbnail to canvas

Parameters
canv– Pointer to canvas
path– path of the file
dst_x– x coord
dst_y– y coord
max_w– maximum width
max_h– maximum height

◆ _Glimpse_get_main_glimp()

GlimpBox * _Glimpse_get_main_glimp ( )
extern

_Glimpse_get_main_glimp – return main glimp area

◆ compute_thumb_size()

void compute_thumb_size ( int  src_w,
int  src_h,
int  max_w,
int  max_h,
int *  out_w,
int *  out_h 
)

compute_thumb_size – computes the best possible thumbnail size out of given image width and height

Parameters
src_w– source image width
src_h– source image height
max_w– desired maximum width
max_h– desired maximum height
out_w– best possible width
out_h– best possible height

◆ GlimpseWindowPaint()

void GlimpseWindowPaint ( ChWindow win)
extern

GlimpseWindowPaint – paint the glimpse window.

Parameters
win– Pointer to window

◆ thumbnail_box()

void thumbnail_box ( ChCanvas canvas,
uint8_t src,
int  src_w,
int  src_h,
uint8_t dst,
int  dst_x,
int  dst_y,
int  dst_w,
int  dst_h 
)
extern

thumbnail_box – calculate and prepare the thumbnail using box_filter algorithm

Parameters
canvas– pointer to canvas
src– source image buffer
src_w– source image width
src_h– source image height
dst– destination image buffer
dst_w– destination image width
dst_h– destination image height