Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BigDataViewer_Core_Extension
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BioinformaticDataCompression
BigDataViewer_Core_Extension
Commits
e60d4c75
Commit
e60d4c75
authored
Dec 8, 2016
by
Stephan Saalfeld
Committed by
Tobias Pietzsch
Mar 16, 2017
Browse files
Options
Downloads
Patches
Plain Diff
added VolatileUnsignedLongType
parent
34b4169e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/net/imglib2/type/volatiles/VolatileUnsignedLongType.java
+133
-0
133 additions, 0 deletions
.../net/imglib2/type/volatiles/VolatileUnsignedLongType.java
with
133 additions
and
0 deletions
src/main/java/net/imglib2/type/volatiles/VolatileUnsignedLongType.java
0 → 100644
+
133
−
0
View file @
e60d4c75
/*
* #%L
* BigDataViewer core classes with minimal dependencies
* %%
* Copyright (C) 2012 - 2016 Tobias Pietzsch, Stephan Saalfeld, Stephan Preibisch,
* Jean-Yves Tinevez, HongKee Moon, Johannes Schindelin, Curtis Rueden, John Bogovic
* %%
* 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 HOLDERS 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.
* #L%
*/
package
net.imglib2.type.volatiles
;
import
net.imglib2.Volatile
;
import
net.imglib2.img.NativeImg
;
import
net.imglib2.img.NativeImgFactory
;
import
net.imglib2.img.basictypeaccess.LongAccess
;
import
net.imglib2.img.basictypeaccess.volatiles.VolatileLongAccess
;
import
net.imglib2.img.basictypeaccess.volatiles.array.VolatileLongArray
;
import
net.imglib2.type.numeric.integer.UnsignedLongType
;
/**
* A {@link Volatile} variant of {@link UnsignedLongType}. It uses an underlying
* {@link UnsignedLongType} that maps into a {@link VolatileLongAccess}.
*
* @author Stephan Saalfeld
*/
public
class
VolatileUnsignedLongType
extends
AbstractVolatileNativeRealType
<
UnsignedLongType
,
VolatileUnsignedLongType
>
{
final
protected
NativeImg
<
?,
?
extends
VolatileLongAccess
>
img
;
private
static
class
WrappedUnsignedLongType
extends
UnsignedLongType
{
public
WrappedUnsignedLongType
(
final
NativeImg
<?,
?
extends
LongAccess
>
img
)
{
super
(
img
);
}
public
WrappedUnsignedLongType
(
final
LongAccess
access
)
{
super
(
access
);
}
public
void
setAccess
(
final
LongAccess
access
)
{
dataAccess
=
access
;
}
}
// this is the constructor if you want it to read from an array
public
VolatileUnsignedLongType
(
final
NativeImg
<
?,
?
extends
VolatileLongAccess
>
img
)
{
super
(
new
WrappedUnsignedLongType
(
img
),
false
);
this
.
img
=
img
;
}
// this is the constructor if you want to specify the dataAccess
public
VolatileUnsignedLongType
(
final
VolatileLongAccess
access
)
{
super
(
new
WrappedUnsignedLongType
(
access
),
access
.
isValid
()
);
this
.
img
=
null
;
}
// this is the constructor if you want it to be a variable
public
VolatileUnsignedLongType
(
final
int
value
)
{
this
(
new
VolatileLongArray
(
1
,
true
)
);
set
(
value
);
}
// this is the constructor if you want it to be a variable
public
VolatileUnsignedLongType
()
{
this
(
0
);
}
public
void
set
(
final
int
value
)
{
get
().
set
(
value
);
}
@Override
public
void
updateContainer
(
final
Object
c
)
{
final
VolatileLongAccess
a
=
img
.
update
(
c
);
(
(
WrappedUnsignedLongType
)
t
).
setAccess
(
a
);
setValid
(
a
.
isValid
()
);
}
@Override
public
NativeImg
<
VolatileUnsignedLongType
,
?
extends
VolatileLongAccess
>
createSuitableNativeImg
(
final
NativeImgFactory
<
VolatileUnsignedLongType
>
storageFactory
,
final
long
[]
dim
)
{
throw
new
UnsupportedOperationException
();
}
@Override
public
VolatileUnsignedLongType
duplicateTypeOnSameNativeImg
()
{
return
new
VolatileUnsignedLongType
(
img
);
}
@Override
public
VolatileUnsignedLongType
createVariable
()
{
return
new
VolatileUnsignedLongType
();
}
@Override
public
VolatileUnsignedLongType
copy
()
{
final
VolatileUnsignedLongType
v
=
createVariable
();
v
.
set
(
this
);
return
v
;
}
}
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