Add following descriptions to the dependencies
of your module’s build.gradle
.
implementation "com.ricoh360.thetaclient:theta-client:1.7.1"
Connect the wireless LAN between THETA and the smartphone that runs on the application using this THETA Client.
When creating an instance, you can set the camera date and time, the language, the shutter volume, the time to sleep, and the time to power off.
import com.ricoh360.pf.theta.ThetaRepository
val thetaUrl = "192.168.1.1:80"
val thetaConfig = ThetaRepository.Config()
// thetaConfig.dateTime = "2023:01:01 12:34:56+09:00" // set current time
// thetaConfig.language = ThetaRepository.LanguageEnum.EN_US
// thetaConfig.shutterVolume = 40 // 0 to 100
// thetaConfig.sleepDelay = ThetaRepository.SleepDelayEnum.SLEEP_DELAY_5M
// thetaConfig.offDelay = ThetaRepository.OffDelayEnum.DISABLE
thetaRepository = ThetaRepository.newInstance(thetaUrl, thetaConfig)
First, shooting settings are performed using PhotoCapture.Builder
to create PhotoCapture
objects.
class TakenCallback : PhotoCapture.TakePictureCallback {
override fun onSuccess(fileUrl: String) {
// get JPEG file
}
override fun onError(exception: ThetaRepository.ThetaRepositoryException) {
// error processing
}
}
thetaRepository.getPhotoCaptureBuilder()
.setExposureProgram(ThetaRepository.ExposureProgramEnum.NORMAL_PROGRAM)
.setWhiteBalance(ThetaRepository.WhiteBalanceEnum.AUTO)
.setExposureCompensation(ThetaRepository.ExposureCompensationEnum.ZERO)
.setIsoAutoHighLimit(ThetaRepository.IsoAutoHighLimitEnum.ISO_800)
.setFilter(ThetaRepository.FilterEnum.HDR)
.setExposureDelay(ThetaRepository.ExposureDelayEnum.DELAY_OFF) // self-timer
.setFileFormat(ThetaRepository.IMAGE_11K)
.build()
.takePicture(TakenCallback())
See Display a preview for instructions on how to view preview.
Model | Specify resolution | Width (Pixel) | Height (Pixel) |
---|---|---|---|
THETA X | IMAGE_11K | 11,008 | 5,504 |
THETA X | IMAGE_5_5K | 5,504 | 2,752 |
THETA Z1 | IMAGE_6_7K | 6,720 | 3,360 |
THETA S, SC, SC2, V | IMAGE_5K | 5,376 | 2,688 |