![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "database/location_repository.h"#include "database/database.h"#include "database/sql_debug.h"#include "system/macros.h"#include "system/mem_alloc.h"#include <sqlite3.h>Go to the source code of this file.
Functions | |
| void | dt_location_repository_delete (const guint locid) |
Drop the geometry row of locid. The tag itself is the tag repository's. | |
| GList * | dt_location_repository_get_in_bbox (const dt_map_box_t *const bbox) |
Locations whose extent overlaps bbox. | |
| dt_map_location_data_t * | dt_location_repository_get_data (const guint locid, const char *name_prefix) |
The geometry of locid, if it is a real location. | |
| void | dt_location_repository_set_data (const guint locid, const dt_map_location_data_t *g) |
Insert or replace the geometry of locid, polygon blob included. | |
| gboolean | dt_location_repository_get_polygon (const guint locid, void **blob, gint *bytes) |
The raw polygon blob of locid. | |
| GList * | dt_location_repository_find_locations_for_image (const int32_t imgid) |
Locations whose shape contains imgid's coordinates. | |
| GList * | dt_location_repository_find_images_for_location (const guint locid, const int shape) |
Images whose coordinates fall inside location locid. | |
| GList * | dt_location_repository_get_image_locations (const int32_t imgid) |
Location (tag) ids currently attached to imgid. GINT_TO_POINTER list. | |
| void dt_location_repository_delete | ( | const guint | locid | ) |
Drop the geometry row of locid. The tag itself is the tag repository's.
Definition at line 28 of file location_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by dt_map_location_delete().
| GList * dt_location_repository_find_images_for_location | ( | const guint | locid, |
| const int | shape ) |
Images whose coordinates fall inside location locid.
| shape | the location's shape, which selects the query. MAP_LOCATION_SHAPE_POLYGONS returns box-bounded candidates with their coordinates filled in. |
Definition at line 227 of file location_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, MAP_LOCATION_SHAPE_ELLIPSE, and MAP_LOCATION_SHAPE_RECTANGLE.
Referenced by _map_location_find_images().
| GList * dt_location_repository_find_locations_for_image | ( | const int32_t | imgid | ) |
Locations whose shape contains imgid's coordinates.
Definition at line 183 of file location_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, MAP_LOCATION_SHAPE_ELLIPSE, MAP_LOCATION_SHAPE_POLYGONS, and MAP_LOCATION_SHAPE_RECTANGLE.
Referenced by dt_map_location_find_locations().
| dt_map_location_data_t * dt_location_repository_get_data | ( | const guint | locid, |
| const char * | name_prefix ) |
The geometry of locid, if it is a real location.
| name_prefix | the darktable|locations| prefix a location's tag name must have. Passed in rather than known here: which tags count as locations is common/map_locations.c's definition, not the database's. |
name_prefix. Definition at line 83 of file location_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, and g.
Referenced by dt_map_location_get_data().
| GList * dt_location_repository_get_image_locations | ( | const int32_t | imgid | ) |
Location (tag) ids currently attached to imgid. GINT_TO_POINTER list.
Definition at line 301 of file location_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by dt_map_location_update_locations().
| GList * dt_location_repository_get_in_bbox | ( | const dt_map_box_t *const | bbox | ) |
Locations whose extent overlaps bbox.
Definition at line 40 of file location_repository.c.
References bbox, dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_DOUBLE, DT_DEBUG_SQLITE3_PREPARE_V2, and t.
Referenced by dt_map_location_get_locations_on_map().
| gboolean dt_location_repository_get_polygon | ( | const guint | locid, |
| void ** | blob, | ||
| gint * | bytes ) |
The raw polygon blob of locid.
| blob | receives a newly allocated copy, or NULL. Free with dt_free(). |
| bytes | receives its size in bytes. |
Definition at line 143 of file location_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, FALSE, IS_NULL_PTR, memcpy(), n, and TRUE.
Referenced by dt_map_location_find_locations(), and dt_map_location_get_polygons().
| void dt_location_repository_set_data | ( | const guint | locid, |
| const dt_map_location_data_t * | g ) |
Insert or replace the geometry of locid, polygon blob included.
Definition at line 113 of file location_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_BLOB, DT_DEBUG_SQLITE3_BIND_DOUBLE, DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, g, and MAP_LOCATION_SHAPE_POLYGONS.
Referenced by dt_map_location_set_data().