Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libsimple_graphical
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
namark
libsimple_graphical
Commits
22ab3197
Commit
22ab3197
authored
5 years ago
by
namark
Browse files
Options
Downloads
Patches
Plain Diff
Floating get for 1 and 2 byte pixel view.
parent
94909175
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
source/simple/graphical/pixels.cpp
+5
-0
5 additions, 0 deletions
source/simple/graphical/pixels.cpp
source/simple/graphical/pixels.h
+17
-2
17 additions, 2 deletions
source/simple/graphical/pixels.h
source/simple/graphical/pixels.hpp
+2
-2
2 additions, 2 deletions
source/simple/graphical/pixels.hpp
with
24 additions
and
4 deletions
source/simple/graphical/pixels.cpp
+
5
−
0
View file @
22ab3197
...
@@ -37,6 +37,7 @@ SIMPLE_GRAPHICAL_PIXEL_WRITER_SET(rgba_pixel, rgb_vector, rgb_vector)
...
@@ -37,6 +37,7 @@ SIMPLE_GRAPHICAL_PIXEL_WRITER_SET(rgba_pixel, rgb_vector, rgb_vector)
SIMPLE_GRAPHICAL_PIXEL_WRITER_SET
(
rgba_pixel
,
rgba_vector
,
rgba_vector
)
SIMPLE_GRAPHICAL_PIXEL_WRITER_SET
(
rgba_pixel
,
rgba_vector
,
rgba_vector
)
SIMPLE_GRAPHICAL_PIXEL_WRITER_SET
(
rgba_pixel
,
rgb_vector
,
rgba_pixel
)
SIMPLE_GRAPHICAL_PIXEL_WRITER_SET
(
rgba_pixel
,
rgb_vector
,
rgba_pixel
)
SIMPLE_GRAPHICAL_PIXEL_WRITER_SET
(
rgba_pixel
,
rgba_vector
,
rgba_pixel
)
SIMPLE_GRAPHICAL_PIXEL_WRITER_SET
(
rgba_pixel
,
rgba_vector
,
rgba_pixel
)
// SIMPLE_GRAPHICAL_PIXEL_WRITER_SET(uint16_t, float, uint16_t) // TODO
#undef SIMPLE_GRAPHICAL_PIXEL_WRITER_SET
#undef SIMPLE_GRAPHICAL_PIXEL_WRITER_SET
using
namespace
pixel_view_details
;
using
namespace
pixel_view_details
;
#define SIMPLE_GRAPHICAL_PIXEL_VIEW_GET(Tag,Pixel,Vector) \
#define SIMPLE_GRAPHICAL_PIXEL_VIEW_GET(Tag,Pixel,Vector) \
...
@@ -46,10 +47,14 @@ SIMPLE_GRAPHICAL_PIXEL_VIEW_GET(tag::reader, rgb_pixel, rgb_vector)
...
@@ -46,10 +47,14 @@ SIMPLE_GRAPHICAL_PIXEL_VIEW_GET(tag::reader, rgb_pixel, rgb_vector)
SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
(
tag
::
reader
,
rgb_pixel
,
rgba_vector
)
SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
(
tag
::
reader
,
rgb_pixel
,
rgba_vector
)
SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
(
tag
::
reader
,
rgba_pixel
,
rgb_vector
)
SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
(
tag
::
reader
,
rgba_pixel
,
rgb_vector
)
SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
(
tag
::
reader
,
rgba_pixel
,
rgba_vector
)
SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
(
tag
::
reader
,
rgba_pixel
,
rgba_vector
)
SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
(
tag
::
reader
,
uint16_t
,
float
)
SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
(
tag
::
reader
,
pixel_byte
,
float
)
SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
(
tag
::
writer
,
rgb_pixel
,
rgb_vector
)
SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
(
tag
::
writer
,
rgb_pixel
,
rgb_vector
)
SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
(
tag
::
writer
,
rgb_pixel
,
rgba_vector
)
SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
(
tag
::
writer
,
rgb_pixel
,
rgba_vector
)
SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
(
tag
::
writer
,
rgba_pixel
,
rgb_vector
)
SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
(
tag
::
writer
,
rgba_pixel
,
rgb_vector
)
SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
(
tag
::
writer
,
rgba_pixel
,
rgba_vector
)
SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
(
tag
::
writer
,
rgba_pixel
,
rgba_vector
)
SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
(
tag
::
writer
,
uint16_t
,
float
)
SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
(
tag
::
writer
,
pixel_byte
,
float
)
#undef SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
#undef SIMPLE_GRAPHICAL_PIXEL_VIEW_GET
}
// namespace simple::graphical
}
// namespace simple::graphical
This diff is collapsed.
Click to expand it.
source/simple/graphical/pixels.h
+
17
−
2
View file @
22ab3197
...
@@ -21,6 +21,21 @@ namespace simple::graphical
...
@@ -21,6 +21,21 @@ namespace simple::graphical
namespace
pixel_view_details
namespace
pixel_view_details
{
{
template
<
typename
Pixel
>
struct
pixel_fraction
{
using
type
=
rgba_vector
;
};
template
<
>
struct
pixel_fraction
<
rgba_pixel
>
{
using
type
=
rgba_vector
;
};
template
<
>
struct
pixel_fraction
<
rgb_pixel
>
{
using
type
=
rgb_vector
;
};
template
<
>
struct
pixel_fraction
<
uint16_t
>
{
using
type
=
float
;
};
template
<
>
struct
pixel_fraction
<
pixel_byte
>
{
using
type
=
float
;
};
template
<
typename
Pixel
>
using
pixel_fraction_t
=
typename
pixel_fraction
<
Pixel
>::
type
;
class
tag
class
tag
{
{
public:
public:
...
@@ -73,10 +88,10 @@ namespace simple::graphical
...
@@ -73,10 +88,10 @@ namespace simple::graphical
auto
get
(
int2
position
)
const
auto
get
(
int2
position
)
const
->
std
::
conditional_t
<
std
::
is_same_v
<
Pixel
,
RawType
>
,
const
Pixel
&
,
Pixel
>
;
->
std
::
conditional_t
<
std
::
is_same_v
<
Pixel
,
RawType
>
,
const
Pixel
&
,
Pixel
>
;
template
<
typename
ColorVector
=
rgba_vector
>
template
<
typename
ColorVector
=
pixel_fraction_t
<
Pixel
>
>
Pixel
get
(
float2
position
)
const
;
Pixel
get
(
float2
position
)
const
;
template
<
typename
ColorVector
=
rgba_vector
>
template
<
typename
ColorVector
=
pixel_fraction_t
<
Pixel
>
>
Pixel
get
(
float2
position
,
range2D
spread
)
const
;
Pixel
get
(
float2
position
,
range2D
spread
)
const
;
impl
(
const
impl
&
other
,
range2D
range
);
impl
(
const
impl
&
other
,
range2D
range
);
...
...
This diff is collapsed.
Click to expand it.
source/simple/graphical/pixels.hpp
+
2
−
2
View file @
22ab3197
...
@@ -116,7 +116,7 @@ namespace simple::graphical
...
@@ -116,7 +116,7 @@ namespace simple::graphical
const
float2
size
(
this
->
size
());
const
float2
size
(
this
->
size
());
assert
(
float2
::
one
(
-
1
)
<
position
&&
position
<
size
);
assert
(
float2
::
one
(
-
1
)
<
position
&&
position
<
size
);
return
get
(
position
,
return
get
<
ColorVector
>
(
position
,
{
{
int2
(
position
<
float2
::
zero
()),
int2
(
position
<
float2
::
zero
()),
int2
::
one
(
2
)
-
int2
(
position
>
(
size
-
1
))
int2
::
one
(
2
)
-
int2
(
position
>
(
size
-
1
))
...
@@ -217,7 +217,7 @@ namespace simple::graphical
...
@@ -217,7 +217,7 @@ namespace simple::graphical
const
float2
size
(
this
->
size
());
const
float2
size
(
this
->
size
());
assert
(
float2
::
one
(
-
1
)
<
position
&&
position
<
size
);
assert
(
float2
::
one
(
-
1
)
<
position
&&
position
<
size
);
set
(
pixel
,
position
,
set
<
ColorVector
>
(
pixel
,
position
,
{
{
int2
(
position
<
float2
::
zero
()),
int2
(
position
<
float2
::
zero
()),
int2
::
one
(
2
)
-
int2
(
position
>
(
size
-
1
))
int2
::
one
(
2
)
-
int2
(
position
>
(
size
-
1
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment